"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),l=require("lodash"),r=n=>(e.pushScopeId("data-v-ffeabca5"),n=n(),e.popScopeId(),n),d=["true-value","false-value"],v=r(()=>e.createElementVNode("div",{class:"zv-switch__action"},null,-1)),b=[v],h=e.defineComponent({name:"zv-interaction-switch"}),f=e.defineComponent({...h,props:{basicOption:{},useEvents:{},sceneOption:{}},emits:["on-change","on-open","on-close"],setup(n,{emit:u}){e.useCssVars(s=>({"1b211f87":s.basicOption.css.onColor,"49c0465e":s.basicOption.css.offColor,"37d4f74e":s.basicOption.css.actionSize+"px","2422c73c":s.basicOption.css.minWidth+"px","4e456c10":s.basicOption.css.coreSize+"px",e5de6cda:s.basicOption.css.coreBorderRadius+"px","04cc88dc":s.basicOption.css.actionBorderRadius+"px","8456717c":s.basicOption.css.actionBackgroundColor}));const i=u,t=n,o=e.ref(JSON.parse(t.basicOption.defaultValue)),p=s=>{o.value=!o.value;const a=t.basicOption.trueValue===o.value?"open":"close";i("on-change",o.value),window.SHJParseEvent(t.useEvents,"on-change",{data:o.value}),i(`on-${a}`,o.value),window.SHJParseEvent(t.useEvents,`on-${a}`,{data:o.value})};return e.watch(()=>l.cloneDeep(t.basicOption),(s,a)=>{l.isEqual(s,a)||(o.value=JSON.parse(t.basicOption.defaultValue))},{deep:!0}),(s,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["zv-switch",{"is-checked":o.value}])},[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":a[0]||(a[0]=c=>o.value=c),class:"zv-switch__input",type:"checkbox","true-value":s.basicOption.trueValue,"false-value":s.basicOption.falseValue},null,8,d),[[e.vModelCheckbox,o.value]]),e.createElementVNode("span",{class:"zv-switch__core",onClick:a[1]||(a[1]=c=>p(o.value))},b)],2))}});exports.default=f;
