System.register(["./index-legacy-1cbe5d00.js","./utils-legacy-e9659ecc.js","./index-legacy-b484c5ea.js"],(function(e,t){"use strict";var a,n,r,l,u,o,m,c,s,i,d,D,g,y,f,p,h,v;return{setters:[e=>{a=e.c,n=e.ai,r=e.bi,l=e.d,u=e.r,o=e.e,m=e.w,c=e.bF,s=e.a,i=e.h,d=e.ak,D=e.k},e=>{g=e.s,y=e.f,f=e.a,p=e.g,h=e.p},e=>{v=e.P}],execute:function(){const t=(new Date).getFullYear(),[x]=a("date-picker"),V=n({},g,{columnsType:{type:Array,default:()=>["year","month","day"]},minDate:{type:Date,default:()=>new Date(t-10,0,1),validator:r},maxDate:{type:Date,default:()=>new Date(t+10,11,31),validator:r}});var w=l({name:x,props:V,emits:["confirm","cancel","change","update:modelValue"],setup(e,{emit:t,slots:a}){const n=u(e.modelValue),r=u(!1),l=t=>t===e.minDate.getFullYear(),D=t=>t===e.maxDate.getFullYear(),g=t=>{const{minDate:a,columnsType:l}=e,u=l.indexOf(t),o=r.value?e.modelValue[u]:n.value[u];if(o)return+o;switch(t){case"year":return a.getFullYear();case"month":return a.getMonth()+1;case"day":return a.getDate()}},x=()=>{const t=g("year"),a=g("month"),n=l(t)&&(t=>t===e.minDate.getMonth()+1)(a)?e.minDate.getDate():1,r=D(t)&&(t=>t===e.maxDate.getMonth()+1)(a)?e.maxDate.getDate():p(t,a);return f(n,r,"day",e.formatter,e.filter)},V=o((()=>e.columnsType.map((t=>{switch(t){case"year":return(()=>{const t=e.minDate.getFullYear(),a=e.maxDate.getFullYear();return f(t,a,"year",e.formatter,e.filter)})();case"month":return(()=>{const t=g("year"),a=l(t)?e.minDate.getMonth()+1:1,n=D(t)?e.maxDate.getMonth()+1:12;return f(a,n,"month",e.formatter,e.filter)})();case"day":return x();default:throw new Error(`[Vant] DatePicker: unsupported columns type: ${t}`)}}))));m(n,(a=>{c(a,e.modelValue)||t("update:modelValue",a)})),m((()=>e.modelValue),((e,t)=>{r.value=c(t,n.value),e=y(e,V.value),c(e,n.value)||(n.value=e),r.value=!1}),{immediate:!0});const w=(...e)=>t("change",...e),F=(...e)=>t("cancel",...e),Y=(...e)=>t("confirm",...e);return()=>s(v,i({modelValue:n.value,"onUpdate:modelValue":e=>n.value=e,columns:V.value,onChange:w,onCancel:F,onConfirm:Y},d(e,h)),a)}});e("D",D(w))}}}));
