@zimyo/ui 1.11.2 → 1.11.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/chunks/{index-76f24a60.js → index-2b363ed7.js} +1 -1
  2. package/dist/chunks/{index-5b35e7d9.esm.js → index-7cc7b46f.esm.js} +1 -1
  3. package/dist/components/Badge/index.d.ts +1 -1
  4. package/dist/components/Badge/index.esm.js +1 -1
  5. package/dist/components/Badge/index.js +1 -1
  6. package/dist/components/Card/index.esm.js +1 -1
  7. package/dist/components/Card/index.js +1 -1
  8. package/dist/components/Charts/index.esm.js +1 -1
  9. package/dist/components/Charts/index.js +1 -1
  10. package/dist/components/Checkbox/index.esm.js +1 -1
  11. package/dist/components/Checkbox/index.js +1 -1
  12. package/dist/components/CheckboxGroup/index.esm.js +1 -1
  13. package/dist/components/CheckboxGroup/index.js +1 -1
  14. package/dist/components/DataTable/index.esm.js +1 -1
  15. package/dist/components/DataTable/index.js +1 -1
  16. package/dist/components/DatePicker/index.esm.js +1 -1
  17. package/dist/components/DatePicker/index.js +1 -1
  18. package/dist/components/DateRangePicker/index.esm.js +1 -1
  19. package/dist/components/DateRangePicker/index.js +1 -1
  20. package/dist/components/Input/index.esm.js +1 -1
  21. package/dist/components/Input/index.js +1 -1
  22. package/dist/components/Modal/index.esm.js +1 -1
  23. package/dist/components/Modal/index.js +1 -1
  24. package/dist/components/Notice/index.esm.js +1 -1
  25. package/dist/components/Notice/index.js +1 -1
  26. package/dist/components/Select/index.esm.js +1 -1
  27. package/dist/components/Select/index.js +1 -1
  28. package/dist/components/TimePicker/index.esm.js +1 -1
  29. package/dist/components/TimePicker/index.js +1 -1
  30. package/dist/index.d.ts +2 -2
  31. package/dist/index.esm.js +1 -1
  32. package/dist/index.js +1 -1
  33. package/dist/theme/index.esm.js +1 -1
  34. package/dist/theme/index.js +1 -1
  35. package/package.json +1 -1
@@ -1 +1 @@
1
- import{_ as e,a as t}from"../../chunks/tslib.es6-4974c96c.esm.js";import{jsxs as i,jsx as n}from"react/jsx-runtime";import*as r from"react";import u from"@mui/material/Popover";import{c as o,g as a}from"../../chunks/_commonjsHelpers-02d3be64.esm.js";import{a as s}from"../../chunks/index-32c3a4e2.esm.js";import{X as l,m as c}from"../../chunks/lucide-8c9441ea.esm.js";var d={exports:{}},f=a(d.exports=function(){var e=1e3,t=6e4,i=36e5,n="millisecond",r="second",u="minute",o="hour",a="day",s="week",l="month",c="quarter",d="year",f="date",h="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,z=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],i=e%100;return"["+e+(t[(i-20)%10]||t[i]||t[0])+"]"}},p=function(e,t,i){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(i)+e},g={s:p,z:function(e){var t=-e.utcOffset(),i=Math.abs(t),n=Math.floor(i/60),r=i%60;return(t<=0?"+":"-")+p(n,2,"0")+":"+p(r,2,"0")},m:function e(t,i){if(t.date()<i.date())return-e(i,t);var n=12*(i.year()-t.year())+(i.month()-t.month()),r=t.clone().add(n,l),u=i-r<0,o=t.clone().add(n+(u?-1:1),l);return+(-(n+(i-r)/(u?r-o:o-r))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:s,d:a,D:f,h:o,m:u,s:r,ms:n,Q:c}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},b="en",x={};x[b]=v;var y="$isDayjsObject",w=function(e){return e instanceof S||!(!e||!e[y])},M=function e(t,i,n){var r;if(!t)return b;if("string"==typeof t){var u=t.toLowerCase();x[u]&&(r=u),i&&(x[u]=i,r=u);var o=t.split("-");if(!r&&o.length>1)return e(o[0])}else{var a=t.name;x[a]=t,r=a}return!n&&r&&(b=r),r||!n&&b},$=function(e,t){if(w(e))return e.clone();var i="object"==typeof t?t:{};return i.date=e,i.args=arguments,new S(i)},D=g;D.l=M,D.i=w,D.w=function(e,t){return $(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var S=function(){function v(e){this.$L=M(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[y]=!0}var p=v.prototype;return p.parse=function(e){this.$d=function(e){var t=e.date,i=e.utc;if(null===t)return new Date(NaN);if(D.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var n=t.match(m);if(n){var r=n[2]-1||0,u=(n[7]||"0").substring(0,3);return i?new Date(Date.UTC(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[6]||0,u)):new Date(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[6]||0,u)}}return new Date(t)}(e),this.init()},p.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},p.$utils=function(){return D},p.isValid=function(){return!(this.$d.toString()===h)},p.isSame=function(e,t){var i=$(e);return this.startOf(t)<=i&&i<=this.endOf(t)},p.isAfter=function(e,t){return $(e)<this.startOf(t)},p.isBefore=function(e,t){return this.endOf(t)<$(e)},p.$g=function(e,t,i){return D.u(e)?this[t]:this.set(i,e)},p.unix=function(){return Math.floor(this.valueOf()/1e3)},p.valueOf=function(){return this.$d.getTime()},p.startOf=function(e,t){var i=this,n=!!D.u(t)||t,c=D.p(e),h=function(e,t){var r=D.w(i.$u?Date.UTC(i.$y,t,e):new Date(i.$y,t,e),i);return n?r:r.endOf(a)},m=function(e,t){return D.w(i.toDate()[e].apply(i.toDate("s"),(n?[0,0,0,0]:[23,59,59,999]).slice(t)),i)},z=this.$W,v=this.$M,p=this.$D,g="set"+(this.$u?"UTC":"");switch(c){case d:return n?h(1,0):h(31,11);case l:return n?h(1,v):h(0,v+1);case s:var b=this.$locale().weekStart||0,x=(z<b?z+7:z)-b;return h(n?p-x:p+(6-x),v);case a:case f:return m(g+"Hours",0);case o:return m(g+"Minutes",1);case u:return m(g+"Seconds",2);case r:return m(g+"Milliseconds",3);default:return this.clone()}},p.endOf=function(e){return this.startOf(e,!1)},p.$set=function(e,t){var i,s=D.p(e),c="set"+(this.$u?"UTC":""),h=(i={},i[a]=c+"Date",i[f]=c+"Date",i[l]=c+"Month",i[d]=c+"FullYear",i[o]=c+"Hours",i[u]=c+"Minutes",i[r]=c+"Seconds",i[n]=c+"Milliseconds",i)[s],m=s===a?this.$D+(t-this.$W):t;if(s===l||s===d){var z=this.clone().set(f,1);z.$d[h](m),z.init(),this.$d=z.set(f,Math.min(this.$D,z.daysInMonth())).$d}else h&&this.$d[h](m);return this.init(),this},p.set=function(e,t){return this.clone().$set(e,t)},p.get=function(e){return this[D.p(e)]()},p.add=function(n,c){var f,h=this;n=Number(n);var m=D.p(c),z=function(e){var t=$(h);return D.w(t.date(t.date()+Math.round(e*n)),h)};if(m===l)return this.set(l,this.$M+n);if(m===d)return this.set(d,this.$y+n);if(m===a)return z(1);if(m===s)return z(7);var v=(f={},f[u]=t,f[o]=i,f[r]=e,f)[m]||1,p=this.$d.getTime()+n*v;return D.w(p,this)},p.subtract=function(e,t){return this.add(-1*e,t)},p.format=function(e){var t=this,i=this.$locale();if(!this.isValid())return i.invalidDate||h;var n=e||"YYYY-MM-DDTHH:mm:ssZ",r=D.z(this),u=this.$H,o=this.$m,a=this.$M,s=i.weekdays,l=i.months,c=i.meridiem,d=function(e,i,r,u){return e&&(e[i]||e(t,n))||r[i].slice(0,u)},f=function(e){return D.s(u%12||12,e,"0")},m=c||function(e,t,i){var n=e<12?"AM":"PM";return i?n.toLowerCase():n};return n.replace(z,function(e,n){return n||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return D.s(t.$y,4,"0");case"M":return a+1;case"MM":return D.s(a+1,2,"0");case"MMM":return d(i.monthsShort,a,l,3);case"MMMM":return d(l,a);case"D":return t.$D;case"DD":return D.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return d(i.weekdaysMin,t.$W,s,2);case"ddd":return d(i.weekdaysShort,t.$W,s,3);case"dddd":return s[t.$W];case"H":return String(u);case"HH":return D.s(u,2,"0");case"h":return f(1);case"hh":return f(2);case"a":return m(u,o,!0);case"A":return m(u,o,!1);case"m":return String(o);case"mm":return D.s(o,2,"0");case"s":return String(t.$s);case"ss":return D.s(t.$s,2,"0");case"SSS":return D.s(t.$ms,3,"0");case"Z":return r}return null}(e)||r.replace(":","")})},p.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},p.diff=function(n,f,h){var m,z=this,v=D.p(f),p=$(n),g=(p.utcOffset()-this.utcOffset())*t,b=this-p,x=function(){return D.m(z,p)};switch(v){case d:m=x()/12;break;case l:m=x();break;case c:m=x()/3;break;case s:m=(b-g)/6048e5;break;case a:m=(b-g)/864e5;break;case o:m=b/i;break;case u:m=b/t;break;case r:m=b/e;break;default:m=b}return h?m:D.a(m)},p.daysInMonth=function(){return this.endOf(l).$D},p.$locale=function(){return x[this.$L]},p.locale=function(e,t){if(!e)return this.$L;var i=this.clone(),n=M(e,t,!0);return n&&(i.$L=n),i},p.clone=function(){return D.w(this.$d,this)},p.toDate=function(){return new Date(this.valueOf())},p.toJSON=function(){return this.isValid()?this.toISOString():null},p.toISOString=function(){return this.$d.toISOString()},p.toString=function(){return this.$d.toUTCString()},v}(),k=S.prototype;return $.prototype=k,[["$ms",n],["$s",r],["$m",u],["$H",o],["$W",a],["$M",l],["$y",d],["$D",f]].forEach(function(e){k[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),$.extend=function(e,t){return e.$i||(e(t,S,$),e.$i=!0),$},$.locale=M,$.isDayjs=w,$.unix=function(e){return $(1e3*e)},$.en=x[b],$.Ls=x,$.p={},$}()),h={exports:{}},m=a(h.exports=function(){var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,n=/\d\d/,r=/\d\d?/,u=/\d*[^-_:/,()\s\d]+/,o={},a=function(e){return(e=+e)+(e>68?1900:2e3)},s=function(e){return function(t){this[e]=+t}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if("Z"===e)return 0;var t=e.match(/([+-]|\d\d)/g),i=60*t[1]+(+t[2]||0);return 0===i?0:"+"===t[0]?-i:i}(e)}],c=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var i,n=o.meridiem;if(n){for(var r=1;r<=24;r+=1)if(e.indexOf(n(r,0,t))>-1){i=r>12;break}}else i=e===(t?"pm":"PM");return i},f={A:[u,function(e){this.afternoon=d(e,!1)}],a:[u,function(e){this.afternoon=d(e,!0)}],Q:[i,function(e){this.month=3*(e-1)+1}],S:[i,function(e){this.milliseconds=100*+e}],SS:[n,function(e){this.milliseconds=10*+e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[r,s("seconds")],ss:[r,s("seconds")],m:[r,s("minutes")],mm:[r,s("minutes")],H:[r,s("hours")],h:[r,s("hours")],HH:[r,s("hours")],hh:[r,s("hours")],D:[r,s("day")],DD:[n,s("day")],Do:[u,function(e){var t=o.ordinal,i=e.match(/\d+/);if(this.day=i[0],t)for(var n=1;n<=31;n+=1)t(n).replace(/\[|\]/g,"")===e&&(this.day=n)}],w:[r,s("week")],ww:[n,s("week")],M:[r,s("month")],MM:[n,s("month")],MMM:[u,function(e){var t=c("months"),i=(c("monthsShort")||t.map(function(e){return e.slice(0,3)})).indexOf(e)+1;if(i<1)throw new Error;this.month=i%12||i}],MMMM:[u,function(e){var t=c("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],Y:[/[+-]?\d+/,s("year")],YY:[n,function(e){this.year=a(e)}],YYYY:[/\d{4}/,s("year")],Z:l,ZZ:l};function h(i){var n,r;n=i,r=o&&o.formats;for(var u=(i=n.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(t,i,n){var u=n&&n.toUpperCase();return i||r[n]||e[n]||r[u].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(e,t,i){return t||i.slice(1)})})).match(t),a=u.length,s=0;s<a;s+=1){var l=u[s],c=f[l],d=c&&c[0],h=c&&c[1];u[s]=h?{regex:d,parser:h}:l.replace(/^\[|\]$/g,"")}return function(e){for(var t={},i=0,n=0;i<a;i+=1){var r=u[i];if("string"==typeof r)n+=r.length;else{var o=r.regex,s=r.parser,l=e.slice(n),c=o.exec(l)[0];s.call(t,c),e=e.replace(c,"")}}return function(e){var t=e.afternoon;if(void 0!==t){var i=e.hours;t?i<12&&(e.hours+=12):12===i&&(e.hours=0),delete e.afternoon}}(t),t}}return function(e,t,i){i.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(a=e.parseTwoDigitYear);var n=t.prototype,r=n.parse;n.parse=function(e){var t=e.date,n=e.utc,u=e.args;this.$u=n;var a=u[1];if("string"==typeof a){var s=!0===u[2],l=!0===u[3],c=s||l,d=u[2];l&&(d=u[2]),o=this.$locale(),!s&&d&&(o=i.Ls[d]),this.$d=function(e,t,i,n){try{if(["x","X"].indexOf(t)>-1)return new Date(("X"===t?1e3:1)*e);var r=h(t)(e),u=r.year,o=r.month,a=r.day,s=r.hours,l=r.minutes,c=r.seconds,d=r.milliseconds,f=r.zone,m=r.week,z=new Date,v=a||(u||o?1:z.getDate()),p=u||z.getFullYear(),g=0;u&&!o||(g=o>0?o-1:z.getMonth());var b,x=s||0,y=l||0,w=c||0,M=d||0;return f?new Date(Date.UTC(p,g,v,x,y,w,M+60*f.offset*1e3)):i?new Date(Date.UTC(p,g,v,x,y,w,M)):(b=new Date(p,g,v,x,y,w,M),m&&(b=n(b).week(m).toDate()),b)}catch(e){return new Date("")}}(t,a,n,i),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),c&&t!=this.format(a)&&(this.$d=new Date("")),o={}}else if(a instanceof Array)for(var f=a.length,m=1;m<=f;m+=1){u[1]=a[m-1];var z=i.apply(this,u);if(z.isValid()){this.$d=z.$d,this.$L=z.$L,this.init();break}m===f&&(this.$d=new Date(""))}else r.call(this,e)}}}());f.extend(m);var z={xs:"zui:h-8 zui:text-xs",sm:"zui:h-9 zui:text-sm",md:"zui:h-10 zui:text-sm",lg:"zui:h-11 zui:text-base"},v={xs:"zui:py-1.5",sm:"zui:py-2",md:"zui:py-2",lg:"zui:py-2.5"},p={xs:"zui:px-2",sm:"zui:px-2.5",md:"zui:px-3",lg:"zui:px-3.5"},g={xs:"zui:min-w-[10rem]",sm:"zui:min-w-[12rem]",md:"zui:min-w-[12rem]",lg:"zui:min-w-[14rem]"},b=function(e){return"contained"===e?"zui:bg-muted":"zui:bg-background"};function x(e){return e<10?"0".concat(e):"".concat(e)}function y(e,t,i){void 0===i&&(i=0);for(var n=[],r=i;r<=t;r+=e)n.push(r);return n}var w=r.forwardRef(function(o,a){var d,h,m,w=o.label,M=o.floatingLabel,$=void 0!==M&&M,D=o.description,S=o.error,k=o.size,Y=void 0===k?"md":k,N=o.variant,L=void 0===N?"outlined":N,T=o.focusOutline,O=void 0===T||T,C=o.className,H=o.value,A=o.defaultValue,_=void 0===A?null:A,P=o.onChange,j=o.format,E=void 0===j?"HH:mm":j,Z=o.use12Hours,F=o.hourStep,U=void 0===F?1:F,W=o.minuteStep,R=void 0===W?1:W,V=o.secondStep,I=void 0===V?1:V,q=o.needConfirm,K=void 0===q||q,B=o.showNow,J=void 0===B||B,Q=o.okText,X=void 0===Q?"OK":Q,G=o.closeText,ee=void 0===G?"Close":G,te=o.nowText,ie=void 0===te?"Now":te,ne=o.amText,re=void 0===ne?"AM":ne,ue=o.pmText,oe=void 0===ue?"PM":ue,ae=o.hourLabel,se=void 0===ae?"Hour":ae,le=o.minuteLabel,ce=void 0===le?"Minute":le,de=o.secondLabel,fe=void 0===de?"Second":de,he=o.disabledHours,me=o.disabledMinutes,ze=o.disabledSeconds,ve=o.disabled,pe=o.placeholder,ge=o.required,be=o.allowClear,xe=void 0===be||be,ye=o.id,we=e(o,["label","floatingLabel","description","error","size","variant","focusOutline","className","value","defaultValue","onChange","format","use12Hours","hourStep","minuteStep","secondStep","needConfirm","showNow","okText","closeText","nowText","amText","pmText","hourLabel","minuteLabel","secondLabel","disabledHours","disabledMinutes","disabledSeconds","disabled","placeholder","required","allowClear","id"]),Me=ye||function(e){void 0===e&&(e="timepicker");var t=r.useRef();return t.current||(t.current="".concat(e,"-").concat(Math.random().toString(36).slice(2,9))),t.current}("timepicker"),$e=(h=E,"boolean"==typeof(m=Z)?m:/(^|[^H])h/.test(h)||/(\sa\b|\sA\b|a\b|A\b)/.test(h)),De=function(e){return/\bss\b/.test(e)}(E),Se=function(e){return{container:e?"zui:opacity-80":"",label:e?"zui:text-gray-500":"zui:text-gray-700",input:e?" zui:cursor-not-allowed zui:opacity-90 zui:text-gray-900 zui:bg-gray-50 zui:border zui:border-gray-300":""}}(ve||!1),ke=r.useRef(void 0!==H).current,Ye=r.useState(_),Ne=Ye[0],Le=Ye[1],Te=ke?null!=H?H:null:null!=Ne?Ne:null,Oe=Te?Te.format(E):"",Ce=r.useState(Oe),He=Ce[0],Ae=Ce[1],_e=r.useState(!1);_e[0];var Pe=_e[1];r.useEffect(function(){Ae(Oe)},[Oe]);var je=r.useState(null),Ee=je[0],Ze=je[1],Fe=Boolean(Ee),Ue=r.useRef(null),We=r.useRef(!1);function Re(e,t){var i;Ze(e&&null!==(i=null!=t?t:Ue.current)&&void 0!==i?i:null)}function Ve(){We.current=!0,Re(!1),K&&(Ae(Oe),Ke(Te)),Promise.resolve().then(function(){We.current=!1})}r.useEffect(function(){function e(e){"Escape"===e.key&&(e.stopPropagation(),e.preventDefault(),Fe&&Ze(null))}return Fe&&document.addEventListener("keydown",e,!0),function(){return document.removeEventListener("keydown",e,!0)}},[Fe]);var Ie=r.useState(Te),qe=Ie[0],Ke=Ie[1];r.useEffect(function(){Fe&&(Ke(Te),Ae(Oe))},[Fe,Te,Oe]);var Be=r.useMemo(function(){return $e?y(U,12,1):y(U,23,0)},[$e,U]),Je=r.useMemo(function(){return y(R,59,0)},[R]),Qe=r.useMemo(function(){return y(I,59,0)},[I]);function Xe(e){var t=e?e.format(E):"";null==P||P(e,t),ke||Le(e)}function Ge(e,t,i,n){var r;if(!(null==he?void 0:he($e?e%12||12:e))&&!((null==me?void 0:me(t))||De&&(null==ze?void 0:ze(i)))){var u=$e?function(e,t){return t?"am"===t?12===e?0:e:12===e?12:e+12:e}(e,n):e,o=(null!==(r=null!=qe?qe:Te)&&void 0!==r?r:f()).hour(u).minute(t).second(De?i:0).millisecond(0);Ke(o),Ae(o.format(E)),K||Xe(o)}}var et=qe?qe.format(E):"",tt=Fe&&""!==et.trim()?et:Oe;var it=r.useRef(null),nt=r.useRef(null),rt=r.useRef(null);function ut(e,t){var i=e.current;if(i){var n=Array.from(i.querySelectorAll('button[role="option"]:not([aria-disabled="true"])'));if(0!==n.length){var r=n.findIndex(function(e){return e===document.activeElement});n[r<0?0:Math.max(0,Math.min(n.length-1,r+t))].focus()}}}function ot(e,t){"ArrowDown"===e.key?(e.preventDefault(),ut(t,1)):"ArrowUp"===e.key&&(e.preventDefault(),ut(t,-1))}var at="lg"===Y?18:16,st=w||"Time picker",lt=Boolean(tt)&&!ve&&!!xe,ct=null!==(d=null!=qe?qe:Te)&&void 0!==d?d:null,dt=ct?ct.hour():$e?12:0,ft=ct?ct.minute():0,ht=ct?ct.second():0,mt=dt>=12?"pm":"am",zt=dt%12==0?12:dt%12;return i("div",{className:s("zui:w-full",Se.container,g[Y],C),children:[!$&&w&&i("label",{htmlFor:Me,className:s("zui:block zui:mb-2 zui:text-sm zui:font-medium zui:leading-none",Se.label),children:[w,ge&&n("span",{className:"zui:text-destructive zui:font-medium",children:" *"})]}),i("div",{className:s("zui:relative zui:w-full zui:rounded-md zui:border zui:bg-background zui:text-sm zui:transition-colors",O&&"zui:focus-within:ring-1 zui:focus-within:ring-ring zui:focus-within:ring-offset-1","outlined"===L&&"zui:border-input","contained"===L&&"zui:bg-muted zui:border-transparent",Se.input,S&&"zui:border-destructive",S&&O&&"zui:focus-within:ring-destructive"),children:[$&&w&&i("label",{htmlFor:Me,className:s("zui:absolute zui:left-3 zui:top-0 zui:-translate-y-1/2 zui:px-1 zui:text-xs zui:pointer-events-none zui:transition-colors zui:z-10",b(L),Se.label),children:[w,ge&&n("span",{className:"zui:text-destructive zui:font-medium",children:" *"})]}),n("input",t({id:Me,ref:function(e){"function"==typeof a?a(e):a&&(a.current=e),Ue.current=e},value:tt,onChange:function(e){var t;Ae(null!==(t=e.target.value)&&void 0!==t?t:"")},onBlur:function(){Pe(!1);var e=(null!=He?He:"").trim();if(K){if(!e)return Ke(null),void Ae(Oe);(t=f(e,E,!0)).isValid()?Ke(t.millisecond(0)):(Ae(Oe),Ke(Te))}else{if(!e)return void Xe(null);var t;(t=f(e,E,!0)).isValid()?Xe(t.millisecond(0)):Ae(Oe)}},onFocus:function(e){Pe(!0),ve||We.current||Re(!0,Ue.current||e.currentTarget)},onClick:function(e){ve||We.current||Re(!0,Ue.current||e.currentTarget)},placeholder:null!=pe?pe:$e?De?"h:mm:ss a":"h:mm a":De?"HH:mm:ss":"HH:mm","aria-label":st,disabled:ve,required:ge,className:s("zui:peer zui:block zui:w-full zui:bg-transparent zui:outline-none zui:px-3 zui:disabled:cursor-not-allowed zui:disabled:opacity-50",z[Y],v[Y],lt?"zui:pr-20":"zui:pr-10")},we)),lt?n("button",{type:"button",onMouseDown:function(e){return e.preventDefault()},onClick:function(e){e.stopPropagation(),Ke(null),Ae(""),Xe(null),We.current=!0,Re(!1),Promise.resolve().then(function(){We.current=!1})},className:s("zui:absolute zui:inset-y-0 zui:right-9 zui:flex zui:items-center zui:text-muted-foreground hover:zui:text-gray-700 focus:zui:outline-none",p[Y]),"aria-label":"Clear time",children:n(l,{size:at})}):null,n("button",{type:"button",onMouseDown:function(e){return e.preventDefault()},onClick:function(e){e.stopPropagation(),function(e){ve||Re(!Fe,e.currentTarget)}(e)},className:s("zui:absolute zui:inset-y-0 zui:right-0 zui:flex zui:items-center zui:text-muted-foreground hover:zui:text-gray-700 disabled:zui:opacity-50",p[Y]),disabled:ve,"aria-label":"Toggle time panel",children:n(c,{size:at})})]}),i("div",{className:"zui:flex zui:flex-row zui:justify-between",children:[D&&!S&&!ve&&n("p",{className:"zui:text-xs zui:text-muted-foreground",children:D}),S&&n("p",{className:"zui:text-xs zui:text-destructive",children:S})]}),n(u,{open:Fe,anchorEl:Ee,onClose:function(e,t){"backdropClick"!==t&&"escapeKeyDown"!==t&&Ve()},anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{className:s("zui:rounded-md zui:border zui:border-gray-200 zui:shadow-lg zui:bg-white zui:p-2","zui:w-[22rem] sm:zui:w-[24rem]")}},children:i("div",{className:"zui:flex zui:flex-col zui:gap-2",children:[i("div",{className:"zui:grid zui:grid-cols-3 zui:gap-2 zui:text-xs zui:text-gray-500 zui:sticky zui:top-0 zui:bg-white zui:z-10",children:[n("div",{className:"zui:text-center",children:se}),n("div",{className:"zui:text-center",children:ce}),n("div",{className:"zui:text-center",children:De?fe:$e?"AM/PM":""})]}),i("div",{className:"zui:grid zui:grid-cols-3 zui:gap-2",children:[n("div",{ref:it,onKeyDown:function(e){return ot(e,it)},className:"zui:max-h-44 zui:overflow-auto zui:p-1 zui:grid zui:grid-cols-3 zui:gap-1",role:"listbox","aria-label":"Select hour",children:Be.map(function(e){var t,i=$e?zt===e:dt===e,r=null!==(t=null==he?void 0:he($e?e%12||12:e))&&void 0!==t&&t;return n("button",{type:"button",role:"option","aria-selected":i,"aria-disabled":r,disabled:r,onClick:function(){r||Ge(e,ft,ht,$e?mt:void 0)},className:s("zui:px-2 zui:py-1 zui:rounded zui:text-sm zui:transition","hover:zui:bg-gray-100 focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500",i&&"zui:bg-blue-50 zui:text-blue-700 zui:font-medium",r&&"zui:opacity-40 zui:cursor-not-allowed"),children:x(e)},e)})}),n("div",{ref:nt,onKeyDown:function(e){return ot(e,nt)},className:"zui:max-h-44 zui:overflow-auto zui:p-1 zui:grid zui:grid-cols-3 zui:gap-1",role:"listbox","aria-label":"Select minute",children:Je.map(function(e){var t,i=ft===e,r=null!==(t=null==me?void 0:me(e))&&void 0!==t&&t;return n("button",{type:"button",role:"option","aria-selected":i,"aria-disabled":r,disabled:r,onClick:function(){r||Ge($e?zt:dt,e,ht,$e?mt:void 0)},className:s("zui:px-2 zui:py-1 zui:rounded zui:text-sm zui:transition","hover:zui:bg-gray-100 focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500",i&&"zui:bg-blue-50 zui:text-blue-700 zui:font-medium",r&&"zui:opacity-40 zui:cursor-not-allowed"),children:x(e)},e)})}),De?n("div",{ref:rt,onKeyDown:function(e){return ot(e,rt)},className:"zui:max-h-44 zui:overflow-auto zui:p-1 zui:grid zui:grid-cols-3 zui:gap-1",role:"listbox","aria-label":"Select second",children:Qe.map(function(e){var t,i=ht===e,r=null!==(t=null==ze?void 0:ze(e))&&void 0!==t&&t;return n("button",{type:"button",role:"option","aria-selected":i,"aria-disabled":r,disabled:r,onClick:function(){r||Ge($e?zt:dt,ft,e,$e?mt:void 0)},className:s("zui:px-2 zui:py-1 zui:rounded zui:text-sm zui:transition","hover:zui:bg-gray-100 focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500",i&&"zui:bg-blue-50 zui:text-blue-700 zui:font-medium",r&&"zui:opacity-40 zui:cursor-not-allowed"),children:x(e)},e)})}):$e?n("div",{className:"zui:flex zui:flex-col zui:gap-1",role:"listbox","aria-label":"Select AM/PM",children:["am","pm"].map(function(e){var t=mt===e;return n("button",{type:"button",role:"option","aria-selected":t,onClick:function(){Ge(zt||12,ft,ht,e)},className:s("zui:flex-1 zui:px-2 zui:py-1 zui:rounded zui:text-sm zui:transition","hover:zui:bg-gray-100 focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500",t&&"zui:bg-blue-50 zui:text-blue-700 zui:font-medium"),"aria-pressed":t,children:"am"===e?re:oe},e)})}):null]}),i("div",{className:"zui:flex zui:items-center zui:justify-between zui:pt-1",children:[J?n("button",{type:"button",onClick:function(){var e=f(),t=e.second(De?e.second():0).millisecond(0);Ke(t),Ae(t.format(E)),Xe(t),We.current=!0,Re(!1),Promise.resolve().then(function(){We.current=!1})},className:"zui:text-gray-700 hover:zui:text-gray-900 zui:text-sm focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500 zui:rounded zui:px-2 zui:py-1",children:ie}):n("span",{}),i("div",{className:"zui:flex zui:gap-2",children:[n("button",{type:"button",onClick:Ve,className:"zui:text-gray-700 hover:zui:text-gray-900 zui:text-sm focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500 zui:rounded zui:px-2 zui:py-1",children:ee}),K&&n("button",{type:"button",onClick:function(){Xe(null!=qe?qe:null),We.current=!0,Re(!1),Promise.resolve().then(function(){We.current=!1})},className:"zui:text-white zui:bg-blue-600 hover:zui:bg-blue-700 zui:text-sm focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500 zui:rounded zui:px-3 zui:py-1",children:X})]})]})]})})]})});export{w as TimePicker,w as default};
1
+ import{_ as e,a as t}from"../../chunks/tslib.es6-4974c96c.esm.js";import{jsxs as i,jsx as n}from"react/jsx-runtime";import*as r from"react";import u from"@mui/material/Popover";import{c as o,g as s}from"../../chunks/_commonjsHelpers-02d3be64.esm.js";import{a}from"../../chunks/index-32c3a4e2.esm.js";import{X as l,m as c}from"../../chunks/lucide-8c9441ea.esm.js";var d={exports:{}},f=s(d.exports=function(){var e=1e3,t=6e4,i=36e5,n="millisecond",r="second",u="minute",o="hour",s="day",a="week",l="month",c="quarter",d="year",f="date",h="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,z=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],i=e%100;return"["+e+(t[(i-20)%10]||t[i]||t[0])+"]"}},p=function(e,t,i){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(i)+e},g={s:p,z:function(e){var t=-e.utcOffset(),i=Math.abs(t),n=Math.floor(i/60),r=i%60;return(t<=0?"+":"-")+p(n,2,"0")+":"+p(r,2,"0")},m:function e(t,i){if(t.date()<i.date())return-e(i,t);var n=12*(i.year()-t.year())+(i.month()-t.month()),r=t.clone().add(n,l),u=i-r<0,o=t.clone().add(n+(u?-1:1),l);return+(-(n+(i-r)/(u?r-o:o-r))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:a,d:s,D:f,h:o,m:u,s:r,ms:n,Q:c}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},b="en",x={};x[b]=v;var y="$isDayjsObject",w=function(e){return e instanceof S||!(!e||!e[y])},M=function e(t,i,n){var r;if(!t)return b;if("string"==typeof t){var u=t.toLowerCase();x[u]&&(r=u),i&&(x[u]=i,r=u);var o=t.split("-");if(!r&&o.length>1)return e(o[0])}else{var s=t.name;x[s]=t,r=s}return!n&&r&&(b=r),r||!n&&b},$=function(e,t){if(w(e))return e.clone();var i="object"==typeof t?t:{};return i.date=e,i.args=arguments,new S(i)},D=g;D.l=M,D.i=w,D.w=function(e,t){return $(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var S=function(){function v(e){this.$L=M(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[y]=!0}var p=v.prototype;return p.parse=function(e){this.$d=function(e){var t=e.date,i=e.utc;if(null===t)return new Date(NaN);if(D.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var n=t.match(m);if(n){var r=n[2]-1||0,u=(n[7]||"0").substring(0,3);return i?new Date(Date.UTC(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[6]||0,u)):new Date(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[6]||0,u)}}return new Date(t)}(e),this.init()},p.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},p.$utils=function(){return D},p.isValid=function(){return!(this.$d.toString()===h)},p.isSame=function(e,t){var i=$(e);return this.startOf(t)<=i&&i<=this.endOf(t)},p.isAfter=function(e,t){return $(e)<this.startOf(t)},p.isBefore=function(e,t){return this.endOf(t)<$(e)},p.$g=function(e,t,i){return D.u(e)?this[t]:this.set(i,e)},p.unix=function(){return Math.floor(this.valueOf()/1e3)},p.valueOf=function(){return this.$d.getTime()},p.startOf=function(e,t){var i=this,n=!!D.u(t)||t,c=D.p(e),h=function(e,t){var r=D.w(i.$u?Date.UTC(i.$y,t,e):new Date(i.$y,t,e),i);return n?r:r.endOf(s)},m=function(e,t){return D.w(i.toDate()[e].apply(i.toDate("s"),(n?[0,0,0,0]:[23,59,59,999]).slice(t)),i)},z=this.$W,v=this.$M,p=this.$D,g="set"+(this.$u?"UTC":"");switch(c){case d:return n?h(1,0):h(31,11);case l:return n?h(1,v):h(0,v+1);case a:var b=this.$locale().weekStart||0,x=(z<b?z+7:z)-b;return h(n?p-x:p+(6-x),v);case s:case f:return m(g+"Hours",0);case o:return m(g+"Minutes",1);case u:return m(g+"Seconds",2);case r:return m(g+"Milliseconds",3);default:return this.clone()}},p.endOf=function(e){return this.startOf(e,!1)},p.$set=function(e,t){var i,a=D.p(e),c="set"+(this.$u?"UTC":""),h=(i={},i[s]=c+"Date",i[f]=c+"Date",i[l]=c+"Month",i[d]=c+"FullYear",i[o]=c+"Hours",i[u]=c+"Minutes",i[r]=c+"Seconds",i[n]=c+"Milliseconds",i)[a],m=a===s?this.$D+(t-this.$W):t;if(a===l||a===d){var z=this.clone().set(f,1);z.$d[h](m),z.init(),this.$d=z.set(f,Math.min(this.$D,z.daysInMonth())).$d}else h&&this.$d[h](m);return this.init(),this},p.set=function(e,t){return this.clone().$set(e,t)},p.get=function(e){return this[D.p(e)]()},p.add=function(n,c){var f,h=this;n=Number(n);var m=D.p(c),z=function(e){var t=$(h);return D.w(t.date(t.date()+Math.round(e*n)),h)};if(m===l)return this.set(l,this.$M+n);if(m===d)return this.set(d,this.$y+n);if(m===s)return z(1);if(m===a)return z(7);var v=(f={},f[u]=t,f[o]=i,f[r]=e,f)[m]||1,p=this.$d.getTime()+n*v;return D.w(p,this)},p.subtract=function(e,t){return this.add(-1*e,t)},p.format=function(e){var t=this,i=this.$locale();if(!this.isValid())return i.invalidDate||h;var n=e||"YYYY-MM-DDTHH:mm:ssZ",r=D.z(this),u=this.$H,o=this.$m,s=this.$M,a=i.weekdays,l=i.months,c=i.meridiem,d=function(e,i,r,u){return e&&(e[i]||e(t,n))||r[i].slice(0,u)},f=function(e){return D.s(u%12||12,e,"0")},m=c||function(e,t,i){var n=e<12?"AM":"PM";return i?n.toLowerCase():n};return n.replace(z,function(e,n){return n||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return D.s(t.$y,4,"0");case"M":return s+1;case"MM":return D.s(s+1,2,"0");case"MMM":return d(i.monthsShort,s,l,3);case"MMMM":return d(l,s);case"D":return t.$D;case"DD":return D.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return d(i.weekdaysMin,t.$W,a,2);case"ddd":return d(i.weekdaysShort,t.$W,a,3);case"dddd":return a[t.$W];case"H":return String(u);case"HH":return D.s(u,2,"0");case"h":return f(1);case"hh":return f(2);case"a":return m(u,o,!0);case"A":return m(u,o,!1);case"m":return String(o);case"mm":return D.s(o,2,"0");case"s":return String(t.$s);case"ss":return D.s(t.$s,2,"0");case"SSS":return D.s(t.$ms,3,"0");case"Z":return r}return null}(e)||r.replace(":","")})},p.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},p.diff=function(n,f,h){var m,z=this,v=D.p(f),p=$(n),g=(p.utcOffset()-this.utcOffset())*t,b=this-p,x=function(){return D.m(z,p)};switch(v){case d:m=x()/12;break;case l:m=x();break;case c:m=x()/3;break;case a:m=(b-g)/6048e5;break;case s:m=(b-g)/864e5;break;case o:m=b/i;break;case u:m=b/t;break;case r:m=b/e;break;default:m=b}return h?m:D.a(m)},p.daysInMonth=function(){return this.endOf(l).$D},p.$locale=function(){return x[this.$L]},p.locale=function(e,t){if(!e)return this.$L;var i=this.clone(),n=M(e,t,!0);return n&&(i.$L=n),i},p.clone=function(){return D.w(this.$d,this)},p.toDate=function(){return new Date(this.valueOf())},p.toJSON=function(){return this.isValid()?this.toISOString():null},p.toISOString=function(){return this.$d.toISOString()},p.toString=function(){return this.$d.toUTCString()},v}(),k=S.prototype;return $.prototype=k,[["$ms",n],["$s",r],["$m",u],["$H",o],["$W",s],["$M",l],["$y",d],["$D",f]].forEach(function(e){k[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),$.extend=function(e,t){return e.$i||(e(t,S,$),e.$i=!0),$},$.locale=M,$.isDayjs=w,$.unix=function(e){return $(1e3*e)},$.en=x[b],$.Ls=x,$.p={},$}()),h={exports:{}},m=s(h.exports=function(){var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,n=/\d\d/,r=/\d\d?/,u=/\d*[^-_:/,()\s\d]+/,o={},s=function(e){return(e=+e)+(e>68?1900:2e3)},a=function(e){return function(t){this[e]=+t}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if("Z"===e)return 0;var t=e.match(/([+-]|\d\d)/g),i=60*t[1]+(+t[2]||0);return 0===i?0:"+"===t[0]?-i:i}(e)}],c=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var i,n=o.meridiem;if(n){for(var r=1;r<=24;r+=1)if(e.indexOf(n(r,0,t))>-1){i=r>12;break}}else i=e===(t?"pm":"PM");return i},f={A:[u,function(e){this.afternoon=d(e,!1)}],a:[u,function(e){this.afternoon=d(e,!0)}],Q:[i,function(e){this.month=3*(e-1)+1}],S:[i,function(e){this.milliseconds=100*+e}],SS:[n,function(e){this.milliseconds=10*+e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[r,a("seconds")],ss:[r,a("seconds")],m:[r,a("minutes")],mm:[r,a("minutes")],H:[r,a("hours")],h:[r,a("hours")],HH:[r,a("hours")],hh:[r,a("hours")],D:[r,a("day")],DD:[n,a("day")],Do:[u,function(e){var t=o.ordinal,i=e.match(/\d+/);if(this.day=i[0],t)for(var n=1;n<=31;n+=1)t(n).replace(/\[|\]/g,"")===e&&(this.day=n)}],w:[r,a("week")],ww:[n,a("week")],M:[r,a("month")],MM:[n,a("month")],MMM:[u,function(e){var t=c("months"),i=(c("monthsShort")||t.map(function(e){return e.slice(0,3)})).indexOf(e)+1;if(i<1)throw new Error;this.month=i%12||i}],MMMM:[u,function(e){var t=c("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],Y:[/[+-]?\d+/,a("year")],YY:[n,function(e){this.year=s(e)}],YYYY:[/\d{4}/,a("year")],Z:l,ZZ:l};function h(i){var n,r;n=i,r=o&&o.formats;for(var u=(i=n.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(t,i,n){var u=n&&n.toUpperCase();return i||r[n]||e[n]||r[u].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(e,t,i){return t||i.slice(1)})})).match(t),s=u.length,a=0;a<s;a+=1){var l=u[a],c=f[l],d=c&&c[0],h=c&&c[1];u[a]=h?{regex:d,parser:h}:l.replace(/^\[|\]$/g,"")}return function(e){for(var t={},i=0,n=0;i<s;i+=1){var r=u[i];if("string"==typeof r)n+=r.length;else{var o=r.regex,a=r.parser,l=e.slice(n),c=o.exec(l)[0];a.call(t,c),e=e.replace(c,"")}}return function(e){var t=e.afternoon;if(void 0!==t){var i=e.hours;t?i<12&&(e.hours+=12):12===i&&(e.hours=0),delete e.afternoon}}(t),t}}return function(e,t,i){i.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(s=e.parseTwoDigitYear);var n=t.prototype,r=n.parse;n.parse=function(e){var t=e.date,n=e.utc,u=e.args;this.$u=n;var s=u[1];if("string"==typeof s){var a=!0===u[2],l=!0===u[3],c=a||l,d=u[2];l&&(d=u[2]),o=this.$locale(),!a&&d&&(o=i.Ls[d]),this.$d=function(e,t,i,n){try{if(["x","X"].indexOf(t)>-1)return new Date(("X"===t?1e3:1)*e);var r=h(t)(e),u=r.year,o=r.month,s=r.day,a=r.hours,l=r.minutes,c=r.seconds,d=r.milliseconds,f=r.zone,m=r.week,z=new Date,v=s||(u||o?1:z.getDate()),p=u||z.getFullYear(),g=0;u&&!o||(g=o>0?o-1:z.getMonth());var b,x=a||0,y=l||0,w=c||0,M=d||0;return f?new Date(Date.UTC(p,g,v,x,y,w,M+60*f.offset*1e3)):i?new Date(Date.UTC(p,g,v,x,y,w,M)):(b=new Date(p,g,v,x,y,w,M),m&&(b=n(b).week(m).toDate()),b)}catch(e){return new Date("")}}(t,s,n,i),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),c&&t!=this.format(s)&&(this.$d=new Date("")),o={}}else if(s instanceof Array)for(var f=s.length,m=1;m<=f;m+=1){u[1]=s[m-1];var z=i.apply(this,u);if(z.isValid()){this.$d=z.$d,this.$L=z.$L,this.init();break}m===f&&(this.$d=new Date(""))}else r.call(this,e)}}}());f.extend(m);var z={xs:"zui:h-8 zui:text-xs",sm:"zui:h-9 zui:text-sm",md:"zui:h-10 zui:text-sm",lg:"zui:h-11 zui:text-base"},v={xs:"zui:py-1.5",sm:"zui:py-2",md:"zui:py-2",lg:"zui:py-2.5"},p={xs:"zui:px-2",sm:"zui:px-2.5",md:"zui:px-3",lg:"zui:px-3.5"},g={xs:"zui:min-w-[10rem]",sm:"zui:min-w-[12rem]",md:"zui:min-w-[12rem]",lg:"zui:min-w-[14rem]"},b=function(e){return"contained"===e?"zui:bg-muted":"zui:bg-background"};function x(e){return e<10?"0".concat(e):"".concat(e)}function y(e,t,i){void 0===i&&(i=0);for(var n=[],r=i;r<=t;r+=e)n.push(r);return n}var w=r.forwardRef(function(o,s){var d,h,m,w=o.label,M=o.floatingLabel,$=void 0!==M&&M,D=o.description,S=o.error,k=o.size,Y=void 0===k?"md":k,N=o.variant,L=void 0===N?"outlined":N,T=o.focusOutline,O=void 0===T||T,C=o.className,H=o.value,A=o.defaultValue,_=void 0===A?null:A,P=o.onChange,j=o.format,E=void 0===j?"HH:mm":j,Z=o.use12Hours,F=o.hourStep,U=void 0===F?1:F,W=o.minuteStep,R=void 0===W?1:W,V=o.secondStep,I=void 0===V?1:V,q=o.needConfirm,K=void 0===q||q,B=o.showNow,J=void 0===B||B,Q=o.okText,X=void 0===Q?"OK":Q,G=o.closeText,ee=void 0===G?"Close":G,te=o.nowText,ie=void 0===te?"Now":te,ne=o.amText,re=void 0===ne?"AM":ne,ue=o.pmText,oe=void 0===ue?"PM":ue,se=o.hourLabel,ae=void 0===se?"Hour":se,le=o.minuteLabel,ce=void 0===le?"Minute":le,de=o.secondLabel,fe=void 0===de?"Second":de,he=o.disabledHours,me=o.disabledMinutes,ze=o.disabledSeconds,ve=o.disabled,pe=o.placeholder,ge=o.required,be=o.allowClear,xe=void 0===be||be,ye=o.id,we=e(o,["label","floatingLabel","description","error","size","variant","focusOutline","className","value","defaultValue","onChange","format","use12Hours","hourStep","minuteStep","secondStep","needConfirm","showNow","okText","closeText","nowText","amText","pmText","hourLabel","minuteLabel","secondLabel","disabledHours","disabledMinutes","disabledSeconds","disabled","placeholder","required","allowClear","id"]),Me=ye||function(e){void 0===e&&(e="timepicker");var t=r.useRef();return t.current||(t.current="".concat(e,"-").concat(Math.random().toString(36).slice(2,9))),t.current}("timepicker"),$e=(h=E,"boolean"==typeof(m=Z)?m:/(^|[^H])h/.test(h)||/(\sa\b|\sA\b|a\b|A\b)/.test(h)),De=function(e){return/\bss\b/.test(e)}(E),Se=function(e){return{container:e?"zui:opacity-80":"",label:e?"zui:text-gray-500":"zui:text-gray-700",input:e?" zui:cursor-not-allowed zui:opacity-90 zui:text-gray-900 zui:bg-gray-50 zui:border zui:border-gray-300":""}}(ve||!1),ke=r.useRef(void 0!==H).current,Ye=r.useState(_),Ne=Ye[0],Le=Ye[1],Te=ke?null!=H?H:null:null!=Ne?Ne:null,Oe=Te?Te.format(E):"",Ce=r.useState(Oe),He=Ce[0],Ae=Ce[1],_e=r.useState(!1);_e[0];var Pe=_e[1];r.useEffect(function(){Ae(Oe)},[Oe]);var je=r.useState(null),Ee=je[0],Ze=je[1],Fe=Boolean(Ee),Ue=r.useRef(null),We=r.useRef(!1);function Re(e,t){var i;Ze(e&&null!==(i=null!=t?t:Ue.current)&&void 0!==i?i:null)}function Ve(){We.current=!0,Re(!1),K&&(Ae(Oe),Ke(Te)),Promise.resolve().then(function(){We.current=!1})}r.useEffect(function(){function e(e){"Escape"===e.key&&(e.stopPropagation(),e.preventDefault(),Fe&&Ze(null))}return Fe&&document.addEventListener("keydown",e,!0),function(){return document.removeEventListener("keydown",e,!0)}},[Fe]);var Ie=r.useState(Te),qe=Ie[0],Ke=Ie[1];r.useEffect(function(){Fe&&(Ke(Te),Ae(Oe))},[Fe,Te,Oe]);var Be=r.useMemo(function(){return $e?y(U,12,1):y(U,23,0)},[$e,U]),Je=r.useMemo(function(){return y(R,59,0)},[R]),Qe=r.useMemo(function(){return y(I,59,0)},[I]);function Xe(e){var t=e?e.format(E):"";null==P||P(e,t),ke||Le(e)}function Ge(e,t,i,n){var r;if(!(null==he?void 0:he($e?e%12||12:e))&&!((null==me?void 0:me(t))||De&&(null==ze?void 0:ze(i)))){var u=$e?function(e,t){return t?"am"===t?12===e?0:e:12===e?12:e+12:e}(e,n):e,o=(null!==(r=null!=qe?qe:Te)&&void 0!==r?r:f()).hour(u).minute(t).second(De?i:0).millisecond(0);Ke(o),Ae(o.format(E)),K||Xe(o)}}var et=qe?qe.format(E):"",tt=Fe&&""!==et.trim()?et:Oe;var it=r.useRef(null),nt=r.useRef(null),rt=r.useRef(null);function ut(e,t){var i=e.current;if(i){var n=Array.from(i.querySelectorAll('button[role="option"]:not([aria-disabled="true"])'));if(0!==n.length){var r=n.findIndex(function(e){return e===document.activeElement});n[r<0?0:Math.max(0,Math.min(n.length-1,r+t))].focus()}}}function ot(e,t){"ArrowDown"===e.key?(e.preventDefault(),ut(t,1)):"ArrowUp"===e.key&&(e.preventDefault(),ut(t,-1))}var st="lg"===Y?18:16,at=w||"Time picker",lt=Boolean(tt)&&!ve&&!!xe,ct=null!==(d=null!=qe?qe:Te)&&void 0!==d?d:null,dt=ct?ct.hour():$e?12:0,ft=ct?ct.minute():0,ht=ct?ct.second():0,mt=dt>=12?"pm":"am",zt=dt%12==0?12:dt%12;return i("div",{className:a("zui:w-full",Se.container,g[Y],C),children:[!$&&w&&i("label",{htmlFor:Me,className:a("zui:block zui:mb-2 zui:text-sm zui:font-medium zui:leading-none",Se.label),children:[w,ge&&n("span",{className:"zui:text-destructive zui:font-medium",children:" *"})]}),i("div",{className:a("zui:relative zui:w-full zui:rounded-sm zui:border zui:bg-background zui:text-sm zui:transition-colors",O&&"zui:focus-within:ring-1 zui:focus-within:ring-ring zui:focus-within:ring-offset-1","outlined"===L&&"zui:border-input","contained"===L&&"zui:bg-muted zui:border-transparent",Se.input,S&&"zui:border-destructive",S&&O&&"zui:focus-within:ring-destructive"),children:[$&&w&&i("label",{htmlFor:Me,className:a("zui:absolute zui:left-3 zui:top-0 zui:-translate-y-1/2 zui:px-1 zui:text-xs zui:pointer-events-none zui:transition-colors zui:z-10",b(L),Se.label),children:[w,ge&&n("span",{className:"zui:text-destructive zui:font-medium",children:" *"})]}),n("input",t({id:Me,ref:function(e){"function"==typeof s?s(e):s&&(s.current=e),Ue.current=e},value:tt,onChange:function(e){var t;Ae(null!==(t=e.target.value)&&void 0!==t?t:"")},onBlur:function(){Pe(!1);var e=(null!=He?He:"").trim();if(K){if(!e)return Ke(null),void Ae(Oe);(t=f(e,E,!0)).isValid()?Ke(t.millisecond(0)):(Ae(Oe),Ke(Te))}else{if(!e)return void Xe(null);var t;(t=f(e,E,!0)).isValid()?Xe(t.millisecond(0)):Ae(Oe)}},onFocus:function(e){Pe(!0),ve||We.current||Re(!0,Ue.current||e.currentTarget)},onClick:function(e){ve||We.current||Re(!0,Ue.current||e.currentTarget)},placeholder:null!=pe?pe:$e?De?"h:mm:ss a":"h:mm a":De?"HH:mm:ss":"HH:mm","aria-label":at,disabled:ve,required:ge,className:a("zui:peer zui:block zui:w-full zui:bg-transparent zui:outline-none zui:px-3 zui:disabled:cursor-not-allowed zui:disabled:opacity-50",z[Y],v[Y],lt?"zui:pr-20":"zui:pr-10")},we)),lt?n("button",{type:"button",onMouseDown:function(e){return e.preventDefault()},onClick:function(e){e.stopPropagation(),Ke(null),Ae(""),Xe(null),We.current=!0,Re(!1),Promise.resolve().then(function(){We.current=!1})},className:a("zui:absolute zui:inset-y-0 zui:right-9 zui:flex zui:items-center zui:text-muted-foreground hover:zui:text-gray-700 focus:zui:outline-none",p[Y]),"aria-label":"Clear time",children:n(l,{size:st})}):null,n("button",{type:"button",onMouseDown:function(e){return e.preventDefault()},onClick:function(e){e.stopPropagation(),function(e){ve||Re(!Fe,e.currentTarget)}(e)},className:a("zui:absolute zui:inset-y-0 zui:right-0 zui:flex zui:items-center zui:text-muted-foreground hover:zui:text-gray-700 disabled:zui:opacity-50",p[Y]),disabled:ve,"aria-label":"Toggle time panel",children:n(c,{size:st})})]}),i("div",{className:"zui:flex zui:flex-row zui:justify-between",children:[D&&!S&&!ve&&n("p",{className:"zui:text-xs zui:text-muted-foreground",children:D}),S&&n("p",{className:"zui:text-xs zui:text-destructive",children:S})]}),n(u,{open:Fe,anchorEl:Ee,onClose:function(e,t){"backdropClick"!==t&&"escapeKeyDown"!==t&&Ve()},anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{className:a("zui:rounded-sm zui:border zui:border-gray-200 zui:shadow-lg zui:bg-white zui:p-2","zui:w-[22rem] sm:zui:w-[24rem]")}},children:i("div",{className:"zui:flex zui:flex-col zui:gap-2",children:[i("div",{className:"zui:grid zui:grid-cols-3 zui:gap-2 zui:text-xs zui:text-gray-500 zui:sticky zui:top-0 zui:bg-white zui:z-10",children:[n("div",{className:"zui:text-center",children:ae}),n("div",{className:"zui:text-center",children:ce}),n("div",{className:"zui:text-center",children:De?fe:$e?"AM/PM":""})]}),i("div",{className:"zui:grid zui:grid-cols-3 zui:gap-2",children:[n("div",{ref:it,onKeyDown:function(e){return ot(e,it)},className:"zui:max-h-44 zui:overflow-auto zui:p-1 zui:grid zui:grid-cols-3 zui:gap-1",role:"listbox","aria-label":"Select hour",children:Be.map(function(e){var t,i=$e?zt===e:dt===e,r=null!==(t=null==he?void 0:he($e?e%12||12:e))&&void 0!==t&&t;return n("button",{type:"button",role:"option","aria-selected":i,"aria-disabled":r,disabled:r,onClick:function(){r||Ge(e,ft,ht,$e?mt:void 0)},className:a("zui:px-2 zui:py-1 zui:rounded zui:text-sm zui:transition","hover:zui:bg-gray-100 focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500",i&&"zui:bg-blue-50 zui:text-blue-700 zui:font-medium",r&&"zui:opacity-40 zui:cursor-not-allowed"),children:x(e)},e)})}),n("div",{ref:nt,onKeyDown:function(e){return ot(e,nt)},className:"zui:max-h-44 zui:overflow-auto zui:p-1 zui:grid zui:grid-cols-3 zui:gap-1",role:"listbox","aria-label":"Select minute",children:Je.map(function(e){var t,i=ft===e,r=null!==(t=null==me?void 0:me(e))&&void 0!==t&&t;return n("button",{type:"button",role:"option","aria-selected":i,"aria-disabled":r,disabled:r,onClick:function(){r||Ge($e?zt:dt,e,ht,$e?mt:void 0)},className:a("zui:px-2 zui:py-1 zui:rounded zui:text-sm zui:transition","hover:zui:bg-gray-100 focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500",i&&"zui:bg-blue-50 zui:text-blue-700 zui:font-medium",r&&"zui:opacity-40 zui:cursor-not-allowed"),children:x(e)},e)})}),De?n("div",{ref:rt,onKeyDown:function(e){return ot(e,rt)},className:"zui:max-h-44 zui:overflow-auto zui:p-1 zui:grid zui:grid-cols-3 zui:gap-1",role:"listbox","aria-label":"Select second",children:Qe.map(function(e){var t,i=ht===e,r=null!==(t=null==ze?void 0:ze(e))&&void 0!==t&&t;return n("button",{type:"button",role:"option","aria-selected":i,"aria-disabled":r,disabled:r,onClick:function(){r||Ge($e?zt:dt,ft,e,$e?mt:void 0)},className:a("zui:px-2 zui:py-1 zui:rounded zui:text-sm zui:transition","hover:zui:bg-gray-100 focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500",i&&"zui:bg-blue-50 zui:text-blue-700 zui:font-medium",r&&"zui:opacity-40 zui:cursor-not-allowed"),children:x(e)},e)})}):$e?n("div",{className:"zui:flex zui:flex-col zui:gap-1",role:"listbox","aria-label":"Select AM/PM",children:["am","pm"].map(function(e){var t=mt===e;return n("button",{type:"button",role:"option","aria-selected":t,onClick:function(){Ge(zt||12,ft,ht,e)},className:a("zui:flex-1 zui:px-2 zui:py-1 zui:rounded zui:text-sm zui:transition","hover:zui:bg-gray-100 focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500",t&&"zui:bg-blue-50 zui:text-blue-700 zui:font-medium"),"aria-pressed":t,children:"am"===e?re:oe},e)})}):null]}),i("div",{className:"zui:flex zui:items-center zui:justify-between zui:pt-1",children:[J?n("button",{type:"button",onClick:function(){var e=f(),t=e.second(De?e.second():0).millisecond(0);Ke(t),Ae(t.format(E)),Xe(t),We.current=!0,Re(!1),Promise.resolve().then(function(){We.current=!1})},className:"zui:text-gray-700 hover:zui:text-gray-900 zui:text-sm focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500 zui:rounded zui:px-2 zui:py-1",children:ie}):n("span",{}),i("div",{className:"zui:flex zui:gap-2",children:[n("button",{type:"button",onClick:Ve,className:"zui:text-gray-700 hover:zui:text-gray-900 zui:text-sm focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500 zui:rounded-sm zui:px-2 zui:py-1",children:ee}),K&&n("button",{type:"button",onClick:function(){Xe(null!=qe?qe:null),We.current=!0,Re(!1),Promise.resolve().then(function(){We.current=!1})},className:"zui:text-white zui:bg-blue-600 hover:zui:bg-blue-700 zui:text-sm focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500 zui:rounded-sm zui:px-3 zui:py-1",children:X})]})]})]})})]})});export{w as TimePicker,w as default};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../chunks/tslib.es6-a3dc1f53.js"),t=require("react/jsx-runtime"),i=require("react"),n=require("@mui/material/Popover"),r=require("../../chunks/_commonjsHelpers-3d4c1909.js"),u=require("../../chunks/index-90b71f01.js"),o=require("../../chunks/lucide-493ccaad.js");function s(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(i){if("default"!==i){var n=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,n.get?n:{enumerable:!0,get:function(){return e[i]}})}}),t.default=e,Object.freeze(t)}var a,c=s(i),l={exports:{}};a=l,r.commonjsGlobal,a.exports=function(){var e=1e3,t=6e4,i=36e5,n="millisecond",r="second",u="minute",o="hour",s="day",a="week",c="month",l="quarter",d="year",f="date",h="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,z=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],i=e%100;return"["+e+(t[(i-20)%10]||t[i]||t[0])+"]"}},p=function(e,t,i){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(i)+e},g={s:p,z:function(e){var t=-e.utcOffset(),i=Math.abs(t),n=Math.floor(i/60),r=i%60;return(t<=0?"+":"-")+p(n,2,"0")+":"+p(r,2,"0")},m:function e(t,i){if(t.date()<i.date())return-e(i,t);var n=12*(i.year()-t.year())+(i.month()-t.month()),r=t.clone().add(n,c),u=i-r<0,o=t.clone().add(n+(u?-1:1),c);return+(-(n+(i-r)/(u?r-o:o-r))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:c,y:d,w:a,d:s,D:f,h:o,m:u,s:r,ms:n,Q:l}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},b="en",x={};x[b]=v;var y="$isDayjsObject",w=function(e){return e instanceof S||!(!e||!e[y])},M=function e(t,i,n){var r;if(!t)return b;if("string"==typeof t){var u=t.toLowerCase();x[u]&&(r=u),i&&(x[u]=i,r=u);var o=t.split("-");if(!r&&o.length>1)return e(o[0])}else{var s=t.name;x[s]=t,r=s}return!n&&r&&(b=r),r||!n&&b},$=function(e,t){if(w(e))return e.clone();var i="object"==typeof t?t:{};return i.date=e,i.args=arguments,new S(i)},D=g;D.l=M,D.i=w,D.w=function(e,t){return $(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var S=function(){function v(e){this.$L=M(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[y]=!0}var p=v.prototype;return p.parse=function(e){this.$d=function(e){var t=e.date,i=e.utc;if(null===t)return new Date(NaN);if(D.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var n=t.match(m);if(n){var r=n[2]-1||0,u=(n[7]||"0").substring(0,3);return i?new Date(Date.UTC(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[6]||0,u)):new Date(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[6]||0,u)}}return new Date(t)}(e),this.init()},p.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},p.$utils=function(){return D},p.isValid=function(){return!(this.$d.toString()===h)},p.isSame=function(e,t){var i=$(e);return this.startOf(t)<=i&&i<=this.endOf(t)},p.isAfter=function(e,t){return $(e)<this.startOf(t)},p.isBefore=function(e,t){return this.endOf(t)<$(e)},p.$g=function(e,t,i){return D.u(e)?this[t]:this.set(i,e)},p.unix=function(){return Math.floor(this.valueOf()/1e3)},p.valueOf=function(){return this.$d.getTime()},p.startOf=function(e,t){var i=this,n=!!D.u(t)||t,l=D.p(e),h=function(e,t){var r=D.w(i.$u?Date.UTC(i.$y,t,e):new Date(i.$y,t,e),i);return n?r:r.endOf(s)},m=function(e,t){return D.w(i.toDate()[e].apply(i.toDate("s"),(n?[0,0,0,0]:[23,59,59,999]).slice(t)),i)},z=this.$W,v=this.$M,p=this.$D,g="set"+(this.$u?"UTC":"");switch(l){case d:return n?h(1,0):h(31,11);case c:return n?h(1,v):h(0,v+1);case a:var b=this.$locale().weekStart||0,x=(z<b?z+7:z)-b;return h(n?p-x:p+(6-x),v);case s:case f:return m(g+"Hours",0);case o:return m(g+"Minutes",1);case u:return m(g+"Seconds",2);case r:return m(g+"Milliseconds",3);default:return this.clone()}},p.endOf=function(e){return this.startOf(e,!1)},p.$set=function(e,t){var i,a=D.p(e),l="set"+(this.$u?"UTC":""),h=(i={},i[s]=l+"Date",i[f]=l+"Date",i[c]=l+"Month",i[d]=l+"FullYear",i[o]=l+"Hours",i[u]=l+"Minutes",i[r]=l+"Seconds",i[n]=l+"Milliseconds",i)[a],m=a===s?this.$D+(t-this.$W):t;if(a===c||a===d){var z=this.clone().set(f,1);z.$d[h](m),z.init(),this.$d=z.set(f,Math.min(this.$D,z.daysInMonth())).$d}else h&&this.$d[h](m);return this.init(),this},p.set=function(e,t){return this.clone().$set(e,t)},p.get=function(e){return this[D.p(e)]()},p.add=function(n,l){var f,h=this;n=Number(n);var m=D.p(l),z=function(e){var t=$(h);return D.w(t.date(t.date()+Math.round(e*n)),h)};if(m===c)return this.set(c,this.$M+n);if(m===d)return this.set(d,this.$y+n);if(m===s)return z(1);if(m===a)return z(7);var v=(f={},f[u]=t,f[o]=i,f[r]=e,f)[m]||1,p=this.$d.getTime()+n*v;return D.w(p,this)},p.subtract=function(e,t){return this.add(-1*e,t)},p.format=function(e){var t=this,i=this.$locale();if(!this.isValid())return i.invalidDate||h;var n=e||"YYYY-MM-DDTHH:mm:ssZ",r=D.z(this),u=this.$H,o=this.$m,s=this.$M,a=i.weekdays,c=i.months,l=i.meridiem,d=function(e,i,r,u){return e&&(e[i]||e(t,n))||r[i].slice(0,u)},f=function(e){return D.s(u%12||12,e,"0")},m=l||function(e,t,i){var n=e<12?"AM":"PM";return i?n.toLowerCase():n};return n.replace(z,function(e,n){return n||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return D.s(t.$y,4,"0");case"M":return s+1;case"MM":return D.s(s+1,2,"0");case"MMM":return d(i.monthsShort,s,c,3);case"MMMM":return d(c,s);case"D":return t.$D;case"DD":return D.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return d(i.weekdaysMin,t.$W,a,2);case"ddd":return d(i.weekdaysShort,t.$W,a,3);case"dddd":return a[t.$W];case"H":return String(u);case"HH":return D.s(u,2,"0");case"h":return f(1);case"hh":return f(2);case"a":return m(u,o,!0);case"A":return m(u,o,!1);case"m":return String(o);case"mm":return D.s(o,2,"0");case"s":return String(t.$s);case"ss":return D.s(t.$s,2,"0");case"SSS":return D.s(t.$ms,3,"0");case"Z":return r}return null}(e)||r.replace(":","")})},p.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},p.diff=function(n,f,h){var m,z=this,v=D.p(f),p=$(n),g=(p.utcOffset()-this.utcOffset())*t,b=this-p,x=function(){return D.m(z,p)};switch(v){case d:m=x()/12;break;case c:m=x();break;case l:m=x()/3;break;case a:m=(b-g)/6048e5;break;case s:m=(b-g)/864e5;break;case o:m=b/i;break;case u:m=b/t;break;case r:m=b/e;break;default:m=b}return h?m:D.a(m)},p.daysInMonth=function(){return this.endOf(c).$D},p.$locale=function(){return x[this.$L]},p.locale=function(e,t){if(!e)return this.$L;var i=this.clone(),n=M(e,t,!0);return n&&(i.$L=n),i},p.clone=function(){return D.w(this.$d,this)},p.toDate=function(){return new Date(this.valueOf())},p.toJSON=function(){return this.isValid()?this.toISOString():null},p.toISOString=function(){return this.$d.toISOString()},p.toString=function(){return this.$d.toUTCString()},v}(),j=S.prototype;return $.prototype=j,[["$ms",n],["$s",r],["$m",u],["$H",o],["$W",s],["$M",c],["$y",d],["$D",f]].forEach(function(e){j[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),$.extend=function(e,t){return e.$i||(e(t,S,$),e.$i=!0),$},$.locale=M,$.isDayjs=w,$.unix=function(e){return $(1e3*e)},$.en=x[b],$.Ls=x,$.p={},$}();var d=l.exports,f=r.getDefaultExportFromCjs(d),h={exports:{}};!function(e){r.commonjsGlobal,e.exports=function(){var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,n=/\d\d/,r=/\d\d?/,u=/\d*[^-_:/,()\s\d]+/,o={},s=function(e){return(e=+e)+(e>68?1900:2e3)},a=function(e){return function(t){this[e]=+t}},c=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if("Z"===e)return 0;var t=e.match(/([+-]|\d\d)/g),i=60*t[1]+(+t[2]||0);return 0===i?0:"+"===t[0]?-i:i}(e)}],l=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var i,n=o.meridiem;if(n){for(var r=1;r<=24;r+=1)if(e.indexOf(n(r,0,t))>-1){i=r>12;break}}else i=e===(t?"pm":"PM");return i},f={A:[u,function(e){this.afternoon=d(e,!1)}],a:[u,function(e){this.afternoon=d(e,!0)}],Q:[i,function(e){this.month=3*(e-1)+1}],S:[i,function(e){this.milliseconds=100*+e}],SS:[n,function(e){this.milliseconds=10*+e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[r,a("seconds")],ss:[r,a("seconds")],m:[r,a("minutes")],mm:[r,a("minutes")],H:[r,a("hours")],h:[r,a("hours")],HH:[r,a("hours")],hh:[r,a("hours")],D:[r,a("day")],DD:[n,a("day")],Do:[u,function(e){var t=o.ordinal,i=e.match(/\d+/);if(this.day=i[0],t)for(var n=1;n<=31;n+=1)t(n).replace(/\[|\]/g,"")===e&&(this.day=n)}],w:[r,a("week")],ww:[n,a("week")],M:[r,a("month")],MM:[n,a("month")],MMM:[u,function(e){var t=l("months"),i=(l("monthsShort")||t.map(function(e){return e.slice(0,3)})).indexOf(e)+1;if(i<1)throw new Error;this.month=i%12||i}],MMMM:[u,function(e){var t=l("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],Y:[/[+-]?\d+/,a("year")],YY:[n,function(e){this.year=s(e)}],YYYY:[/\d{4}/,a("year")],Z:c,ZZ:c};function h(i){var n,r;n=i,r=o&&o.formats;for(var u=(i=n.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(t,i,n){var u=n&&n.toUpperCase();return i||r[n]||e[n]||r[u].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(e,t,i){return t||i.slice(1)})})).match(t),s=u.length,a=0;a<s;a+=1){var c=u[a],l=f[c],d=l&&l[0],h=l&&l[1];u[a]=h?{regex:d,parser:h}:c.replace(/^\[|\]$/g,"")}return function(e){for(var t={},i=0,n=0;i<s;i+=1){var r=u[i];if("string"==typeof r)n+=r.length;else{var o=r.regex,a=r.parser,c=e.slice(n),l=o.exec(c)[0];a.call(t,l),e=e.replace(l,"")}}return function(e){var t=e.afternoon;if(void 0!==t){var i=e.hours;t?i<12&&(e.hours+=12):12===i&&(e.hours=0),delete e.afternoon}}(t),t}}return function(e,t,i){i.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(s=e.parseTwoDigitYear);var n=t.prototype,r=n.parse;n.parse=function(e){var t=e.date,n=e.utc,u=e.args;this.$u=n;var s=u[1];if("string"==typeof s){var a=!0===u[2],c=!0===u[3],l=a||c,d=u[2];c&&(d=u[2]),o=this.$locale(),!a&&d&&(o=i.Ls[d]),this.$d=function(e,t,i,n){try{if(["x","X"].indexOf(t)>-1)return new Date(("X"===t?1e3:1)*e);var r=h(t)(e),u=r.year,o=r.month,s=r.day,a=r.hours,c=r.minutes,l=r.seconds,d=r.milliseconds,f=r.zone,m=r.week,z=new Date,v=s||(u||o?1:z.getDate()),p=u||z.getFullYear(),g=0;u&&!o||(g=o>0?o-1:z.getMonth());var b,x=a||0,y=c||0,w=l||0,M=d||0;return f?new Date(Date.UTC(p,g,v,x,y,w,M+60*f.offset*1e3)):i?new Date(Date.UTC(p,g,v,x,y,w,M)):(b=new Date(p,g,v,x,y,w,M),m&&(b=n(b).week(m).toDate()),b)}catch(e){return new Date("")}}(t,s,n,i),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),l&&t!=this.format(s)&&(this.$d=new Date("")),o={}}else if(s instanceof Array)for(var f=s.length,m=1;m<=f;m+=1){u[1]=s[m-1];var z=i.apply(this,u);if(z.isValid()){this.$d=z.$d,this.$L=z.$L,this.init();break}m===f&&(this.$d=new Date(""))}else r.call(this,e)}}}()}(h);var m=h.exports,z=r.getDefaultExportFromCjs(m);f.extend(z);var v={xs:"zui:h-8 zui:text-xs",sm:"zui:h-9 zui:text-sm",md:"zui:h-10 zui:text-sm",lg:"zui:h-11 zui:text-base"},p={xs:"zui:py-1.5",sm:"zui:py-2",md:"zui:py-2",lg:"zui:py-2.5"},g={xs:"zui:px-2",sm:"zui:px-2.5",md:"zui:px-3",lg:"zui:px-3.5"},b={xs:"zui:min-w-[10rem]",sm:"zui:min-w-[12rem]",md:"zui:min-w-[12rem]",lg:"zui:min-w-[14rem]"},x=function(e){return"contained"===e?"zui:bg-muted":"zui:bg-background"};function y(e){return e<10?"0".concat(e):"".concat(e)}function w(e,t,i){void 0===i&&(i=0);for(var n=[],r=i;r<=t;r+=e)n.push(r);return n}var M=c.forwardRef(function(i,r){var s,a,l,d=i.label,h=i.floatingLabel,m=void 0!==h&&h,z=i.description,M=i.error,$=i.size,D=void 0===$?"md":$,S=i.variant,j=void 0===S?"outlined":S,k=i.focusOutline,Y=void 0===k||k,N=i.className,O=i.value,L=i.defaultValue,C=void 0===L?null:L,T=i.onChange,H=i.format,_=void 0===H?"HH:mm":H,A=i.use12Hours,P=i.hourStep,E=void 0===P?1:P,q=i.minuteStep,F=void 0===q?1:q,Z=i.secondStep,U=void 0===Z?1:Z,W=i.needConfirm,R=void 0===W||W,V=i.showNow,I=void 0===V||V,K=i.okText,B=void 0===K?"OK":K,J=i.closeText,Q=void 0===J?"Close":J,X=i.nowText,G=void 0===X?"Now":X,ee=i.amText,te=void 0===ee?"AM":ee,ie=i.pmText,ne=void 0===ie?"PM":ie,re=i.hourLabel,ue=void 0===re?"Hour":re,oe=i.minuteLabel,se=void 0===oe?"Minute":oe,ae=i.secondLabel,ce=void 0===ae?"Second":ae,le=i.disabledHours,de=i.disabledMinutes,fe=i.disabledSeconds,he=i.disabled,me=i.placeholder,ze=i.required,ve=i.allowClear,pe=void 0===ve||ve,ge=i.id,be=e.__rest(i,["label","floatingLabel","description","error","size","variant","focusOutline","className","value","defaultValue","onChange","format","use12Hours","hourStep","minuteStep","secondStep","needConfirm","showNow","okText","closeText","nowText","amText","pmText","hourLabel","minuteLabel","secondLabel","disabledHours","disabledMinutes","disabledSeconds","disabled","placeholder","required","allowClear","id"]),xe=ge||function(e){void 0===e&&(e="timepicker");var t=c.useRef();return t.current||(t.current="".concat(e,"-").concat(Math.random().toString(36).slice(2,9))),t.current}("timepicker"),ye=(a=_,"boolean"==typeof(l=A)?l:/(^|[^H])h/.test(a)||/(\sa\b|\sA\b|a\b|A\b)/.test(a)),we=function(e){return/\bss\b/.test(e)}(_),Me=function(e){return{container:e?"zui:opacity-80":"",label:e?"zui:text-gray-500":"zui:text-gray-700",input:e?" zui:cursor-not-allowed zui:opacity-90 zui:text-gray-900 zui:bg-gray-50 zui:border zui:border-gray-300":""}}(he||!1),$e=c.useRef(void 0!==O).current,De=c.useState(C),Se=De[0],je=De[1],ke=$e?null!=O?O:null:null!=Se?Se:null,Ye=ke?ke.format(_):"",Ne=c.useState(Ye),Oe=Ne[0],Le=Ne[1],Ce=c.useState(!1);Ce[0];var Te=Ce[1];c.useEffect(function(){Le(Ye)},[Ye]);var He=c.useState(null),_e=He[0],Ae=He[1],Pe=Boolean(_e),Ee=c.useRef(null),qe=c.useRef(!1);function Fe(e,t){var i;Ae(e&&null!==(i=null!=t?t:Ee.current)&&void 0!==i?i:null)}function Ze(){qe.current=!0,Fe(!1),R&&(Le(Ye),Re(ke)),Promise.resolve().then(function(){qe.current=!1})}c.useEffect(function(){function e(e){"Escape"===e.key&&(e.stopPropagation(),e.preventDefault(),Pe&&Ae(null))}return Pe&&document.addEventListener("keydown",e,!0),function(){return document.removeEventListener("keydown",e,!0)}},[Pe]);var Ue=c.useState(ke),We=Ue[0],Re=Ue[1];c.useEffect(function(){Pe&&(Re(ke),Le(Ye))},[Pe,ke,Ye]);var Ve=c.useMemo(function(){return ye?w(E,12,1):w(E,23,0)},[ye,E]),Ie=c.useMemo(function(){return w(F,59,0)},[F]),Ke=c.useMemo(function(){return w(U,59,0)},[U]);function Be(e){var t=e?e.format(_):"";null==T||T(e,t),$e||je(e)}function Je(e,t,i,n){var r;if(!(null==le?void 0:le(ye?e%12||12:e))&&!((null==de?void 0:de(t))||we&&(null==fe?void 0:fe(i)))){var u=ye?function(e,t){return t?"am"===t?12===e?0:e:12===e?12:e+12:e}(e,n):e,o=(null!==(r=null!=We?We:ke)&&void 0!==r?r:f()).hour(u).minute(t).second(we?i:0).millisecond(0);Re(o),Le(o.format(_)),R||Be(o)}}var Qe=We?We.format(_):"",Xe=Pe&&""!==Qe.trim()?Qe:Ye;var Ge=c.useRef(null),et=c.useRef(null),tt=c.useRef(null);function it(e,t){var i=e.current;if(i){var n=Array.from(i.querySelectorAll('button[role="option"]:not([aria-disabled="true"])'));if(0!==n.length){var r=n.findIndex(function(e){return e===document.activeElement});n[r<0?0:Math.max(0,Math.min(n.length-1,r+t))].focus()}}}function nt(e,t){"ArrowDown"===e.key?(e.preventDefault(),it(t,1)):"ArrowUp"===e.key&&(e.preventDefault(),it(t,-1))}var rt="lg"===D?18:16,ut=d||"Time picker",ot=Boolean(Xe)&&!he&&!!pe,st=null!==(s=null!=We?We:ke)&&void 0!==s?s:null,at=st?st.hour():ye?12:0,ct=st?st.minute():0,lt=st?st.second():0,dt=at>=12?"pm":"am",ft=at%12==0?12:at%12;return t.jsxs("div",{className:u.cn("zui:w-full",Me.container,b[D],N),children:[!m&&d&&t.jsxs("label",{htmlFor:xe,className:u.cn("zui:block zui:mb-2 zui:text-sm zui:font-medium zui:leading-none",Me.label),children:[d,ze&&t.jsx("span",{className:"zui:text-destructive zui:font-medium",children:" *"})]}),t.jsxs("div",{className:u.cn("zui:relative zui:w-full zui:rounded-md zui:border zui:bg-background zui:text-sm zui:transition-colors",Y&&"zui:focus-within:ring-1 zui:focus-within:ring-ring zui:focus-within:ring-offset-1","outlined"===j&&"zui:border-input","contained"===j&&"zui:bg-muted zui:border-transparent",Me.input,M&&"zui:border-destructive",M&&Y&&"zui:focus-within:ring-destructive"),children:[m&&d&&t.jsxs("label",{htmlFor:xe,className:u.cn("zui:absolute zui:left-3 zui:top-0 zui:-translate-y-1/2 zui:px-1 zui:text-xs zui:pointer-events-none zui:transition-colors zui:z-10",x(j),Me.label),children:[d,ze&&t.jsx("span",{className:"zui:text-destructive zui:font-medium",children:" *"})]}),t.jsx("input",e.__assign({id:xe,ref:function(e){"function"==typeof r?r(e):r&&(r.current=e),Ee.current=e},value:Xe,onChange:function(e){var t;Le(null!==(t=e.target.value)&&void 0!==t?t:"")},onBlur:function(){Te(!1);var e=(null!=Oe?Oe:"").trim();if(R){if(!e)return Re(null),void Le(Ye);(t=f(e,_,!0)).isValid()?Re(t.millisecond(0)):(Le(Ye),Re(ke))}else{if(!e)return void Be(null);var t;(t=f(e,_,!0)).isValid()?Be(t.millisecond(0)):Le(Ye)}},onFocus:function(e){Te(!0),he||qe.current||Fe(!0,Ee.current||e.currentTarget)},onClick:function(e){he||qe.current||Fe(!0,Ee.current||e.currentTarget)},placeholder:null!=me?me:ye?we?"h:mm:ss a":"h:mm a":we?"HH:mm:ss":"HH:mm","aria-label":ut,disabled:he,required:ze,className:u.cn("zui:peer zui:block zui:w-full zui:bg-transparent zui:outline-none zui:px-3 zui:disabled:cursor-not-allowed zui:disabled:opacity-50",v[D],p[D],ot?"zui:pr-20":"zui:pr-10")},be)),ot?t.jsx("button",{type:"button",onMouseDown:function(e){return e.preventDefault()},onClick:function(e){e.stopPropagation(),Re(null),Le(""),Be(null),qe.current=!0,Fe(!1),Promise.resolve().then(function(){qe.current=!1})},className:u.cn("zui:absolute zui:inset-y-0 zui:right-9 zui:flex zui:items-center zui:text-muted-foreground hover:zui:text-gray-700 focus:zui:outline-none",g[D]),"aria-label":"Clear time",children:t.jsx(o.X,{size:rt})}):null,t.jsx("button",{type:"button",onMouseDown:function(e){return e.preventDefault()},onClick:function(e){e.stopPropagation(),function(e){he||Fe(!Pe,e.currentTarget)}(e)},className:u.cn("zui:absolute zui:inset-y-0 zui:right-0 zui:flex zui:items-center zui:text-muted-foreground hover:zui:text-gray-700 disabled:zui:opacity-50",g[D]),disabled:he,"aria-label":"Toggle time panel",children:t.jsx(o.Clock,{size:rt})})]}),t.jsxs("div",{className:"zui:flex zui:flex-row zui:justify-between",children:[z&&!M&&!he&&t.jsx("p",{className:"zui:text-xs zui:text-muted-foreground",children:z}),M&&t.jsx("p",{className:"zui:text-xs zui:text-destructive",children:M})]}),t.jsx(n,{open:Pe,anchorEl:_e,onClose:function(e,t){"backdropClick"!==t&&"escapeKeyDown"!==t&&Ze()},anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{className:u.cn("zui:rounded-md zui:border zui:border-gray-200 zui:shadow-lg zui:bg-white zui:p-2","zui:w-[22rem] sm:zui:w-[24rem]")}},children:t.jsxs("div",{className:"zui:flex zui:flex-col zui:gap-2",children:[t.jsxs("div",{className:"zui:grid zui:grid-cols-3 zui:gap-2 zui:text-xs zui:text-gray-500 zui:sticky zui:top-0 zui:bg-white zui:z-10",children:[t.jsx("div",{className:"zui:text-center",children:ue}),t.jsx("div",{className:"zui:text-center",children:se}),t.jsx("div",{className:"zui:text-center",children:we?ce:ye?"AM/PM":""})]}),t.jsxs("div",{className:"zui:grid zui:grid-cols-3 zui:gap-2",children:[t.jsx("div",{ref:Ge,onKeyDown:function(e){return nt(e,Ge)},className:"zui:max-h-44 zui:overflow-auto zui:p-1 zui:grid zui:grid-cols-3 zui:gap-1",role:"listbox","aria-label":"Select hour",children:Ve.map(function(e){var i,n=ye?ft===e:at===e,r=null!==(i=null==le?void 0:le(ye?e%12||12:e))&&void 0!==i&&i;return t.jsx("button",{type:"button",role:"option","aria-selected":n,"aria-disabled":r,disabled:r,onClick:function(){r||Je(e,ct,lt,ye?dt:void 0)},className:u.cn("zui:px-2 zui:py-1 zui:rounded zui:text-sm zui:transition","hover:zui:bg-gray-100 focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500",n&&"zui:bg-blue-50 zui:text-blue-700 zui:font-medium",r&&"zui:opacity-40 zui:cursor-not-allowed"),children:y(e)},e)})}),t.jsx("div",{ref:et,onKeyDown:function(e){return nt(e,et)},className:"zui:max-h-44 zui:overflow-auto zui:p-1 zui:grid zui:grid-cols-3 zui:gap-1",role:"listbox","aria-label":"Select minute",children:Ie.map(function(e){var i,n=ct===e,r=null!==(i=null==de?void 0:de(e))&&void 0!==i&&i;return t.jsx("button",{type:"button",role:"option","aria-selected":n,"aria-disabled":r,disabled:r,onClick:function(){r||Je(ye?ft:at,e,lt,ye?dt:void 0)},className:u.cn("zui:px-2 zui:py-1 zui:rounded zui:text-sm zui:transition","hover:zui:bg-gray-100 focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500",n&&"zui:bg-blue-50 zui:text-blue-700 zui:font-medium",r&&"zui:opacity-40 zui:cursor-not-allowed"),children:y(e)},e)})}),we?t.jsx("div",{ref:tt,onKeyDown:function(e){return nt(e,tt)},className:"zui:max-h-44 zui:overflow-auto zui:p-1 zui:grid zui:grid-cols-3 zui:gap-1",role:"listbox","aria-label":"Select second",children:Ke.map(function(e){var i,n=lt===e,r=null!==(i=null==fe?void 0:fe(e))&&void 0!==i&&i;return t.jsx("button",{type:"button",role:"option","aria-selected":n,"aria-disabled":r,disabled:r,onClick:function(){r||Je(ye?ft:at,ct,e,ye?dt:void 0)},className:u.cn("zui:px-2 zui:py-1 zui:rounded zui:text-sm zui:transition","hover:zui:bg-gray-100 focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500",n&&"zui:bg-blue-50 zui:text-blue-700 zui:font-medium",r&&"zui:opacity-40 zui:cursor-not-allowed"),children:y(e)},e)})}):ye?t.jsx("div",{className:"zui:flex zui:flex-col zui:gap-1",role:"listbox","aria-label":"Select AM/PM",children:["am","pm"].map(function(e){var i=dt===e;return t.jsx("button",{type:"button",role:"option","aria-selected":i,onClick:function(){Je(ft||12,ct,lt,e)},className:u.cn("zui:flex-1 zui:px-2 zui:py-1 zui:rounded zui:text-sm zui:transition","hover:zui:bg-gray-100 focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500",i&&"zui:bg-blue-50 zui:text-blue-700 zui:font-medium"),"aria-pressed":i,children:"am"===e?te:ne},e)})}):null]}),t.jsxs("div",{className:"zui:flex zui:items-center zui:justify-between zui:pt-1",children:[I?t.jsx("button",{type:"button",onClick:function(){var e=f(),t=e.second(we?e.second():0).millisecond(0);Re(t),Le(t.format(_)),Be(t),qe.current=!0,Fe(!1),Promise.resolve().then(function(){qe.current=!1})},className:"zui:text-gray-700 hover:zui:text-gray-900 zui:text-sm focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500 zui:rounded zui:px-2 zui:py-1",children:G}):t.jsx("span",{}),t.jsxs("div",{className:"zui:flex zui:gap-2",children:[t.jsx("button",{type:"button",onClick:Ze,className:"zui:text-gray-700 hover:zui:text-gray-900 zui:text-sm focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500 zui:rounded zui:px-2 zui:py-1",children:Q}),R&&t.jsx("button",{type:"button",onClick:function(){Be(null!=We?We:null),qe.current=!0,Fe(!1),Promise.resolve().then(function(){qe.current=!1})},className:"zui:text-white zui:bg-blue-600 hover:zui:bg-blue-700 zui:text-sm focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500 zui:rounded zui:px-3 zui:py-1",children:B})]})]})]})})]})});exports.TimePicker=M,exports.default=M;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../chunks/tslib.es6-a3dc1f53.js"),t=require("react/jsx-runtime"),i=require("react"),n=require("@mui/material/Popover"),r=require("../../chunks/_commonjsHelpers-3d4c1909.js"),u=require("../../chunks/index-90b71f01.js"),o=require("../../chunks/lucide-493ccaad.js");function s(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(i){if("default"!==i){var n=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,n.get?n:{enumerable:!0,get:function(){return e[i]}})}}),t.default=e,Object.freeze(t)}var a,c=s(i),l={exports:{}};a=l,r.commonjsGlobal,a.exports=function(){var e=1e3,t=6e4,i=36e5,n="millisecond",r="second",u="minute",o="hour",s="day",a="week",c="month",l="quarter",d="year",f="date",h="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,z=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],i=e%100;return"["+e+(t[(i-20)%10]||t[i]||t[0])+"]"}},p=function(e,t,i){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(i)+e},g={s:p,z:function(e){var t=-e.utcOffset(),i=Math.abs(t),n=Math.floor(i/60),r=i%60;return(t<=0?"+":"-")+p(n,2,"0")+":"+p(r,2,"0")},m:function e(t,i){if(t.date()<i.date())return-e(i,t);var n=12*(i.year()-t.year())+(i.month()-t.month()),r=t.clone().add(n,c),u=i-r<0,o=t.clone().add(n+(u?-1:1),c);return+(-(n+(i-r)/(u?r-o:o-r))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:c,y:d,w:a,d:s,D:f,h:o,m:u,s:r,ms:n,Q:l}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},b="en",x={};x[b]=v;var y="$isDayjsObject",w=function(e){return e instanceof S||!(!e||!e[y])},M=function e(t,i,n){var r;if(!t)return b;if("string"==typeof t){var u=t.toLowerCase();x[u]&&(r=u),i&&(x[u]=i,r=u);var o=t.split("-");if(!r&&o.length>1)return e(o[0])}else{var s=t.name;x[s]=t,r=s}return!n&&r&&(b=r),r||!n&&b},$=function(e,t){if(w(e))return e.clone();var i="object"==typeof t?t:{};return i.date=e,i.args=arguments,new S(i)},D=g;D.l=M,D.i=w,D.w=function(e,t){return $(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var S=function(){function v(e){this.$L=M(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[y]=!0}var p=v.prototype;return p.parse=function(e){this.$d=function(e){var t=e.date,i=e.utc;if(null===t)return new Date(NaN);if(D.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var n=t.match(m);if(n){var r=n[2]-1||0,u=(n[7]||"0").substring(0,3);return i?new Date(Date.UTC(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[6]||0,u)):new Date(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[6]||0,u)}}return new Date(t)}(e),this.init()},p.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},p.$utils=function(){return D},p.isValid=function(){return!(this.$d.toString()===h)},p.isSame=function(e,t){var i=$(e);return this.startOf(t)<=i&&i<=this.endOf(t)},p.isAfter=function(e,t){return $(e)<this.startOf(t)},p.isBefore=function(e,t){return this.endOf(t)<$(e)},p.$g=function(e,t,i){return D.u(e)?this[t]:this.set(i,e)},p.unix=function(){return Math.floor(this.valueOf()/1e3)},p.valueOf=function(){return this.$d.getTime()},p.startOf=function(e,t){var i=this,n=!!D.u(t)||t,l=D.p(e),h=function(e,t){var r=D.w(i.$u?Date.UTC(i.$y,t,e):new Date(i.$y,t,e),i);return n?r:r.endOf(s)},m=function(e,t){return D.w(i.toDate()[e].apply(i.toDate("s"),(n?[0,0,0,0]:[23,59,59,999]).slice(t)),i)},z=this.$W,v=this.$M,p=this.$D,g="set"+(this.$u?"UTC":"");switch(l){case d:return n?h(1,0):h(31,11);case c:return n?h(1,v):h(0,v+1);case a:var b=this.$locale().weekStart||0,x=(z<b?z+7:z)-b;return h(n?p-x:p+(6-x),v);case s:case f:return m(g+"Hours",0);case o:return m(g+"Minutes",1);case u:return m(g+"Seconds",2);case r:return m(g+"Milliseconds",3);default:return this.clone()}},p.endOf=function(e){return this.startOf(e,!1)},p.$set=function(e,t){var i,a=D.p(e),l="set"+(this.$u?"UTC":""),h=(i={},i[s]=l+"Date",i[f]=l+"Date",i[c]=l+"Month",i[d]=l+"FullYear",i[o]=l+"Hours",i[u]=l+"Minutes",i[r]=l+"Seconds",i[n]=l+"Milliseconds",i)[a],m=a===s?this.$D+(t-this.$W):t;if(a===c||a===d){var z=this.clone().set(f,1);z.$d[h](m),z.init(),this.$d=z.set(f,Math.min(this.$D,z.daysInMonth())).$d}else h&&this.$d[h](m);return this.init(),this},p.set=function(e,t){return this.clone().$set(e,t)},p.get=function(e){return this[D.p(e)]()},p.add=function(n,l){var f,h=this;n=Number(n);var m=D.p(l),z=function(e){var t=$(h);return D.w(t.date(t.date()+Math.round(e*n)),h)};if(m===c)return this.set(c,this.$M+n);if(m===d)return this.set(d,this.$y+n);if(m===s)return z(1);if(m===a)return z(7);var v=(f={},f[u]=t,f[o]=i,f[r]=e,f)[m]||1,p=this.$d.getTime()+n*v;return D.w(p,this)},p.subtract=function(e,t){return this.add(-1*e,t)},p.format=function(e){var t=this,i=this.$locale();if(!this.isValid())return i.invalidDate||h;var n=e||"YYYY-MM-DDTHH:mm:ssZ",r=D.z(this),u=this.$H,o=this.$m,s=this.$M,a=i.weekdays,c=i.months,l=i.meridiem,d=function(e,i,r,u){return e&&(e[i]||e(t,n))||r[i].slice(0,u)},f=function(e){return D.s(u%12||12,e,"0")},m=l||function(e,t,i){var n=e<12?"AM":"PM";return i?n.toLowerCase():n};return n.replace(z,function(e,n){return n||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return D.s(t.$y,4,"0");case"M":return s+1;case"MM":return D.s(s+1,2,"0");case"MMM":return d(i.monthsShort,s,c,3);case"MMMM":return d(c,s);case"D":return t.$D;case"DD":return D.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return d(i.weekdaysMin,t.$W,a,2);case"ddd":return d(i.weekdaysShort,t.$W,a,3);case"dddd":return a[t.$W];case"H":return String(u);case"HH":return D.s(u,2,"0");case"h":return f(1);case"hh":return f(2);case"a":return m(u,o,!0);case"A":return m(u,o,!1);case"m":return String(o);case"mm":return D.s(o,2,"0");case"s":return String(t.$s);case"ss":return D.s(t.$s,2,"0");case"SSS":return D.s(t.$ms,3,"0");case"Z":return r}return null}(e)||r.replace(":","")})},p.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},p.diff=function(n,f,h){var m,z=this,v=D.p(f),p=$(n),g=(p.utcOffset()-this.utcOffset())*t,b=this-p,x=function(){return D.m(z,p)};switch(v){case d:m=x()/12;break;case c:m=x();break;case l:m=x()/3;break;case a:m=(b-g)/6048e5;break;case s:m=(b-g)/864e5;break;case o:m=b/i;break;case u:m=b/t;break;case r:m=b/e;break;default:m=b}return h?m:D.a(m)},p.daysInMonth=function(){return this.endOf(c).$D},p.$locale=function(){return x[this.$L]},p.locale=function(e,t){if(!e)return this.$L;var i=this.clone(),n=M(e,t,!0);return n&&(i.$L=n),i},p.clone=function(){return D.w(this.$d,this)},p.toDate=function(){return new Date(this.valueOf())},p.toJSON=function(){return this.isValid()?this.toISOString():null},p.toISOString=function(){return this.$d.toISOString()},p.toString=function(){return this.$d.toUTCString()},v}(),j=S.prototype;return $.prototype=j,[["$ms",n],["$s",r],["$m",u],["$H",o],["$W",s],["$M",c],["$y",d],["$D",f]].forEach(function(e){j[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),$.extend=function(e,t){return e.$i||(e(t,S,$),e.$i=!0),$},$.locale=M,$.isDayjs=w,$.unix=function(e){return $(1e3*e)},$.en=x[b],$.Ls=x,$.p={},$}();var d=l.exports,f=r.getDefaultExportFromCjs(d),h={exports:{}};!function(e){r.commonjsGlobal,e.exports=function(){var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,n=/\d\d/,r=/\d\d?/,u=/\d*[^-_:/,()\s\d]+/,o={},s=function(e){return(e=+e)+(e>68?1900:2e3)},a=function(e){return function(t){this[e]=+t}},c=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if("Z"===e)return 0;var t=e.match(/([+-]|\d\d)/g),i=60*t[1]+(+t[2]||0);return 0===i?0:"+"===t[0]?-i:i}(e)}],l=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var i,n=o.meridiem;if(n){for(var r=1;r<=24;r+=1)if(e.indexOf(n(r,0,t))>-1){i=r>12;break}}else i=e===(t?"pm":"PM");return i},f={A:[u,function(e){this.afternoon=d(e,!1)}],a:[u,function(e){this.afternoon=d(e,!0)}],Q:[i,function(e){this.month=3*(e-1)+1}],S:[i,function(e){this.milliseconds=100*+e}],SS:[n,function(e){this.milliseconds=10*+e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[r,a("seconds")],ss:[r,a("seconds")],m:[r,a("minutes")],mm:[r,a("minutes")],H:[r,a("hours")],h:[r,a("hours")],HH:[r,a("hours")],hh:[r,a("hours")],D:[r,a("day")],DD:[n,a("day")],Do:[u,function(e){var t=o.ordinal,i=e.match(/\d+/);if(this.day=i[0],t)for(var n=1;n<=31;n+=1)t(n).replace(/\[|\]/g,"")===e&&(this.day=n)}],w:[r,a("week")],ww:[n,a("week")],M:[r,a("month")],MM:[n,a("month")],MMM:[u,function(e){var t=l("months"),i=(l("monthsShort")||t.map(function(e){return e.slice(0,3)})).indexOf(e)+1;if(i<1)throw new Error;this.month=i%12||i}],MMMM:[u,function(e){var t=l("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],Y:[/[+-]?\d+/,a("year")],YY:[n,function(e){this.year=s(e)}],YYYY:[/\d{4}/,a("year")],Z:c,ZZ:c};function h(i){var n,r;n=i,r=o&&o.formats;for(var u=(i=n.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(t,i,n){var u=n&&n.toUpperCase();return i||r[n]||e[n]||r[u].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(e,t,i){return t||i.slice(1)})})).match(t),s=u.length,a=0;a<s;a+=1){var c=u[a],l=f[c],d=l&&l[0],h=l&&l[1];u[a]=h?{regex:d,parser:h}:c.replace(/^\[|\]$/g,"")}return function(e){for(var t={},i=0,n=0;i<s;i+=1){var r=u[i];if("string"==typeof r)n+=r.length;else{var o=r.regex,a=r.parser,c=e.slice(n),l=o.exec(c)[0];a.call(t,l),e=e.replace(l,"")}}return function(e){var t=e.afternoon;if(void 0!==t){var i=e.hours;t?i<12&&(e.hours+=12):12===i&&(e.hours=0),delete e.afternoon}}(t),t}}return function(e,t,i){i.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(s=e.parseTwoDigitYear);var n=t.prototype,r=n.parse;n.parse=function(e){var t=e.date,n=e.utc,u=e.args;this.$u=n;var s=u[1];if("string"==typeof s){var a=!0===u[2],c=!0===u[3],l=a||c,d=u[2];c&&(d=u[2]),o=this.$locale(),!a&&d&&(o=i.Ls[d]),this.$d=function(e,t,i,n){try{if(["x","X"].indexOf(t)>-1)return new Date(("X"===t?1e3:1)*e);var r=h(t)(e),u=r.year,o=r.month,s=r.day,a=r.hours,c=r.minutes,l=r.seconds,d=r.milliseconds,f=r.zone,m=r.week,z=new Date,v=s||(u||o?1:z.getDate()),p=u||z.getFullYear(),g=0;u&&!o||(g=o>0?o-1:z.getMonth());var b,x=a||0,y=c||0,w=l||0,M=d||0;return f?new Date(Date.UTC(p,g,v,x,y,w,M+60*f.offset*1e3)):i?new Date(Date.UTC(p,g,v,x,y,w,M)):(b=new Date(p,g,v,x,y,w,M),m&&(b=n(b).week(m).toDate()),b)}catch(e){return new Date("")}}(t,s,n,i),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),l&&t!=this.format(s)&&(this.$d=new Date("")),o={}}else if(s instanceof Array)for(var f=s.length,m=1;m<=f;m+=1){u[1]=s[m-1];var z=i.apply(this,u);if(z.isValid()){this.$d=z.$d,this.$L=z.$L,this.init();break}m===f&&(this.$d=new Date(""))}else r.call(this,e)}}}()}(h);var m=h.exports,z=r.getDefaultExportFromCjs(m);f.extend(z);var v={xs:"zui:h-8 zui:text-xs",sm:"zui:h-9 zui:text-sm",md:"zui:h-10 zui:text-sm",lg:"zui:h-11 zui:text-base"},p={xs:"zui:py-1.5",sm:"zui:py-2",md:"zui:py-2",lg:"zui:py-2.5"},g={xs:"zui:px-2",sm:"zui:px-2.5",md:"zui:px-3",lg:"zui:px-3.5"},b={xs:"zui:min-w-[10rem]",sm:"zui:min-w-[12rem]",md:"zui:min-w-[12rem]",lg:"zui:min-w-[14rem]"},x=function(e){return"contained"===e?"zui:bg-muted":"zui:bg-background"};function y(e){return e<10?"0".concat(e):"".concat(e)}function w(e,t,i){void 0===i&&(i=0);for(var n=[],r=i;r<=t;r+=e)n.push(r);return n}var M=c.forwardRef(function(i,r){var s,a,l,d=i.label,h=i.floatingLabel,m=void 0!==h&&h,z=i.description,M=i.error,$=i.size,D=void 0===$?"md":$,S=i.variant,j=void 0===S?"outlined":S,k=i.focusOutline,Y=void 0===k||k,N=i.className,O=i.value,L=i.defaultValue,C=void 0===L?null:L,T=i.onChange,H=i.format,_=void 0===H?"HH:mm":H,A=i.use12Hours,P=i.hourStep,E=void 0===P?1:P,q=i.minuteStep,F=void 0===q?1:q,Z=i.secondStep,U=void 0===Z?1:Z,W=i.needConfirm,R=void 0===W||W,V=i.showNow,I=void 0===V||V,K=i.okText,B=void 0===K?"OK":K,J=i.closeText,Q=void 0===J?"Close":J,X=i.nowText,G=void 0===X?"Now":X,ee=i.amText,te=void 0===ee?"AM":ee,ie=i.pmText,ne=void 0===ie?"PM":ie,re=i.hourLabel,ue=void 0===re?"Hour":re,oe=i.minuteLabel,se=void 0===oe?"Minute":oe,ae=i.secondLabel,ce=void 0===ae?"Second":ae,le=i.disabledHours,de=i.disabledMinutes,fe=i.disabledSeconds,he=i.disabled,me=i.placeholder,ze=i.required,ve=i.allowClear,pe=void 0===ve||ve,ge=i.id,be=e.__rest(i,["label","floatingLabel","description","error","size","variant","focusOutline","className","value","defaultValue","onChange","format","use12Hours","hourStep","minuteStep","secondStep","needConfirm","showNow","okText","closeText","nowText","amText","pmText","hourLabel","minuteLabel","secondLabel","disabledHours","disabledMinutes","disabledSeconds","disabled","placeholder","required","allowClear","id"]),xe=ge||function(e){void 0===e&&(e="timepicker");var t=c.useRef();return t.current||(t.current="".concat(e,"-").concat(Math.random().toString(36).slice(2,9))),t.current}("timepicker"),ye=(a=_,"boolean"==typeof(l=A)?l:/(^|[^H])h/.test(a)||/(\sa\b|\sA\b|a\b|A\b)/.test(a)),we=function(e){return/\bss\b/.test(e)}(_),Me=function(e){return{container:e?"zui:opacity-80":"",label:e?"zui:text-gray-500":"zui:text-gray-700",input:e?" zui:cursor-not-allowed zui:opacity-90 zui:text-gray-900 zui:bg-gray-50 zui:border zui:border-gray-300":""}}(he||!1),$e=c.useRef(void 0!==O).current,De=c.useState(C),Se=De[0],je=De[1],ke=$e?null!=O?O:null:null!=Se?Se:null,Ye=ke?ke.format(_):"",Ne=c.useState(Ye),Oe=Ne[0],Le=Ne[1],Ce=c.useState(!1);Ce[0];var Te=Ce[1];c.useEffect(function(){Le(Ye)},[Ye]);var He=c.useState(null),_e=He[0],Ae=He[1],Pe=Boolean(_e),Ee=c.useRef(null),qe=c.useRef(!1);function Fe(e,t){var i;Ae(e&&null!==(i=null!=t?t:Ee.current)&&void 0!==i?i:null)}function Ze(){qe.current=!0,Fe(!1),R&&(Le(Ye),Re(ke)),Promise.resolve().then(function(){qe.current=!1})}c.useEffect(function(){function e(e){"Escape"===e.key&&(e.stopPropagation(),e.preventDefault(),Pe&&Ae(null))}return Pe&&document.addEventListener("keydown",e,!0),function(){return document.removeEventListener("keydown",e,!0)}},[Pe]);var Ue=c.useState(ke),We=Ue[0],Re=Ue[1];c.useEffect(function(){Pe&&(Re(ke),Le(Ye))},[Pe,ke,Ye]);var Ve=c.useMemo(function(){return ye?w(E,12,1):w(E,23,0)},[ye,E]),Ie=c.useMemo(function(){return w(F,59,0)},[F]),Ke=c.useMemo(function(){return w(U,59,0)},[U]);function Be(e){var t=e?e.format(_):"";null==T||T(e,t),$e||je(e)}function Je(e,t,i,n){var r;if(!(null==le?void 0:le(ye?e%12||12:e))&&!((null==de?void 0:de(t))||we&&(null==fe?void 0:fe(i)))){var u=ye?function(e,t){return t?"am"===t?12===e?0:e:12===e?12:e+12:e}(e,n):e,o=(null!==(r=null!=We?We:ke)&&void 0!==r?r:f()).hour(u).minute(t).second(we?i:0).millisecond(0);Re(o),Le(o.format(_)),R||Be(o)}}var Qe=We?We.format(_):"",Xe=Pe&&""!==Qe.trim()?Qe:Ye;var Ge=c.useRef(null),et=c.useRef(null),tt=c.useRef(null);function it(e,t){var i=e.current;if(i){var n=Array.from(i.querySelectorAll('button[role="option"]:not([aria-disabled="true"])'));if(0!==n.length){var r=n.findIndex(function(e){return e===document.activeElement});n[r<0?0:Math.max(0,Math.min(n.length-1,r+t))].focus()}}}function nt(e,t){"ArrowDown"===e.key?(e.preventDefault(),it(t,1)):"ArrowUp"===e.key&&(e.preventDefault(),it(t,-1))}var rt="lg"===D?18:16,ut=d||"Time picker",ot=Boolean(Xe)&&!he&&!!pe,st=null!==(s=null!=We?We:ke)&&void 0!==s?s:null,at=st?st.hour():ye?12:0,ct=st?st.minute():0,lt=st?st.second():0,dt=at>=12?"pm":"am",ft=at%12==0?12:at%12;return t.jsxs("div",{className:u.cn("zui:w-full",Me.container,b[D],N),children:[!m&&d&&t.jsxs("label",{htmlFor:xe,className:u.cn("zui:block zui:mb-2 zui:text-sm zui:font-medium zui:leading-none",Me.label),children:[d,ze&&t.jsx("span",{className:"zui:text-destructive zui:font-medium",children:" *"})]}),t.jsxs("div",{className:u.cn("zui:relative zui:w-full zui:rounded-sm zui:border zui:bg-background zui:text-sm zui:transition-colors",Y&&"zui:focus-within:ring-1 zui:focus-within:ring-ring zui:focus-within:ring-offset-1","outlined"===j&&"zui:border-input","contained"===j&&"zui:bg-muted zui:border-transparent",Me.input,M&&"zui:border-destructive",M&&Y&&"zui:focus-within:ring-destructive"),children:[m&&d&&t.jsxs("label",{htmlFor:xe,className:u.cn("zui:absolute zui:left-3 zui:top-0 zui:-translate-y-1/2 zui:px-1 zui:text-xs zui:pointer-events-none zui:transition-colors zui:z-10",x(j),Me.label),children:[d,ze&&t.jsx("span",{className:"zui:text-destructive zui:font-medium",children:" *"})]}),t.jsx("input",e.__assign({id:xe,ref:function(e){"function"==typeof r?r(e):r&&(r.current=e),Ee.current=e},value:Xe,onChange:function(e){var t;Le(null!==(t=e.target.value)&&void 0!==t?t:"")},onBlur:function(){Te(!1);var e=(null!=Oe?Oe:"").trim();if(R){if(!e)return Re(null),void Le(Ye);(t=f(e,_,!0)).isValid()?Re(t.millisecond(0)):(Le(Ye),Re(ke))}else{if(!e)return void Be(null);var t;(t=f(e,_,!0)).isValid()?Be(t.millisecond(0)):Le(Ye)}},onFocus:function(e){Te(!0),he||qe.current||Fe(!0,Ee.current||e.currentTarget)},onClick:function(e){he||qe.current||Fe(!0,Ee.current||e.currentTarget)},placeholder:null!=me?me:ye?we?"h:mm:ss a":"h:mm a":we?"HH:mm:ss":"HH:mm","aria-label":ut,disabled:he,required:ze,className:u.cn("zui:peer zui:block zui:w-full zui:bg-transparent zui:outline-none zui:px-3 zui:disabled:cursor-not-allowed zui:disabled:opacity-50",v[D],p[D],ot?"zui:pr-20":"zui:pr-10")},be)),ot?t.jsx("button",{type:"button",onMouseDown:function(e){return e.preventDefault()},onClick:function(e){e.stopPropagation(),Re(null),Le(""),Be(null),qe.current=!0,Fe(!1),Promise.resolve().then(function(){qe.current=!1})},className:u.cn("zui:absolute zui:inset-y-0 zui:right-9 zui:flex zui:items-center zui:text-muted-foreground hover:zui:text-gray-700 focus:zui:outline-none",g[D]),"aria-label":"Clear time",children:t.jsx(o.X,{size:rt})}):null,t.jsx("button",{type:"button",onMouseDown:function(e){return e.preventDefault()},onClick:function(e){e.stopPropagation(),function(e){he||Fe(!Pe,e.currentTarget)}(e)},className:u.cn("zui:absolute zui:inset-y-0 zui:right-0 zui:flex zui:items-center zui:text-muted-foreground hover:zui:text-gray-700 disabled:zui:opacity-50",g[D]),disabled:he,"aria-label":"Toggle time panel",children:t.jsx(o.Clock,{size:rt})})]}),t.jsxs("div",{className:"zui:flex zui:flex-row zui:justify-between",children:[z&&!M&&!he&&t.jsx("p",{className:"zui:text-xs zui:text-muted-foreground",children:z}),M&&t.jsx("p",{className:"zui:text-xs zui:text-destructive",children:M})]}),t.jsx(n,{open:Pe,anchorEl:_e,onClose:function(e,t){"backdropClick"!==t&&"escapeKeyDown"!==t&&Ze()},anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{className:u.cn("zui:rounded-sm zui:border zui:border-gray-200 zui:shadow-lg zui:bg-white zui:p-2","zui:w-[22rem] sm:zui:w-[24rem]")}},children:t.jsxs("div",{className:"zui:flex zui:flex-col zui:gap-2",children:[t.jsxs("div",{className:"zui:grid zui:grid-cols-3 zui:gap-2 zui:text-xs zui:text-gray-500 zui:sticky zui:top-0 zui:bg-white zui:z-10",children:[t.jsx("div",{className:"zui:text-center",children:ue}),t.jsx("div",{className:"zui:text-center",children:se}),t.jsx("div",{className:"zui:text-center",children:we?ce:ye?"AM/PM":""})]}),t.jsxs("div",{className:"zui:grid zui:grid-cols-3 zui:gap-2",children:[t.jsx("div",{ref:Ge,onKeyDown:function(e){return nt(e,Ge)},className:"zui:max-h-44 zui:overflow-auto zui:p-1 zui:grid zui:grid-cols-3 zui:gap-1",role:"listbox","aria-label":"Select hour",children:Ve.map(function(e){var i,n=ye?ft===e:at===e,r=null!==(i=null==le?void 0:le(ye?e%12||12:e))&&void 0!==i&&i;return t.jsx("button",{type:"button",role:"option","aria-selected":n,"aria-disabled":r,disabled:r,onClick:function(){r||Je(e,ct,lt,ye?dt:void 0)},className:u.cn("zui:px-2 zui:py-1 zui:rounded zui:text-sm zui:transition","hover:zui:bg-gray-100 focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500",n&&"zui:bg-blue-50 zui:text-blue-700 zui:font-medium",r&&"zui:opacity-40 zui:cursor-not-allowed"),children:y(e)},e)})}),t.jsx("div",{ref:et,onKeyDown:function(e){return nt(e,et)},className:"zui:max-h-44 zui:overflow-auto zui:p-1 zui:grid zui:grid-cols-3 zui:gap-1",role:"listbox","aria-label":"Select minute",children:Ie.map(function(e){var i,n=ct===e,r=null!==(i=null==de?void 0:de(e))&&void 0!==i&&i;return t.jsx("button",{type:"button",role:"option","aria-selected":n,"aria-disabled":r,disabled:r,onClick:function(){r||Je(ye?ft:at,e,lt,ye?dt:void 0)},className:u.cn("zui:px-2 zui:py-1 zui:rounded zui:text-sm zui:transition","hover:zui:bg-gray-100 focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500",n&&"zui:bg-blue-50 zui:text-blue-700 zui:font-medium",r&&"zui:opacity-40 zui:cursor-not-allowed"),children:y(e)},e)})}),we?t.jsx("div",{ref:tt,onKeyDown:function(e){return nt(e,tt)},className:"zui:max-h-44 zui:overflow-auto zui:p-1 zui:grid zui:grid-cols-3 zui:gap-1",role:"listbox","aria-label":"Select second",children:Ke.map(function(e){var i,n=lt===e,r=null!==(i=null==fe?void 0:fe(e))&&void 0!==i&&i;return t.jsx("button",{type:"button",role:"option","aria-selected":n,"aria-disabled":r,disabled:r,onClick:function(){r||Je(ye?ft:at,ct,e,ye?dt:void 0)},className:u.cn("zui:px-2 zui:py-1 zui:rounded zui:text-sm zui:transition","hover:zui:bg-gray-100 focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500",n&&"zui:bg-blue-50 zui:text-blue-700 zui:font-medium",r&&"zui:opacity-40 zui:cursor-not-allowed"),children:y(e)},e)})}):ye?t.jsx("div",{className:"zui:flex zui:flex-col zui:gap-1",role:"listbox","aria-label":"Select AM/PM",children:["am","pm"].map(function(e){var i=dt===e;return t.jsx("button",{type:"button",role:"option","aria-selected":i,onClick:function(){Je(ft||12,ct,lt,e)},className:u.cn("zui:flex-1 zui:px-2 zui:py-1 zui:rounded zui:text-sm zui:transition","hover:zui:bg-gray-100 focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500",i&&"zui:bg-blue-50 zui:text-blue-700 zui:font-medium"),"aria-pressed":i,children:"am"===e?te:ne},e)})}):null]}),t.jsxs("div",{className:"zui:flex zui:items-center zui:justify-between zui:pt-1",children:[I?t.jsx("button",{type:"button",onClick:function(){var e=f(),t=e.second(we?e.second():0).millisecond(0);Re(t),Le(t.format(_)),Be(t),qe.current=!0,Fe(!1),Promise.resolve().then(function(){qe.current=!1})},className:"zui:text-gray-700 hover:zui:text-gray-900 zui:text-sm focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500 zui:rounded zui:px-2 zui:py-1",children:G}):t.jsx("span",{}),t.jsxs("div",{className:"zui:flex zui:gap-2",children:[t.jsx("button",{type:"button",onClick:Ze,className:"zui:text-gray-700 hover:zui:text-gray-900 zui:text-sm focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500 zui:rounded-sm zui:px-2 zui:py-1",children:Q}),R&&t.jsx("button",{type:"button",onClick:function(){Be(null!=We?We:null),qe.current=!0,Fe(!1),Promise.resolve().then(function(){qe.current=!1})},className:"zui:text-white zui:bg-blue-600 hover:zui:bg-blue-700 zui:text-sm focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500 zui:rounded-sm zui:px-3 zui:py-1",children:B})]})]})]})})]})});exports.TimePicker=M,exports.default=M;
package/dist/index.d.ts CHANGED
@@ -239,9 +239,9 @@ interface BadgeProps extends VariantProps<typeof badgeVariants> {
239
239
  className?: string;
240
240
  }
241
241
  declare const badgeVariants: (props?: ({
242
- variant?: "text" | "contained" | "outlined" | null | undefined;
242
+ variant?: "text" | "outlined" | "contained" | null | undefined;
243
243
  size?: "sm" | "md" | "lg" | null | undefined;
244
- type?: "default" | "error" | "info" | "success" | "warning" | null | undefined;
244
+ type?: "default" | "success" | "error" | "info" | "warning" | null | undefined;
245
245
  } & class_variance_authority_dist_types.ClassProp) | undefined) => string;
246
246
  declare const Badge: ({ label, icon, iconPosition, dot, dotPosition, variant, size, type, color, className, }: BadgeProps) => react_jsx_runtime.JSX.Element;
247
247