1import{_ as m,o,g as h,i as n,af as i,q as f,aM as c,j as r}from"./BJk5OFEY.js";const k={props:{type:{type:String,default:"checkbox"},name:{type:String,default:""},value:{type:String,default:""},modelValue:{type:[Boolean,String,Array],default:!1},checked:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},toggle:{type:Boolean,default:!1},hover:{type:Boolean,default:!1},focus:{type:Boolean,default:!1},appliedFilter:{type:Boolean,default:!1}},data(){return{mChecked:!1}},emits:["change","keyup","click"],computed:{isButton(){return this.name.toLowerCase().includes("size")},id(){const a=this.value.replace(" ","-").toLowerCase().replace("'","-").replace(/[^a-zA-Z0-9-]/g,"");return`${this.name}-${a}`},shouldBeChecked(){if(this.modelValue!==void 0){if(this.type==="radio")return this.modelValue===this.value;if(this.modelValue instanceof Array){const e=[...this.modelValue].map(d=>d.toLowerCase()),s=this.value.toLowerCase();return e.includes(s)}return typeof this.modelValue=="string"?!0:!!this.modelValue}let t;return this.mChecked===void 0?t=!!this.checked:t=this.mChecked,t}},watch:{checked(t){this.mChecked=t}},mounted(){this.$el.setAttribute(`p-${this.type}`,"")},methods:{updateInput(t){if(this.type==="radio"){this.$emit("change",this.value);return}let a;if(this.isButton?a=t.target.getAttribute("checked"):a=t.target.checked,this.mChecked=a,this.modelValue instanceof Array){const e=[...this.modelValue],s=e.some(d=>d.toUpperCase()===this.value.toUpperCase());!this.mChecked&&!s?e.push(this.value):a&&!s?e.push(this.value):e.splice(e.indexOf(this.value),1),this.$emit("change",e)}else this.$emit("change",!!a)},emitKeyup(t){this.$emit("keyup",t)},emitClick(t){this.$emit("click",t)}}},y=["id","name","checked","disabled","value","required"],v=["id","type","name","checked","value","disabled","required"],C=["for"];function g(t,a,e,s,d,l){return l.isButton&&!e.appliedFilter?(o(),h("div",{class:"button-wrapper",key:`${e.name}-${e.value}-button`},[n("button",{id:l.id,class:f(["num-btn",l.shouldBeChecked?"selected-btn":""]),type:"button",name:e.name,checked:l.shouldBeChecked,disabled:e.disabled,value:e.value,required:e.required,onClick:a[0]||(a[0]=(...u)=>l.updateInput&&l.updateInput(...u))},[i(t.$slots,"default")],10,y)])):(o(),h("div",{class:"radio-check-wrapper",key:`${e.name}-${e.value}-checkbox`},[n("input",{ref:"input",id:l.id,type:e.type,name:e.name,checked:l.shouldBeChecked,value:e.value,disabled:e.disabled,required:e.required,onKeyup:a[1]||(a[1]=c((...u)=>l.emitKeyup&&l.emitKeyup(...u),["stop"])),onChange:a[2]||(a[2]=(...u)=>l.updateInput&&l.updateInput(...u))},null,40,v),n("label",{for:l.id,onClick:a[3]||(a[3]=c((...u)=>l.emitClick&&l.emitClick(...u),["stop"]))},[i(t.$slots,"default"),i(t.$slots,"extra"),e.toggle?i(t.$slots,"off-extra",{key:0}):r("",!0),e.toggle?i(t.$slots,"off-label",{key:1}):r("",!0),e.hover?i(t.$slots,"hover-extra",{key:2}):r("",!0),e.hover?i(t.$slots,"hover-label",{key:3}):r("",!0)],8,C)]))}const b=m(k,[["render",g]]);export{b as _};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.