import{b as A}from"./index.6205915e.js";import{u as k}from"./PostTypes.4e006733.js";import{B}from"./HighlightToggle.cd602d8b.js";import{C as D}from"./Index.92195ca4.js";import{C as N}from"./Tooltip.e5a30815.js";import{G as S,a as w}from"./Row.8a74cb5b.js";import"./translations.e71e2202.js";import{_ as I}from"./_plugin-vue_export-helper.eefbdd86.js";import{_ as p}from"./default-i18n.65d58dd6.js";import{a7 as m,o as c,a3 as f,a4 as n,c as _,w as a,t as o,a as g,b as h,F as R,af as L,q as x,ae as q}from"./runtime-core.esm-bundler.50cb9e6d.js";const d="all-in-one-seo-pack",G={setup(){const{getPostIconClass:e}=k();return{getPostIconClass:e,rootStore:A()}},components:{BaseHighlightToggle:B,CoreAlert:D,CoreTooltip:N,GridColumn:S,GridRow:w},props:{type:{type:String,required:!0},options:{type:Object,required:!0},registeredPostTypes:Object,excluded:{type:Array,default(){return[]}},supports:{type:Array,default(){return[]}}},data(){return{strings:{label:p("Label:",d),name:p("Slug:",d),noPostTypes:p("No post types available.",d),noTaxonomies:p("No taxonomies available.",d),noPostTypesDescription:p("All post types are set to noindex or your site does not have any post types registered that are supported by this feature.",d),noTaxonomiesDescription:p("All taxonomies are set to noindex or your site does not have any taxonomies registered that are supported by this feature.",d)}}},computed:{getRegisteredPostTypes(){return this.registeredPostTypes||this.rootStore.aioseo.postData},postTypes(){return this.getRegisteredPostTypes[this.type].filter(e=>{let r=!0;return this.supports.length&&e.supports.length&&(r=this.supports.every(t=>e.supports.includes(t))),r&&!this.excluded.includes(e.name)})}},methods:{emitInput(e){this.$emit("input",e)},updateValue(e,r){if(e){const l=this.options[this.type].included;l.push(r.name),this.options[this.type].included=l;return}const t=this.options[this.type].included.findIndex(l=>l===r.name);t!==-1&&this.options[this.type].included.splice(t,1)},getValue(e){return this.options[this.type].included.includes(e.name)},isActive(e){return this.options[this.type].included.findIndex(t=>t===e.name)!==-1}}},O={class:"aioseo-post-type-options-toggle"},U={class:"post-type-options-settings"},j={class:"aioseo-description"},z=n("br",null,null,-1);function F(e,r,t,l,u,i){const y=m("core-alert"),T=m("core-tooltip"),b=m("base-highlight-toggle"),v=m("grid-column"),C=m("grid-row");return c(),f("div",O,[n("div",U,[i.postTypes.length===0&&t.type==="postTypes"?(c(),_(y,{key:0,type:"blue"},{default:a(()=>[n("strong",null,o(u.strings.noPostTypes),1),g(" "+o(u.strings.noPostTypesDescription),1)]),_:1})):h("",!0),i.postTypes.length===0&&t.type==="taxonomies"?(c(),_(y,{key:1,type:"blue"},{default:a(()=>[n("strong",null,o(u.strings.noTaxonomies),1),g(" "+o(u.strings.noTaxonomiesDescription),1)]),_:1})):h("",!0),0<i.postTypes.length?(c(),_(C,{key:2},{default:a(()=>[(c(!0),f(R,null,L(i.postTypes,(s,P)=>(c(),_(v,{md:"6",key:P},{default:a(()=>[x(b,{size:"medium",active:i.isActive(s),name:s.name,type:"checkbox",modelValue:i.getValue(s),"onUpdate:modelValue":V=>i.updateValue(V,s)},{default:a(()=>[x(T,null,{tooltip:a(()=>[n("div",j,[g(o(u.strings.label)+" ",1),n("strong",null,o(s.label),1),z,g(" "+o(u.strings.name)+" ",1),n("strong",null,o(s.name),1)])]),default:a(()=>[n("span",{class:q(["icon dashicons",l.getPostIconClass(s.icon)])},null,2)]),_:2},1024),g(" "+o(s.label),1)]),_:2},1032,["active","name","modelValue","onUpdate:modelValue"])]),_:2},1024))),128))]),_:1})):h("",!0)])])}const $=I(G,[["render",F]]);export{$ as C};
