import{t as x,N as P,z as n,d as k,R as v,D as V,Z as i,aW as s,c as g,v as C,am as S,x as H}from"./index.8f93de0e.js";import{s as M,a as r,f as N,p as T}from"./utils.52cced7f.js";import{P as p}from"./index.16055f9a.js";const[y]=x("time-picker"),D=P({},M,{minHour:n(0),maxHour:n(23),minMinute:n(0),maxMinute:n(59),minSecond:n(0),maxSecond:n(59),columnsType:{type:Array,default:()=>["hour","minute"]}});var I=k({name:y,props:D,emits:["confirm","cancel","change","update:modelValue"],setup(a,{emit:t,slots:l}){const o=v(a.modelValue),u=V(()=>a.columnsType.map(e=>{const{filter:m,formatter:c}=a;switch(e){case"hour":return r(+a.minHour,+a.maxHour,e,c,m);case"minute":return r(+a.minMinute,+a.maxMinute,e,c,m);case"second":return r(+a.minSecond,+a.maxSecond,e,c,m);default:throw new Error(`[Vant] DatePicker: unsupported columns type: ${e}`)}}));i(o,e=>{s(e,a.modelValue)||t("update:modelValue",e)}),i(()=>a.modelValue,e=>{e=N(e,u.value),s(e,o.value)||(o.value=e)},{immediate:!0});const d=(...e)=>t("change",...e),f=(...e)=>t("cancel",...e),h=(...e)=>t("confirm",...e);return()=>g(p,C({modelValue:o.value,"onUpdate:modelValue":e=>o.value=e,columns:u.value,onChange:d,onCancel:f,onConfirm:h},S(a,T)),l)}});const A=H(I);export{A as T};
