import{h as e}from"./p-CAus4tQt.js";import{r as a}from"./p-DKrliuRO.js";import{I as t}from"./p-CulpZvvY.js";import{h as r}from"./p-CRukm3e1.js";const o=({id:o,label:s,placeholder:i="",value:c="",onChange:p,autoFocus:l,error:d,disabled:n,min:u})=>{const m=a.get("theme");return e("div",{class:"mb-2","data-theme":m},s&&e("label",{class:"z-date-picker-label"},s),e("div",{class:"z-date-picker-field"},e("input",{id:o,type:c?"date":"text",placeholder:i,class:"z-date-picker-input "+(n?"bg-paper":""),value:r(c??""),onFocus:e=>{if(!n){const a=e.target;if(a.type="date","function"==typeof a.showPicker)try{a.showPicker()}catch(e){}}},onClick:e=>{if(!n){const a=e.target;if("date"===a.type&&"function"==typeof a.showPicker)try{a.showPicker()}catch(e){}}},onBlur:e=>{e.target.value||(e.target.type="text")},onInput:e=>{p&&p(e.target.value)},autoFocus:l,disabled:n,min:u}),e("div",{class:"z-date-picker-icon-wrapper"},e(t,{name:"CalendarDays",addClass:"z-date-picker-icon"}))),d&&e("p",{class:"z-date-picker-error"},d))};export{o as Z}