import{j as L,x as l}from"./index.e0fdfdc6.js";import{G as q,a as V}from"./Row.bb9acf3f.js";import"./translations.5e539ab1.js";import{a as g}from"./runtime-dom.esm-bundler.dc49ee3e.js";import{_ as B}from"./_plugin-vue_export-helper.eefbdd86.js";import{_ as h}from"./default-i18n.368c2d5c.js";import{a6 as S,o as t,a1 as n,a2 as i,_ as s,$ as c,a4 as d,c as w,af as M,ae as k,F as v,a7 as N,l as R}from"./runtime-core.esm-bundler.ce5add0b.js";const _="all-in-one-seo-pack",b={emits:["update:separator"],setup(){return{settingsStore:L()}},components:{GridColumn:q,GridRow:V},props:{optionsSeparator:{type:String,required:!0},showMoreSlug:{type:String,required:!0}},data(){return{strings:{custom:h("Custom separator:",_),showMore:h("Show More",_),showLess:h("Show Less",_)},showMoreSeparators:!1,showMoreInitial:!0,customSeparator:null,separators:["&ndash;","&raquo;","&rsaquo;","&#x2023;","&rarr;","&bull;","&#47;","&#124;"],moreSeparators:["&#45;","&mdash;","&laquo;","&larr;","&gt;","&ge;","&#92;","&#43;","&#9658;"]}},watch:{showMoreSeparators(e){if(this.showMoreInitial){this.showMoreInitial=!1;return}this.settingsStore.toggleRadio({slug:this.showMoreSlug,value:e})},customSeparator(e){e!==null&&(this.$emit("update:separator",l(e)),this.separators.concat(this.moreSeparators).concat(this.decodedSeparators).concat(this.decodedMoreSeparators).includes(e)&&(this.customSeparator=null))}},computed:{hiddenSeparator(){const e=this.customSeparator?l(this.customSeparator):null;return this.optionsSeparator===e||this.decodedMoreSeparators.includes(this.optionsSeparator)?this.optionsSeparator:null},decodedSeparators(){return this.separators.map(e=>l(e))},decodedMoreSeparators(){return this.moreSeparators.map(e=>l(e))},decodedCustomSeparator(){return l(this.hiddenSeparator)}},methods:{setSeparator(e){this.customSeparator=null,this.$emit("update:separator",e)}},mounted(){this.showMoreSeparators=this.settingsStore.settings.toggledRadio[this.showMoreSlug],this.customSeparator=this.decodedSeparators.concat(this.decodedMoreSeparators).includes(this.optionsSeparator)?null:this.optionsSeparator}},z={class:"active separator"},A=["onClick"],G=["onClick"],I={class:"show-more"},F={class:"custom-separator"},U={class:"show-more"};function j(e,u,f,D,r,a){const p=S("grid-column"),y=S("base-input"),C=S("grid-row");return t(),n(C,{class:"aioseo-separators"},{default:i(()=>[!r.showMoreSeparators&&a.hiddenSeparator?(t(),n(p,{key:0,xs:"2",sm:"1"},{default:i(()=>[s("div",z,c(a.decodedCustomSeparator),1)]),_:1})):d("",!0),(t(!0),w(v,null,M(a.decodedSeparators,(o,m)=>(t(),n(p,{xs:"2",sm:"1",key:m},{default:i(()=>[s("div",{onClick:x=>a.setSeparator(o),class:k(["separator",{active:f.optionsSeparator===o}])},c(o),11,A)]),_:2},1024))),128)),r.showMoreSeparators?(t(!0),w(v,{key:1},M(a.decodedMoreSeparators,(o,m)=>(t(),n(p,{xs:"2",sm:"1",key:`m_${m}`},{default:i(()=>[s("div",{onClick:x=>a.setSeparator(o),class:k(["separator",{active:f.optionsSeparator===o}])},c(o),11,G)]),_:2},1024))),128)):d("",!0),r.showMoreSeparators?d("",!0):(t(),n(p,{key:2,xs:a.hiddenSeparator?"3":"4"},{default:i(()=>[s("div",I,[s("a",{href:"#",onClick:u[0]||(u[0]=g(o=>r.showMoreSeparators=!0,["prevent"]))},c(r.strings.showMore)+"… ",1)])]),_:1},8,["xs"])),r.showMoreSeparators?(t(),n(p,{key:3,class:"custom-separator-col"},{default:i(()=>[s("div",F,[N(c(r.strings.custom)+" ",1),R(y,{spellcheck:!1,size:"medium",modelValue:r.customSeparator,"onUpdate:modelValue":u[1]||(u[1]=o=>r.customSeparator=o)},null,8,["modelValue"])])]),_:1})):d("",!0),r.showMoreSeparators?(t(),n(p,{key:4,xs:"2"},{default:i(()=>[s("div",U,[s("a",{href:"#",onClick:u[2]||(u[2]=g(o=>r.showMoreSeparators=!1,["prevent"]))},c(r.strings.showLess)+"… ",1)])]),_:1})):d("",!0)]),_:1})}const Q=B(b,[["render",j]]);export{Q as C};
