import{n as y}from"./util.1703796278973.js";import{d as m,k as _,l as g,m as w,o as c,x as i,z as k,D as v,u,F as x,h as C,A}from"./vue.1703796278973.js";import{_ as O}from"./_plugin-vue_export-helper.1703796278973.js";import"./isArray.1703796278973.js";const S={class:"timer-when-warp"},B=["onClick"],W=m({name:"WhenOption"}),b=m({...W,props:{value:{type:Array,default:[]},type:{type:String,default:""}},emits:["update:value","change"],setup(f,{emit:p}){const n=f,d=_([]),a=_(n.value),o=t=>{const e=new Set(a.value);t===0?e.clear():e.has(t)?e.delete(t):e.add(t),a.value=[...e.values()].sort((s,l)=>s-l),p("update:value",a.value),p("change",a.value)},h=g(()=>!a.value.length);return w(()=>n.type,()=>{const t=n.type==="month",e=t?31:7;n.value.length||o(0),d.value=new Array(e).fill(1).map((s,l)=>{const r=l+1;return{label:t?`${r}号`:y[r],value:r}})},{immediate:!0}),(t,e)=>(c(),i("div",S,[k("div",{class:v(["when-item-option",u(h)?"active":""]),onClick:e[0]||(e[0]=()=>o(0))},"每天",2),(c(!0),i(x,null,C(u(d),s=>(c(),i("div",{class:v(["when-item-option",u(a).includes(s.value)?"active":""]),onClick:()=>o(s.value)},A(s.label),11,B))),256))]))}});const I=O(b,[["__scopeId","data-v-5d82b4fc"]]);export{I as default};
