beesoft-components 0.9.2 → 0.9.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.
package/dist/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(X,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],d):(X=typeof globalThis<"u"?globalThis:X||self,d(X.BeeSoftComponents={},X.React,X.ReactDOM))})(this,function(X,d,Fe){"use strict";var lp=Object.defineProperty;var fp=(X,d,Fe)=>d in X?lp(X,d,{enumerable:!0,configurable:!0,writable:!0,value:Fe}):X[d]=Fe;var m=(X,d,Fe)=>(fp(X,typeof d!="symbol"?d+"":d,Fe),Fe);function Aa(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const Rt=Aa(d);function Ar(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Lr={exports:{}},At={};/**
1
+ (function(K,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],d):(K=typeof globalThis<"u"?globalThis:K||self,d(K.BeeSoftComponents={},K.React,K.ReactDOM))})(this,function(K,d,Fe){"use strict";var lp=Object.defineProperty;var fp=(K,d,Fe)=>d in K?lp(K,d,{enumerable:!0,configurable:!0,writable:!0,value:Fe}):K[d]=Fe;var m=(K,d,Fe)=>(fp(K,typeof d!="symbol"?d+"":d,Fe),Fe);function La(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const jt=La(d);function Fr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Yr={exports:{}},Mt={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var Dn;function La(){if(Dn)return At;Dn=1;var e=d,r=Symbol.for("react.element"),t=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function o(i,c,f){var h,p={},y=null,x=null;f!==void 0&&(y=""+f),c.key!==void 0&&(y=""+c.key),c.ref!==void 0&&(x=c.ref);for(h in c)n.call(c,h)&&!a.hasOwnProperty(h)&&(p[h]=c[h]);if(i&&i.defaultProps)for(h in c=i.defaultProps,c)p[h]===void 0&&(p[h]=c[h]);return{$$typeof:r,type:i,key:y,ref:x,props:p,_owner:s.current}}return At.Fragment=t,At.jsx=o,At.jsxs=o,At}var Lt={};/**
9
+ */var _n;function $a(){if(_n)return Mt;_n=1;var e=d,r=Symbol.for("react.element"),t=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function o(i,c,f){var h,p={},y=null,x=null;f!==void 0&&(y=""+f),c.key!==void 0&&(y=""+c.key),c.ref!==void 0&&(x=c.ref);for(h in c)n.call(c,h)&&!a.hasOwnProperty(h)&&(p[h]=c[h]);if(i&&i.defaultProps)for(h in c=i.defaultProps,c)p[h]===void 0&&(p[h]=c[h]);return{$$typeof:r,type:i,key:y,ref:x,props:p,_owner:s.current}}return Mt.Fragment=t,Mt.jsx=o,Mt.jsxs=o,Mt}var Rt={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,37 +14,37 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var On;function $a(){return On||(On=1,process.env.NODE_ENV!=="production"&&function(){var e=d,r=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),i=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),x=Symbol.for("react.offscreen"),w=Symbol.iterator,D="@@iterator";function O(u){if(u===null||typeof u!="object")return null;var T=w&&u[w]||u[D];return typeof T=="function"?T:null}var S=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function R(u){{for(var T=arguments.length,M=new Array(T>1?T-1:0),K=1;K<T;K++)M[K-1]=arguments[K];U("error",u,M)}}function U(u,T,M){{var K=S.ReactDebugCurrentFrame,de=K.getStackAddendum();de!==""&&(T+="%s",M=M.concat([de]));var be=M.map(function(oe){return String(oe)});be.unshift("Warning: "+T),Function.prototype.apply.call(console[u],console,be)}}var F=!1,b=!1,A=!1,k=!1,V=!1,B;B=Symbol.for("react.module.reference");function ne(u){return!!(typeof u=="string"||typeof u=="function"||u===n||u===a||V||u===s||u===f||u===h||k||u===x||F||b||A||typeof u=="object"&&u!==null&&(u.$$typeof===y||u.$$typeof===p||u.$$typeof===o||u.$$typeof===i||u.$$typeof===c||u.$$typeof===B||u.getModuleId!==void 0))}function te(u,T,M){var K=u.displayName;if(K)return K;var de=T.displayName||T.name||"";return de!==""?M+"("+de+")":M}function J(u){return u.displayName||"Context"}function N(u){if(u==null)return null;if(typeof u.tag=="number"&&R("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case n:return"Fragment";case t:return"Portal";case a:return"Profiler";case s:return"StrictMode";case f:return"Suspense";case h:return"SuspenseList"}if(typeof u=="object")switch(u.$$typeof){case i:var T=u;return J(T)+".Consumer";case o:var M=u;return J(M._context)+".Provider";case c:return te(u,u.render,"ForwardRef");case p:var K=u.displayName||null;return K!==null?K:N(u.type)||"Memo";case y:{var de=u,be=de._payload,oe=de._init;try{return N(oe(be))}catch{return null}}}return null}var $=Object.assign,I=0,C,G,v,ee,g,_,z;function E(){}E.__reactDisabledLog=!0;function Y(){{if(I===0){C=console.log,G=console.info,v=console.warn,ee=console.error,g=console.group,_=console.groupCollapsed,z=console.groupEnd;var u={configurable:!0,enumerable:!0,value:E,writable:!0};Object.defineProperties(console,{info:u,log:u,warn:u,error:u,group:u,groupCollapsed:u,groupEnd:u})}I++}}function q(){{if(I--,I===0){var u={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:$({},u,{value:C}),info:$({},u,{value:G}),warn:$({},u,{value:v}),error:$({},u,{value:ee}),group:$({},u,{value:g}),groupCollapsed:$({},u,{value:_}),groupEnd:$({},u,{value:z})})}I<0&&R("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var L=S.ReactCurrentDispatcher,H;function P(u,T,M){{if(H===void 0)try{throw Error()}catch(de){var K=de.stack.trim().match(/\n( *(at )?)/);H=K&&K[1]||""}return`
18
- `+H+u}}var W=!1,Z;{var Te=typeof WeakMap=="function"?WeakMap:Map;Z=new Te}function j(u,T){if(!u||W)return"";{var M=Z.get(u);if(M!==void 0)return M}var K;W=!0;var de=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var be;be=L.current,L.current=null,Y();try{if(T){var oe=function(){throw Error()};if(Object.defineProperty(oe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(oe,[])}catch(et){K=et}Reflect.construct(u,[],oe)}else{try{oe.call()}catch(et){K=et}u.call(oe.prototype)}}else{try{throw Error()}catch(et){K=et}u()}}catch(et){if(et&&K&&typeof et.stack=="string"){for(var se=et.stack.split(`
19
- `),Me=K.stack.split(`
20
- `),Ce=se.length-1,De=Me.length-1;Ce>=1&&De>=0&&se[Ce]!==Me[De];)De--;for(;Ce>=1&&De>=0;Ce--,De--)if(se[Ce]!==Me[De]){if(Ce!==1||De!==1)do if(Ce--,De--,De<0||se[Ce]!==Me[De]){var $e=`
21
- `+se[Ce].replace(" at new "," at ");return u.displayName&&$e.includes("<anonymous>")&&($e=$e.replace("<anonymous>",u.displayName)),typeof u=="function"&&Z.set(u,$e),$e}while(Ce>=1&&De>=0);break}}}finally{W=!1,L.current=be,q(),Error.prepareStackTrace=de}var Mt=u?u.displayName||u.name:"",Ra=Mt?P(Mt):"";return typeof u=="function"&&Z.set(u,Ra),Ra}function je(u,T,M){return j(u,!1)}function nt(u){var T=u.prototype;return!!(T&&T.isReactComponent)}function Xe(u,T,M){if(u==null)return"";if(typeof u=="function")return j(u,nt(u));if(typeof u=="string")return P(u);switch(u){case f:return P("Suspense");case h:return P("SuspenseList")}if(typeof u=="object")switch(u.$$typeof){case c:return je(u.render);case p:return Xe(u.type,T,M);case y:{var K=u,de=K._payload,be=K._init;try{return Xe(be(de),T,M)}catch{}}}return""}var ht=Object.prototype.hasOwnProperty,Dr={},Jt=S.ReactDebugCurrentFrame;function pt(u){if(u){var T=u._owner,M=Xe(u.type,u._source,T?T.type:null);Jt.setExtraStackFrame(M)}else Jt.setExtraStackFrame(null)}function er(u,T,M,K,de){{var be=Function.call.bind(ht);for(var oe in u)if(be(u,oe)){var se=void 0;try{if(typeof u[oe]!="function"){var Me=Error((K||"React class")+": "+M+" type `"+oe+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof u[oe]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Me.name="Invariant Violation",Me}se=u[oe](T,oe,K,M,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Ce){se=Ce}se&&!(se instanceof Error)&&(pt(de),R("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",K||"React class",M,oe,typeof se),pt(null)),se instanceof Error&&!(se.message in Dr)&&(Dr[se.message]=!0,pt(de),R("Failed %s type: %s",M,se.message),pt(null))}}}var Or=Array.isArray;function Dt(u){return Or(u)}function En(u){{var T=typeof Symbol=="function"&&Symbol.toStringTag,M=T&&u[Symbol.toStringTag]||u.constructor.name||"Object";return M}}function Ot(u){try{return mt(u),!1}catch{return!0}}function mt(u){return""+u}function _r(u){if(Ot(u))return R("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",En(u)),mt(u)}var We=S.ReactCurrentOwner,kn={key:!0,ref:!0,__self:!0,__source:!0},Cn,Nr,_t;_t={};function Ir(u){if(ht.call(u,"ref")){var T=Object.getOwnPropertyDescriptor(u,"ref").get;if(T&&T.isReactWarning)return!1}return u.ref!==void 0}function Ia(u){if(ht.call(u,"key")){var T=Object.getOwnPropertyDescriptor(u,"key").get;if(T&&T.isReactWarning)return!1}return u.key!==void 0}function jr(u,T){if(typeof u.ref=="string"&&We.current&&T&&We.current.stateNode!==T){var M=N(We.current.type);_t[M]||(R('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',N(We.current.type),u.ref),_t[M]=!0)}}function tr(u,T){{var M=function(){Cn||(Cn=!0,R("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",T))};M.isReactWarning=!0,Object.defineProperty(u,"key",{get:M,configurable:!0})}}function Q(u,T){{var M=function(){Nr||(Nr=!0,R("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",T))};M.isReactWarning=!0,Object.defineProperty(u,"ref",{get:M,configurable:!0})}}var ce=function(u,T,M,K,de,be,oe){var se={$$typeof:r,type:u,key:T,ref:M,props:oe,_owner:be};return se._store={},Object.defineProperty(se._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(se,"_self",{configurable:!1,enumerable:!1,writable:!1,value:K}),Object.defineProperty(se,"_source",{configurable:!1,enumerable:!1,writable:!1,value:de}),Object.freeze&&(Object.freeze(se.props),Object.freeze(se)),se};function Ae(u,T,M,K,de){{var be,oe={},se=null,Me=null;M!==void 0&&(_r(M),se=""+M),Ia(T)&&(_r(T.key),se=""+T.key),Ir(T)&&(Me=T.ref,jr(T,de));for(be in T)ht.call(T,be)&&!kn.hasOwnProperty(be)&&(oe[be]=T[be]);if(u&&u.defaultProps){var Ce=u.defaultProps;for(be in Ce)oe[be]===void 0&&(oe[be]=Ce[be])}if(se||Me){var De=typeof u=="function"?u.displayName||u.name||"Unknown":u;se&&tr(oe,De),Me&&Q(oe,De)}return ce(u,se,Me,de,K,We.current,oe)}}var Nt=S.ReactCurrentOwner,rr=S.ReactDebugCurrentFrame;function Je(u){if(u){var T=u._owner,M=Xe(u.type,u._source,T?T.type:null);rr.setExtraStackFrame(M)}else rr.setExtraStackFrame(null)}var It;It=!1;function jt(u){return typeof u=="object"&&u!==null&&u.$$typeof===r}function nr(){{if(Nt.current){var u=N(Nt.current.type);if(u)return`
17
+ */var Nn;function Fa(){return Nn||(Nn=1,process.env.NODE_ENV!=="production"&&function(){var e=d,r=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),i=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),x=Symbol.for("react.offscreen"),w=Symbol.iterator,O="@@iterator";function _(u){if(u===null||typeof u!="object")return null;var T=w&&u[w]||u[O];return typeof T=="function"?T:null}var S=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function R(u){{for(var T=arguments.length,M=new Array(T>1?T-1:0),Q=1;Q<T;Q++)M[Q-1]=arguments[Q];z("error",u,M)}}function z(u,T,M){{var Q=S.ReactDebugCurrentFrame,he=Q.getStackAddendum();he!==""&&(T+="%s",M=M.concat([he]));var ge=M.map(function(ce){return String(ce)});ge.unshift("Warning: "+T),Function.prototype.apply.call(console[u],console,ge)}}var F=!1,b=!1,A=!1,k=!1,W=!1,V;V=Symbol.for("react.module.reference");function ne(u){return!!(typeof u=="string"||typeof u=="function"||u===n||u===a||W||u===s||u===f||u===h||k||u===x||F||b||A||typeof u=="object"&&u!==null&&(u.$$typeof===y||u.$$typeof===p||u.$$typeof===o||u.$$typeof===i||u.$$typeof===c||u.$$typeof===V||u.getModuleId!==void 0))}function te(u,T,M){var Q=u.displayName;if(Q)return Q;var he=T.displayName||T.name||"";return he!==""?M+"("+he+")":M}function X(u){return u.displayName||"Context"}function N(u){if(u==null)return null;if(typeof u.tag=="number"&&R("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case n:return"Fragment";case t:return"Portal";case a:return"Profiler";case s:return"StrictMode";case f:return"Suspense";case h:return"SuspenseList"}if(typeof u=="object")switch(u.$$typeof){case i:var T=u;return X(T)+".Consumer";case o:var M=u;return X(M._context)+".Provider";case c:return te(u,u.render,"ForwardRef");case p:var Q=u.displayName||null;return Q!==null?Q:N(u.type)||"Memo";case y:{var he=u,ge=he._payload,ce=he._init;try{return N(ce(ge))}catch{return null}}}return null}var $=Object.assign,j=0,C,q,v,ee,g,D,B;function P(){}P.__reactDisabledLog=!0;function Y(){{if(j===0){C=console.log,q=console.info,v=console.warn,ee=console.error,g=console.group,D=console.groupCollapsed,B=console.groupEnd;var u={configurable:!0,enumerable:!0,value:P,writable:!0};Object.defineProperties(console,{info:u,log:u,warn:u,error:u,group:u,groupCollapsed:u,groupEnd:u})}j++}}function G(){{if(j--,j===0){var u={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:$({},u,{value:C}),info:$({},u,{value:q}),warn:$({},u,{value:v}),error:$({},u,{value:ee}),group:$({},u,{value:g}),groupCollapsed:$({},u,{value:D}),groupEnd:$({},u,{value:B})})}j<0&&R("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var L=S.ReactCurrentDispatcher,H;function U(u,T,M){{if(H===void 0)try{throw Error()}catch(he){var Q=he.stack.trim().match(/\n( *(at )?)/);H=Q&&Q[1]||""}return`
18
+ `+H+u}}var J=!1,E;{var se=typeof WeakMap=="function"?WeakMap:Map;E=new se}function I(u,T){if(!u||J)return"";{var M=E.get(u);if(M!==void 0)return M}var Q;J=!0;var he=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var ge;ge=L.current,L.current=null,Y();try{if(T){var ce=function(){throw Error()};if(Object.defineProperty(ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ce,[])}catch(et){Q=et}Reflect.construct(u,[],ce)}else{try{ce.call()}catch(et){Q=et}u.call(ce.prototype)}}else{try{throw Error()}catch(et){Q=et}u()}}catch(et){if(et&&Q&&typeof et.stack=="string"){for(var ae=et.stack.split(`
19
+ `),Me=Q.stack.split(`
20
+ `),Ce=ae.length-1,De=Me.length-1;Ce>=1&&De>=0&&ae[Ce]!==Me[De];)De--;for(;Ce>=1&&De>=0;Ce--,De--)if(ae[Ce]!==Me[De]){if(Ce!==1||De!==1)do if(Ce--,De--,De<0||ae[Ce]!==Me[De]){var $e=`
21
+ `+ae[Ce].replace(" at new "," at ");return u.displayName&&$e.includes("<anonymous>")&&($e=$e.replace("<anonymous>",u.displayName)),typeof u=="function"&&E.set(u,$e),$e}while(Ce>=1&&De>=0);break}}}finally{J=!1,L.current=ge,G(),Error.prepareStackTrace=he}var It=u?u.displayName||u.name:"",Aa=It?U(It):"";return typeof u=="function"&&E.set(u,Aa),Aa}function Ne(u,T,M){return I(u,!1)}function nt(u){var T=u.prototype;return!!(T&&T.isReactComponent)}function qe(u,T,M){if(u==null)return"";if(typeof u=="function")return I(u,nt(u));if(typeof u=="string")return U(u);switch(u){case f:return U("Suspense");case h:return U("SuspenseList")}if(typeof u=="object")switch(u.$$typeof){case c:return Ne(u.render);case p:return qe(u.type,T,M);case y:{var Q=u,he=Q._payload,ge=Q._init;try{return qe(ge(he),T,M)}catch{}}}return""}var Dt=Object.prototype.hasOwnProperty,Er={},Kt=S.ReactDebugCurrentFrame;function Ot(u){if(u){var T=u._owner,M=qe(u.type,u._source,T?T.type:null);Kt.setExtraStackFrame(M)}else Kt.setExtraStackFrame(null)}function kr(u,T,M,Q,he){{var ge=Function.call.bind(Dt);for(var ce in u)if(ge(u,ce)){var ae=void 0;try{if(typeof u[ce]!="function"){var Me=Error((Q||"React class")+": "+M+" type `"+ce+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof u[ce]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Me.name="Invariant Violation",Me}ae=u[ce](T,ce,Q,M,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Ce){ae=Ce}ae&&!(ae instanceof Error)&&(Ot(he),R("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",Q||"React class",M,ce,typeof ae),Ot(null)),ae instanceof Error&&!(ae.message in Er)&&(Er[ae.message]=!0,Ot(he),R("Failed %s type: %s",M,ae.message),Ot(null))}}}var Cr=Array.isArray;function pt(u){return Cr(u)}function Dr(u){{var T=typeof Symbol=="function"&&Symbol.toStringTag,M=T&&u[Symbol.toStringTag]||u.constructor.name||"Object";return M}}function Or(u){try{return _r(u),!1}catch{return!0}}function _r(u){return""+u}function mt(u){if(Or(u))return R("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Dr(u)),_r(u)}var Ge=S.ReactCurrentOwner,Dn={key:!0,ref:!0,__self:!0,__source:!0},st,Nr,Ir;Ir={};function On(u){if(Dt.call(u,"ref")){var T=Object.getOwnPropertyDescriptor(u,"ref").get;if(T&&T.isReactWarning)return!1}return u.ref!==void 0}function jr(u){if(Dt.call(u,"key")){var T=Object.getOwnPropertyDescriptor(u,"key").get;if(T&&T.isReactWarning)return!1}return u.key!==void 0}function Mr(u,T){if(typeof u.ref=="string"&&Ge.current&&T&&Ge.current.stateNode!==T){var M=N(Ge.current.type);Ir[M]||(R('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',N(Ge.current.type),u.ref),Ir[M]=!0)}}function Ma(u,T){{var M=function(){st||(st=!0,R("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",T))};M.isReactWarning=!0,Object.defineProperty(u,"key",{get:M,configurable:!0})}}function Rr(u,T){{var M=function(){Nr||(Nr=!0,R("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",T))};M.isReactWarning=!0,Object.defineProperty(u,"ref",{get:M,configurable:!0})}}var Xt=function(u,T,M,Q,he,ge,ce){var ae={$$typeof:r,type:u,key:T,ref:M,props:ce,_owner:ge};return ae._store={},Object.defineProperty(ae._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(ae,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Q}),Object.defineProperty(ae,"_source",{configurable:!1,enumerable:!1,writable:!1,value:he}),Object.freeze&&(Object.freeze(ae.props),Object.freeze(ae)),ae};function Z(u,T,M,Q,he){{var ge,ce={},ae=null,Me=null;M!==void 0&&(mt(M),ae=""+M),jr(T)&&(mt(T.key),ae=""+T.key),On(T)&&(Me=T.ref,Mr(T,he));for(ge in T)Dt.call(T,ge)&&!Dn.hasOwnProperty(ge)&&(ce[ge]=T[ge]);if(u&&u.defaultProps){var Ce=u.defaultProps;for(ge in Ce)ce[ge]===void 0&&(ce[ge]=Ce[ge])}if(ae||Me){var De=typeof u=="function"?u.displayName||u.name||"Unknown":u;ae&&Ma(ce,De),Me&&Rr(ce,De)}return Xt(u,ae,Me,he,Q,Ge.current,ce)}}var oe=S.ReactCurrentOwner,Re=S.ReactDebugCurrentFrame;function Je(u){if(u){var T=u._owner,M=qe(u.type,u._source,T?T.type:null);Re.setExtraStackFrame(M)}else Re.setExtraStackFrame(null)}var _t;_t=!1;function Nt(u){return typeof u=="object"&&u!==null&&u.$$typeof===r}function Jt(){{if(oe.current){var u=N(oe.current.type);if(u)return`
22
22
 
23
- Check the render method of \``+u+"`."}return""}}function Mr(u){{if(u!==void 0){var T=u.fileName.replace(/^.*[\\\/]/,""),M=u.lineNumber;return`
23
+ Check the render method of \``+u+"`."}return""}}function Ar(u){{if(u!==void 0){var T=u.fileName.replace(/^.*[\\\/]/,""),M=u.lineNumber;return`
24
24
 
25
- Check your code at `+T+":"+M+"."}return""}}var sr={};function Rr(u){{var T=nr();if(!T){var M=typeof u=="string"?u:u.displayName||u.name;M&&(T=`
25
+ Check your code at `+T+":"+M+"."}return""}}var er={};function Lr(u){{var T=Jt();if(!T){var M=typeof u=="string"?u:u.displayName||u.name;M&&(T=`
26
26
 
27
- Check the top-level render call using <`+M+">.")}return T}}function ar(u,T){{if(!u._store||u._store.validated||u.key!=null)return;u._store.validated=!0;var M=Rr(T);if(sr[M])return;sr[M]=!0;var K="";u&&u._owner&&u._owner!==Nt.current&&(K=" It was passed a child from "+N(u._owner.type)+"."),Je(u),R('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',M,K),Je(null)}}function ja(u,T){{if(typeof u!="object")return;if(Dt(u))for(var M=0;M<u.length;M++){var K=u[M];jt(K)&&ar(K,T)}else if(jt(u))u._store&&(u._store.validated=!0);else if(u){var de=O(u);if(typeof de=="function"&&de!==u.entries)for(var be=de.call(u),oe;!(oe=be.next()).done;)jt(oe.value)&&ar(oe.value,T)}}}function sp(u){{var T=u.type;if(T==null||typeof T=="string")return;var M;if(typeof T=="function")M=T.propTypes;else if(typeof T=="object"&&(T.$$typeof===c||T.$$typeof===p))M=T.propTypes;else return;if(M){var K=N(T);er(M,u.props,"prop",K,u)}else if(T.PropTypes!==void 0&&!It){It=!0;var de=N(T);R("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",de||"Unknown")}typeof T.getDefaultProps=="function"&&!T.getDefaultProps.isReactClassApproved&&R("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ap(u){{for(var T=Object.keys(u.props),M=0;M<T.length;M++){var K=T[M];if(K!=="children"&&K!=="key"){Je(u),R("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",K),Je(null);break}}u.ref!==null&&(Je(u),R("Invalid attribute `ref` supplied to `React.Fragment`."),Je(null))}}function Ma(u,T,M,K,de,be){{var oe=ne(u);if(!oe){var se="";(u===void 0||typeof u=="object"&&u!==null&&Object.keys(u).length===0)&&(se+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Me=Mr(de);Me?se+=Me:se+=nr();var Ce;u===null?Ce="null":Dt(u)?Ce="array":u!==void 0&&u.$$typeof===r?(Ce="<"+(N(u.type)||"Unknown")+" />",se=" Did you accidentally export a JSX literal instead of a component?"):Ce=typeof u,R("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Ce,se)}var De=Ae(u,T,M,de,be);if(De==null)return De;if(oe){var $e=T.children;if($e!==void 0)if(K)if(Dt($e)){for(var Mt=0;Mt<$e.length;Mt++)ja($e[Mt],u);Object.freeze&&Object.freeze($e)}else R("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else ja($e,u)}return u===n?ap(De):sp(De),De}}function op(u,T,M){return Ma(u,T,M,!0)}function ip(u,T,M){return Ma(u,T,M,!1)}var cp=ip,up=op;Lt.Fragment=n,Lt.jsx=cp,Lt.jsxs=up}()),Lt}process.env.NODE_ENV==="production"?Lr.exports=La():Lr.exports=$a();var l=Lr.exports;const _n=d.createContext(void 0),Nn=()=>d.useContext(_n),Fa=({overlayKeepOnScreen:e=!0,useAnimations:r=!0,mobileMediaQuery:t,tabletMediaQuery:n,desktopMediaQuery:s,isValidScrollableElement:a,children:o})=>{const i={overlayKeepOnScreen:e,useAnimations:r,mobileMediaQuery:t,tabletMediaQuery:n,desktopMediaQuery:s,isValidScrollableElement:a};return l.jsx(_n.Provider,{value:i,children:o})};var Ne=(e=>(e[e.Vertical=0]="Vertical",e[e.Horizontal=1]="Horizontal",e))(Ne||{}),Re=(e=>(e[e.Right=0]="Right",e[e.Left=1]="Left",e))(Re||{}),In={exports:{}};/*!
27
+ Check the top-level render call using <`+M+">.")}return T}}function tr(u,T){{if(!u._store||u._store.validated||u.key!=null)return;u._store.validated=!0;var M=Lr(T);if(er[M])return;er[M]=!0;var Q="";u&&u._owner&&u._owner!==oe.current&&(Q=" It was passed a child from "+N(u._owner.type)+"."),Je(u),R('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',M,Q),Je(null)}}function rr(u,T){{if(typeof u!="object")return;if(pt(u))for(var M=0;M<u.length;M++){var Q=u[M];Nt(Q)&&tr(Q,T)}else if(Nt(u))u._store&&(u._store.validated=!0);else if(u){var he=_(u);if(typeof he=="function"&&he!==u.entries)for(var ge=he.call(u),ce;!(ce=ge.next()).done;)Nt(ce.value)&&tr(ce.value,T)}}}function $r(u){{var T=u.type;if(T==null||typeof T=="string")return;var M;if(typeof T=="function")M=T.propTypes;else if(typeof T=="object"&&(T.$$typeof===c||T.$$typeof===p))M=T.propTypes;else return;if(M){var Q=N(T);kr(M,u.props,"prop",Q,u)}else if(T.PropTypes!==void 0&&!_t){_t=!0;var he=N(T);R("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",he||"Unknown")}typeof T.getDefaultProps=="function"&&!T.getDefaultProps.isReactClassApproved&&R("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ap(u){{for(var T=Object.keys(u.props),M=0;M<T.length;M++){var Q=T[M];if(Q!=="children"&&Q!=="key"){Je(u),R("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Q),Je(null);break}}u.ref!==null&&(Je(u),R("Invalid attribute `ref` supplied to `React.Fragment`."),Je(null))}}function Ra(u,T,M,Q,he,ge){{var ce=ne(u);if(!ce){var ae="";(u===void 0||typeof u=="object"&&u!==null&&Object.keys(u).length===0)&&(ae+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Me=Ar(he);Me?ae+=Me:ae+=Jt();var Ce;u===null?Ce="null":pt(u)?Ce="array":u!==void 0&&u.$$typeof===r?(Ce="<"+(N(u.type)||"Unknown")+" />",ae=" Did you accidentally export a JSX literal instead of a component?"):Ce=typeof u,R("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Ce,ae)}var De=Z(u,T,M,he,ge);if(De==null)return De;if(ce){var $e=T.children;if($e!==void 0)if(Q)if(pt($e)){for(var It=0;It<$e.length;It++)rr($e[It],u);Object.freeze&&Object.freeze($e)}else R("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else rr($e,u)}return u===n?ap(De):$r(De),De}}function op(u,T,M){return Ra(u,T,M,!0)}function ip(u,T,M){return Ra(u,T,M,!1)}var cp=ip,up=op;Rt.Fragment=n,Rt.jsx=cp,Rt.jsxs=up}()),Rt}process.env.NODE_ENV==="production"?Yr.exports=$a():Yr.exports=Fa();var l=Yr.exports;const In=d.createContext(void 0),jn=()=>d.useContext(In),Ya=({overlayKeepOnScreen:e=!0,useAnimations:r=!0,mobileMediaQuery:t,tabletMediaQuery:n,desktopMediaQuery:s,isValidScrollableElement:a,children:o})=>{const i={overlayKeepOnScreen:e,useAnimations:r,mobileMediaQuery:t,tabletMediaQuery:n,desktopMediaQuery:s,isValidScrollableElement:a};return l.jsx(In.Provider,{value:i,children:o})};var Ie=(e=>(e[e.Vertical=0]="Vertical",e[e.Horizontal=1]="Horizontal",e))(Ie||{}),Ae=(e=>(e[e.Right=0]="Right",e[e.Left=1]="Left",e))(Ae||{}),Mn={exports:{}};/*!
28
28
  Copyright (c) 2018 Jed Watson.
29
29
  Licensed under the MIT License (MIT), see
30
30
  http://jedwatson.github.io/classnames
31
- */(function(e){(function(){var r={}.hasOwnProperty;function t(){for(var a="",o=0;o<arguments.length;o++){var i=arguments[o];i&&(a=s(a,n(i)))}return a}function n(a){if(typeof a=="string"||typeof a=="number")return a;if(typeof a!="object")return"";if(Array.isArray(a))return t.apply(null,a);if(a.toString!==Object.prototype.toString&&!a.toString.toString().includes("[native code]"))return a.toString();var o="";for(var i in a)r.call(a,i)&&a[i]&&(o=s(o,i));return o}function s(a,o){return o?a?a+" "+o:a+o:a}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(In);var Ya=In.exports;const ie=Ar(Ya);var $t=(e=>(e[e.Focus=0]="Focus",e[e.FocusWithin=1]="FocusWithin",e))($t||{});const or=(e=1)=>d.useMemo(()=>ie("dark:bsc-ring-mono-light-2 dark:bsc-ring-offset-mono-dark-1",{"focus-within:bsc-ring focus-within:bsc-ring-offset-2 focus-within:bsc-ring-opacity-50":e===1,"focus:bsc-ring focus:bsc-ring-offset-2 focus:bsc-ring-opacity-50":e===0}),[e]),Ha=(e,r)=>{const t=d.useRef(null),{buttonType:n,buttonStyle:s="flat",type:a="button",disabled:o=!1,form:i,fullWidth:c=!1,onClick:f,className:h,children:p}=e,y=()=>{f==null||f()},x=()=>{var O;(O=t.current)==null||O.click()};d.useImperativeHandle(r,()=>({click:x}));const w=or($t.Focus),D=ie("bc-button max-sm:bsc-p-4 md:bsc-p-2 dark:bsc-bg-mono-light-1 dark:hover:bsc-bg-mono-light-2 dark:bsc-text-mono-dark-1",w,{"bsc-w-full":c,"bc-disabled bsc-bg-gray-3 bsc-text-gray-2 bsc-pointer-events-none":o,"bsc-bg-primary-1 bsc-text-white hover:bsc-bg-primary-2 focus:bsc-ring-primary-1":n==="primary","bsc-bg-primary-2 bsc-text-white hover:bsc-bg-primary-3 focus:bsc-ring-primary-2":n==="secondary","bsc-bg-info bsc-text-white focus:bsc-ring-info":n==="info","bsc-bg-success bsc-text-white focus:bsc-ring-success":n==="success","bsc-bg-warning bsc-text-white focus:bsc-ring-warning":n==="warning","bsc-bg-error bsc-text-white focus:bsc-ring-error":n==="error","bsc-rounded-md":s==="curved","bsc-rounded-full !bsc-px-4":s==="round"},h);return l.jsx("button",{ref:t,type:a,onClick:y,disabled:o,form:i,className:D,children:p})},Ve=d.forwardRef(Ha),$r=e=>{const[r,t]=d.useState(!0),n=Nn();return d.useEffect(()=>{e!==void 0?t(e):n&&n.useAnimations!==void 0&&t(n.useAnimations)},[n,e]),r},jn=d.createContext(void 0),Mn=()=>d.useContext(jn),Wa=({children:e})=>{const r=d.useId(),t=d.useMemo(()=>({sharedId:r}),[r]);return l.jsx(jn.Provider,{value:t,children:e})},ir=e=>e==null?!1:typeof e=="object",Rn=e=>e instanceof Date,An=e=>typeof e=="function",Ln=e=>{const r=typeof e;return r==="string"||r==="number"||r==="boolean"||r==="bigint"},Fr=e=>{if(!ir(e))return e;const r={},t=Object.keys(e);for(let n=0,s=t.length;n<s;n++){const a=t[n],o=e[a];Ln(o)||An(o)?r[a]=o:Rn(o)?r[a]=new Date(o.getTime()):Array.isArray(o)?r[a]=Yr(o):ir(o)&&(r[a]=Fr(o))}return r},Yr=e=>{let r=e.length;const t=new Array(r);for(;r--!==0;){const n=e[r];Ln(n)||An(n)?t[r]=n:Rn(n)?t[r]=new Date(n.getTime()):ir(n)&&!Array.isArray(n)?t[r]=Fr(n):Array.isArray(n)?t[r]=Yr(n):t[r]=n}return t},Va=e=>ir(e)?Array.isArray(e)?Yr(e):Fr(e):e;function Ba(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var za=function e(r,t){if(r===t)return!0;if(r&&t&&typeof r=="object"&&typeof t=="object"){if(r.constructor!==t.constructor)return!1;var n,s,a;if(Array.isArray(r)){if(n=r.length,n!=t.length)return!1;for(s=n;s--!==0;)if(!e(r[s],t[s]))return!1;return!0}if(r.constructor===RegExp)return r.source===t.source&&r.flags===t.flags;if(r.valueOf!==Object.prototype.valueOf)return r.valueOf()===t.valueOf();if(r.toString!==Object.prototype.toString)return r.toString()===t.toString();if(a=Object.keys(r),n=a.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,a[s]))return!1;for(s=n;s--!==0;){var o=a[s];if(!e(r[o],t[o]))return!1}return!0}return r!==r&&t!==t};const $n=Ba(za);function Ua(e,r){for(let t=e.length;t--!==0;)if(!$n(e[t],r[t]))return!0;return!1}const cr=(e,r)=>{const t=d.useRef([]),n=t.current.length>0&&t.current[0]&&Ua(t.current[0],r);return(t.current.length===0||n)&&(t.current=[Va(r),e()]),t.current[1]},Fn=e=>{const r=d.useRef();let t=!1;r.current!==void 0&&(t=!$n(r.current,e));const n={changed:t,previousValue:r.current};return r.current=e,n},qa=e=>typeof e=="function",Ga=e=>{const[r,t]=d.useState({value:e,initial:!0}),n=d.useRef(e);return[r,s=>{if(!qa(s))t({value:s,initial:!1});else{const a=s(n.current);n.current=a,t({value:a,initial:!1})}}]},Za=e=>{const[r,t]=Ga(e),n=d.useRef({value:e,initial:!0});return n.current!==r&&(n.current=r),[r,t,n]},Qa=e=>{const[r,t]=d.useState(e),n=d.useRef(e);return n.current!==r&&(n.current=r),[r,t,n]};function Yn(){return window.navigator.languages?window.navigator.languages[0]:window.navigator.language}function Ka(e,r,t){const n=[];for(let s=e;s<=r;s++)n.push(t?t(s):s);return n}function Xa(e,r){const t=e.target;return t?!r.isSameNode(t)&&!r.contains(t):!1}function Ja(e,r){return e.isSameNode(r)||e.contains(r)}function eo(e,r){const t=Object.entries(r),n=getComputedStyle(e);for(let s=0,a=t.length;s<a;s++){const[o,i]=t[s];if(typeof i=="string"&&i.indexOf(",")>-1){if(!i.split(",").map(f=>f.trim()).includes(n[o]))return!1}else if(n[o]!==i)return!1}return!0}function to(e,r){const t=Object.entries(r),n=getComputedStyle(e);for(let s=0,a=t.length;s<a;s++){const[o,i]=t[s];if(typeof i=="string"&&i.indexOf(",")>-1){if(i.split(",").map(f=>f.trim()).includes(n[o]))return!0}else if(n[o]===i)return!0}return!1}function Hn(e,r,t=!1,n){if(t&&eo(e,r)){if(!n||(n==null?void 0:n(e))===!0)return e}else if(!t&&to(e,r)&&(!n||(n==null?void 0:n(e))===!0))return e;return e.parentElement?Hn(e.parentElement,r,t,n):e}function Wn(e,r){const t=Array.from(document.querySelectorAll("body *")),n=[];for(let s=0,a=t.length;s<a;s++){const o=getComputedStyle(t[s]);o[e]&&r(o[e])&&n.push(o[e])}return n}function dp(e){return e}function ro(e){const r=document.documentElement;Object.keys(e).forEach(t=>{r.style.setProperty(t,e[t])})}function no(e){return{"--theme-bsc-primary-1":e.primary1,"--theme-bsc-primary-2":e.primary2,"--theme-bsc-primary-3":e.primary3,"--theme-bsc-primary-4":e.primary4,"--theme-bsc-primary-5":e.primary5,"--theme-bsc-gray-1":e.gray1||"#303030","--theme-bsc-gray-2":e.gray2||"#5f5f5f","--theme-bsc-gray-3":e.gray3||"#8f8f8f","--theme-bsc-gray-4":e.gray4||"#bebebe","--theme-bsc-gray-5":e.gray5||"#eee","--theme-bsc-black":e.black||"#000","--theme-bsc-white":e.white||"#fff","--theme-bsc-mono-dark-1":e.monoDark1||"#222","--theme-bsc-mono-dark-2":e.monoDark2||"#3c3c3c","--theme-bsc-mono-dark-3":e.monoDark3||"#4e4e4e","--theme-bsc-mono-light-1":e.monoLight1||"#fefefe","--theme-bsc-mono-light-2":e.monoLight2||"#eee","--theme-bsc-mono-light-3":e.monoLight3||"#ccc","--theme-bsc-info":e.info||"#2e7ff8","--theme-bsc-success":e.success||"#53ae0c","--theme-bsc-warning":e.warning||"#ff6914","--theme-bsc-error":e.error||"#f01616"}}const so=d.createContext(void 0),ao=()=>d.useContext(so),oo=({id:e,name:r,value:t,type:n,checked:s,readOnly:a,className:o})=>l.jsx("input",{id:e,name:r,value:t,type:n,checked:s,readOnly:a,disabled:a,className:o}),io=({type:e,props:r,renderProps:t,signalName:n,onSignalRetrieved:s,children:a,className:o})=>{const i=ao(),{id:c,name:f}=cr(()=>{const h=r;return{id:h.id,name:h.name}},[r]);return d.useEffect(()=>{i&&n&&i[n]&&s&&s(i[n])},[i]),l.jsxs(l.Fragment,{children:[c&&f&&e&&l.jsx(oo,{id:c,name:f,type:e,className:o,...r}),a&&a(t)]})},co=(e,r)=>{const{name:t,value:n,checked:s=!1,partial:a=!1,onChange:o,children:i,labelStyles:c,className:f}=e,h=Mn(),p=d.useId(),[y,x,w]=Za({checked:!1,partial:!1}),D=Fn(s),O=Fn(a),S={id:(h==null?void 0:h.sharedId)||e.id||p,...e,...y.value};d.useEffect(()=>{if(y.initial)x({checked:a?!0:s,partial:a});else{const b=D.changed?s:y.value.checked,A=O.changed?a:y.value.partial;x({checked:A?!0:b,partial:A})}},[s,a]);const R=b=>{var k;const A=((k=w.current)==null?void 0:k.value.partial)===!0?!0:b.target.checked;x({checked:A,partial:!1}),o==null||o({originalEvent:b,name:t||b.target.name,value:n,checked:A})},U=b=>{var k;const A={checked:b?!0:((k=w.current)==null?void 0:k.value.checked)||!1,partial:b};x(A)},F=b=>{x({checked:b,partial:!1})};return d.useImperativeHandle(r,()=>({setPartiallyChecked:U,setChecked:F})),l.jsx("label",{className:c,onChange:b=>R(b),children:l.jsx(io,{id:p,name:t,type:"checkbox",props:S,renderProps:y.value,className:f,children:i})})},uo=d.memo(d.forwardRef(co)),lo=({label:e,htmlFor:r,className:t})=>{const n=Mn(),s=d.useMemo(()=>(n==null?void 0:n.sharedId)||r,[n==null?void 0:n.sharedId,r]);return l.jsx("label",{htmlFor:s,className:t,children:e})},Ge=({label:e,htmlFor:r,readOnly:t=!1,className:n})=>{const s=ie("bc-label",{"bsc-text-black dark:bsc-text-mono-light-1":!t,"bc-read-only bsc-text-gray-4 dark:bsc-text-mono-light-3 bsc-pointer-events-none":t},n);return l.jsx(lo,{label:e,htmlFor:r,className:s})},fo=(e,r)=>{const{name:t,label:n,value:s,readOnly:a=!1,checked:o=!1,partial:i=!1,labelLocation:c=Re.Right,className:f,useAnimation:h,onChange:p}=e,y=$r(h),x=ie("bc-checkbox-wrapper bsc-flex bsc-items-center",{"bc-read-only bsc-pointer-events-none bsc-text-gray-2 dark:bsc-text-mono-light-3":a},f),w=ie("bc-checkbox-label bsc-cursor-pointer",{"bsc-ml-2":c===Re.Right,"bsc-mr-2":c===Re.Left}),D=or($t.FocusWithin),O=ie("bc-checkbox-outer bsc-relative bsc-rounded *:bsc-block *:bsc-size-[21px]",{"bsc-checkbox-animate":!a&&y,"bc-read-only bsc-checkbox-no-animate":a||!a&&!y},D),S=ie("bc-checkbox-inner bsc-relative bsc-m-0 bsc-cursor-pointer bsc-appearance-none bsc-rounded bsc-border-none bsc-bg-mono-light-1 bsc-p-0 bsc-outline-none dark:bsc-bg-mono-dark-1 dark:checked:bsc-bg-mono-light-1",{"[transition:box-shadow_0.3s]":y,"bsc-checkbox":!a,"bc-read-only bsc-checkbox-read-only":a}),R=ie("bc-checkbox-svg bsc-pointer-events-none bsc-absolute bsc-left-0 bsc-top-0 bsc-stroke-mono-light-1 bsc-stroke-2 [stroke-linecap:round] [stroke-linejoin:round] [transform:scale(0)_translateZ(0)] dark:bsc-stroke-mono-dark-3",{"bsc-fill-primary-1 dark:bsc-fill-mono-light-1":!a,"bc-read-only bsc-fill-primary-4 dark:bsc-fill-mono-light-3":a});return l.jsx(Wa,{children:l.jsxs("div",{className:x,children:[n&&c===Re.Left&&l.jsx(Ge,{label:n,readOnly:a,className:w}),l.jsx(uo,{ref:r,name:t,value:s,checked:o,partial:i,readOnly:a,className:S,labelStyles:O,onChange:p,children:({partial:U})=>l.jsx("svg",{viewBox:"0 0 21 21",className:R,children:U?l.jsx("polyline",{points:"6 10.5 16 10.5"}):l.jsx("polyline",{points:"5 10.75 8.5 14.25 16 6"})})}),n&&c===Re.Right&&l.jsx(Ge,{label:n,readOnly:a,className:w})]})})},Vn=d.memo(d.forwardRef(fo)),ho=({name:e,label:r,value:t,data:n,textField:s,valueField:a,readOnly:o=!1,orientation:i=Ne.Vertical,className:c,onChange:f})=>{const[h,p]=d.useState([]),y=cr(()=>n,[n]);d.useEffect(()=>{p(t??[])},[t]);const x=R=>{const{value:U,checked:F}=R;let b;F?b=[...h,U]:b=h.filter(A=>A!==U),p(b),f==null||f({name:e,value:b})},w=(R,U)=>l.jsx(Vn,{name:e,label:R[s],value:R[a],checked:h.some(F=>F===R[a]),readOnly:o,onChange:F=>F&&x(F),className:"bsc-mr-3"},`${e}_checkbox_${U}`),D=ie("bsc-flex bsc-flex-col bsc-gap-1",c),O=ie("bsc-flex bsc-gap-1",{"bsc-flex-col":i===Ne.Vertical}),S=R=>l.jsx("div",{className:O,children:R.map(w)});return l.jsxs("div",{className:D,children:[r&&l.jsx(Ge,{label:r,readOnly:o}),y&&S(y)]})},po=d.memo(ho);var mo=typeof global=="object"&&global&&global.Object===Object&&global;const Bn=mo;var bo=typeof self=="object"&&self&&self.Object===Object&&self,go=Bn||bo||Function("return this")();const Ye=go;var yo=Ye.Symbol;const bt=yo;var zn=Object.prototype,vo=zn.hasOwnProperty,xo=zn.toString,Ft=bt?bt.toStringTag:void 0;function wo(e){var r=vo.call(e,Ft),t=e[Ft];try{e[Ft]=void 0;var n=!0}catch{}var s=xo.call(e);return n&&(r?e[Ft]=t:delete e[Ft]),s}var To=Object.prototype,So=To.toString;function Po(e){return So.call(e)}var Eo="[object Null]",ko="[object Undefined]",Un=bt?bt.toStringTag:void 0;function gt(e){return e==null?e===void 0?ko:Eo:Un&&Un in Object(e)?wo(e):Po(e)}function yt(e){return e!=null&&typeof e=="object"}var Co="[object Symbol]";function Do(e){return typeof e=="symbol"||yt(e)&&gt(e)==Co}var Oo=Array.isArray;const Hr=Oo;var _o=/\s/;function No(e){for(var r=e.length;r--&&_o.test(e.charAt(r)););return r}var Io=/^\s+/;function jo(e){return e&&e.slice(0,No(e)+1).replace(Io,"")}function Ze(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}var qn=0/0,Mo=/^[-+]0x[0-9a-f]+$/i,Ro=/^0b[01]+$/i,Ao=/^0o[0-7]+$/i,Lo=parseInt;function Gn(e){if(typeof e=="number")return e;if(Do(e))return qn;if(Ze(e)){var r=typeof e.valueOf=="function"?e.valueOf():e;e=Ze(r)?r+"":r}if(typeof e!="string")return e===0?e:+e;e=jo(e);var t=Ro.test(e);return t||Ao.test(e)?Lo(e.slice(2),t?2:8):Mo.test(e)?qn:+e}var $o="[object AsyncFunction]",Fo="[object Function]",Yo="[object GeneratorFunction]",Ho="[object Proxy]";function Zn(e){if(!Ze(e))return!1;var r=gt(e);return r==Fo||r==Yo||r==$o||r==Ho}var Wo=Ye["__core-js_shared__"];const Wr=Wo;var Qn=function(){var e=/[^.]+$/.exec(Wr&&Wr.keys&&Wr.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Vo(e){return!!Qn&&Qn in e}var Bo=Function.prototype,zo=Bo.toString;function st(e){if(e!=null){try{return zo.call(e)}catch{}try{return e+""}catch{}}return""}var Uo=/[\\^$.*+?()[\]{}|]/g,qo=/^\[object .+?Constructor\]$/,Go=Function.prototype,Zo=Object.prototype,Qo=Go.toString,Ko=Zo.hasOwnProperty,Xo=RegExp("^"+Qo.call(Ko).replace(Uo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Jo(e){if(!Ze(e)||Vo(e))return!1;var r=Zn(e)?Xo:qo;return r.test(st(e))}function ei(e,r){return e==null?void 0:e[r]}function at(e,r){var t=ei(e,r);return Jo(t)?t:void 0}var ti=at(Ye,"WeakMap");const Vr=ti;var Kn=Object.create,ri=function(){function e(){}return function(r){if(!Ze(r))return{};if(Kn)return Kn(r);e.prototype=r;var t=new e;return e.prototype=void 0,t}}();const ni=ri;function si(e,r){var t=-1,n=e.length;for(r||(r=Array(n));++t<n;)r[t]=e[t];return r}var ai=function(){try{var e=at(Object,"defineProperty");return e({},"",{}),e}catch{}}();const Xn=ai;function oi(e,r){for(var t=-1,n=e==null?0:e.length;++t<n&&r(e[t],t,e)!==!1;);return e}var ii=9007199254740991,ci=/^(?:0|[1-9]\d*)$/;function ui(e,r){var t=typeof e;return r=r??ii,!!r&&(t=="number"||t!="symbol"&&ci.test(e))&&e>-1&&e%1==0&&e<r}function Jn(e,r,t){r=="__proto__"&&Xn?Xn(e,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[r]=t}function es(e,r){return e===r||e!==e&&r!==r}var li=Object.prototype,fi=li.hasOwnProperty;function ts(e,r,t){var n=e[r];(!(fi.call(e,r)&&es(n,t))||t===void 0&&!(r in e))&&Jn(e,r,t)}function ur(e,r,t,n){var s=!t;t||(t={});for(var a=-1,o=r.length;++a<o;){var i=r[a],c=n?n(t[i],e[i],i,t,e):void 0;c===void 0&&(c=e[i]),s?Jn(t,i,c):ts(t,i,c)}return t}var di=9007199254740991;function rs(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=di}function ns(e){return e!=null&&rs(e.length)&&!Zn(e)}var hi=Object.prototype;function Br(e){var r=e&&e.constructor,t=typeof r=="function"&&r.prototype||hi;return e===t}function pi(e,r){for(var t=-1,n=Array(e);++t<e;)n[t]=r(t);return n}var mi="[object Arguments]";function ss(e){return yt(e)&&gt(e)==mi}var as=Object.prototype,bi=as.hasOwnProperty,gi=as.propertyIsEnumerable,yi=ss(function(){return arguments}())?ss:function(e){return yt(e)&&bi.call(e,"callee")&&!gi.call(e,"callee")};const vi=yi;function xi(){return!1}var os=typeof X=="object"&&X&&!X.nodeType&&X,is=os&&typeof module=="object"&&module&&!module.nodeType&&module,wi=is&&is.exports===os,cs=wi?Ye.Buffer:void 0,Ti=cs?cs.isBuffer:void 0,Si=Ti||xi;const us=Si;var Pi="[object Arguments]",Ei="[object Array]",ki="[object Boolean]",Ci="[object Date]",Di="[object Error]",Oi="[object Function]",_i="[object Map]",Ni="[object Number]",Ii="[object Object]",ji="[object RegExp]",Mi="[object Set]",Ri="[object String]",Ai="[object WeakMap]",Li="[object ArrayBuffer]",$i="[object DataView]",Fi="[object Float32Array]",Yi="[object Float64Array]",Hi="[object Int8Array]",Wi="[object Int16Array]",Vi="[object Int32Array]",Bi="[object Uint8Array]",zi="[object Uint8ClampedArray]",Ui="[object Uint16Array]",qi="[object Uint32Array]",ve={};ve[Fi]=ve[Yi]=ve[Hi]=ve[Wi]=ve[Vi]=ve[Bi]=ve[zi]=ve[Ui]=ve[qi]=!0,ve[Pi]=ve[Ei]=ve[Li]=ve[ki]=ve[$i]=ve[Ci]=ve[Di]=ve[Oi]=ve[_i]=ve[Ni]=ve[Ii]=ve[ji]=ve[Mi]=ve[Ri]=ve[Ai]=!1;function Gi(e){return yt(e)&&rs(e.length)&&!!ve[gt(e)]}function zr(e){return function(r){return e(r)}}var ls=typeof X=="object"&&X&&!X.nodeType&&X,Yt=ls&&typeof module=="object"&&module&&!module.nodeType&&module,Zi=Yt&&Yt.exports===ls,Ur=Zi&&Bn.process,Qi=function(){try{var e=Yt&&Yt.require&&Yt.require("util").types;return e||Ur&&Ur.binding&&Ur.binding("util")}catch{}}();const vt=Qi;var fs=vt&&vt.isTypedArray,Ki=fs?zr(fs):Gi;const Xi=Ki;var Ji=Object.prototype,ec=Ji.hasOwnProperty;function ds(e,r){var t=Hr(e),n=!t&&vi(e),s=!t&&!n&&us(e),a=!t&&!n&&!s&&Xi(e),o=t||n||s||a,i=o?pi(e.length,String):[],c=i.length;for(var f in e)(r||ec.call(e,f))&&!(o&&(f=="length"||s&&(f=="offset"||f=="parent")||a&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||ui(f,c)))&&i.push(f);return i}function hs(e,r){return function(t){return e(r(t))}}var tc=hs(Object.keys,Object);const rc=tc;var nc=Object.prototype,sc=nc.hasOwnProperty;function ac(e){if(!Br(e))return rc(e);var r=[];for(var t in Object(e))sc.call(e,t)&&t!="constructor"&&r.push(t);return r}function qr(e){return ns(e)?ds(e):ac(e)}function oc(e){var r=[];if(e!=null)for(var t in Object(e))r.push(t);return r}var ic=Object.prototype,cc=ic.hasOwnProperty;function uc(e){if(!Ze(e))return oc(e);var r=Br(e),t=[];for(var n in e)n=="constructor"&&(r||!cc.call(e,n))||t.push(n);return t}function Gr(e){return ns(e)?ds(e,!0):uc(e)}var lc=at(Object,"create");const Ht=lc;function fc(){this.__data__=Ht?Ht(null):{},this.size=0}function dc(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}var hc="__lodash_hash_undefined__",pc=Object.prototype,mc=pc.hasOwnProperty;function bc(e){var r=this.__data__;if(Ht){var t=r[e];return t===hc?void 0:t}return mc.call(r,e)?r[e]:void 0}var gc=Object.prototype,yc=gc.hasOwnProperty;function vc(e){var r=this.__data__;return Ht?r[e]!==void 0:yc.call(r,e)}var xc="__lodash_hash_undefined__";function wc(e,r){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=Ht&&r===void 0?xc:r,this}function ot(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}ot.prototype.clear=fc,ot.prototype.delete=dc,ot.prototype.get=bc,ot.prototype.has=vc,ot.prototype.set=wc;function Tc(){this.__data__=[],this.size=0}function lr(e,r){for(var t=e.length;t--;)if(es(e[t][0],r))return t;return-1}var Sc=Array.prototype,Pc=Sc.splice;function Ec(e){var r=this.__data__,t=lr(r,e);if(t<0)return!1;var n=r.length-1;return t==n?r.pop():Pc.call(r,t,1),--this.size,!0}function kc(e){var r=this.__data__,t=lr(r,e);return t<0?void 0:r[t][1]}function Cc(e){return lr(this.__data__,e)>-1}function Dc(e,r){var t=this.__data__,n=lr(t,e);return n<0?(++this.size,t.push([e,r])):t[n][1]=r,this}function Qe(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}Qe.prototype.clear=Tc,Qe.prototype.delete=Ec,Qe.prototype.get=kc,Qe.prototype.has=Cc,Qe.prototype.set=Dc;var Oc=at(Ye,"Map");const Wt=Oc;function _c(){this.size=0,this.__data__={hash:new ot,map:new(Wt||Qe),string:new ot}}function Nc(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}function fr(e,r){var t=e.__data__;return Nc(r)?t[typeof r=="string"?"string":"hash"]:t.map}function Ic(e){var r=fr(this,e).delete(e);return this.size-=r?1:0,r}function jc(e){return fr(this,e).get(e)}function Mc(e){return fr(this,e).has(e)}function Rc(e,r){var t=fr(this,e),n=t.size;return t.set(e,r),this.size+=t.size==n?0:1,this}function xt(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}xt.prototype.clear=_c,xt.prototype.delete=Ic,xt.prototype.get=jc,xt.prototype.has=Mc,xt.prototype.set=Rc;function ps(e,r){for(var t=-1,n=r.length,s=e.length;++t<n;)e[s+t]=r[t];return e}var Ac=hs(Object.getPrototypeOf,Object);const ms=Ac;function Lc(){this.__data__=new Qe,this.size=0}function $c(e){var r=this.__data__,t=r.delete(e);return this.size=r.size,t}function Fc(e){return this.__data__.get(e)}function Yc(e){return this.__data__.has(e)}var Hc=200;function Wc(e,r){var t=this.__data__;if(t instanceof Qe){var n=t.__data__;if(!Wt||n.length<Hc-1)return n.push([e,r]),this.size=++t.size,this;t=this.__data__=new xt(n)}return t.set(e,r),this.size=t.size,this}function wt(e){var r=this.__data__=new Qe(e);this.size=r.size}wt.prototype.clear=Lc,wt.prototype.delete=$c,wt.prototype.get=Fc,wt.prototype.has=Yc,wt.prototype.set=Wc;function Vc(e,r){return e&&ur(r,qr(r),e)}function Bc(e,r){return e&&ur(r,Gr(r),e)}var bs=typeof X=="object"&&X&&!X.nodeType&&X,gs=bs&&typeof module=="object"&&module&&!module.nodeType&&module,zc=gs&&gs.exports===bs,ys=zc?Ye.Buffer:void 0,vs=ys?ys.allocUnsafe:void 0;function Uc(e,r){if(r)return e.slice();var t=e.length,n=vs?vs(t):new e.constructor(t);return e.copy(n),n}function qc(e,r){for(var t=-1,n=e==null?0:e.length,s=0,a=[];++t<n;){var o=e[t];r(o,t,e)&&(a[s++]=o)}return a}function xs(){return[]}var Gc=Object.prototype,Zc=Gc.propertyIsEnumerable,ws=Object.getOwnPropertySymbols,Qc=ws?function(e){return e==null?[]:(e=Object(e),qc(ws(e),function(r){return Zc.call(e,r)}))}:xs;const Zr=Qc;function Kc(e,r){return ur(e,Zr(e),r)}var Xc=Object.getOwnPropertySymbols,Jc=Xc?function(e){for(var r=[];e;)ps(r,Zr(e)),e=ms(e);return r}:xs;const Ts=Jc;function eu(e,r){return ur(e,Ts(e),r)}function Ss(e,r,t){var n=r(e);return Hr(e)?n:ps(n,t(e))}function tu(e){return Ss(e,qr,Zr)}function ru(e){return Ss(e,Gr,Ts)}var nu=at(Ye,"DataView");const Qr=nu;var su=at(Ye,"Promise");const Kr=su;var au=at(Ye,"Set");const Xr=au;var Ps="[object Map]",ou="[object Object]",Es="[object Promise]",ks="[object Set]",Cs="[object WeakMap]",Ds="[object DataView]",iu=st(Qr),cu=st(Wt),uu=st(Kr),lu=st(Xr),fu=st(Vr),it=gt;(Qr&&it(new Qr(new ArrayBuffer(1)))!=Ds||Wt&&it(new Wt)!=Ps||Kr&&it(Kr.resolve())!=Es||Xr&&it(new Xr)!=ks||Vr&&it(new Vr)!=Cs)&&(it=function(e){var r=gt(e),t=r==ou?e.constructor:void 0,n=t?st(t):"";if(n)switch(n){case iu:return Ds;case cu:return Ps;case uu:return Es;case lu:return ks;case fu:return Cs}return r});const Jr=it;var du=Object.prototype,hu=du.hasOwnProperty;function pu(e){var r=e.length,t=new e.constructor(r);return r&&typeof e[0]=="string"&&hu.call(e,"index")&&(t.index=e.index,t.input=e.input),t}var mu=Ye.Uint8Array;const Os=mu;function en(e){var r=new e.constructor(e.byteLength);return new Os(r).set(new Os(e)),r}function bu(e,r){var t=r?en(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.byteLength)}var gu=/\w*$/;function yu(e){var r=new e.constructor(e.source,gu.exec(e));return r.lastIndex=e.lastIndex,r}var _s=bt?bt.prototype:void 0,Ns=_s?_s.valueOf:void 0;function vu(e){return Ns?Object(Ns.call(e)):{}}function xu(e,r){var t=r?en(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}var wu="[object Boolean]",Tu="[object Date]",Su="[object Map]",Pu="[object Number]",Eu="[object RegExp]",ku="[object Set]",Cu="[object String]",Du="[object Symbol]",Ou="[object ArrayBuffer]",_u="[object DataView]",Nu="[object Float32Array]",Iu="[object Float64Array]",ju="[object Int8Array]",Mu="[object Int16Array]",Ru="[object Int32Array]",Au="[object Uint8Array]",Lu="[object Uint8ClampedArray]",$u="[object Uint16Array]",Fu="[object Uint32Array]";function Yu(e,r,t){var n=e.constructor;switch(r){case Ou:return en(e);case wu:case Tu:return new n(+e);case _u:return bu(e,t);case Nu:case Iu:case ju:case Mu:case Ru:case Au:case Lu:case $u:case Fu:return xu(e,t);case Su:return new n;case Pu:case Cu:return new n(e);case Eu:return yu(e);case ku:return new n;case Du:return vu(e)}}function Hu(e){return typeof e.constructor=="function"&&!Br(e)?ni(ms(e)):{}}var Wu="[object Map]";function Vu(e){return yt(e)&&Jr(e)==Wu}var Is=vt&&vt.isMap,Bu=Is?zr(Is):Vu;const zu=Bu;var Uu="[object Set]";function qu(e){return yt(e)&&Jr(e)==Uu}var js=vt&&vt.isSet,Gu=js?zr(js):qu;const Zu=Gu;var Qu=1,Ku=2,Xu=4,Ms="[object Arguments]",Ju="[object Array]",el="[object Boolean]",tl="[object Date]",rl="[object Error]",Rs="[object Function]",nl="[object GeneratorFunction]",sl="[object Map]",al="[object Number]",As="[object Object]",ol="[object RegExp]",il="[object Set]",cl="[object String]",ul="[object Symbol]",ll="[object WeakMap]",fl="[object ArrayBuffer]",dl="[object DataView]",hl="[object Float32Array]",pl="[object Float64Array]",ml="[object Int8Array]",bl="[object Int16Array]",gl="[object Int32Array]",yl="[object Uint8Array]",vl="[object Uint8ClampedArray]",xl="[object Uint16Array]",wl="[object Uint32Array]",ge={};ge[Ms]=ge[Ju]=ge[fl]=ge[dl]=ge[el]=ge[tl]=ge[hl]=ge[pl]=ge[ml]=ge[bl]=ge[gl]=ge[sl]=ge[al]=ge[As]=ge[ol]=ge[il]=ge[cl]=ge[ul]=ge[yl]=ge[vl]=ge[xl]=ge[wl]=!0,ge[rl]=ge[Rs]=ge[ll]=!1;function dr(e,r,t,n,s,a){var o,i=r&Qu,c=r&Ku,f=r&Xu;if(t&&(o=s?t(e,n,s,a):t(e)),o!==void 0)return o;if(!Ze(e))return e;var h=Hr(e);if(h){if(o=pu(e),!i)return si(e,o)}else{var p=Jr(e),y=p==Rs||p==nl;if(us(e))return Uc(e,i);if(p==As||p==Ms||y&&!s){if(o=c||y?{}:Hu(e),!i)return c?eu(e,Bc(o,e)):Kc(e,Vc(o,e))}else{if(!ge[p])return s?e:{};o=Yu(e,p,i)}}a||(a=new wt);var x=a.get(e);if(x)return x;a.set(e,o),Zu(e)?e.forEach(function(O){o.add(dr(O,r,t,O,e,a))}):zu(e)&&e.forEach(function(O,S){o.set(S,dr(O,r,t,S,e,a))});var w=f?c?ru:tu:c?Gr:qr,D=h?void 0:w(e);return oi(D||e,function(O,S){D&&(S=O,O=e[S]),ts(o,S,dr(O,r,t,S,e,a))}),o}var Tl=1,Sl=4;function Pl(e){return dr(e,Tl|Sl)}var El=function(){return Ye.Date.now()};const tn=El;var kl="Expected a function",Cl=Math.max,Dl=Math.min;function Vt(e,r,t){var n,s,a,o,i,c,f=0,h=!1,p=!1,y=!0;if(typeof e!="function")throw new TypeError(kl);r=Gn(r)||0,Ze(t)&&(h=!!t.leading,p="maxWait"in t,a=p?Cl(Gn(t.maxWait)||0,r):a,y="trailing"in t?!!t.trailing:y);function x(A){var k=n,V=s;return n=s=void 0,f=A,o=e.apply(V,k),o}function w(A){return f=A,i=setTimeout(S,r),h?x(A):o}function D(A){var k=A-c,V=A-f,B=r-k;return p?Dl(B,a-V):B}function O(A){var k=A-c,V=A-f;return c===void 0||k>=r||k<0||p&&V>=a}function S(){var A=tn();if(O(A))return R(A);i=setTimeout(S,D(A))}function R(A){return i=void 0,y&&n?x(A):(n=s=void 0,o)}function U(){i!==void 0&&clearTimeout(i),f=0,n=c=s=i=void 0}function F(){return i===void 0?o:R(tn())}function b(){var A=tn(),k=O(A);if(n=arguments,s=this,c=A,k){if(i===void 0)return w(c);if(p)return clearTimeout(i),i=setTimeout(S,r),x(c)}return i===void 0&&(i=setTimeout(S,r)),o}return b.cancel=U,b.flush=F,b}var Ol="Expected a function";function _l(e,r,t){var n=!0,s=!0;if(typeof e!="function")throw new TypeError(Ol);return Ze(t)&&(n="leading"in t?!!t.leading:n,s="trailing"in t?!!t.trailing:s),Vt(e,r,{leading:n,maxWait:r,trailing:s})}const Nl=(e,r)=>{const{value:t,readOnly:n=!1,debounceTime:s=800,fillContainer:a=!0,leftElement:o,rightElement:i,className:c,leftElementClassName:f,rightElementClassName:h,isSingleLine:p=!0,allowSingleLineScroll:y=!1,inputMode:x,placeholder:w,onFocus:D,onBlur:O,onInput:S,onInnerTextChange:R,onInnerHTMLChange:U,onElementCreate:F,onLeftElementClick:b,onRightElementClick:A}=e,k=d.useRef("bsc-flex-grow focus:bsc-outline-none"),V=d.useRef("bsc-text-gray-4"),B=d.useRef(),ne=d.useCallback(E=>{const Y=E.target,q=Y.innerHTML;Y.className=`${k.current}`,w&&q===w&&(Y.innerHTML=""),D==null||D(E)},[w,D]),te=d.useCallback(E=>{const Y=E.target.innerHTML;if(w&&Y===""){const q=E.target;q.innerHTML=w,q.className=`${k.current} ${V.current}`}O==null||O(E)},[w,O]),J=d.useCallback(E=>{var Y,q;(Y=B.current)==null||Y.removeEventListener("focus",ne),(q=B.current)==null||q.removeEventListener("blur",te),w&&E&&E!==document.activeElement&&E.innerHTML===""&&(E.innerHTML=w,E.className=`${k.current} ${V.current}`),E.addEventListener("focus",ne),E.addEventListener("blur",te),B.current=E},[w]),N=d.useCallback(E=>{F==null||F(E)},[F]),$=E=>{b==null||b(E)},I=E=>{A==null||A(E)},C=Vt(E=>{S==null||S(E),R==null||R(E.target.innerText),U==null||U(E.target.innerHTML)},s),G=d.useCallback(E=>{B.current&&(B.current.innerText=E)},[]),v=d.useCallback(E=>{B.current&&(B.current.innerHTML=E)},[]),ee=d.useCallback(()=>{var E;(E=B.current)==null||E.focus()},[]);d.useImperativeHandle(r,()=>({inputElement:B.current,setInnerText:G,setInnerHTML:v,focus:ee}));const g=ie({"bsc-w-full ":a},"bsc-flex bsc-flex-row bsc-items-center bsc-shadow-sm bsc-border bsc-border-solid bsc-border-gray-3 dark:bsc-border-white dark:bsc-bg-mono-dark-1 dark:bsc-text-mono-light-1 bsc-rounded-md bsc-p-2",{"bsc-overflow-x-auto bsc-overflow-y-hidden bsc-whitespace-pre":p&&y,"bsc-overflow-hidden bsc-whitespace-pre":p&&!y},c),_=ie("bsc-flex-shrink",{"bsc-mr-2":o},f),z=ie("bsc-flex-shrink",{"bsc-ml-2":i},h);return l.jsxs("div",{className:g,ref:E=>E&&N(E),children:[o&&l.jsx("div",{className:_,onClick:$,children:o}),l.jsx("div",{ref:E=>E&&J(E),className:k.current,contentEditable:!n,suppressContentEditableWarning:!0,inputMode:x,onInput:C,children:t}),i&&l.jsx("div",{className:z,onClick:I,children:i})]})},hr=d.forwardRef(Nl);function le(e){const r=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&r==="[object Date]"?new e.constructor(+e):typeof e=="number"||r==="[object Number]"||typeof e=="string"||r==="[object String]"?new Date(e):new Date(NaN)}function ye(e,r){return e instanceof Date?new e.constructor(r):new Date(r)}function Tt(e,r){const t=le(e);return isNaN(r)?ye(e,NaN):(r&&t.setDate(t.getDate()+r),t)}function ct(e,r){const t=le(e);if(isNaN(r))return ye(e,NaN);if(!r)return t;const n=t.getDate(),s=ye(e,t.getTime());s.setMonth(t.getMonth()+r+1,0);const a=s.getDate();return n>=a?s:(t.setFullYear(s.getFullYear(),s.getMonth(),n),t)}const Ls=6048e5,rn=6e4,nn=36e5,Il=1e3;let jl={};function Bt(){return jl}function tt(e,r){var i,c,f,h;const t=Bt(),n=(r==null?void 0:r.weekStartsOn)??((c=(i=r==null?void 0:r.locale)==null?void 0:i.options)==null?void 0:c.weekStartsOn)??t.weekStartsOn??((h=(f=t.locale)==null?void 0:f.options)==null?void 0:h.weekStartsOn)??0,s=le(e),a=s.getDay(),o=(a<n?7:0)+a-n;return s.setDate(s.getDate()-o),s.setHours(0,0,0,0),s}function St(e){return tt(e,{weekStartsOn:1})}function Ml(e){const r=le(e),t=r.getFullYear(),n=ye(e,0);n.setFullYear(t+1,0,4),n.setHours(0,0,0,0);const s=St(n),a=ye(e,0);a.setFullYear(t,0,4),a.setHours(0,0,0,0);const o=St(a);return r.getTime()>=s.getTime()?t+1:r.getTime()>=o.getTime()?t:t-1}function $s(e){const r=le(e);return r.setHours(0,0,0,0),r}function Fs(e){const r=le(e),t=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return t.setUTCFullYear(r.getFullYear()),+e-+t}function Rl(e){const r=Ml(e),t=ye(e,0);return t.setFullYear(r,0,4),t.setHours(0,0,0,0),St(t)}function pr(e,r){return ct(e,r*12)}function Ys(e,r){const t=$s(e),n=$s(r);return+t==+n}function Al(e){const r=le(e),t=r.getMonth();return r.setFullYear(r.getFullYear(),t+1,0),r.setHours(23,59,59,999),r}function Ll(e,r){const t=le(e.start),n=le(e.end);let s=+t>+n;const a=s?+t:+n,o=s?n:t;o.setHours(0,0,0,0);let i=(r==null?void 0:r.step)??1;if(!i)return[];i<0&&(i=-i,s=!s);const c=[];for(;+o<=a;)c.push(le(o)),o.setDate(o.getDate()+i),o.setHours(0,0,0,0);return s?c.reverse():c}function Hs(e){const r=le(e);return r.setDate(1),r.setHours(0,0,0,0),r}function $l(e,r){const t=le(e.start),n=le(e.end);let s=+t>+n;const a=s?+t:+n,o=s?n:t;o.setHours(0,0,0,0),o.setMonth(0,1);let i=(r==null?void 0:r.step)??1;if(!i)return[];i<0&&(i=-i,s=!s);const c=[];for(;+o<=a;)c.push(le(o)),o.setFullYear(o.getFullYear()+i);return s?c.reverse():c}const Fl={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Yl=(e,r,t)=>{let n;const s=Fl[e];return typeof s=="string"?n=s:r===1?n=s.one:n=s.other.replace("{{count}}",r.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+n:n+" ago":n};function sn(e){return(r={})=>{const t=r.width?String(r.width):e.defaultWidth;return e.formats[t]||e.formats[e.defaultWidth]}}const Hl={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Wl={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Vl={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Bl={date:sn({formats:Hl,defaultWidth:"full"}),time:sn({formats:Wl,defaultWidth:"full"}),dateTime:sn({formats:Vl,defaultWidth:"full"})},zl={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Ul=(e,r,t,n)=>zl[e];function zt(e){return(r,t)=>{const n=t!=null&&t.context?String(t.context):"standalone";let s;if(n==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,i=t!=null&&t.width?String(t.width):o;s=e.formattingValues[i]||e.formattingValues[o]}else{const o=e.defaultWidth,i=t!=null&&t.width?String(t.width):e.defaultWidth;s=e.values[i]||e.values[o]}const a=e.argumentCallback?e.argumentCallback(r):r;return s[a]}}const ql={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Gl={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Zl={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Ql={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Kl={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Xl={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Jl={ordinalNumber:(e,r)=>{const t=Number(e),n=t%100;if(n>20||n<10)switch(n%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},era:zt({values:ql,defaultWidth:"wide"}),quarter:zt({values:Gl,defaultWidth:"wide",argumentCallback:e=>e-1}),month:zt({values:Zl,defaultWidth:"wide"}),day:zt({values:Ql,defaultWidth:"wide"}),dayPeriod:zt({values:Kl,defaultWidth:"wide",formattingValues:Xl,defaultFormattingWidth:"wide"})};function Ut(e){return(r,t={})=>{const n=t.width,s=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],a=r.match(s);if(!a)return null;const o=a[0],i=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(i)?tf(i,p=>p.test(o)):ef(i,p=>p.test(o));let f;f=e.valueCallback?e.valueCallback(c):c,f=t.valueCallback?t.valueCallback(f):f;const h=r.slice(o.length);return{value:f,rest:h}}}function ef(e,r){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&r(e[t]))return t}function tf(e,r){for(let t=0;t<e.length;t++)if(r(e[t]))return t}function rf(e){return(r,t={})=>{const n=r.match(e.matchPattern);if(!n)return null;const s=n[0],a=r.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=t.valueCallback?t.valueCallback(o):o;const i=r.slice(s.length);return{value:o,rest:i}}}const nf=/^(\d+)(th|st|nd|rd)?/i,sf=/\d+/i,af={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},of={any:[/^b/i,/^(a|c)/i]},cf={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},uf={any:[/1/i,/2/i,/3/i,/4/i]},lf={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},ff={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},df={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},hf={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},pf={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},mf={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},bf={ordinalNumber:rf({matchPattern:nf,parsePattern:sf,valueCallback:e=>parseInt(e,10)}),era:Ut({matchPatterns:af,defaultMatchWidth:"wide",parsePatterns:of,defaultParseWidth:"any"}),quarter:Ut({matchPatterns:cf,defaultMatchWidth:"wide",parsePatterns:uf,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Ut({matchPatterns:lf,defaultMatchWidth:"wide",parsePatterns:ff,defaultParseWidth:"any"}),day:Ut({matchPatterns:df,defaultMatchWidth:"wide",parsePatterns:hf,defaultParseWidth:"any"}),dayPeriod:Ut({matchPatterns:pf,defaultMatchWidth:"any",parsePatterns:mf,defaultParseWidth:"any"})},gf={code:"en-US",formatDistance:Yl,formatLong:Bl,formatRelative:Ul,localize:Jl,match:bf,options:{weekStartsOn:0,firstWeekContainsDate:1}};function yf(e){const r=le(e),t=+St(r)-+Rl(r);return Math.round(t/Ls)+1}function Ws(e,r){var h,p,y,x;const t=le(e),n=t.getFullYear(),s=Bt(),a=(r==null?void 0:r.firstWeekContainsDate)??((p=(h=r==null?void 0:r.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??s.firstWeekContainsDate??((x=(y=s.locale)==null?void 0:y.options)==null?void 0:x.firstWeekContainsDate)??1,o=ye(e,0);o.setFullYear(n+1,0,a),o.setHours(0,0,0,0);const i=tt(o,r),c=ye(e,0);c.setFullYear(n,0,a),c.setHours(0,0,0,0);const f=tt(c,r);return t.getTime()>=i.getTime()?n+1:t.getTime()>=f.getTime()?n:n-1}function vf(e,r){var i,c,f,h;const t=Bt(),n=(r==null?void 0:r.firstWeekContainsDate)??((c=(i=r==null?void 0:r.locale)==null?void 0:i.options)==null?void 0:c.firstWeekContainsDate)??t.firstWeekContainsDate??((h=(f=t.locale)==null?void 0:f.options)==null?void 0:h.firstWeekContainsDate)??1,s=Ws(e,r),a=ye(e,0);return a.setFullYear(s,0,n),a.setHours(0,0,0,0),tt(a,r)}function xf(e,r){const t=le(e),n=+tt(t,r)-+vf(t,r);return Math.round(n/Ls)+1}const Vs=(e,r)=>{switch(e){case"P":return r.date({width:"short"});case"PP":return r.date({width:"medium"});case"PPP":return r.date({width:"long"});case"PPPP":default:return r.date({width:"full"})}},Bs=(e,r)=>{switch(e){case"p":return r.time({width:"short"});case"pp":return r.time({width:"medium"});case"ppp":return r.time({width:"long"});case"pppp":default:return r.time({width:"full"})}},zs={p:Bs,P:(e,r)=>{const t=e.match(/(P+)(p+)?/)||[],n=t[1],s=t[2];if(!s)return Vs(e,r);let a;switch(n){case"P":a=r.dateTime({width:"short"});break;case"PP":a=r.dateTime({width:"medium"});break;case"PPP":a=r.dateTime({width:"long"});break;case"PPPP":default:a=r.dateTime({width:"full"});break}return a.replace("{{date}}",Vs(n,r)).replace("{{time}}",Bs(s,r))}},wf=/^D+$/,Tf=/^Y+$/,Sf=["D","DD","YY","YYYY"];function Pf(e){return wf.test(e)}function Ef(e){return Tf.test(e)}function Us(e,r,t){const n=kf(e,r,t);if(console.warn(n),Sf.includes(e))throw new RangeError(n)}function kf(e,r,t){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${r}\`) for formatting ${n} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function an(e){return le(e).getDay()}function qs(e){const r=le(e),t=r.getFullYear(),n=r.getMonth(),s=ye(e,0);return s.setFullYear(t,n+1,0),s.setHours(0,0,0,0),s.getDate()}function Cf(){return Object.assign({},Bt())}function Df(e){let t=le(e).getDay();return t===0&&(t=7),t}function Of(e){const r=le(e),t=r.getMonth();return r.setFullYear(r.getFullYear(),t+1,0),r.setHours(0,0,0,0),r}function _f(e,r){const t=le(e),n=le(r);return+t<+n}function Nf(e,r){const t=r instanceof Date?ye(r,0):new r(0);return t.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),t.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),t}const If=10;class Gs{constructor(){m(this,"subPriority",0)}validate(r,t){return!0}}class jf extends Gs{constructor(r,t,n,s,a){super(),this.value=r,this.validateValue=t,this.setValue=n,this.priority=s,a&&(this.subPriority=a)}validate(r,t){return this.validateValue(r,this.value,t)}set(r,t,n){return this.setValue(r,t,this.value,n)}}class Mf extends Gs{constructor(){super(...arguments);m(this,"priority",If);m(this,"subPriority",-1)}set(t,n){return n.timestampIsSet?t:ye(t,Nf(t,Date))}}class fe{run(r,t,n,s){const a=this.parse(r,t,n,s);return a?{setter:new jf(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}validate(r,t,n){return!0}}class Rf extends fe{constructor(){super(...arguments);m(this,"priority",140);m(this,"incompatibleTokens",["R","u","t","T"])}parse(t,n,s){switch(n){case"G":case"GG":case"GGG":return s.era(t,{width:"abbreviated"})||s.era(t,{width:"narrow"});case"GGGGG":return s.era(t,{width:"narrow"});case"GGGG":default:return s.era(t,{width:"wide"})||s.era(t,{width:"abbreviated"})||s.era(t,{width:"narrow"})}}set(t,n,s){return n.era=s,t.setFullYear(s,0,1),t.setHours(0,0,0,0),t}}const Ee={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Be={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function ke(e,r){return e&&{value:r(e.value),rest:e.rest}}function we(e,r){const t=r.match(e);return t?{value:parseInt(t[0],10),rest:r.slice(t[0].length)}:null}function ze(e,r){const t=r.match(e);if(!t)return null;if(t[0]==="Z")return{value:0,rest:r.slice(1)};const n=t[1]==="+"?1:-1,s=t[2]?parseInt(t[2],10):0,a=t[3]?parseInt(t[3],10):0,o=t[5]?parseInt(t[5],10):0;return{value:n*(s*nn+a*rn+o*Il),rest:r.slice(t[0].length)}}function Zs(e){return we(Ee.anyDigitsSigned,e)}function Se(e,r){switch(e){case 1:return we(Ee.singleDigit,r);case 2:return we(Ee.twoDigits,r);case 3:return we(Ee.threeDigits,r);case 4:return we(Ee.fourDigits,r);default:return we(new RegExp("^\\d{1,"+e+"}"),r)}}function mr(e,r){switch(e){case 1:return we(Ee.singleDigitSigned,r);case 2:return we(Ee.twoDigitsSigned,r);case 3:return we(Ee.threeDigitsSigned,r);case 4:return we(Ee.fourDigitsSigned,r);default:return we(new RegExp("^-?\\d{1,"+e+"}"),r)}}function on(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function Qs(e,r){const t=r>0,n=t?r:1-r;let s;if(n<=50)s=e||100;else{const a=n+50,o=Math.trunc(a/100)*100,i=e>=a%100;s=e+o-(i?100:0)}return t?s:1-s}function Ks(e){return e%400===0||e%4===0&&e%100!==0}class Af extends fe{constructor(){super(...arguments);m(this,"priority",130);m(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(t,n,s){const a=o=>({year:o,isTwoDigitYear:n==="yy"});switch(n){case"y":return ke(Se(4,t),a);case"yo":return ke(s.ordinalNumber(t,{unit:"year"}),a);default:return ke(Se(n.length,t),a)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,s){const a=t.getFullYear();if(s.isTwoDigitYear){const i=Qs(s.year,a);return t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}const o=!("era"in n)||n.era===1?s.year:1-s.year;return t.setFullYear(o,0,1),t.setHours(0,0,0,0),t}}class Lf extends fe{constructor(){super(...arguments);m(this,"priority",130);m(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(t,n,s){const a=o=>({year:o,isTwoDigitYear:n==="YY"});switch(n){case"Y":return ke(Se(4,t),a);case"Yo":return ke(s.ordinalNumber(t,{unit:"year"}),a);default:return ke(Se(n.length,t),a)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,s,a){const o=Ws(t,a);if(s.isTwoDigitYear){const c=Qs(s.year,o);return t.setFullYear(c,0,a.firstWeekContainsDate),t.setHours(0,0,0,0),tt(t,a)}const i=!("era"in n)||n.era===1?s.year:1-s.year;return t.setFullYear(i,0,a.firstWeekContainsDate),t.setHours(0,0,0,0),tt(t,a)}}class $f extends fe{constructor(){super(...arguments);m(this,"priority",130);m(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(t,n){return mr(n==="R"?4:n.length,t)}set(t,n,s){const a=ye(t,0);return a.setFullYear(s,0,4),a.setHours(0,0,0,0),St(a)}}class Ff extends fe{constructor(){super(...arguments);m(this,"priority",130);m(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(t,n){return mr(n==="u"?4:n.length,t)}set(t,n,s){return t.setFullYear(s,0,1),t.setHours(0,0,0,0),t}}class Yf extends fe{constructor(){super(...arguments);m(this,"priority",120);m(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(t,n,s){switch(n){case"Q":case"QQ":return Se(n.length,t);case"Qo":return s.ordinalNumber(t,{unit:"quarter"});case"QQQ":return s.quarter(t,{width:"abbreviated",context:"formatting"})||s.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(t,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(t,{width:"wide",context:"formatting"})||s.quarter(t,{width:"abbreviated",context:"formatting"})||s.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=1&&n<=4}set(t,n,s){return t.setMonth((s-1)*3,1),t.setHours(0,0,0,0),t}}class Hf extends fe{constructor(){super(...arguments);m(this,"priority",120);m(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(t,n,s){switch(n){case"q":case"qq":return Se(n.length,t);case"qo":return s.ordinalNumber(t,{unit:"quarter"});case"qqq":return s.quarter(t,{width:"abbreviated",context:"standalone"})||s.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(t,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(t,{width:"wide",context:"standalone"})||s.quarter(t,{width:"abbreviated",context:"standalone"})||s.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=1&&n<=4}set(t,n,s){return t.setMonth((s-1)*3,1),t.setHours(0,0,0,0),t}}class Wf extends fe{constructor(){super(...arguments);m(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);m(this,"priority",110)}parse(t,n,s){const a=o=>o-1;switch(n){case"M":return ke(we(Ee.month,t),a);case"MM":return ke(Se(2,t),a);case"Mo":return ke(s.ordinalNumber(t,{unit:"month"}),a);case"MMM":return s.month(t,{width:"abbreviated",context:"formatting"})||s.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(t,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(t,{width:"wide",context:"formatting"})||s.month(t,{width:"abbreviated",context:"formatting"})||s.month(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=11}set(t,n,s){return t.setMonth(s,1),t.setHours(0,0,0,0),t}}class Vf extends fe{constructor(){super(...arguments);m(this,"priority",110);m(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(t,n,s){const a=o=>o-1;switch(n){case"L":return ke(we(Ee.month,t),a);case"LL":return ke(Se(2,t),a);case"Lo":return ke(s.ordinalNumber(t,{unit:"month"}),a);case"LLL":return s.month(t,{width:"abbreviated",context:"standalone"})||s.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(t,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(t,{width:"wide",context:"standalone"})||s.month(t,{width:"abbreviated",context:"standalone"})||s.month(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=0&&n<=11}set(t,n,s){return t.setMonth(s,1),t.setHours(0,0,0,0),t}}function Bf(e,r,t){const n=le(e),s=xf(n,t)-r;return n.setDate(n.getDate()-s*7),n}class zf extends fe{constructor(){super(...arguments);m(this,"priority",100);m(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(t,n,s){switch(n){case"w":return we(Ee.week,t);case"wo":return s.ordinalNumber(t,{unit:"week"});default:return Se(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,s,a){return tt(Bf(t,s,a),a)}}function Uf(e,r){const t=le(e),n=yf(t)-r;return t.setDate(t.getDate()-n*7),t}class qf extends fe{constructor(){super(...arguments);m(this,"priority",100);m(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(t,n,s){switch(n){case"I":return we(Ee.week,t);case"Io":return s.ordinalNumber(t,{unit:"week"});default:return Se(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,s){return St(Uf(t,s))}}const Gf=[31,28,31,30,31,30,31,31,30,31,30,31],Zf=[31,29,31,30,31,30,31,31,30,31,30,31];class Qf extends fe{constructor(){super(...arguments);m(this,"priority",90);m(this,"subPriority",1);m(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(t,n,s){switch(n){case"d":return we(Ee.date,t);case"do":return s.ordinalNumber(t,{unit:"date"});default:return Se(n.length,t)}}validate(t,n){const s=t.getFullYear(),a=Ks(s),o=t.getMonth();return a?n>=1&&n<=Zf[o]:n>=1&&n<=Gf[o]}set(t,n,s){return t.setDate(s),t.setHours(0,0,0,0),t}}class Kf extends fe{constructor(){super(...arguments);m(this,"priority",90);m(this,"subpriority",1);m(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(t,n,s){switch(n){case"D":case"DD":return we(Ee.dayOfYear,t);case"Do":return s.ordinalNumber(t,{unit:"date"});default:return Se(n.length,t)}}validate(t,n){const s=t.getFullYear();return Ks(s)?n>=1&&n<=366:n>=1&&n<=365}set(t,n,s){return t.setMonth(0,s),t.setHours(0,0,0,0),t}}function cn(e,r,t){var p,y,x,w;const n=Bt(),s=(t==null?void 0:t.weekStartsOn)??((y=(p=t==null?void 0:t.locale)==null?void 0:p.options)==null?void 0:y.weekStartsOn)??n.weekStartsOn??((w=(x=n.locale)==null?void 0:x.options)==null?void 0:w.weekStartsOn)??0,a=le(e),o=a.getDay(),c=(r%7+7)%7,f=7-s,h=r<0||r>6?r-(o+f)%7:(c+f)%7-(o+f)%7;return Tt(a,h)}class Xf extends fe{constructor(){super(...arguments);m(this,"priority",90);m(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(t,n,s){switch(n){case"E":case"EE":case"EEE":return s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});case"EEEE":default:return s.day(t,{width:"wide",context:"formatting"})||s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=6}set(t,n,s,a){return t=cn(t,s,a),t.setHours(0,0,0,0),t}}class Jf extends fe{constructor(){super(...arguments);m(this,"priority",90);m(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(t,n,s,a){const o=i=>{const c=Math.floor((i-1)/7)*7;return(i+a.weekStartsOn+6)%7+c};switch(n){case"e":case"ee":return ke(Se(n.length,t),o);case"eo":return ke(s.ordinalNumber(t,{unit:"day"}),o);case"eee":return s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});case"eeeee":return s.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});case"eeee":default:return s.day(t,{width:"wide",context:"formatting"})||s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=6}set(t,n,s,a){return t=cn(t,s,a),t.setHours(0,0,0,0),t}}class ed extends fe{constructor(){super(...arguments);m(this,"priority",90);m(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(t,n,s,a){const o=i=>{const c=Math.floor((i-1)/7)*7;return(i+a.weekStartsOn+6)%7+c};switch(n){case"c":case"cc":return ke(Se(n.length,t),o);case"co":return ke(s.ordinalNumber(t,{unit:"day"}),o);case"ccc":return s.day(t,{width:"abbreviated",context:"standalone"})||s.day(t,{width:"short",context:"standalone"})||s.day(t,{width:"narrow",context:"standalone"});case"ccccc":return s.day(t,{width:"narrow",context:"standalone"});case"cccccc":return s.day(t,{width:"short",context:"standalone"})||s.day(t,{width:"narrow",context:"standalone"});case"cccc":default:return s.day(t,{width:"wide",context:"standalone"})||s.day(t,{width:"abbreviated",context:"standalone"})||s.day(t,{width:"short",context:"standalone"})||s.day(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=0&&n<=6}set(t,n,s,a){return t=cn(t,s,a),t.setHours(0,0,0,0),t}}function td(e,r){const t=le(e),n=Df(t),s=r-n;return Tt(t,s)}class rd extends fe{constructor(){super(...arguments);m(this,"priority",90);m(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(t,n,s){const a=o=>o===0?7:o;switch(n){case"i":case"ii":return Se(n.length,t);case"io":return s.ordinalNumber(t,{unit:"day"});case"iii":return ke(s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"}),a);case"iiiii":return ke(s.day(t,{width:"narrow",context:"formatting"}),a);case"iiiiii":return ke(s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"}),a);case"iiii":default:return ke(s.day(t,{width:"wide",context:"formatting"})||s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"}),a)}}validate(t,n){return n>=1&&n<=7}set(t,n,s){return t=td(t,s),t.setHours(0,0,0,0),t}}class nd extends fe{constructor(){super(...arguments);m(this,"priority",80);m(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(t,n,s){switch(n){case"a":case"aa":case"aaa":return s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(t,{width:"wide",context:"formatting"})||s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,s){return t.setHours(on(s),0,0,0),t}}class sd extends fe{constructor(){super(...arguments);m(this,"priority",80);m(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(t,n,s){switch(n){case"b":case"bb":case"bbb":return s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(t,{width:"wide",context:"formatting"})||s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,s){return t.setHours(on(s),0,0,0),t}}class ad extends fe{constructor(){super(...arguments);m(this,"priority",80);m(this,"incompatibleTokens",["a","b","t","T"])}parse(t,n,s){switch(n){case"B":case"BB":case"BBB":return s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(t,{width:"wide",context:"formatting"})||s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,s){return t.setHours(on(s),0,0,0),t}}class od extends fe{constructor(){super(...arguments);m(this,"priority",70);m(this,"incompatibleTokens",["H","K","k","t","T"])}parse(t,n,s){switch(n){case"h":return we(Ee.hour12h,t);case"ho":return s.ordinalNumber(t,{unit:"hour"});default:return Se(n.length,t)}}validate(t,n){return n>=1&&n<=12}set(t,n,s){const a=t.getHours()>=12;return a&&s<12?t.setHours(s+12,0,0,0):!a&&s===12?t.setHours(0,0,0,0):t.setHours(s,0,0,0),t}}class id extends fe{constructor(){super(...arguments);m(this,"priority",70);m(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(t,n,s){switch(n){case"H":return we(Ee.hour23h,t);case"Ho":return s.ordinalNumber(t,{unit:"hour"});default:return Se(n.length,t)}}validate(t,n){return n>=0&&n<=23}set(t,n,s){return t.setHours(s,0,0,0),t}}class cd extends fe{constructor(){super(...arguments);m(this,"priority",70);m(this,"incompatibleTokens",["h","H","k","t","T"])}parse(t,n,s){switch(n){case"K":return we(Ee.hour11h,t);case"Ko":return s.ordinalNumber(t,{unit:"hour"});default:return Se(n.length,t)}}validate(t,n){return n>=0&&n<=11}set(t,n,s){return t.getHours()>=12&&s<12?t.setHours(s+12,0,0,0):t.setHours(s,0,0,0),t}}class ud extends fe{constructor(){super(...arguments);m(this,"priority",70);m(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(t,n,s){switch(n){case"k":return we(Ee.hour24h,t);case"ko":return s.ordinalNumber(t,{unit:"hour"});default:return Se(n.length,t)}}validate(t,n){return n>=1&&n<=24}set(t,n,s){const a=s<=24?s%24:s;return t.setHours(a,0,0,0),t}}class ld extends fe{constructor(){super(...arguments);m(this,"priority",60);m(this,"incompatibleTokens",["t","T"])}parse(t,n,s){switch(n){case"m":return we(Ee.minute,t);case"mo":return s.ordinalNumber(t,{unit:"minute"});default:return Se(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,s){return t.setMinutes(s,0,0),t}}class fd extends fe{constructor(){super(...arguments);m(this,"priority",50);m(this,"incompatibleTokens",["t","T"])}parse(t,n,s){switch(n){case"s":return we(Ee.second,t);case"so":return s.ordinalNumber(t,{unit:"second"});default:return Se(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,s){return t.setSeconds(s,0),t}}class dd extends fe{constructor(){super(...arguments);m(this,"priority",30);m(this,"incompatibleTokens",["t","T"])}parse(t,n){const s=a=>Math.trunc(a*Math.pow(10,-n.length+3));return ke(Se(n.length,t),s)}set(t,n,s){return t.setMilliseconds(s),t}}class hd extends fe{constructor(){super(...arguments);m(this,"priority",10);m(this,"incompatibleTokens",["t","T","x"])}parse(t,n){switch(n){case"X":return ze(Be.basicOptionalMinutes,t);case"XX":return ze(Be.basic,t);case"XXXX":return ze(Be.basicOptionalSeconds,t);case"XXXXX":return ze(Be.extendedOptionalSeconds,t);case"XXX":default:return ze(Be.extended,t)}}set(t,n,s){return n.timestampIsSet?t:ye(t,t.getTime()-Fs(t)-s)}}class pd extends fe{constructor(){super(...arguments);m(this,"priority",10);m(this,"incompatibleTokens",["t","T","X"])}parse(t,n){switch(n){case"x":return ze(Be.basicOptionalMinutes,t);case"xx":return ze(Be.basic,t);case"xxxx":return ze(Be.basicOptionalSeconds,t);case"xxxxx":return ze(Be.extendedOptionalSeconds,t);case"xxx":default:return ze(Be.extended,t)}}set(t,n,s){return n.timestampIsSet?t:ye(t,t.getTime()-Fs(t)-s)}}class md extends fe{constructor(){super(...arguments);m(this,"priority",40);m(this,"incompatibleTokens","*")}parse(t){return Zs(t)}set(t,n,s){return[ye(t,s*1e3),{timestampIsSet:!0}]}}class bd extends fe{constructor(){super(...arguments);m(this,"priority",20);m(this,"incompatibleTokens","*")}parse(t){return Zs(t)}set(t,n,s){return[ye(t,s),{timestampIsSet:!0}]}}const gd={G:new Rf,y:new Af,Y:new Lf,R:new $f,u:new Ff,Q:new Yf,q:new Hf,M:new Wf,L:new Vf,w:new zf,I:new qf,d:new Qf,D:new Kf,E:new Xf,e:new Jf,c:new ed,i:new rd,a:new nd,b:new sd,B:new ad,h:new od,H:new id,K:new cd,k:new ud,m:new ld,s:new fd,S:new dd,X:new hd,x:new pd,t:new md,T:new bd},yd=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,vd=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,xd=/^'([^]*?)'?$/,wd=/''/g,Td=/\S/,Sd=/[a-zA-Z]/;function Ue(e,r,t,n){var D,O,S,R,U,F,b,A;const s=Cf(),a=(n==null?void 0:n.locale)??s.locale??gf,o=(n==null?void 0:n.firstWeekContainsDate)??((O=(D=n==null?void 0:n.locale)==null?void 0:D.options)==null?void 0:O.firstWeekContainsDate)??s.firstWeekContainsDate??((R=(S=s.locale)==null?void 0:S.options)==null?void 0:R.firstWeekContainsDate)??1,i=(n==null?void 0:n.weekStartsOn)??((F=(U=n==null?void 0:n.locale)==null?void 0:U.options)==null?void 0:F.weekStartsOn)??s.weekStartsOn??((A=(b=s.locale)==null?void 0:b.options)==null?void 0:A.weekStartsOn)??0;if(r==="")return e===""?le(t):ye(t,NaN);const c={firstWeekContainsDate:o,weekStartsOn:i,locale:a},f=[new Mf],h=r.match(vd).map(k=>{const V=k[0];if(V in zs){const B=zs[V];return B(k,a.formatLong)}return k}).join("").match(yd),p=[];for(let k of h){!(n!=null&&n.useAdditionalWeekYearTokens)&&Ef(k)&&Us(k,r,e),!(n!=null&&n.useAdditionalDayOfYearTokens)&&Pf(k)&&Us(k,r,e);const V=k[0],B=gd[V];if(B){const{incompatibleTokens:ne}=B;if(Array.isArray(ne)){const J=p.find(N=>ne.includes(N.token)||N.token===V);if(J)throw new RangeError(`The format string mustn't contain \`${J.fullToken}\` and \`${k}\` at the same time`)}else if(B.incompatibleTokens==="*"&&p.length>0)throw new RangeError(`The format string mustn't contain \`${k}\` and any other token at the same time`);p.push({token:V,fullToken:k});const te=B.run(e,k,a.match,c);if(!te)return ye(t,NaN);f.push(te.setter),e=te.rest}else{if(V.match(Sd))throw new RangeError("Format string contains an unescaped latin alphabet character `"+V+"`");if(k==="''"?k="'":V==="'"&&(k=Pd(k)),e.indexOf(k)===0)e=e.slice(k.length);else return ye(t,NaN)}}if(e.length>0&&Td.test(e))return ye(t,NaN);const y=f.map(k=>k.priority).sort((k,V)=>V-k).filter((k,V,B)=>B.indexOf(k)===V).map(k=>f.filter(V=>V.priority===k).sort((V,B)=>B.subPriority-V.subPriority)).map(k=>k[0]);let x=le(t);if(isNaN(x.getTime()))return ye(t,NaN);const w={};for(const k of y){if(!k.validate(x,c))return ye(t,NaN);const V=k.set(x,w,c);Array.isArray(V)?(x=V[0],Object.assign(w,V[1])):x=V}return ye(t,x)}function Pd(e){return e.match(xd)[1].replace(wd,"'")}function Ed(e){return Ys(e,Date.now())}function kd(e,r){return Tt(e,-r)}function Cd(e,r){let t=r-an(e);return t<=0&&(t+=7),Tt(e,t)}function Dd(e,r){const t=(r==null?void 0:r.additionalDigits)??2,n=Id(e);let s;if(n.date){const c=jd(n.date,t);s=Md(c.restDateString,c.year)}if(!s||isNaN(s.getTime()))return new Date(NaN);const a=s.getTime();let o=0,i;if(n.time&&(o=Rd(n.time),isNaN(o)))return new Date(NaN);if(n.timezone){if(i=Ad(n.timezone),isNaN(i))return new Date(NaN)}else{const c=new Date(a+o),f=new Date(0);return f.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),f.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),f}return new Date(a+o+i)}const br={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Od=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,_d=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Nd=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Id(e){const r={},t=e.split(br.dateTimeDelimiter);let n;if(t.length>2)return r;if(/:/.test(t[0])?n=t[0]:(r.date=t[0],n=t[1],br.timeZoneDelimiter.test(r.date)&&(r.date=e.split(br.timeZoneDelimiter)[0],n=e.substr(r.date.length,e.length))),n){const s=br.timezone.exec(n);s?(r.time=n.replace(s[1],""),r.timezone=s[1]):r.time=n}return r}function jd(e,r){const t=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+r)+"})|(\\d{2}|[+-]\\d{"+(2+r)+"})$)"),n=e.match(t);if(!n)return{year:NaN,restDateString:""};const s=n[1]?parseInt(n[1]):null,a=n[2]?parseInt(n[2]):null;return{year:a===null?s:a*100,restDateString:e.slice((n[1]||n[2]).length)}}function Md(e,r){if(r===null)return new Date(NaN);const t=e.match(Od);if(!t)return new Date(NaN);const n=!!t[4],s=qt(t[1]),a=qt(t[2])-1,o=qt(t[3]),i=qt(t[4]),c=qt(t[5])-1;if(n)return Hd(r,i,c)?Ld(r,i,c):new Date(NaN);{const f=new Date(0);return!Fd(r,a,o)||!Yd(r,s)?new Date(NaN):(f.setUTCFullYear(r,a,Math.max(s,o)),f)}}function qt(e){return e?parseInt(e):1}function Rd(e){const r=e.match(_d);if(!r)return NaN;const t=un(r[1]),n=un(r[2]),s=un(r[3]);return Wd(t,n,s)?t*nn+n*rn+s*1e3:NaN}function un(e){return e&&parseFloat(e.replace(",","."))||0}function Ad(e){if(e==="Z")return 0;const r=e.match(Nd);if(!r)return 0;const t=r[1]==="+"?-1:1,n=parseInt(r[2]),s=r[3]&&parseInt(r[3])||0;return Vd(n,s)?t*(n*nn+s*rn):NaN}function Ld(e,r,t){const n=new Date(0);n.setUTCFullYear(e,0,4);const s=n.getUTCDay()||7,a=(r-1)*7+t+1-s;return n.setUTCDate(n.getUTCDate()+a),n}const $d=[31,null,31,30,31,30,31,31,30,31,30,31];function Xs(e){return e%400===0||e%4===0&&e%100!==0}function Fd(e,r,t){return r>=0&&r<=11&&t>=1&&t<=($d[r]||(Xs(e)?29:28))}function Yd(e,r){return r>=1&&r<=(Xs(e)?366:365)}function Hd(e,r,t){return r>=1&&r<=53&&t>=0&&t<=6}function Wd(e,r,t){return e===24?r===0&&t===0:t>=0&&t<60&&r>=0&&r<60&&e>=0&&e<25}function Vd(e,r){return r>=0&&r<=59}function Bd(e,r){const t=le(e),n=t.getFullYear(),s=t.getDate(),a=ye(e,0);a.setFullYear(n,r,15),a.setHours(0,0,0,0);const o=qs(a);return t.setMonth(r,Math.min(s,o)),t}function zd(e,r){const t=le(e);return isNaN(+t)?ye(e,NaN):(t.setFullYear(r),t)}function Js(e,r){return ct(e,-r)}function ea(e,r){return pr(e,-r)}var Ie=(e=>(e[e.Regular=24]="Regular",e[e.Small=20]="Small",e))(Ie||{});const ta=({className:e})=>l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5m-9-6h.008v.008H12v-.008ZM12 15h.008v.008H12V15Zm0 2.25h.008v.008H12v-.008ZM9.75 15h.008v.008H9.75V15Zm0 2.25h.008v.008H9.75v-.008ZM7.5 15h.008v.008H7.5V15Zm0 2.25h.008v.008H7.5v-.008Zm6.75-4.5h.008v.008h-.008v-.008Zm0 2.25h.008v.008h-.008V15Zm0 2.25h.008v.008h-.008v-.008Zm2.25-4.5h.008v.008H16.5v-.008Zm0 2.25h.008v.008H16.5V15Z"})}),Ud=({className:e})=>{const r=ie("bsc-h-6 bsc-w-6",e);return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:r,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})})},qd=({className:e})=>{const r=ie("bsc-h-6 bsc-w-6",e);return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:r,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5 8.25 12l7.5-7.5"})})},Gd=({className:e})=>{const r=ie("bsc-h-6 bsc-w-6",e);return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:r,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"})})},Zd=({className:e})=>{const r=ie("bsc-h-6 bsc-w-6",e);return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:r,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"})})},Qd=({className:e})=>l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})}),Le=({icon:e,size:r=Ie.Regular,onClick:t,className:n})=>{const s=d.useRef({calendar:ta,chevronDown:Ud,chevronLeft:qd,chevronRight:Gd,chevronUp:Zd,close:Qd}),a=d.useMemo(()=>s.current[e]||ta,[e]),o=ie({"bsc-h-[24px] bsc-w-[24px]":r===Ie.Regular,"bsc-h-[20px] bsc-w-[20px]":r===Ie.Small},n);return l.jsx("div",{onClick:t,children:l.jsx(a,{className:o})})},ut=({template:e,props:r,children:t})=>e(r,t);function Kd(e,r){if(r===e)return!1;const t=Object.values(r),n=Object.values(e);if(t.length!==n.length||t.some((a,o)=>a!==n[o]))return!0;const s=Object.keys(e);return Object.keys(r).some((a,o)=>a!==s[o])}function Xd(e,r){return e.matches[r]=!1,e.mediaQueries[r]={},e}function ra(e){const r=Object.keys(e);return typeof window>"u"?r.reduce(Xd,{mediaQueries:{},matches:{}}):r.reduce((t,n)=>{const s=window.matchMedia(e[n]);return t.mediaQueries[n]=s,t.matches[n]=s.matches,t},{mediaQueries:{},matches:{}})}function Jd(e,r){function t(n,s){return n[s]=e.mediaQueries[s].matches,n}switch(r.type){case"updateMatches":return{matches:Object.keys(e.mediaQueries).reduce(t,{}),mediaQueries:e.mediaQueries};case"setQueries":return ra(r.queries)}}function eh(e){const r=Rt.useRef(e),[t,n]=Rt.useReducer(Jd,e,ra);Rt.useEffect(()=>{Kd(e,r.current)&&(n({type:"setQueries",queries:e}),r.current=e)},[e]);function s(){return n({type:"updateMatches"})}function a(c){const f=s;return typeof c.addListener<"u"?c.addListener(f):c.addEventListener("change",f),f}Rt.useEffect(()=>{const c=Object.values(t.mediaQueries),f=c.map(a);function h(p,y){typeof p.addListener<"u"?p.removeListener(f[y]):p.removeEventListener("change",f[y])}return()=>{c.forEach(h)}},[t.mediaQueries]);const{matches:o}=t,i=Rt.useMemo(()=>Object.values(o),[o]);return{matches:o,matchesAny:i.some(Boolean),matchesAll:i.length>0&&i.every(Boolean)}}function gr(e){return eh(th(e)).matchesAll}const ln={};function th(e){return ln[e]===void 0&&(ln[e]={default:e}),ln[e]}const fn=({mobileQuery:e="screen and (max-device-width: 40rem)",tabletQuery:r="screen and (min-device-width: 40.01rem) and (max-device-width: 63.9375rem)",desktopQuery:t="screen and (min-device-width: 64rem)",mobileMarkup:n,aboveMobileMarkup:s,tabletMarkup:a,desktopMarkup:o})=>{const i=gr(e),c=gr(r),f=gr(t);return(()=>i&&n?n:!i&&s?s:c&&a?a:f&&o?o:(console.error("Invalid media settings"),null))()};function na(e,r,t){const n=a=>{const o=a.target,i=e.style.display!=="hidden";e&&i&&!Ja(e,o)&&!s(t,o)&&r(!1),r(!0)},s=(a,o)=>{if(!a)return!1;for(let i=0,c=a.length;i<c;i++)if(a[i].isSameNode(o)||a[i].contains(o))return!0;return!1};return document.addEventListener("mousedown",n),n}function sa(e){document.removeEventListener("mousedown",e)}function rh(e,r){if(e==null)return{};var t={},n=Object.keys(e),s,a;for(a=0;a<n.length;a++)s=n[a],!(r.indexOf(s)>=0)&&(t[s]=e[s]);return t}function dn(e,r){return dn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},dn(e,r)}function nh(e,r){e.prototype=Object.create(r.prototype),e.prototype.constructor=e,dn(e,r)}var hn={exports:{}},yr={exports:{}},he={};/** @license React v16.13.1
31
+ */(function(e){(function(){var r={}.hasOwnProperty;function t(){for(var a="",o=0;o<arguments.length;o++){var i=arguments[o];i&&(a=s(a,n(i)))}return a}function n(a){if(typeof a=="string"||typeof a=="number")return a;if(typeof a!="object")return"";if(Array.isArray(a))return t.apply(null,a);if(a.toString!==Object.prototype.toString&&!a.toString.toString().includes("[native code]"))return a.toString();var o="";for(var i in a)r.call(a,i)&&a[i]&&(o=s(o,i));return o}function s(a,o){return o?a?a+" "+o:a+o:a}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(Mn);var Ha=Mn.exports;const ue=Fr(Ha);var At=(e=>(e[e.Focus=0]="Focus",e[e.FocusWithin=1]="FocusWithin",e))(At||{});const nr=(e=1)=>d.useMemo(()=>ue("dark:bsc-ring-mono-light-2 dark:bsc-ring-offset-mono-dark-1",{"focus-within:bsc-ring focus-within:bsc-ring-offset-2 focus-within:bsc-ring-opacity-50":e===1,"focus:bsc-ring focus:bsc-ring-offset-2 focus:bsc-ring-opacity-50":e===0}),[e]),Wa=(e,r)=>{const t=d.useRef(null),{buttonType:n,buttonStyle:s="flat",type:a="button",disabled:o=!1,form:i,fullWidth:c=!1,onClick:f,className:h,children:p}=e,y=()=>{f==null||f()},x=()=>{var _;(_=t.current)==null||_.click()};d.useImperativeHandle(r,()=>({click:x}));const w=nr(At.Focus),O=ue("bc-button max-sm:bsc-p-4 md:bsc-p-2 dark:bsc-bg-mono-light-1 dark:hover:bsc-bg-mono-light-2 dark:bsc-text-mono-dark-1",w,{"bsc-w-full":c,"bc-disabled bsc-bg-gray-3 bsc-text-gray-2 bsc-pointer-events-none":o,"bsc-bg-primary-1 bsc-text-white hover:bsc-bg-primary-2 focus:bsc-ring-primary-1":n==="primary","bsc-bg-primary-2 bsc-text-white hover:bsc-bg-primary-3 focus:bsc-ring-primary-2":n==="secondary","bsc-bg-info bsc-text-white focus:bsc-ring-info":n==="info","bsc-bg-success bsc-text-white focus:bsc-ring-success":n==="success","bsc-bg-warning bsc-text-white focus:bsc-ring-warning":n==="warning","bsc-bg-error bsc-text-white focus:bsc-ring-error":n==="error","bsc-rounded-md":s==="curved","bsc-rounded-full !bsc-px-4":s==="round"},h);return l.jsx("button",{ref:t,type:a,onClick:y,disabled:o,form:i,className:O,children:p})},We=d.forwardRef(Wa),Hr=e=>{const[r,t]=d.useState(!0),n=jn();return d.useEffect(()=>{e!==void 0?t(e):n&&n.useAnimations!==void 0&&t(n.useAnimations)},[n,e]),r},Rn=d.createContext(void 0),An=()=>d.useContext(Rn),Va=({children:e})=>{const r=d.useId(),t=d.useMemo(()=>({sharedId:r}),[r]);return l.jsx(Rn.Provider,{value:t,children:e})},sr=e=>e==null?!1:typeof e=="object",Ln=e=>e instanceof Date,$n=e=>typeof e=="function",Fn=e=>{const r=typeof e;return r==="string"||r==="number"||r==="boolean"||r==="bigint"},Wr=e=>{if(!sr(e))return e;const r={},t=Object.keys(e);for(let n=0,s=t.length;n<s;n++){const a=t[n],o=e[a];Fn(o)||$n(o)?r[a]=o:Ln(o)?r[a]=new Date(o.getTime()):Array.isArray(o)?r[a]=Vr(o):sr(o)&&(r[a]=Wr(o))}return r},Vr=e=>{let r=e.length;const t=new Array(r);for(;r--!==0;){const n=e[r];Fn(n)||$n(n)?t[r]=n:Ln(n)?t[r]=new Date(n.getTime()):sr(n)&&!Array.isArray(n)?t[r]=Wr(n):Array.isArray(n)?t[r]=Vr(n):t[r]=n}return t},Ba=e=>sr(e)?Array.isArray(e)?Vr(e):Wr(e):e;function za(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ua=function e(r,t){if(r===t)return!0;if(r&&t&&typeof r=="object"&&typeof t=="object"){if(r.constructor!==t.constructor)return!1;var n,s,a;if(Array.isArray(r)){if(n=r.length,n!=t.length)return!1;for(s=n;s--!==0;)if(!e(r[s],t[s]))return!1;return!0}if(r.constructor===RegExp)return r.source===t.source&&r.flags===t.flags;if(r.valueOf!==Object.prototype.valueOf)return r.valueOf()===t.valueOf();if(r.toString!==Object.prototype.toString)return r.toString()===t.toString();if(a=Object.keys(r),n=a.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,a[s]))return!1;for(s=n;s--!==0;){var o=a[s];if(!e(r[o],t[o]))return!1}return!0}return r!==r&&t!==t};const Yn=za(Ua);function qa(e,r){for(let t=e.length;t--!==0;)if(!Yn(e[t],r[t]))return!0;return!1}const ar=(e,r)=>{const t=d.useRef([]),n=t.current.length>0&&t.current[0]&&qa(t.current[0],r);return(t.current.length===0||n)&&(t.current=[Ba(r),e()]),t.current[1]},Hn=e=>{const r=d.useRef();let t=!1;r.current!==void 0&&(t=!Yn(r.current,e));const n={changed:t,previousValue:r.current};return r.current=e,n},Ga=e=>typeof e=="function",Za=e=>{const[r,t]=d.useState({value:e,initial:!0}),n=d.useRef(e);return[r,s=>{if(!Ga(s))t({value:s,initial:!1});else{const a=s(n.current);n.current=a,t({value:a,initial:!1})}}]},Qa=e=>{const[r,t]=Za(e),n=d.useRef({value:e,initial:!0});return n.current!==r&&(n.current=r),[r,t,n]},Ka=e=>{const[r,t]=d.useState(e),n=d.useRef(e);return n.current!==r&&(n.current=r),[r,t,n]};function Wn(){return window.navigator.languages?window.navigator.languages[0]:window.navigator.language}function Xa(e,r,t){const n=[];for(let s=e;s<=r;s++)n.push(t?t(s):s);return n}function Ja(e,r){const t=e.target;return t?!r.isSameNode(t)&&!r.contains(t):!1}function eo(e,r){return e.isSameNode(r)||e.contains(r)}function to(e,r){const t=Object.entries(r),n=getComputedStyle(e);for(let s=0,a=t.length;s<a;s++){const[o,i]=t[s];if(typeof i=="string"&&i.indexOf(",")>-1){if(!i.split(",").map(f=>f.trim()).includes(n[o]))return!1}else if(n[o]!==i)return!1}return!0}function ro(e,r){const t=Object.entries(r),n=getComputedStyle(e);for(let s=0,a=t.length;s<a;s++){const[o,i]=t[s];if(typeof i=="string"&&i.indexOf(",")>-1){if(i.split(",").map(f=>f.trim()).includes(n[o]))return!0}else if(n[o]===i)return!0}return!1}function Vn(e,r,t=!1,n){if(t&&to(e,r)){if(!n||(n==null?void 0:n(e))===!0)return e}else if(!t&&ro(e,r)&&(!n||(n==null?void 0:n(e))===!0))return e;return e.parentElement?Vn(e.parentElement,r,t,n):e}function Bn(e,r){const t=Array.from(document.querySelectorAll("body *")),n=[];for(let s=0,a=t.length;s<a;s++){const o=getComputedStyle(t[s]);o[e]&&r(o[e])&&n.push(o[e])}return n}function dp(e){return e}function no(e){const r=document.documentElement;Object.keys(e).forEach(t=>{r.style.setProperty(t,e[t])})}function so(e){return{"--theme-bsc-primary-1":e.primary1,"--theme-bsc-primary-2":e.primary2,"--theme-bsc-primary-3":e.primary3,"--theme-bsc-primary-4":e.primary4,"--theme-bsc-primary-5":e.primary5,"--theme-bsc-gray-1":e.gray1||"#303030","--theme-bsc-gray-2":e.gray2||"#5f5f5f","--theme-bsc-gray-3":e.gray3||"#8f8f8f","--theme-bsc-gray-4":e.gray4||"#bebebe","--theme-bsc-gray-5":e.gray5||"#eee","--theme-bsc-black":e.black||"#000","--theme-bsc-white":e.white||"#fff","--theme-bsc-mono-dark-1":e.monoDark1||"#222","--theme-bsc-mono-dark-2":e.monoDark2||"#3c3c3c","--theme-bsc-mono-dark-3":e.monoDark3||"#4e4e4e","--theme-bsc-mono-light-1":e.monoLight1||"#fefefe","--theme-bsc-mono-light-2":e.monoLight2||"#eee","--theme-bsc-mono-light-3":e.monoLight3||"#ccc","--theme-bsc-info":e.info||"#2e7ff8","--theme-bsc-success":e.success||"#53ae0c","--theme-bsc-warning":e.warning||"#ff6914","--theme-bsc-error":e.error||"#f01616"}}const ao=d.createContext(void 0),oo=()=>d.useContext(ao),io=({id:e,name:r,value:t,type:n,checked:s,readOnly:a,className:o})=>l.jsx("input",{id:e,name:r,value:t,type:n,checked:s,readOnly:a,disabled:a,className:o}),co=({type:e,props:r,renderProps:t,signalName:n,onSignalRetrieved:s,children:a,className:o})=>{const i=oo(),{id:c,name:f}=ar(()=>{const h=r;return{id:h.id,name:h.name}},[r]);return d.useEffect(()=>{i&&n&&i[n]&&s&&s(i[n])},[i]),l.jsxs(l.Fragment,{children:[c&&f&&e&&l.jsx(io,{id:c,name:f,type:e,className:o,...r}),a&&a(t)]})},uo=(e,r)=>{const{name:t,value:n,checked:s=!1,partial:a=!1,onChange:o,children:i,labelStyles:c,className:f}=e,h=An(),p=d.useId(),[y,x,w]=Qa({checked:!1,partial:!1}),O=Hn(s),_=Hn(a),S={id:(h==null?void 0:h.sharedId)||e.id||p,...e,...y.value};d.useEffect(()=>{if(y.initial)x({checked:a?!0:s,partial:a});else{const b=O.changed?s:y.value.checked,A=_.changed?a:y.value.partial;x({checked:A?!0:b,partial:A})}},[s,a]);const R=b=>{var k;const A=((k=w.current)==null?void 0:k.value.partial)===!0?!0:b.target.checked;x({checked:A,partial:!1}),o==null||o({originalEvent:b,name:t||b.target.name,value:n,checked:A})},z=b=>{var k;const A={checked:b?!0:((k=w.current)==null?void 0:k.value.checked)||!1,partial:b};x(A)},F=b=>{x({checked:b,partial:!1})};return d.useImperativeHandle(r,()=>({setPartiallyChecked:z,setChecked:F})),l.jsx("label",{className:c,onChange:b=>R(b),children:l.jsx(co,{id:p,name:t,type:"checkbox",props:S,renderProps:y.value,className:f,children:i})})},lo=d.memo(d.forwardRef(uo)),fo=({label:e,htmlFor:r,className:t})=>{const n=An(),s=d.useMemo(()=>(n==null?void 0:n.sharedId)||r,[n==null?void 0:n.sharedId,r]);return l.jsx("label",{htmlFor:s,className:t,children:e})},Ze=({label:e,htmlFor:r,readOnly:t=!1,className:n})=>{const s=ue("bc-label",{"bsc-text-black dark:bsc-text-mono-light-1":!t,"bc-read-only bsc-text-gray-4 dark:bsc-text-mono-light-3 bsc-pointer-events-none":t},n);return l.jsx(fo,{label:e,htmlFor:r,className:s})},ho=(e,r)=>{const{name:t,label:n,value:s,readOnly:a=!1,checked:o=!1,partial:i=!1,labelLocation:c=Ae.Right,className:f,useAnimation:h,onChange:p}=e,y=Hr(h),x=ue("bc-checkbox-wrapper bsc-flex bsc-items-center",{"bc-read-only bsc-pointer-events-none bsc-text-gray-2 dark:bsc-text-mono-light-3":a},f),w=ue("bc-checkbox-label bsc-cursor-pointer",{"bsc-ml-2":c===Ae.Right,"bsc-mr-2":c===Ae.Left}),O=nr(At.FocusWithin),_=ue("bc-checkbox-outer bsc-relative bsc-rounded *:bsc-block *:bsc-size-[21px]",{"bsc-checkbox-animate":!a&&y,"bc-read-only bsc-checkbox-no-animate":a||!a&&!y},O),S=ue("bc-checkbox-inner bsc-relative bsc-m-0 bsc-cursor-pointer bsc-appearance-none bsc-rounded bsc-border-none bsc-bg-mono-light-1 bsc-p-0 bsc-outline-none dark:bsc-bg-mono-dark-1 dark:checked:bsc-bg-mono-light-1",{"[transition:box-shadow_0.3s]":y,"bsc-checkbox":!a,"bc-read-only bsc-checkbox-read-only":a}),R=ue("bc-checkbox-svg bsc-pointer-events-none bsc-absolute bsc-left-0 bsc-top-0 bsc-stroke-mono-light-1 bsc-stroke-2 [stroke-linecap:round] [stroke-linejoin:round] [transform:scale(0)_translateZ(0)] dark:bsc-stroke-mono-dark-3",{"bsc-fill-primary-1 dark:bsc-fill-mono-light-1":!a,"bc-read-only bsc-fill-primary-4 dark:bsc-fill-mono-light-3":a});return l.jsx(Va,{children:l.jsxs("div",{className:x,children:[n&&c===Ae.Left&&l.jsx(Ze,{label:n,readOnly:a,className:w}),l.jsx(lo,{ref:r,name:t,value:s,checked:o,partial:i,readOnly:a,className:S,labelStyles:_,onChange:p,children:({partial:z})=>l.jsx("svg",{viewBox:"0 0 21 21",className:R,children:z?l.jsx("polyline",{points:"6 10.5 16 10.5"}):l.jsx("polyline",{points:"5 10.75 8.5 14.25 16 6"})})}),n&&c===Ae.Right&&l.jsx(Ze,{label:n,readOnly:a,className:w})]})})},zn=d.memo(d.forwardRef(ho)),po=({name:e,label:r,value:t,data:n,textField:s,valueField:a,readOnly:o=!1,orientation:i=Ie.Vertical,className:c,onChange:f})=>{const[h,p]=d.useState([]),y=ar(()=>n,[n]);d.useEffect(()=>{p(t??[])},[t]);const x=R=>{const{value:z,checked:F}=R;let b;F?b=[...h,z]:b=h.filter(A=>A!==z),p(b),f==null||f({name:e,value:b})},w=(R,z)=>l.jsx(zn,{name:e,label:R[s],value:R[a],checked:h.some(F=>F===R[a]),readOnly:o,onChange:F=>F&&x(F),className:"bsc-mr-3"},`${e}_checkbox_${z}`),O=ue("bsc-flex bsc-flex-col bsc-gap-1",c),_=ue("bsc-flex bsc-gap-1",{"bsc-flex-col":i===Ie.Vertical}),S=R=>l.jsx("div",{className:_,children:R.map(w)});return l.jsxs("div",{className:O,children:[r&&l.jsx(Ze,{label:r,readOnly:o}),y&&S(y)]})},mo=d.memo(po);var bo=typeof global=="object"&&global&&global.Object===Object&&global;const Un=bo;var go=typeof self=="object"&&self&&self.Object===Object&&self,yo=Un||go||Function("return this")();const Ye=yo;var vo=Ye.Symbol;const bt=vo;var qn=Object.prototype,xo=qn.hasOwnProperty,wo=qn.toString,Lt=bt?bt.toStringTag:void 0;function To(e){var r=xo.call(e,Lt),t=e[Lt];try{e[Lt]=void 0;var n=!0}catch{}var s=wo.call(e);return n&&(r?e[Lt]=t:delete e[Lt]),s}var So=Object.prototype,Po=So.toString;function Eo(e){return Po.call(e)}var ko="[object Null]",Co="[object Undefined]",Gn=bt?bt.toStringTag:void 0;function gt(e){return e==null?e===void 0?Co:ko:Gn&&Gn in Object(e)?To(e):Eo(e)}function yt(e){return e!=null&&typeof e=="object"}var Do="[object Symbol]";function Oo(e){return typeof e=="symbol"||yt(e)&&gt(e)==Do}var _o=Array.isArray;const Br=_o;var No=/\s/;function Io(e){for(var r=e.length;r--&&No.test(e.charAt(r)););return r}var jo=/^\s+/;function Mo(e){return e&&e.slice(0,Io(e)+1).replace(jo,"")}function Qe(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}var Zn=0/0,Ro=/^[-+]0x[0-9a-f]+$/i,Ao=/^0b[01]+$/i,Lo=/^0o[0-7]+$/i,$o=parseInt;function Qn(e){if(typeof e=="number")return e;if(Oo(e))return Zn;if(Qe(e)){var r=typeof e.valueOf=="function"?e.valueOf():e;e=Qe(r)?r+"":r}if(typeof e!="string")return e===0?e:+e;e=Mo(e);var t=Ao.test(e);return t||Lo.test(e)?$o(e.slice(2),t?2:8):Ro.test(e)?Zn:+e}var Fo="[object AsyncFunction]",Yo="[object Function]",Ho="[object GeneratorFunction]",Wo="[object Proxy]";function Kn(e){if(!Qe(e))return!1;var r=gt(e);return r==Yo||r==Ho||r==Fo||r==Wo}var Vo=Ye["__core-js_shared__"];const zr=Vo;var Xn=function(){var e=/[^.]+$/.exec(zr&&zr.keys&&zr.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Bo(e){return!!Xn&&Xn in e}var zo=Function.prototype,Uo=zo.toString;function at(e){if(e!=null){try{return Uo.call(e)}catch{}try{return e+""}catch{}}return""}var qo=/[\\^$.*+?()[\]{}|]/g,Go=/^\[object .+?Constructor\]$/,Zo=Function.prototype,Qo=Object.prototype,Ko=Zo.toString,Xo=Qo.hasOwnProperty,Jo=RegExp("^"+Ko.call(Xo).replace(qo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ei(e){if(!Qe(e)||Bo(e))return!1;var r=Kn(e)?Jo:Go;return r.test(at(e))}function ti(e,r){return e==null?void 0:e[r]}function ot(e,r){var t=ti(e,r);return ei(t)?t:void 0}var ri=ot(Ye,"WeakMap");const Ur=ri;var Jn=Object.create,ni=function(){function e(){}return function(r){if(!Qe(r))return{};if(Jn)return Jn(r);e.prototype=r;var t=new e;return e.prototype=void 0,t}}();const si=ni;function ai(e,r){var t=-1,n=e.length;for(r||(r=Array(n));++t<n;)r[t]=e[t];return r}var oi=function(){try{var e=ot(Object,"defineProperty");return e({},"",{}),e}catch{}}();const es=oi;function ii(e,r){for(var t=-1,n=e==null?0:e.length;++t<n&&r(e[t],t,e)!==!1;);return e}var ci=9007199254740991,ui=/^(?:0|[1-9]\d*)$/;function li(e,r){var t=typeof e;return r=r??ci,!!r&&(t=="number"||t!="symbol"&&ui.test(e))&&e>-1&&e%1==0&&e<r}function ts(e,r,t){r=="__proto__"&&es?es(e,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[r]=t}function rs(e,r){return e===r||e!==e&&r!==r}var fi=Object.prototype,di=fi.hasOwnProperty;function ns(e,r,t){var n=e[r];(!(di.call(e,r)&&rs(n,t))||t===void 0&&!(r in e))&&ts(e,r,t)}function or(e,r,t,n){var s=!t;t||(t={});for(var a=-1,o=r.length;++a<o;){var i=r[a],c=n?n(t[i],e[i],i,t,e):void 0;c===void 0&&(c=e[i]),s?ts(t,i,c):ns(t,i,c)}return t}var hi=9007199254740991;function ss(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=hi}function as(e){return e!=null&&ss(e.length)&&!Kn(e)}var pi=Object.prototype;function qr(e){var r=e&&e.constructor,t=typeof r=="function"&&r.prototype||pi;return e===t}function mi(e,r){for(var t=-1,n=Array(e);++t<e;)n[t]=r(t);return n}var bi="[object Arguments]";function os(e){return yt(e)&&gt(e)==bi}var is=Object.prototype,gi=is.hasOwnProperty,yi=is.propertyIsEnumerable,vi=os(function(){return arguments}())?os:function(e){return yt(e)&&gi.call(e,"callee")&&!yi.call(e,"callee")};const xi=vi;function wi(){return!1}var cs=typeof K=="object"&&K&&!K.nodeType&&K,us=cs&&typeof module=="object"&&module&&!module.nodeType&&module,Ti=us&&us.exports===cs,ls=Ti?Ye.Buffer:void 0,Si=ls?ls.isBuffer:void 0,Pi=Si||wi;const fs=Pi;var Ei="[object Arguments]",ki="[object Array]",Ci="[object Boolean]",Di="[object Date]",Oi="[object Error]",_i="[object Function]",Ni="[object Map]",Ii="[object Number]",ji="[object Object]",Mi="[object RegExp]",Ri="[object Set]",Ai="[object String]",Li="[object WeakMap]",$i="[object ArrayBuffer]",Fi="[object DataView]",Yi="[object Float32Array]",Hi="[object Float64Array]",Wi="[object Int8Array]",Vi="[object Int16Array]",Bi="[object Int32Array]",zi="[object Uint8Array]",Ui="[object Uint8ClampedArray]",qi="[object Uint16Array]",Gi="[object Uint32Array]",xe={};xe[Yi]=xe[Hi]=xe[Wi]=xe[Vi]=xe[Bi]=xe[zi]=xe[Ui]=xe[qi]=xe[Gi]=!0,xe[Ei]=xe[ki]=xe[$i]=xe[Ci]=xe[Fi]=xe[Di]=xe[Oi]=xe[_i]=xe[Ni]=xe[Ii]=xe[ji]=xe[Mi]=xe[Ri]=xe[Ai]=xe[Li]=!1;function Zi(e){return yt(e)&&ss(e.length)&&!!xe[gt(e)]}function Gr(e){return function(r){return e(r)}}var ds=typeof K=="object"&&K&&!K.nodeType&&K,$t=ds&&typeof module=="object"&&module&&!module.nodeType&&module,Qi=$t&&$t.exports===ds,Zr=Qi&&Un.process,Ki=function(){try{var e=$t&&$t.require&&$t.require("util").types;return e||Zr&&Zr.binding&&Zr.binding("util")}catch{}}();const vt=Ki;var hs=vt&&vt.isTypedArray,Xi=hs?Gr(hs):Zi;const Ji=Xi;var ec=Object.prototype,tc=ec.hasOwnProperty;function ps(e,r){var t=Br(e),n=!t&&xi(e),s=!t&&!n&&fs(e),a=!t&&!n&&!s&&Ji(e),o=t||n||s||a,i=o?mi(e.length,String):[],c=i.length;for(var f in e)(r||tc.call(e,f))&&!(o&&(f=="length"||s&&(f=="offset"||f=="parent")||a&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||li(f,c)))&&i.push(f);return i}function ms(e,r){return function(t){return e(r(t))}}var rc=ms(Object.keys,Object);const nc=rc;var sc=Object.prototype,ac=sc.hasOwnProperty;function oc(e){if(!qr(e))return nc(e);var r=[];for(var t in Object(e))ac.call(e,t)&&t!="constructor"&&r.push(t);return r}function Qr(e){return as(e)?ps(e):oc(e)}function ic(e){var r=[];if(e!=null)for(var t in Object(e))r.push(t);return r}var cc=Object.prototype,uc=cc.hasOwnProperty;function lc(e){if(!Qe(e))return ic(e);var r=qr(e),t=[];for(var n in e)n=="constructor"&&(r||!uc.call(e,n))||t.push(n);return t}function Kr(e){return as(e)?ps(e,!0):lc(e)}var fc=ot(Object,"create");const Ft=fc;function dc(){this.__data__=Ft?Ft(null):{},this.size=0}function hc(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}var pc="__lodash_hash_undefined__",mc=Object.prototype,bc=mc.hasOwnProperty;function gc(e){var r=this.__data__;if(Ft){var t=r[e];return t===pc?void 0:t}return bc.call(r,e)?r[e]:void 0}var yc=Object.prototype,vc=yc.hasOwnProperty;function xc(e){var r=this.__data__;return Ft?r[e]!==void 0:vc.call(r,e)}var wc="__lodash_hash_undefined__";function Tc(e,r){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=Ft&&r===void 0?wc:r,this}function it(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}it.prototype.clear=dc,it.prototype.delete=hc,it.prototype.get=gc,it.prototype.has=xc,it.prototype.set=Tc;function Sc(){this.__data__=[],this.size=0}function ir(e,r){for(var t=e.length;t--;)if(rs(e[t][0],r))return t;return-1}var Pc=Array.prototype,Ec=Pc.splice;function kc(e){var r=this.__data__,t=ir(r,e);if(t<0)return!1;var n=r.length-1;return t==n?r.pop():Ec.call(r,t,1),--this.size,!0}function Cc(e){var r=this.__data__,t=ir(r,e);return t<0?void 0:r[t][1]}function Dc(e){return ir(this.__data__,e)>-1}function Oc(e,r){var t=this.__data__,n=ir(t,e);return n<0?(++this.size,t.push([e,r])):t[n][1]=r,this}function Ke(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}Ke.prototype.clear=Sc,Ke.prototype.delete=kc,Ke.prototype.get=Cc,Ke.prototype.has=Dc,Ke.prototype.set=Oc;var _c=ot(Ye,"Map");const Yt=_c;function Nc(){this.size=0,this.__data__={hash:new it,map:new(Yt||Ke),string:new it}}function Ic(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}function cr(e,r){var t=e.__data__;return Ic(r)?t[typeof r=="string"?"string":"hash"]:t.map}function jc(e){var r=cr(this,e).delete(e);return this.size-=r?1:0,r}function Mc(e){return cr(this,e).get(e)}function Rc(e){return cr(this,e).has(e)}function Ac(e,r){var t=cr(this,e),n=t.size;return t.set(e,r),this.size+=t.size==n?0:1,this}function xt(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}xt.prototype.clear=Nc,xt.prototype.delete=jc,xt.prototype.get=Mc,xt.prototype.has=Rc,xt.prototype.set=Ac;function bs(e,r){for(var t=-1,n=r.length,s=e.length;++t<n;)e[s+t]=r[t];return e}var Lc=ms(Object.getPrototypeOf,Object);const gs=Lc;function $c(){this.__data__=new Ke,this.size=0}function Fc(e){var r=this.__data__,t=r.delete(e);return this.size=r.size,t}function Yc(e){return this.__data__.get(e)}function Hc(e){return this.__data__.has(e)}var Wc=200;function Vc(e,r){var t=this.__data__;if(t instanceof Ke){var n=t.__data__;if(!Yt||n.length<Wc-1)return n.push([e,r]),this.size=++t.size,this;t=this.__data__=new xt(n)}return t.set(e,r),this.size=t.size,this}function wt(e){var r=this.__data__=new Ke(e);this.size=r.size}wt.prototype.clear=$c,wt.prototype.delete=Fc,wt.prototype.get=Yc,wt.prototype.has=Hc,wt.prototype.set=Vc;function Bc(e,r){return e&&or(r,Qr(r),e)}function zc(e,r){return e&&or(r,Kr(r),e)}var ys=typeof K=="object"&&K&&!K.nodeType&&K,vs=ys&&typeof module=="object"&&module&&!module.nodeType&&module,Uc=vs&&vs.exports===ys,xs=Uc?Ye.Buffer:void 0,ws=xs?xs.allocUnsafe:void 0;function qc(e,r){if(r)return e.slice();var t=e.length,n=ws?ws(t):new e.constructor(t);return e.copy(n),n}function Gc(e,r){for(var t=-1,n=e==null?0:e.length,s=0,a=[];++t<n;){var o=e[t];r(o,t,e)&&(a[s++]=o)}return a}function Ts(){return[]}var Zc=Object.prototype,Qc=Zc.propertyIsEnumerable,Ss=Object.getOwnPropertySymbols,Kc=Ss?function(e){return e==null?[]:(e=Object(e),Gc(Ss(e),function(r){return Qc.call(e,r)}))}:Ts;const Xr=Kc;function Xc(e,r){return or(e,Xr(e),r)}var Jc=Object.getOwnPropertySymbols,eu=Jc?function(e){for(var r=[];e;)bs(r,Xr(e)),e=gs(e);return r}:Ts;const Ps=eu;function tu(e,r){return or(e,Ps(e),r)}function Es(e,r,t){var n=r(e);return Br(e)?n:bs(n,t(e))}function ru(e){return Es(e,Qr,Xr)}function nu(e){return Es(e,Kr,Ps)}var su=ot(Ye,"DataView");const Jr=su;var au=ot(Ye,"Promise");const en=au;var ou=ot(Ye,"Set");const tn=ou;var ks="[object Map]",iu="[object Object]",Cs="[object Promise]",Ds="[object Set]",Os="[object WeakMap]",_s="[object DataView]",cu=at(Jr),uu=at(Yt),lu=at(en),fu=at(tn),du=at(Ur),ct=gt;(Jr&&ct(new Jr(new ArrayBuffer(1)))!=_s||Yt&&ct(new Yt)!=ks||en&&ct(en.resolve())!=Cs||tn&&ct(new tn)!=Ds||Ur&&ct(new Ur)!=Os)&&(ct=function(e){var r=gt(e),t=r==iu?e.constructor:void 0,n=t?at(t):"";if(n)switch(n){case cu:return _s;case uu:return ks;case lu:return Cs;case fu:return Ds;case du:return Os}return r});const rn=ct;var hu=Object.prototype,pu=hu.hasOwnProperty;function mu(e){var r=e.length,t=new e.constructor(r);return r&&typeof e[0]=="string"&&pu.call(e,"index")&&(t.index=e.index,t.input=e.input),t}var bu=Ye.Uint8Array;const Ns=bu;function nn(e){var r=new e.constructor(e.byteLength);return new Ns(r).set(new Ns(e)),r}function gu(e,r){var t=r?nn(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.byteLength)}var yu=/\w*$/;function vu(e){var r=new e.constructor(e.source,yu.exec(e));return r.lastIndex=e.lastIndex,r}var Is=bt?bt.prototype:void 0,js=Is?Is.valueOf:void 0;function xu(e){return js?Object(js.call(e)):{}}function wu(e,r){var t=r?nn(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}var Tu="[object Boolean]",Su="[object Date]",Pu="[object Map]",Eu="[object Number]",ku="[object RegExp]",Cu="[object Set]",Du="[object String]",Ou="[object Symbol]",_u="[object ArrayBuffer]",Nu="[object DataView]",Iu="[object Float32Array]",ju="[object Float64Array]",Mu="[object Int8Array]",Ru="[object Int16Array]",Au="[object Int32Array]",Lu="[object Uint8Array]",$u="[object Uint8ClampedArray]",Fu="[object Uint16Array]",Yu="[object Uint32Array]";function Hu(e,r,t){var n=e.constructor;switch(r){case _u:return nn(e);case Tu:case Su:return new n(+e);case Nu:return gu(e,t);case Iu:case ju:case Mu:case Ru:case Au:case Lu:case $u:case Fu:case Yu:return wu(e,t);case Pu:return new n;case Eu:case Du:return new n(e);case ku:return vu(e);case Cu:return new n;case Ou:return xu(e)}}function Wu(e){return typeof e.constructor=="function"&&!qr(e)?si(gs(e)):{}}var Vu="[object Map]";function Bu(e){return yt(e)&&rn(e)==Vu}var Ms=vt&&vt.isMap,zu=Ms?Gr(Ms):Bu;const Uu=zu;var qu="[object Set]";function Gu(e){return yt(e)&&rn(e)==qu}var Rs=vt&&vt.isSet,Zu=Rs?Gr(Rs):Gu;const Qu=Zu;var Ku=1,Xu=2,Ju=4,As="[object Arguments]",el="[object Array]",tl="[object Boolean]",rl="[object Date]",nl="[object Error]",Ls="[object Function]",sl="[object GeneratorFunction]",al="[object Map]",ol="[object Number]",$s="[object Object]",il="[object RegExp]",cl="[object Set]",ul="[object String]",ll="[object Symbol]",fl="[object WeakMap]",dl="[object ArrayBuffer]",hl="[object DataView]",pl="[object Float32Array]",ml="[object Float64Array]",bl="[object Int8Array]",gl="[object Int16Array]",yl="[object Int32Array]",vl="[object Uint8Array]",xl="[object Uint8ClampedArray]",wl="[object Uint16Array]",Tl="[object Uint32Array]",ye={};ye[As]=ye[el]=ye[dl]=ye[hl]=ye[tl]=ye[rl]=ye[pl]=ye[ml]=ye[bl]=ye[gl]=ye[yl]=ye[al]=ye[ol]=ye[$s]=ye[il]=ye[cl]=ye[ul]=ye[ll]=ye[vl]=ye[xl]=ye[wl]=ye[Tl]=!0,ye[nl]=ye[Ls]=ye[fl]=!1;function ur(e,r,t,n,s,a){var o,i=r&Ku,c=r&Xu,f=r&Ju;if(t&&(o=s?t(e,n,s,a):t(e)),o!==void 0)return o;if(!Qe(e))return e;var h=Br(e);if(h){if(o=mu(e),!i)return ai(e,o)}else{var p=rn(e),y=p==Ls||p==sl;if(fs(e))return qc(e,i);if(p==$s||p==As||y&&!s){if(o=c||y?{}:Wu(e),!i)return c?tu(e,zc(o,e)):Xc(e,Bc(o,e))}else{if(!ye[p])return s?e:{};o=Hu(e,p,i)}}a||(a=new wt);var x=a.get(e);if(x)return x;a.set(e,o),Qu(e)?e.forEach(function(_){o.add(ur(_,r,t,_,e,a))}):Uu(e)&&e.forEach(function(_,S){o.set(S,ur(_,r,t,S,e,a))});var w=f?c?nu:ru:c?Kr:Qr,O=h?void 0:w(e);return ii(O||e,function(_,S){O&&(S=_,_=e[S]),ns(o,S,ur(_,r,t,S,e,a))}),o}var Sl=1,Pl=4;function El(e){return ur(e,Sl|Pl)}var kl=function(){return Ye.Date.now()};const sn=kl;var Cl="Expected a function",Dl=Math.max,Ol=Math.min;function Ht(e,r,t){var n,s,a,o,i,c,f=0,h=!1,p=!1,y=!0;if(typeof e!="function")throw new TypeError(Cl);r=Qn(r)||0,Qe(t)&&(h=!!t.leading,p="maxWait"in t,a=p?Dl(Qn(t.maxWait)||0,r):a,y="trailing"in t?!!t.trailing:y);function x(A){var k=n,W=s;return n=s=void 0,f=A,o=e.apply(W,k),o}function w(A){return f=A,i=setTimeout(S,r),h?x(A):o}function O(A){var k=A-c,W=A-f,V=r-k;return p?Ol(V,a-W):V}function _(A){var k=A-c,W=A-f;return c===void 0||k>=r||k<0||p&&W>=a}function S(){var A=sn();if(_(A))return R(A);i=setTimeout(S,O(A))}function R(A){return i=void 0,y&&n?x(A):(n=s=void 0,o)}function z(){i!==void 0&&clearTimeout(i),f=0,n=c=s=i=void 0}function F(){return i===void 0?o:R(sn())}function b(){var A=sn(),k=_(A);if(n=arguments,s=this,c=A,k){if(i===void 0)return w(c);if(p)return clearTimeout(i),i=setTimeout(S,r),x(c)}return i===void 0&&(i=setTimeout(S,r)),o}return b.cancel=z,b.flush=F,b}var _l="Expected a function";function Nl(e,r,t){var n=!0,s=!0;if(typeof e!="function")throw new TypeError(_l);return Qe(t)&&(n="leading"in t?!!t.leading:n,s="trailing"in t?!!t.trailing:s),Ht(e,r,{leading:n,maxWait:r,trailing:s})}const Il=(e,r)=>{const{value:t,readOnly:n=!1,debounceTime:s=800,fillContainer:a=!0,leftElement:o,rightElement:i,className:c,leftElementClassName:f,rightElementClassName:h,isSingleLine:p=!0,allowSingleLineScroll:y=!1,inputMode:x,placeholder:w,onFocus:O,onBlur:_,onInput:S,onInnerTextChange:R,onInnerHTMLChange:z,onElementCreate:F,onLeftElementClick:b,onRightElementClick:A}=e,k=d.useRef("bsc-flex-grow focus:bsc-outline-none"),W=d.useRef("bsc-text-gray-4"),V=d.useRef(),ne=d.useCallback(P=>{const Y=P.target,G=Y.innerHTML;Y.className=`${k.current}`,w&&G===w&&(Y.innerHTML=""),O==null||O(P)},[w,O]),te=d.useCallback(P=>{const Y=P.target.innerHTML;if(w&&Y===""){const G=P.target;G.innerHTML=w,G.className=`${k.current} ${W.current}`}_==null||_(P)},[w,_]),X=d.useCallback(P=>{var Y,G;(Y=V.current)==null||Y.removeEventListener("focus",ne),(G=V.current)==null||G.removeEventListener("blur",te),w&&P&&P!==document.activeElement&&P.innerHTML===""&&(P.innerHTML=w,P.className=`${k.current} ${W.current}`),P.addEventListener("focus",ne),P.addEventListener("blur",te),V.current=P},[w]),N=d.useCallback(P=>{F==null||F(P)},[F]),$=P=>{b==null||b(P)},j=P=>{A==null||A(P)},C=Ht(P=>{S==null||S(P),R==null||R(P.target.innerText),z==null||z(P.target.innerHTML)},s),q=d.useCallback(P=>{V.current&&(V.current.innerText=P)},[]),v=d.useCallback(P=>{V.current&&(V.current.innerHTML=P)},[]),ee=d.useCallback(()=>{var P;(P=V.current)==null||P.focus()},[]);d.useImperativeHandle(r,()=>({inputElement:V.current,setInnerText:q,setInnerHTML:v,focus:ee}));const g=ue({"bsc-w-full ":a},"bsc-flex bsc-flex-row bsc-items-center bsc-shadow-sm bsc-border bsc-border-solid bsc-border-gray-3 dark:bsc-border-white dark:bsc-bg-mono-dark-1 dark:bsc-text-mono-light-1 bsc-rounded-md bsc-p-2",{"bsc-overflow-x-auto bsc-overflow-y-hidden bsc-whitespace-pre":p&&y,"bsc-overflow-hidden bsc-whitespace-pre":p&&!y},c),D=ue("bsc-flex-shrink",{"bsc-mr-2":o},f),B=ue("bsc-flex-shrink",{"bsc-ml-2":i},h);return l.jsxs("div",{className:g,ref:P=>P&&N(P),children:[o&&l.jsx("div",{className:D,onClick:$,children:o}),l.jsx("div",{ref:P=>P&&X(P),className:k.current,contentEditable:!n,suppressContentEditableWarning:!0,inputMode:x,onInput:C,children:t}),i&&l.jsx("div",{className:B,onClick:j,children:i})]})},lr=d.forwardRef(Il);function fe(e){const r=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&r==="[object Date]"?new e.constructor(+e):typeof e=="number"||r==="[object Number]"||typeof e=="string"||r==="[object String]"?new Date(e):new Date(NaN)}function ve(e,r){return e instanceof Date?new e.constructor(r):new Date(r)}function Tt(e,r){const t=fe(e);return isNaN(r)?ve(e,NaN):(r&&t.setDate(t.getDate()+r),t)}function ut(e,r){const t=fe(e);if(isNaN(r))return ve(e,NaN);if(!r)return t;const n=t.getDate(),s=ve(e,t.getTime());s.setMonth(t.getMonth()+r+1,0);const a=s.getDate();return n>=a?s:(t.setFullYear(s.getFullYear(),s.getMonth(),n),t)}const Fs=6048e5,an=6e4,on=36e5,jl=1e3;let Ml={};function Wt(){return Ml}function tt(e,r){var i,c,f,h;const t=Wt(),n=(r==null?void 0:r.weekStartsOn)??((c=(i=r==null?void 0:r.locale)==null?void 0:i.options)==null?void 0:c.weekStartsOn)??t.weekStartsOn??((h=(f=t.locale)==null?void 0:f.options)==null?void 0:h.weekStartsOn)??0,s=fe(e),a=s.getDay(),o=(a<n?7:0)+a-n;return s.setDate(s.getDate()-o),s.setHours(0,0,0,0),s}function St(e){return tt(e,{weekStartsOn:1})}function Rl(e){const r=fe(e),t=r.getFullYear(),n=ve(e,0);n.setFullYear(t+1,0,4),n.setHours(0,0,0,0);const s=St(n),a=ve(e,0);a.setFullYear(t,0,4),a.setHours(0,0,0,0);const o=St(a);return r.getTime()>=s.getTime()?t+1:r.getTime()>=o.getTime()?t:t-1}function Ys(e){const r=fe(e);return r.setHours(0,0,0,0),r}function Hs(e){const r=fe(e),t=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return t.setUTCFullYear(r.getFullYear()),+e-+t}function Al(e){const r=Rl(e),t=ve(e,0);return t.setFullYear(r,0,4),t.setHours(0,0,0,0),St(t)}function fr(e,r){return ut(e,r*12)}function Ws(e,r){const t=Ys(e),n=Ys(r);return+t==+n}function Ll(e){const r=fe(e),t=r.getMonth();return r.setFullYear(r.getFullYear(),t+1,0),r.setHours(23,59,59,999),r}function $l(e,r){const t=fe(e.start),n=fe(e.end);let s=+t>+n;const a=s?+t:+n,o=s?n:t;o.setHours(0,0,0,0);let i=(r==null?void 0:r.step)??1;if(!i)return[];i<0&&(i=-i,s=!s);const c=[];for(;+o<=a;)c.push(fe(o)),o.setDate(o.getDate()+i),o.setHours(0,0,0,0);return s?c.reverse():c}function Vs(e){const r=fe(e);return r.setDate(1),r.setHours(0,0,0,0),r}function Fl(e,r){const t=fe(e.start),n=fe(e.end);let s=+t>+n;const a=s?+t:+n,o=s?n:t;o.setHours(0,0,0,0),o.setMonth(0,1);let i=(r==null?void 0:r.step)??1;if(!i)return[];i<0&&(i=-i,s=!s);const c=[];for(;+o<=a;)c.push(fe(o)),o.setFullYear(o.getFullYear()+i);return s?c.reverse():c}const Yl={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Hl=(e,r,t)=>{let n;const s=Yl[e];return typeof s=="string"?n=s:r===1?n=s.one:n=s.other.replace("{{count}}",r.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+n:n+" ago":n};function cn(e){return(r={})=>{const t=r.width?String(r.width):e.defaultWidth;return e.formats[t]||e.formats[e.defaultWidth]}}const Wl={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Vl={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Bl={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},zl={date:cn({formats:Wl,defaultWidth:"full"}),time:cn({formats:Vl,defaultWidth:"full"}),dateTime:cn({formats:Bl,defaultWidth:"full"})},Ul={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ql=(e,r,t,n)=>Ul[e];function Vt(e){return(r,t)=>{const n=t!=null&&t.context?String(t.context):"standalone";let s;if(n==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,i=t!=null&&t.width?String(t.width):o;s=e.formattingValues[i]||e.formattingValues[o]}else{const o=e.defaultWidth,i=t!=null&&t.width?String(t.width):e.defaultWidth;s=e.values[i]||e.values[o]}const a=e.argumentCallback?e.argumentCallback(r):r;return s[a]}}const Gl={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Zl={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ql={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Kl={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Xl={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Jl={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ef={ordinalNumber:(e,r)=>{const t=Number(e),n=t%100;if(n>20||n<10)switch(n%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},era:Vt({values:Gl,defaultWidth:"wide"}),quarter:Vt({values:Zl,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Vt({values:Ql,defaultWidth:"wide"}),day:Vt({values:Kl,defaultWidth:"wide"}),dayPeriod:Vt({values:Xl,defaultWidth:"wide",formattingValues:Jl,defaultFormattingWidth:"wide"})};function Bt(e){return(r,t={})=>{const n=t.width,s=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],a=r.match(s);if(!a)return null;const o=a[0],i=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(i)?rf(i,p=>p.test(o)):tf(i,p=>p.test(o));let f;f=e.valueCallback?e.valueCallback(c):c,f=t.valueCallback?t.valueCallback(f):f;const h=r.slice(o.length);return{value:f,rest:h}}}function tf(e,r){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&r(e[t]))return t}function rf(e,r){for(let t=0;t<e.length;t++)if(r(e[t]))return t}function nf(e){return(r,t={})=>{const n=r.match(e.matchPattern);if(!n)return null;const s=n[0],a=r.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=t.valueCallback?t.valueCallback(o):o;const i=r.slice(s.length);return{value:o,rest:i}}}const sf=/^(\d+)(th|st|nd|rd)?/i,af=/\d+/i,of={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},cf={any:[/^b/i,/^(a|c)/i]},uf={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},lf={any:[/1/i,/2/i,/3/i,/4/i]},ff={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},df={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},hf={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},pf={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},mf={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},bf={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},gf={ordinalNumber:nf({matchPattern:sf,parsePattern:af,valueCallback:e=>parseInt(e,10)}),era:Bt({matchPatterns:of,defaultMatchWidth:"wide",parsePatterns:cf,defaultParseWidth:"any"}),quarter:Bt({matchPatterns:uf,defaultMatchWidth:"wide",parsePatterns:lf,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Bt({matchPatterns:ff,defaultMatchWidth:"wide",parsePatterns:df,defaultParseWidth:"any"}),day:Bt({matchPatterns:hf,defaultMatchWidth:"wide",parsePatterns:pf,defaultParseWidth:"any"}),dayPeriod:Bt({matchPatterns:mf,defaultMatchWidth:"any",parsePatterns:bf,defaultParseWidth:"any"})},yf={code:"en-US",formatDistance:Hl,formatLong:zl,formatRelative:ql,localize:ef,match:gf,options:{weekStartsOn:0,firstWeekContainsDate:1}};function vf(e){const r=fe(e),t=+St(r)-+Al(r);return Math.round(t/Fs)+1}function Bs(e,r){var h,p,y,x;const t=fe(e),n=t.getFullYear(),s=Wt(),a=(r==null?void 0:r.firstWeekContainsDate)??((p=(h=r==null?void 0:r.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??s.firstWeekContainsDate??((x=(y=s.locale)==null?void 0:y.options)==null?void 0:x.firstWeekContainsDate)??1,o=ve(e,0);o.setFullYear(n+1,0,a),o.setHours(0,0,0,0);const i=tt(o,r),c=ve(e,0);c.setFullYear(n,0,a),c.setHours(0,0,0,0);const f=tt(c,r);return t.getTime()>=i.getTime()?n+1:t.getTime()>=f.getTime()?n:n-1}function xf(e,r){var i,c,f,h;const t=Wt(),n=(r==null?void 0:r.firstWeekContainsDate)??((c=(i=r==null?void 0:r.locale)==null?void 0:i.options)==null?void 0:c.firstWeekContainsDate)??t.firstWeekContainsDate??((h=(f=t.locale)==null?void 0:f.options)==null?void 0:h.firstWeekContainsDate)??1,s=Bs(e,r),a=ve(e,0);return a.setFullYear(s,0,n),a.setHours(0,0,0,0),tt(a,r)}function wf(e,r){const t=fe(e),n=+tt(t,r)-+xf(t,r);return Math.round(n/Fs)+1}const zs=(e,r)=>{switch(e){case"P":return r.date({width:"short"});case"PP":return r.date({width:"medium"});case"PPP":return r.date({width:"long"});case"PPPP":default:return r.date({width:"full"})}},Us=(e,r)=>{switch(e){case"p":return r.time({width:"short"});case"pp":return r.time({width:"medium"});case"ppp":return r.time({width:"long"});case"pppp":default:return r.time({width:"full"})}},qs={p:Us,P:(e,r)=>{const t=e.match(/(P+)(p+)?/)||[],n=t[1],s=t[2];if(!s)return zs(e,r);let a;switch(n){case"P":a=r.dateTime({width:"short"});break;case"PP":a=r.dateTime({width:"medium"});break;case"PPP":a=r.dateTime({width:"long"});break;case"PPPP":default:a=r.dateTime({width:"full"});break}return a.replace("{{date}}",zs(n,r)).replace("{{time}}",Us(s,r))}},Tf=/^D+$/,Sf=/^Y+$/,Pf=["D","DD","YY","YYYY"];function Ef(e){return Tf.test(e)}function kf(e){return Sf.test(e)}function Gs(e,r,t){const n=Cf(e,r,t);if(console.warn(n),Pf.includes(e))throw new RangeError(n)}function Cf(e,r,t){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${r}\`) for formatting ${n} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function un(e){return fe(e).getDay()}function Zs(e){const r=fe(e),t=r.getFullYear(),n=r.getMonth(),s=ve(e,0);return s.setFullYear(t,n+1,0),s.setHours(0,0,0,0),s.getDate()}function Df(){return Object.assign({},Wt())}function Of(e){let t=fe(e).getDay();return t===0&&(t=7),t}function _f(e){const r=fe(e),t=r.getMonth();return r.setFullYear(r.getFullYear(),t+1,0),r.setHours(0,0,0,0),r}function Nf(e,r){const t=fe(e),n=fe(r);return+t<+n}function If(e,r){const t=r instanceof Date?ve(r,0):new r(0);return t.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),t.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),t}const jf=10;class Qs{constructor(){m(this,"subPriority",0)}validate(r,t){return!0}}class Mf extends Qs{constructor(r,t,n,s,a){super(),this.value=r,this.validateValue=t,this.setValue=n,this.priority=s,a&&(this.subPriority=a)}validate(r,t){return this.validateValue(r,this.value,t)}set(r,t,n){return this.setValue(r,t,this.value,n)}}class Rf extends Qs{constructor(){super(...arguments);m(this,"priority",jf);m(this,"subPriority",-1)}set(t,n){return n.timestampIsSet?t:ve(t,If(t,Date))}}class de{run(r,t,n,s){const a=this.parse(r,t,n,s);return a?{setter:new Mf(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}validate(r,t,n){return!0}}class Af extends de{constructor(){super(...arguments);m(this,"priority",140);m(this,"incompatibleTokens",["R","u","t","T"])}parse(t,n,s){switch(n){case"G":case"GG":case"GGG":return s.era(t,{width:"abbreviated"})||s.era(t,{width:"narrow"});case"GGGGG":return s.era(t,{width:"narrow"});case"GGGG":default:return s.era(t,{width:"wide"})||s.era(t,{width:"abbreviated"})||s.era(t,{width:"narrow"})}}set(t,n,s){return n.era=s,t.setFullYear(s,0,1),t.setHours(0,0,0,0),t}}const Ee={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Ve={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function ke(e,r){return e&&{value:r(e.value),rest:e.rest}}function Te(e,r){const t=r.match(e);return t?{value:parseInt(t[0],10),rest:r.slice(t[0].length)}:null}function Be(e,r){const t=r.match(e);if(!t)return null;if(t[0]==="Z")return{value:0,rest:r.slice(1)};const n=t[1]==="+"?1:-1,s=t[2]?parseInt(t[2],10):0,a=t[3]?parseInt(t[3],10):0,o=t[5]?parseInt(t[5],10):0;return{value:n*(s*on+a*an+o*jl),rest:r.slice(t[0].length)}}function Ks(e){return Te(Ee.anyDigitsSigned,e)}function Se(e,r){switch(e){case 1:return Te(Ee.singleDigit,r);case 2:return Te(Ee.twoDigits,r);case 3:return Te(Ee.threeDigits,r);case 4:return Te(Ee.fourDigits,r);default:return Te(new RegExp("^\\d{1,"+e+"}"),r)}}function dr(e,r){switch(e){case 1:return Te(Ee.singleDigitSigned,r);case 2:return Te(Ee.twoDigitsSigned,r);case 3:return Te(Ee.threeDigitsSigned,r);case 4:return Te(Ee.fourDigitsSigned,r);default:return Te(new RegExp("^-?\\d{1,"+e+"}"),r)}}function ln(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function Xs(e,r){const t=r>0,n=t?r:1-r;let s;if(n<=50)s=e||100;else{const a=n+50,o=Math.trunc(a/100)*100,i=e>=a%100;s=e+o-(i?100:0)}return t?s:1-s}function Js(e){return e%400===0||e%4===0&&e%100!==0}class Lf extends de{constructor(){super(...arguments);m(this,"priority",130);m(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(t,n,s){const a=o=>({year:o,isTwoDigitYear:n==="yy"});switch(n){case"y":return ke(Se(4,t),a);case"yo":return ke(s.ordinalNumber(t,{unit:"year"}),a);default:return ke(Se(n.length,t),a)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,s){const a=t.getFullYear();if(s.isTwoDigitYear){const i=Xs(s.year,a);return t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}const o=!("era"in n)||n.era===1?s.year:1-s.year;return t.setFullYear(o,0,1),t.setHours(0,0,0,0),t}}class $f extends de{constructor(){super(...arguments);m(this,"priority",130);m(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(t,n,s){const a=o=>({year:o,isTwoDigitYear:n==="YY"});switch(n){case"Y":return ke(Se(4,t),a);case"Yo":return ke(s.ordinalNumber(t,{unit:"year"}),a);default:return ke(Se(n.length,t),a)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,s,a){const o=Bs(t,a);if(s.isTwoDigitYear){const c=Xs(s.year,o);return t.setFullYear(c,0,a.firstWeekContainsDate),t.setHours(0,0,0,0),tt(t,a)}const i=!("era"in n)||n.era===1?s.year:1-s.year;return t.setFullYear(i,0,a.firstWeekContainsDate),t.setHours(0,0,0,0),tt(t,a)}}class Ff extends de{constructor(){super(...arguments);m(this,"priority",130);m(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(t,n){return dr(n==="R"?4:n.length,t)}set(t,n,s){const a=ve(t,0);return a.setFullYear(s,0,4),a.setHours(0,0,0,0),St(a)}}class Yf extends de{constructor(){super(...arguments);m(this,"priority",130);m(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(t,n){return dr(n==="u"?4:n.length,t)}set(t,n,s){return t.setFullYear(s,0,1),t.setHours(0,0,0,0),t}}class Hf extends de{constructor(){super(...arguments);m(this,"priority",120);m(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(t,n,s){switch(n){case"Q":case"QQ":return Se(n.length,t);case"Qo":return s.ordinalNumber(t,{unit:"quarter"});case"QQQ":return s.quarter(t,{width:"abbreviated",context:"formatting"})||s.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(t,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(t,{width:"wide",context:"formatting"})||s.quarter(t,{width:"abbreviated",context:"formatting"})||s.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=1&&n<=4}set(t,n,s){return t.setMonth((s-1)*3,1),t.setHours(0,0,0,0),t}}class Wf extends de{constructor(){super(...arguments);m(this,"priority",120);m(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(t,n,s){switch(n){case"q":case"qq":return Se(n.length,t);case"qo":return s.ordinalNumber(t,{unit:"quarter"});case"qqq":return s.quarter(t,{width:"abbreviated",context:"standalone"})||s.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(t,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(t,{width:"wide",context:"standalone"})||s.quarter(t,{width:"abbreviated",context:"standalone"})||s.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=1&&n<=4}set(t,n,s){return t.setMonth((s-1)*3,1),t.setHours(0,0,0,0),t}}class Vf extends de{constructor(){super(...arguments);m(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);m(this,"priority",110)}parse(t,n,s){const a=o=>o-1;switch(n){case"M":return ke(Te(Ee.month,t),a);case"MM":return ke(Se(2,t),a);case"Mo":return ke(s.ordinalNumber(t,{unit:"month"}),a);case"MMM":return s.month(t,{width:"abbreviated",context:"formatting"})||s.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(t,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(t,{width:"wide",context:"formatting"})||s.month(t,{width:"abbreviated",context:"formatting"})||s.month(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=11}set(t,n,s){return t.setMonth(s,1),t.setHours(0,0,0,0),t}}class Bf extends de{constructor(){super(...arguments);m(this,"priority",110);m(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(t,n,s){const a=o=>o-1;switch(n){case"L":return ke(Te(Ee.month,t),a);case"LL":return ke(Se(2,t),a);case"Lo":return ke(s.ordinalNumber(t,{unit:"month"}),a);case"LLL":return s.month(t,{width:"abbreviated",context:"standalone"})||s.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(t,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(t,{width:"wide",context:"standalone"})||s.month(t,{width:"abbreviated",context:"standalone"})||s.month(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=0&&n<=11}set(t,n,s){return t.setMonth(s,1),t.setHours(0,0,0,0),t}}function zf(e,r,t){const n=fe(e),s=wf(n,t)-r;return n.setDate(n.getDate()-s*7),n}class Uf extends de{constructor(){super(...arguments);m(this,"priority",100);m(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(t,n,s){switch(n){case"w":return Te(Ee.week,t);case"wo":return s.ordinalNumber(t,{unit:"week"});default:return Se(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,s,a){return tt(zf(t,s,a),a)}}function qf(e,r){const t=fe(e),n=vf(t)-r;return t.setDate(t.getDate()-n*7),t}class Gf extends de{constructor(){super(...arguments);m(this,"priority",100);m(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(t,n,s){switch(n){case"I":return Te(Ee.week,t);case"Io":return s.ordinalNumber(t,{unit:"week"});default:return Se(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,s){return St(qf(t,s))}}const Zf=[31,28,31,30,31,30,31,31,30,31,30,31],Qf=[31,29,31,30,31,30,31,31,30,31,30,31];class Kf extends de{constructor(){super(...arguments);m(this,"priority",90);m(this,"subPriority",1);m(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(t,n,s){switch(n){case"d":return Te(Ee.date,t);case"do":return s.ordinalNumber(t,{unit:"date"});default:return Se(n.length,t)}}validate(t,n){const s=t.getFullYear(),a=Js(s),o=t.getMonth();return a?n>=1&&n<=Qf[o]:n>=1&&n<=Zf[o]}set(t,n,s){return t.setDate(s),t.setHours(0,0,0,0),t}}class Xf extends de{constructor(){super(...arguments);m(this,"priority",90);m(this,"subpriority",1);m(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(t,n,s){switch(n){case"D":case"DD":return Te(Ee.dayOfYear,t);case"Do":return s.ordinalNumber(t,{unit:"date"});default:return Se(n.length,t)}}validate(t,n){const s=t.getFullYear();return Js(s)?n>=1&&n<=366:n>=1&&n<=365}set(t,n,s){return t.setMonth(0,s),t.setHours(0,0,0,0),t}}function fn(e,r,t){var p,y,x,w;const n=Wt(),s=(t==null?void 0:t.weekStartsOn)??((y=(p=t==null?void 0:t.locale)==null?void 0:p.options)==null?void 0:y.weekStartsOn)??n.weekStartsOn??((w=(x=n.locale)==null?void 0:x.options)==null?void 0:w.weekStartsOn)??0,a=fe(e),o=a.getDay(),c=(r%7+7)%7,f=7-s,h=r<0||r>6?r-(o+f)%7:(c+f)%7-(o+f)%7;return Tt(a,h)}class Jf extends de{constructor(){super(...arguments);m(this,"priority",90);m(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(t,n,s){switch(n){case"E":case"EE":case"EEE":return s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});case"EEEE":default:return s.day(t,{width:"wide",context:"formatting"})||s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=6}set(t,n,s,a){return t=fn(t,s,a),t.setHours(0,0,0,0),t}}class ed extends de{constructor(){super(...arguments);m(this,"priority",90);m(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(t,n,s,a){const o=i=>{const c=Math.floor((i-1)/7)*7;return(i+a.weekStartsOn+6)%7+c};switch(n){case"e":case"ee":return ke(Se(n.length,t),o);case"eo":return ke(s.ordinalNumber(t,{unit:"day"}),o);case"eee":return s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});case"eeeee":return s.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});case"eeee":default:return s.day(t,{width:"wide",context:"formatting"})||s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=6}set(t,n,s,a){return t=fn(t,s,a),t.setHours(0,0,0,0),t}}class td extends de{constructor(){super(...arguments);m(this,"priority",90);m(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(t,n,s,a){const o=i=>{const c=Math.floor((i-1)/7)*7;return(i+a.weekStartsOn+6)%7+c};switch(n){case"c":case"cc":return ke(Se(n.length,t),o);case"co":return ke(s.ordinalNumber(t,{unit:"day"}),o);case"ccc":return s.day(t,{width:"abbreviated",context:"standalone"})||s.day(t,{width:"short",context:"standalone"})||s.day(t,{width:"narrow",context:"standalone"});case"ccccc":return s.day(t,{width:"narrow",context:"standalone"});case"cccccc":return s.day(t,{width:"short",context:"standalone"})||s.day(t,{width:"narrow",context:"standalone"});case"cccc":default:return s.day(t,{width:"wide",context:"standalone"})||s.day(t,{width:"abbreviated",context:"standalone"})||s.day(t,{width:"short",context:"standalone"})||s.day(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=0&&n<=6}set(t,n,s,a){return t=fn(t,s,a),t.setHours(0,0,0,0),t}}function rd(e,r){const t=fe(e),n=Of(t),s=r-n;return Tt(t,s)}class nd extends de{constructor(){super(...arguments);m(this,"priority",90);m(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(t,n,s){const a=o=>o===0?7:o;switch(n){case"i":case"ii":return Se(n.length,t);case"io":return s.ordinalNumber(t,{unit:"day"});case"iii":return ke(s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"}),a);case"iiiii":return ke(s.day(t,{width:"narrow",context:"formatting"}),a);case"iiiiii":return ke(s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"}),a);case"iiii":default:return ke(s.day(t,{width:"wide",context:"formatting"})||s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"}),a)}}validate(t,n){return n>=1&&n<=7}set(t,n,s){return t=rd(t,s),t.setHours(0,0,0,0),t}}class sd extends de{constructor(){super(...arguments);m(this,"priority",80);m(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(t,n,s){switch(n){case"a":case"aa":case"aaa":return s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(t,{width:"wide",context:"formatting"})||s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,s){return t.setHours(ln(s),0,0,0),t}}class ad extends de{constructor(){super(...arguments);m(this,"priority",80);m(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(t,n,s){switch(n){case"b":case"bb":case"bbb":return s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(t,{width:"wide",context:"formatting"})||s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,s){return t.setHours(ln(s),0,0,0),t}}class od extends de{constructor(){super(...arguments);m(this,"priority",80);m(this,"incompatibleTokens",["a","b","t","T"])}parse(t,n,s){switch(n){case"B":case"BB":case"BBB":return s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(t,{width:"wide",context:"formatting"})||s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,s){return t.setHours(ln(s),0,0,0),t}}class id extends de{constructor(){super(...arguments);m(this,"priority",70);m(this,"incompatibleTokens",["H","K","k","t","T"])}parse(t,n,s){switch(n){case"h":return Te(Ee.hour12h,t);case"ho":return s.ordinalNumber(t,{unit:"hour"});default:return Se(n.length,t)}}validate(t,n){return n>=1&&n<=12}set(t,n,s){const a=t.getHours()>=12;return a&&s<12?t.setHours(s+12,0,0,0):!a&&s===12?t.setHours(0,0,0,0):t.setHours(s,0,0,0),t}}class cd extends de{constructor(){super(...arguments);m(this,"priority",70);m(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(t,n,s){switch(n){case"H":return Te(Ee.hour23h,t);case"Ho":return s.ordinalNumber(t,{unit:"hour"});default:return Se(n.length,t)}}validate(t,n){return n>=0&&n<=23}set(t,n,s){return t.setHours(s,0,0,0),t}}class ud extends de{constructor(){super(...arguments);m(this,"priority",70);m(this,"incompatibleTokens",["h","H","k","t","T"])}parse(t,n,s){switch(n){case"K":return Te(Ee.hour11h,t);case"Ko":return s.ordinalNumber(t,{unit:"hour"});default:return Se(n.length,t)}}validate(t,n){return n>=0&&n<=11}set(t,n,s){return t.getHours()>=12&&s<12?t.setHours(s+12,0,0,0):t.setHours(s,0,0,0),t}}class ld extends de{constructor(){super(...arguments);m(this,"priority",70);m(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(t,n,s){switch(n){case"k":return Te(Ee.hour24h,t);case"ko":return s.ordinalNumber(t,{unit:"hour"});default:return Se(n.length,t)}}validate(t,n){return n>=1&&n<=24}set(t,n,s){const a=s<=24?s%24:s;return t.setHours(a,0,0,0),t}}class fd extends de{constructor(){super(...arguments);m(this,"priority",60);m(this,"incompatibleTokens",["t","T"])}parse(t,n,s){switch(n){case"m":return Te(Ee.minute,t);case"mo":return s.ordinalNumber(t,{unit:"minute"});default:return Se(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,s){return t.setMinutes(s,0,0),t}}class dd extends de{constructor(){super(...arguments);m(this,"priority",50);m(this,"incompatibleTokens",["t","T"])}parse(t,n,s){switch(n){case"s":return Te(Ee.second,t);case"so":return s.ordinalNumber(t,{unit:"second"});default:return Se(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,s){return t.setSeconds(s,0),t}}class hd extends de{constructor(){super(...arguments);m(this,"priority",30);m(this,"incompatibleTokens",["t","T"])}parse(t,n){const s=a=>Math.trunc(a*Math.pow(10,-n.length+3));return ke(Se(n.length,t),s)}set(t,n,s){return t.setMilliseconds(s),t}}class pd extends de{constructor(){super(...arguments);m(this,"priority",10);m(this,"incompatibleTokens",["t","T","x"])}parse(t,n){switch(n){case"X":return Be(Ve.basicOptionalMinutes,t);case"XX":return Be(Ve.basic,t);case"XXXX":return Be(Ve.basicOptionalSeconds,t);case"XXXXX":return Be(Ve.extendedOptionalSeconds,t);case"XXX":default:return Be(Ve.extended,t)}}set(t,n,s){return n.timestampIsSet?t:ve(t,t.getTime()-Hs(t)-s)}}class md extends de{constructor(){super(...arguments);m(this,"priority",10);m(this,"incompatibleTokens",["t","T","X"])}parse(t,n){switch(n){case"x":return Be(Ve.basicOptionalMinutes,t);case"xx":return Be(Ve.basic,t);case"xxxx":return Be(Ve.basicOptionalSeconds,t);case"xxxxx":return Be(Ve.extendedOptionalSeconds,t);case"xxx":default:return Be(Ve.extended,t)}}set(t,n,s){return n.timestampIsSet?t:ve(t,t.getTime()-Hs(t)-s)}}class bd extends de{constructor(){super(...arguments);m(this,"priority",40);m(this,"incompatibleTokens","*")}parse(t){return Ks(t)}set(t,n,s){return[ve(t,s*1e3),{timestampIsSet:!0}]}}class gd extends de{constructor(){super(...arguments);m(this,"priority",20);m(this,"incompatibleTokens","*")}parse(t){return Ks(t)}set(t,n,s){return[ve(t,s),{timestampIsSet:!0}]}}const yd={G:new Af,y:new Lf,Y:new $f,R:new Ff,u:new Yf,Q:new Hf,q:new Wf,M:new Vf,L:new Bf,w:new Uf,I:new Gf,d:new Kf,D:new Xf,E:new Jf,e:new ed,c:new td,i:new nd,a:new sd,b:new ad,B:new od,h:new id,H:new cd,K:new ud,k:new ld,m:new fd,s:new dd,S:new hd,X:new pd,x:new md,t:new bd,T:new gd},vd=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,xd=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,wd=/^'([^]*?)'?$/,Td=/''/g,Sd=/\S/,Pd=/[a-zA-Z]/;function ze(e,r,t,n){var O,_,S,R,z,F,b,A;const s=Df(),a=(n==null?void 0:n.locale)??s.locale??yf,o=(n==null?void 0:n.firstWeekContainsDate)??((_=(O=n==null?void 0:n.locale)==null?void 0:O.options)==null?void 0:_.firstWeekContainsDate)??s.firstWeekContainsDate??((R=(S=s.locale)==null?void 0:S.options)==null?void 0:R.firstWeekContainsDate)??1,i=(n==null?void 0:n.weekStartsOn)??((F=(z=n==null?void 0:n.locale)==null?void 0:z.options)==null?void 0:F.weekStartsOn)??s.weekStartsOn??((A=(b=s.locale)==null?void 0:b.options)==null?void 0:A.weekStartsOn)??0;if(r==="")return e===""?fe(t):ve(t,NaN);const c={firstWeekContainsDate:o,weekStartsOn:i,locale:a},f=[new Rf],h=r.match(xd).map(k=>{const W=k[0];if(W in qs){const V=qs[W];return V(k,a.formatLong)}return k}).join("").match(vd),p=[];for(let k of h){!(n!=null&&n.useAdditionalWeekYearTokens)&&kf(k)&&Gs(k,r,e),!(n!=null&&n.useAdditionalDayOfYearTokens)&&Ef(k)&&Gs(k,r,e);const W=k[0],V=yd[W];if(V){const{incompatibleTokens:ne}=V;if(Array.isArray(ne)){const X=p.find(N=>ne.includes(N.token)||N.token===W);if(X)throw new RangeError(`The format string mustn't contain \`${X.fullToken}\` and \`${k}\` at the same time`)}else if(V.incompatibleTokens==="*"&&p.length>0)throw new RangeError(`The format string mustn't contain \`${k}\` and any other token at the same time`);p.push({token:W,fullToken:k});const te=V.run(e,k,a.match,c);if(!te)return ve(t,NaN);f.push(te.setter),e=te.rest}else{if(W.match(Pd))throw new RangeError("Format string contains an unescaped latin alphabet character `"+W+"`");if(k==="''"?k="'":W==="'"&&(k=Ed(k)),e.indexOf(k)===0)e=e.slice(k.length);else return ve(t,NaN)}}if(e.length>0&&Sd.test(e))return ve(t,NaN);const y=f.map(k=>k.priority).sort((k,W)=>W-k).filter((k,W,V)=>V.indexOf(k)===W).map(k=>f.filter(W=>W.priority===k).sort((W,V)=>V.subPriority-W.subPriority)).map(k=>k[0]);let x=fe(t);if(isNaN(x.getTime()))return ve(t,NaN);const w={};for(const k of y){if(!k.validate(x,c))return ve(t,NaN);const W=k.set(x,w,c);Array.isArray(W)?(x=W[0],Object.assign(w,W[1])):x=W}return ve(t,x)}function Ed(e){return e.match(wd)[1].replace(Td,"'")}function kd(e){return Ws(e,Date.now())}function Cd(e,r){return Tt(e,-r)}function Dd(e,r){let t=r-un(e);return t<=0&&(t+=7),Tt(e,t)}function Od(e,r){const t=(r==null?void 0:r.additionalDigits)??2,n=jd(e);let s;if(n.date){const c=Md(n.date,t);s=Rd(c.restDateString,c.year)}if(!s||isNaN(s.getTime()))return new Date(NaN);const a=s.getTime();let o=0,i;if(n.time&&(o=Ad(n.time),isNaN(o)))return new Date(NaN);if(n.timezone){if(i=Ld(n.timezone),isNaN(i))return new Date(NaN)}else{const c=new Date(a+o),f=new Date(0);return f.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),f.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),f}return new Date(a+o+i)}const hr={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},_d=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Nd=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Id=/^([+-])(\d{2})(?::?(\d{2}))?$/;function jd(e){const r={},t=e.split(hr.dateTimeDelimiter);let n;if(t.length>2)return r;if(/:/.test(t[0])?n=t[0]:(r.date=t[0],n=t[1],hr.timeZoneDelimiter.test(r.date)&&(r.date=e.split(hr.timeZoneDelimiter)[0],n=e.substr(r.date.length,e.length))),n){const s=hr.timezone.exec(n);s?(r.time=n.replace(s[1],""),r.timezone=s[1]):r.time=n}return r}function Md(e,r){const t=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+r)+"})|(\\d{2}|[+-]\\d{"+(2+r)+"})$)"),n=e.match(t);if(!n)return{year:NaN,restDateString:""};const s=n[1]?parseInt(n[1]):null,a=n[2]?parseInt(n[2]):null;return{year:a===null?s:a*100,restDateString:e.slice((n[1]||n[2]).length)}}function Rd(e,r){if(r===null)return new Date(NaN);const t=e.match(_d);if(!t)return new Date(NaN);const n=!!t[4],s=zt(t[1]),a=zt(t[2])-1,o=zt(t[3]),i=zt(t[4]),c=zt(t[5])-1;if(n)return Wd(r,i,c)?$d(r,i,c):new Date(NaN);{const f=new Date(0);return!Yd(r,a,o)||!Hd(r,s)?new Date(NaN):(f.setUTCFullYear(r,a,Math.max(s,o)),f)}}function zt(e){return e?parseInt(e):1}function Ad(e){const r=e.match(Nd);if(!r)return NaN;const t=dn(r[1]),n=dn(r[2]),s=dn(r[3]);return Vd(t,n,s)?t*on+n*an+s*1e3:NaN}function dn(e){return e&&parseFloat(e.replace(",","."))||0}function Ld(e){if(e==="Z")return 0;const r=e.match(Id);if(!r)return 0;const t=r[1]==="+"?-1:1,n=parseInt(r[2]),s=r[3]&&parseInt(r[3])||0;return Bd(n,s)?t*(n*on+s*an):NaN}function $d(e,r,t){const n=new Date(0);n.setUTCFullYear(e,0,4);const s=n.getUTCDay()||7,a=(r-1)*7+t+1-s;return n.setUTCDate(n.getUTCDate()+a),n}const Fd=[31,null,31,30,31,30,31,31,30,31,30,31];function ea(e){return e%400===0||e%4===0&&e%100!==0}function Yd(e,r,t){return r>=0&&r<=11&&t>=1&&t<=(Fd[r]||(ea(e)?29:28))}function Hd(e,r){return r>=1&&r<=(ea(e)?366:365)}function Wd(e,r,t){return r>=1&&r<=53&&t>=0&&t<=6}function Vd(e,r,t){return e===24?r===0&&t===0:t>=0&&t<60&&r>=0&&r<60&&e>=0&&e<25}function Bd(e,r){return r>=0&&r<=59}function zd(e,r){const t=fe(e),n=t.getFullYear(),s=t.getDate(),a=ve(e,0);a.setFullYear(n,r,15),a.setHours(0,0,0,0);const o=Zs(a);return t.setMonth(r,Math.min(s,o)),t}function Ud(e,r){const t=fe(e);return isNaN(+t)?ve(e,NaN):(t.setFullYear(r),t)}function ta(e,r){return ut(e,-r)}function ra(e,r){return fr(e,-r)}var je=(e=>(e[e.Regular=24]="Regular",e[e.Small=20]="Small",e))(je||{});const na=({className:e})=>l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5m-9-6h.008v.008H12v-.008ZM12 15h.008v.008H12V15Zm0 2.25h.008v.008H12v-.008ZM9.75 15h.008v.008H9.75V15Zm0 2.25h.008v.008H9.75v-.008ZM7.5 15h.008v.008H7.5V15Zm0 2.25h.008v.008H7.5v-.008Zm6.75-4.5h.008v.008h-.008v-.008Zm0 2.25h.008v.008h-.008V15Zm0 2.25h.008v.008h-.008v-.008Zm2.25-4.5h.008v.008H16.5v-.008Zm0 2.25h.008v.008H16.5V15Z"})}),qd=({className:e})=>{const r=ue("bsc-h-6 bsc-w-6",e);return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:r,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})})},Gd=({className:e})=>{const r=ue("bsc-h-6 bsc-w-6",e);return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:r,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5 8.25 12l7.5-7.5"})})},Zd=({className:e})=>{const r=ue("bsc-h-6 bsc-w-6",e);return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:r,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"})})},Qd=({className:e})=>{const r=ue("bsc-h-6 bsc-w-6",e);return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:r,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"})})},Kd=({className:e})=>l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})}),Le=({icon:e,size:r=je.Regular,onClick:t,className:n})=>{const s=d.useRef({calendar:na,chevronDown:qd,chevronLeft:Gd,chevronRight:Zd,chevronUp:Qd,close:Kd}),a=d.useMemo(()=>s.current[e]||na,[e]),o=ue({"bsc-h-[24px] bsc-w-[24px]":r===je.Regular,"bsc-h-[20px] bsc-w-[20px]":r===je.Small},n);return l.jsx("div",{onClick:t,children:l.jsx(a,{className:o})})},lt=({template:e,props:r,children:t})=>e(r,t);function Xd(e,r){if(r===e)return!1;const t=Object.values(r),n=Object.values(e);if(t.length!==n.length||t.some((a,o)=>a!==n[o]))return!0;const s=Object.keys(e);return Object.keys(r).some((a,o)=>a!==s[o])}function Jd(e,r){return e.matches[r]=!1,e.mediaQueries[r]={},e}function sa(e){const r=Object.keys(e);return typeof window>"u"?r.reduce(Jd,{mediaQueries:{},matches:{}}):r.reduce((t,n)=>{const s=window.matchMedia(e[n]);return t.mediaQueries[n]=s,t.matches[n]=s.matches,t},{mediaQueries:{},matches:{}})}function eh(e,r){function t(n,s){return n[s]=e.mediaQueries[s].matches,n}switch(r.type){case"updateMatches":return{matches:Object.keys(e.mediaQueries).reduce(t,{}),mediaQueries:e.mediaQueries};case"setQueries":return sa(r.queries)}}function th(e){const r=jt.useRef(e),[t,n]=jt.useReducer(eh,e,sa);jt.useEffect(()=>{Xd(e,r.current)&&(n({type:"setQueries",queries:e}),r.current=e)},[e]);function s(){return n({type:"updateMatches"})}function a(c){const f=s;return typeof c.addListener<"u"?c.addListener(f):c.addEventListener("change",f),f}jt.useEffect(()=>{const c=Object.values(t.mediaQueries),f=c.map(a);function h(p,y){typeof p.addListener<"u"?p.removeListener(f[y]):p.removeEventListener("change",f[y])}return()=>{c.forEach(h)}},[t.mediaQueries]);const{matches:o}=t,i=jt.useMemo(()=>Object.values(o),[o]);return{matches:o,matchesAny:i.some(Boolean),matchesAll:i.length>0&&i.every(Boolean)}}function pr(e){return th(rh(e)).matchesAll}const hn={};function rh(e){return hn[e]===void 0&&(hn[e]={default:e}),hn[e]}const pn=({mobileQuery:e="screen and (max-device-width: 40rem)",tabletQuery:r="screen and (min-device-width: 40.01rem) and (max-device-width: 63.9375rem)",desktopQuery:t="screen and (min-device-width: 64rem)",mobileMarkup:n,aboveMobileMarkup:s,tabletMarkup:a,desktopMarkup:o})=>{const i=pr(e),c=pr(r),f=pr(t);return(()=>i&&n?n:!i&&s?s:c&&a?a:f&&o?o:(console.error("Invalid media settings"),null))()};function aa(e,r,t){const n=a=>{const o=a.target,i=e.style.display!=="hidden";e&&i&&!eo(e,o)&&!s(t,o)&&r(!1),r(!0)},s=(a,o)=>{if(!a)return!1;for(let i=0,c=a.length;i<c;i++)if(a[i].isSameNode(o)||a[i].contains(o))return!0;return!1};return document.addEventListener("mousedown",n),n}function oa(e){document.removeEventListener("mousedown",e)}function nh(e,r){if(e==null)return{};var t={},n=Object.keys(e),s,a;for(a=0;a<n.length;a++)s=n[a],!(r.indexOf(s)>=0)&&(t[s]=e[s]);return t}function mn(e,r){return mn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},mn(e,r)}function sh(e,r){e.prototype=Object.create(r.prototype),e.prototype.constructor=e,mn(e,r)}var bn={exports:{}},mr={exports:{}},pe={};/** @license React v16.13.1
32
32
  * react-is.production.min.js
33
33
  *
34
34
  * Copyright (c) Facebook, Inc. and its affiliates.
35
35
  *
36
36
  * This source code is licensed under the MIT license found in the
37
37
  * LICENSE file in the root directory of this source tree.
38
- */var aa;function sh(){if(aa)return he;aa=1;var e=typeof Symbol=="function"&&Symbol.for,r=e?Symbol.for("react.element"):60103,t=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,i=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,f=e?Symbol.for("react.concurrent_mode"):60111,h=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,y=e?Symbol.for("react.suspense_list"):60120,x=e?Symbol.for("react.memo"):60115,w=e?Symbol.for("react.lazy"):60116,D=e?Symbol.for("react.block"):60121,O=e?Symbol.for("react.fundamental"):60117,S=e?Symbol.for("react.responder"):60118,R=e?Symbol.for("react.scope"):60119;function U(b){if(typeof b=="object"&&b!==null){var A=b.$$typeof;switch(A){case r:switch(b=b.type,b){case c:case f:case n:case a:case s:case p:return b;default:switch(b=b&&b.$$typeof,b){case i:case h:case w:case x:case o:return b;default:return A}}case t:return A}}}function F(b){return U(b)===f}return he.AsyncMode=c,he.ConcurrentMode=f,he.ContextConsumer=i,he.ContextProvider=o,he.Element=r,he.ForwardRef=h,he.Fragment=n,he.Lazy=w,he.Memo=x,he.Portal=t,he.Profiler=a,he.StrictMode=s,he.Suspense=p,he.isAsyncMode=function(b){return F(b)||U(b)===c},he.isConcurrentMode=F,he.isContextConsumer=function(b){return U(b)===i},he.isContextProvider=function(b){return U(b)===o},he.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===r},he.isForwardRef=function(b){return U(b)===h},he.isFragment=function(b){return U(b)===n},he.isLazy=function(b){return U(b)===w},he.isMemo=function(b){return U(b)===x},he.isPortal=function(b){return U(b)===t},he.isProfiler=function(b){return U(b)===a},he.isStrictMode=function(b){return U(b)===s},he.isSuspense=function(b){return U(b)===p},he.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===n||b===f||b===a||b===s||b===p||b===y||typeof b=="object"&&b!==null&&(b.$$typeof===w||b.$$typeof===x||b.$$typeof===o||b.$$typeof===i||b.$$typeof===h||b.$$typeof===O||b.$$typeof===S||b.$$typeof===R||b.$$typeof===D)},he.typeOf=U,he}var pe={};/** @license React v16.13.1
38
+ */var ia;function ah(){if(ia)return pe;ia=1;var e=typeof Symbol=="function"&&Symbol.for,r=e?Symbol.for("react.element"):60103,t=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,i=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,f=e?Symbol.for("react.concurrent_mode"):60111,h=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,y=e?Symbol.for("react.suspense_list"):60120,x=e?Symbol.for("react.memo"):60115,w=e?Symbol.for("react.lazy"):60116,O=e?Symbol.for("react.block"):60121,_=e?Symbol.for("react.fundamental"):60117,S=e?Symbol.for("react.responder"):60118,R=e?Symbol.for("react.scope"):60119;function z(b){if(typeof b=="object"&&b!==null){var A=b.$$typeof;switch(A){case r:switch(b=b.type,b){case c:case f:case n:case a:case s:case p:return b;default:switch(b=b&&b.$$typeof,b){case i:case h:case w:case x:case o:return b;default:return A}}case t:return A}}}function F(b){return z(b)===f}return pe.AsyncMode=c,pe.ConcurrentMode=f,pe.ContextConsumer=i,pe.ContextProvider=o,pe.Element=r,pe.ForwardRef=h,pe.Fragment=n,pe.Lazy=w,pe.Memo=x,pe.Portal=t,pe.Profiler=a,pe.StrictMode=s,pe.Suspense=p,pe.isAsyncMode=function(b){return F(b)||z(b)===c},pe.isConcurrentMode=F,pe.isContextConsumer=function(b){return z(b)===i},pe.isContextProvider=function(b){return z(b)===o},pe.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===r},pe.isForwardRef=function(b){return z(b)===h},pe.isFragment=function(b){return z(b)===n},pe.isLazy=function(b){return z(b)===w},pe.isMemo=function(b){return z(b)===x},pe.isPortal=function(b){return z(b)===t},pe.isProfiler=function(b){return z(b)===a},pe.isStrictMode=function(b){return z(b)===s},pe.isSuspense=function(b){return z(b)===p},pe.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===n||b===f||b===a||b===s||b===p||b===y||typeof b=="object"&&b!==null&&(b.$$typeof===w||b.$$typeof===x||b.$$typeof===o||b.$$typeof===i||b.$$typeof===h||b.$$typeof===_||b.$$typeof===S||b.$$typeof===R||b.$$typeof===O)},pe.typeOf=z,pe}var me={};/** @license React v16.13.1
39
39
  * react-is.development.js
40
40
  *
41
41
  * Copyright (c) Facebook, Inc. and its affiliates.
42
42
  *
43
43
  * This source code is licensed under the MIT license found in the
44
44
  * LICENSE file in the root directory of this source tree.
45
- */var oa;function ah(){return oa||(oa=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,r=e?Symbol.for("react.element"):60103,t=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,i=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,f=e?Symbol.for("react.concurrent_mode"):60111,h=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,y=e?Symbol.for("react.suspense_list"):60120,x=e?Symbol.for("react.memo"):60115,w=e?Symbol.for("react.lazy"):60116,D=e?Symbol.for("react.block"):60121,O=e?Symbol.for("react.fundamental"):60117,S=e?Symbol.for("react.responder"):60118,R=e?Symbol.for("react.scope"):60119;function U(j){return typeof j=="string"||typeof j=="function"||j===n||j===f||j===a||j===s||j===p||j===y||typeof j=="object"&&j!==null&&(j.$$typeof===w||j.$$typeof===x||j.$$typeof===o||j.$$typeof===i||j.$$typeof===h||j.$$typeof===O||j.$$typeof===S||j.$$typeof===R||j.$$typeof===D)}function F(j){if(typeof j=="object"&&j!==null){var je=j.$$typeof;switch(je){case r:var nt=j.type;switch(nt){case c:case f:case n:case a:case s:case p:return nt;default:var Xe=nt&&nt.$$typeof;switch(Xe){case i:case h:case w:case x:case o:return Xe;default:return je}}case t:return je}}}var b=c,A=f,k=i,V=o,B=r,ne=h,te=n,J=w,N=x,$=t,I=a,C=s,G=p,v=!1;function ee(j){return v||(v=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),g(j)||F(j)===c}function g(j){return F(j)===f}function _(j){return F(j)===i}function z(j){return F(j)===o}function E(j){return typeof j=="object"&&j!==null&&j.$$typeof===r}function Y(j){return F(j)===h}function q(j){return F(j)===n}function L(j){return F(j)===w}function H(j){return F(j)===x}function P(j){return F(j)===t}function W(j){return F(j)===a}function Z(j){return F(j)===s}function Te(j){return F(j)===p}pe.AsyncMode=b,pe.ConcurrentMode=A,pe.ContextConsumer=k,pe.ContextProvider=V,pe.Element=B,pe.ForwardRef=ne,pe.Fragment=te,pe.Lazy=J,pe.Memo=N,pe.Portal=$,pe.Profiler=I,pe.StrictMode=C,pe.Suspense=G,pe.isAsyncMode=ee,pe.isConcurrentMode=g,pe.isContextConsumer=_,pe.isContextProvider=z,pe.isElement=E,pe.isForwardRef=Y,pe.isFragment=q,pe.isLazy=L,pe.isMemo=H,pe.isPortal=P,pe.isProfiler=W,pe.isStrictMode=Z,pe.isSuspense=Te,pe.isValidElementType=U,pe.typeOf=F}()),pe}var ia;function ca(){return ia||(ia=1,process.env.NODE_ENV==="production"?yr.exports=sh():yr.exports=ah()),yr.exports}/*
45
+ */var ca;function oh(){return ca||(ca=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,r=e?Symbol.for("react.element"):60103,t=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,i=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,f=e?Symbol.for("react.concurrent_mode"):60111,h=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,y=e?Symbol.for("react.suspense_list"):60120,x=e?Symbol.for("react.memo"):60115,w=e?Symbol.for("react.lazy"):60116,O=e?Symbol.for("react.block"):60121,_=e?Symbol.for("react.fundamental"):60117,S=e?Symbol.for("react.responder"):60118,R=e?Symbol.for("react.scope"):60119;function z(I){return typeof I=="string"||typeof I=="function"||I===n||I===f||I===a||I===s||I===p||I===y||typeof I=="object"&&I!==null&&(I.$$typeof===w||I.$$typeof===x||I.$$typeof===o||I.$$typeof===i||I.$$typeof===h||I.$$typeof===_||I.$$typeof===S||I.$$typeof===R||I.$$typeof===O)}function F(I){if(typeof I=="object"&&I!==null){var Ne=I.$$typeof;switch(Ne){case r:var nt=I.type;switch(nt){case c:case f:case n:case a:case s:case p:return nt;default:var qe=nt&&nt.$$typeof;switch(qe){case i:case h:case w:case x:case o:return qe;default:return Ne}}case t:return Ne}}}var b=c,A=f,k=i,W=o,V=r,ne=h,te=n,X=w,N=x,$=t,j=a,C=s,q=p,v=!1;function ee(I){return v||(v=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),g(I)||F(I)===c}function g(I){return F(I)===f}function D(I){return F(I)===i}function B(I){return F(I)===o}function P(I){return typeof I=="object"&&I!==null&&I.$$typeof===r}function Y(I){return F(I)===h}function G(I){return F(I)===n}function L(I){return F(I)===w}function H(I){return F(I)===x}function U(I){return F(I)===t}function J(I){return F(I)===a}function E(I){return F(I)===s}function se(I){return F(I)===p}me.AsyncMode=b,me.ConcurrentMode=A,me.ContextConsumer=k,me.ContextProvider=W,me.Element=V,me.ForwardRef=ne,me.Fragment=te,me.Lazy=X,me.Memo=N,me.Portal=$,me.Profiler=j,me.StrictMode=C,me.Suspense=q,me.isAsyncMode=ee,me.isConcurrentMode=g,me.isContextConsumer=D,me.isContextProvider=B,me.isElement=P,me.isForwardRef=Y,me.isFragment=G,me.isLazy=L,me.isMemo=H,me.isPortal=U,me.isProfiler=J,me.isStrictMode=E,me.isSuspense=se,me.isValidElementType=z,me.typeOf=F}()),me}var ua;function la(){return ua||(ua=1,process.env.NODE_ENV==="production"?mr.exports=ah():mr.exports=oh()),mr.exports}/*
46
46
  object-assign
47
47
  (c) Sindre Sorhus
48
48
  @license MIT
49
- */var pn,ua;function oh(){if(ua)return pn;ua=1;var e=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;function n(a){if(a==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}function s(){try{if(!Object.assign)return!1;var a=new String("abc");if(a[5]="de",Object.getOwnPropertyNames(a)[0]==="5")return!1;for(var o={},i=0;i<10;i++)o["_"+String.fromCharCode(i)]=i;var c=Object.getOwnPropertyNames(o).map(function(h){return o[h]});if(c.join("")!=="0123456789")return!1;var f={};return"abcdefghijklmnopqrst".split("").forEach(function(h){f[h]=h}),Object.keys(Object.assign({},f)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return pn=s()?Object.assign:function(a,o){for(var i,c=n(a),f,h=1;h<arguments.length;h++){i=Object(arguments[h]);for(var p in i)r.call(i,p)&&(c[p]=i[p]);if(e){f=e(i);for(var y=0;y<f.length;y++)t.call(i,f[y])&&(c[f[y]]=i[f[y]])}}return c},pn}var mn,la;function bn(){if(la)return mn;la=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return mn=e,mn}var gn,fa;function da(){return fa||(fa=1,gn=Function.call.bind(Object.prototype.hasOwnProperty)),gn}var yn,ha;function ih(){if(ha)return yn;ha=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var r=bn(),t={},n=da();e=function(a){var o="Warning: "+a;typeof console<"u"&&console.error(o);try{throw new Error(o)}catch{}}}function s(a,o,i,c,f){if(process.env.NODE_ENV!=="production"){for(var h in a)if(n(a,h)){var p;try{if(typeof a[h]!="function"){var y=Error((c||"React class")+": "+i+" type `"+h+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[h]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw y.name="Invariant Violation",y}p=a[h](o,h,c,i,null,r)}catch(w){p=w}if(p&&!(p instanceof Error)&&e((c||"React class")+": type specification of "+i+" `"+h+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof p+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),p instanceof Error&&!(p.message in t)){t[p.message]=!0;var x=f?f():"";e("Failed "+i+" type: "+p.message+(x??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(t={})},yn=s,yn}var vn,pa;function ch(){if(pa)return vn;pa=1;var e=ca(),r=oh(),t=bn(),n=da(),s=ih(),a=function(){};process.env.NODE_ENV!=="production"&&(a=function(i){var c="Warning: "+i;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}});function o(){return null}return vn=function(i,c){var f=typeof Symbol=="function"&&Symbol.iterator,h="@@iterator";function p(g){var _=g&&(f&&g[f]||g[h]);if(typeof _=="function")return _}var y="<<anonymous>>",x={array:S("array"),bigint:S("bigint"),bool:S("boolean"),func:S("function"),number:S("number"),object:S("object"),string:S("string"),symbol:S("symbol"),any:R(),arrayOf:U,element:F(),elementType:b(),instanceOf:A,node:ne(),objectOf:V,oneOf:k,oneOfType:B,shape:J,exact:N};function w(g,_){return g===_?g!==0||1/g===1/_:g!==g&&_!==_}function D(g,_){this.message=g,this.data=_&&typeof _=="object"?_:{},this.stack=""}D.prototype=Error.prototype;function O(g){if(process.env.NODE_ENV!=="production")var _={},z=0;function E(q,L,H,P,W,Z,Te){if(P=P||y,Z=Z||H,Te!==t){if(c){var j=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw j.name="Invariant Violation",j}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var je=P+":"+H;!_[je]&&z<3&&(a("You are manually calling a React.PropTypes validation function for the `"+Z+"` prop on `"+P+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),_[je]=!0,z++)}}return L[H]==null?q?L[H]===null?new D("The "+W+" `"+Z+"` is marked as required "+("in `"+P+"`, but its value is `null`.")):new D("The "+W+" `"+Z+"` is marked as required in "+("`"+P+"`, but its value is `undefined`.")):null:g(L,H,P,W,Z)}var Y=E.bind(null,!1);return Y.isRequired=E.bind(null,!0),Y}function S(g){function _(z,E,Y,q,L,H){var P=z[E],W=C(P);if(W!==g){var Z=G(P);return new D("Invalid "+q+" `"+L+"` of type "+("`"+Z+"` supplied to `"+Y+"`, expected ")+("`"+g+"`."),{expectedType:g})}return null}return O(_)}function R(){return O(o)}function U(g){function _(z,E,Y,q,L){if(typeof g!="function")return new D("Property `"+L+"` of component `"+Y+"` has invalid PropType notation inside arrayOf.");var H=z[E];if(!Array.isArray(H)){var P=C(H);return new D("Invalid "+q+" `"+L+"` of type "+("`"+P+"` supplied to `"+Y+"`, expected an array."))}for(var W=0;W<H.length;W++){var Z=g(H,W,Y,q,L+"["+W+"]",t);if(Z instanceof Error)return Z}return null}return O(_)}function F(){function g(_,z,E,Y,q){var L=_[z];if(!i(L)){var H=C(L);return new D("Invalid "+Y+" `"+q+"` of type "+("`"+H+"` supplied to `"+E+"`, expected a single ReactElement."))}return null}return O(g)}function b(){function g(_,z,E,Y,q){var L=_[z];if(!e.isValidElementType(L)){var H=C(L);return new D("Invalid "+Y+" `"+q+"` of type "+("`"+H+"` supplied to `"+E+"`, expected a single ReactElement type."))}return null}return O(g)}function A(g){function _(z,E,Y,q,L){if(!(z[E]instanceof g)){var H=g.name||y,P=ee(z[E]);return new D("Invalid "+q+" `"+L+"` of type "+("`"+P+"` supplied to `"+Y+"`, expected ")+("instance of `"+H+"`."))}return null}return O(_)}function k(g){if(!Array.isArray(g))return process.env.NODE_ENV!=="production"&&(arguments.length>1?a("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):a("Invalid argument supplied to oneOf, expected an array.")),o;function _(z,E,Y,q,L){for(var H=z[E],P=0;P<g.length;P++)if(w(H,g[P]))return null;var W=JSON.stringify(g,function(Te,j){var je=G(j);return je==="symbol"?String(j):j});return new D("Invalid "+q+" `"+L+"` of value `"+String(H)+"` "+("supplied to `"+Y+"`, expected one of "+W+"."))}return O(_)}function V(g){function _(z,E,Y,q,L){if(typeof g!="function")return new D("Property `"+L+"` of component `"+Y+"` has invalid PropType notation inside objectOf.");var H=z[E],P=C(H);if(P!=="object")return new D("Invalid "+q+" `"+L+"` of type "+("`"+P+"` supplied to `"+Y+"`, expected an object."));for(var W in H)if(n(H,W)){var Z=g(H,W,Y,q,L+"."+W,t);if(Z instanceof Error)return Z}return null}return O(_)}function B(g){if(!Array.isArray(g))return process.env.NODE_ENV!=="production"&&a("Invalid argument supplied to oneOfType, expected an instance of array."),o;for(var _=0;_<g.length;_++){var z=g[_];if(typeof z!="function")return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+v(z)+" at index "+_+"."),o}function E(Y,q,L,H,P){for(var W=[],Z=0;Z<g.length;Z++){var Te=g[Z],j=Te(Y,q,L,H,P,t);if(j==null)return null;j.data&&n(j.data,"expectedType")&&W.push(j.data.expectedType)}var je=W.length>0?", expected one of type ["+W.join(", ")+"]":"";return new D("Invalid "+H+" `"+P+"` supplied to "+("`"+L+"`"+je+"."))}return O(E)}function ne(){function g(_,z,E,Y,q){return $(_[z])?null:new D("Invalid "+Y+" `"+q+"` supplied to "+("`"+E+"`, expected a ReactNode."))}return O(g)}function te(g,_,z,E,Y){return new D((g||"React class")+": "+_+" type `"+z+"."+E+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+Y+"`.")}function J(g){function _(z,E,Y,q,L){var H=z[E],P=C(H);if(P!=="object")return new D("Invalid "+q+" `"+L+"` of type `"+P+"` "+("supplied to `"+Y+"`, expected `object`."));for(var W in g){var Z=g[W];if(typeof Z!="function")return te(Y,q,L,W,G(Z));var Te=Z(H,W,Y,q,L+"."+W,t);if(Te)return Te}return null}return O(_)}function N(g){function _(z,E,Y,q,L){var H=z[E],P=C(H);if(P!=="object")return new D("Invalid "+q+" `"+L+"` of type `"+P+"` "+("supplied to `"+Y+"`, expected `object`."));var W=r({},z[E],g);for(var Z in W){var Te=g[Z];if(n(g,Z)&&typeof Te!="function")return te(Y,q,L,Z,G(Te));if(!Te)return new D("Invalid "+q+" `"+L+"` key `"+Z+"` supplied to `"+Y+"`.\nBad object: "+JSON.stringify(z[E],null," ")+`
50
- Valid keys: `+JSON.stringify(Object.keys(g),null," "));var j=Te(H,Z,Y,q,L+"."+Z,t);if(j)return j}return null}return O(_)}function $(g){switch(typeof g){case"number":case"string":case"undefined":return!0;case"boolean":return!g;case"object":if(Array.isArray(g))return g.every($);if(g===null||i(g))return!0;var _=p(g);if(_){var z=_.call(g),E;if(_!==g.entries){for(;!(E=z.next()).done;)if(!$(E.value))return!1}else for(;!(E=z.next()).done;){var Y=E.value;if(Y&&!$(Y[1]))return!1}}else return!1;return!0;default:return!1}}function I(g,_){return g==="symbol"?!0:_?_["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&_ instanceof Symbol:!1}function C(g){var _=typeof g;return Array.isArray(g)?"array":g instanceof RegExp?"object":I(_,g)?"symbol":_}function G(g){if(typeof g>"u"||g===null)return""+g;var _=C(g);if(_==="object"){if(g instanceof Date)return"date";if(g instanceof RegExp)return"regexp"}return _}function v(g){var _=G(g);switch(_){case"array":case"object":return"an "+_;case"boolean":case"date":case"regexp":return"a "+_;default:return _}}function ee(g){return!g.constructor||!g.constructor.name?y:g.constructor.name}return x.checkPropTypes=s,x.resetWarningCache=s.resetWarningCache,x.PropTypes=x,x},vn}var xn,ma;function uh(){if(ma)return xn;ma=1;var e=bn();function r(){}function t(){}return t.resetWarningCache=r,xn=function(){function n(o,i,c,f,h,p){if(p!==e){var y=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw y.name="Invariant Violation",y}}n.isRequired=n;function s(){return n}var a={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:s,element:n,elementType:n,instanceOf:s,node:n,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:t,resetWarningCache:r};return a.PropTypes=a,a},xn}if(process.env.NODE_ENV!=="production"){var lh=ca(),fh=!0;hn.exports=ch()(lh.isElement,fh)}else hn.exports=uh()();var dh=hn.exports;const re=Ar(dh),ba={disabled:!1};var hh=process.env.NODE_ENV!=="production"?re.oneOfType([re.number,re.shape({enter:re.number,exit:re.number,appear:re.number}).isRequired]):null;process.env.NODE_ENV!=="production"&&re.oneOfType([re.string,re.shape({enter:re.string,exit:re.string,active:re.string}),re.shape({enter:re.string,enterDone:re.string,enterActive:re.string,exit:re.string,exitDone:re.string,exitActive:re.string})]);const ga=d.createContext(null);var ph=function(r){return r.scrollTop},Gt="unmounted",lt="exited",ft="entering",Pt="entered",wn="exiting",Ke=function(e){nh(r,e);function r(n,s){var a;a=e.call(this,n,s)||this;var o=s,i=o&&!o.isMounting?n.enter:n.appear,c;return a.appearStatus=null,n.in?i?(c=lt,a.appearStatus=ft):c=Pt:n.unmountOnExit||n.mountOnEnter?c=Gt:c=lt,a.state={status:c},a.nextCallback=null,a}r.getDerivedStateFromProps=function(s,a){var o=s.in;return o&&a.status===Gt?{status:lt}:null};var t=r.prototype;return t.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},t.componentDidUpdate=function(s){var a=null;if(s!==this.props){var o=this.state.status;this.props.in?o!==ft&&o!==Pt&&(a=ft):(o===ft||o===Pt)&&(a=wn)}this.updateStatus(!1,a)},t.componentWillUnmount=function(){this.cancelNextCallback()},t.getTimeouts=function(){var s=this.props.timeout,a,o,i;return a=o=i=s,s!=null&&typeof s!="number"&&(a=s.exit,o=s.enter,i=s.appear!==void 0?s.appear:o),{exit:a,enter:o,appear:i}},t.updateStatus=function(s,a){if(s===void 0&&(s=!1),a!==null)if(this.cancelNextCallback(),a===ft){if(this.props.unmountOnExit||this.props.mountOnEnter){var o=this.props.nodeRef?this.props.nodeRef.current:Fe.findDOMNode(this);o&&ph(o)}this.performEnter(s)}else this.performExit();else this.props.unmountOnExit&&this.state.status===lt&&this.setState({status:Gt})},t.performEnter=function(s){var a=this,o=this.props.enter,i=this.context?this.context.isMounting:s,c=this.props.nodeRef?[i]:[Fe.findDOMNode(this),i],f=c[0],h=c[1],p=this.getTimeouts(),y=i?p.appear:p.enter;if(!s&&!o||ba.disabled){this.safeSetState({status:Pt},function(){a.props.onEntered(f)});return}this.props.onEnter(f,h),this.safeSetState({status:ft},function(){a.props.onEntering(f,h),a.onTransitionEnd(y,function(){a.safeSetState({status:Pt},function(){a.props.onEntered(f,h)})})})},t.performExit=function(){var s=this,a=this.props.exit,o=this.getTimeouts(),i=this.props.nodeRef?void 0:Fe.findDOMNode(this);if(!a||ba.disabled){this.safeSetState({status:lt},function(){s.props.onExited(i)});return}this.props.onExit(i),this.safeSetState({status:wn},function(){s.props.onExiting(i),s.onTransitionEnd(o.exit,function(){s.safeSetState({status:lt},function(){s.props.onExited(i)})})})},t.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},t.safeSetState=function(s,a){a=this.setNextCallback(a),this.setState(s,a)},t.setNextCallback=function(s){var a=this,o=!0;return this.nextCallback=function(i){o&&(o=!1,a.nextCallback=null,s(i))},this.nextCallback.cancel=function(){o=!1},this.nextCallback},t.onTransitionEnd=function(s,a){this.setNextCallback(a);var o=this.props.nodeRef?this.props.nodeRef.current:Fe.findDOMNode(this),i=s==null&&!this.props.addEndListener;if(!o||i){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var c=this.props.nodeRef?[this.nextCallback]:[o,this.nextCallback],f=c[0],h=c[1];this.props.addEndListener(f,h)}s!=null&&setTimeout(this.nextCallback,s)},t.render=function(){var s=this.state.status;if(s===Gt)return null;var a=this.props,o=a.children;a.in,a.mountOnEnter,a.unmountOnExit,a.appear,a.enter,a.exit,a.timeout,a.addEndListener,a.onEnter,a.onEntering,a.onEntered,a.onExit,a.onExiting,a.onExited,a.nodeRef;var i=rh(a,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return d.createElement(ga.Provider,{value:null},typeof o=="function"?o(s,i):d.cloneElement(d.Children.only(o),i))},r}(d.Component);Ke.contextType=ga,Ke.propTypes=process.env.NODE_ENV!=="production"?{nodeRef:re.shape({current:typeof Element>"u"?re.any:function(e,r,t,n,s,a){var o=e[r];return re.instanceOf(o&&"ownerDocument"in o?o.ownerDocument.defaultView.Element:Element)(e,r,t,n,s,a)}}),children:re.oneOfType([re.func.isRequired,re.element.isRequired]).isRequired,in:re.bool,mountOnEnter:re.bool,unmountOnExit:re.bool,appear:re.bool,enter:re.bool,exit:re.bool,timeout:function(r){var t=hh;r.addEndListener||(t=t.isRequired);for(var n=arguments.length,s=new Array(n>1?n-1:0),a=1;a<n;a++)s[a-1]=arguments[a];return t.apply(void 0,[r].concat(s))},addEndListener:re.func,onEnter:re.func,onEntering:re.func,onEntered:re.func,onExit:re.func,onExiting:re.func,onExited:re.func}:{};function Et(){}Ke.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Et,onEntering:Et,onEntered:Et,onExit:Et,onExiting:Et,onExited:Et},Ke.UNMOUNTED=Gt,Ke.EXITED=lt,Ke.ENTERING=ft,Ke.ENTERED=Pt,Ke.EXITING=wn;const mh=Ke,ya=({start:e,timeout:r=400,defaultStyle:t,transitionStyles:n,showTransitionOptions:s="cubic-bezier(0, 0, 0.2, 1)",hideTransitionOptions:a="linear",unmountOnExit:o=!1,onEntering:i,onEntered:c,onExit:f,onExited:h,children:p})=>{const y=t||{transition:`opacity ${r}ms ${s}`,opacity:0},x=n||{entering:{opacity:1},entered:{opacity:1},exiting:{transition:`opacity ${r}ms ${a}`,opacity:0},exited:{transition:`opacity ${r}ms ${a}`,opacity:0},unmounted:{}};return l.jsx(mh,{in:e,timeout:r,onEntering:i,onEntered:c,onExit:f,onExited:h,unmountOnExit:o,children:w=>p({state:w,defaultStyle:y,transitionStyles:x})})};function va(e){return e.target?e.target:e}const xa=({visible:e,target:r,appendTo:t=document.body,unmountWhenHidden:n=!1,transitionDuration:s=400,showTransitionOptions:a="cubic-bezier(0, 0, 0.2, 1)",hideTransitionOptions:o="linear",approveText:i="DONE",shown:c,hidden:f,isClickedWithin:h,children:p})=>{const[y,x]=d.useState(-1),[w,D]=d.useState(-1),[O,S]=d.useState(e),R=d.useRef(100),U=d.useRef(101),F=d.useRef(),b=d.useRef(),A=d.useRef();d.useEffect(()=>{r&&(F.current=va(r));const N=Wn("zIndex",$=>$==="auto"||$==="-1"?!1:parseInt($)>100).map($=>parseInt($,10));N.length>0&&(R.current=Math.max(...N)+1,U.current=Math.max(...N)+2),S(e)},[e,r]);const k=N=>{b.current=N},V=()=>{D(R.current),x(U.current)},B=()=>{if(!b.current)return;c==null||c();let N;F.current&&(N=[F.current]);const $=I=>{I?h==null||h():S(!1)};A.current=na(b.current,$,N)},ne=()=>{A.current&&sa(A.current)},te=()=>{D(-1),x(-1),f==null||f()},J={entering:{opacity:.5},entered:{opacity:.5}};return Fe.createPortal(l.jsx(ya,{start:O,timeout:s,showTransitionOptions:a,hideTransitionOptions:o,onEntering:V,onEntered:B,onExit:ne,onExited:te,unmountOnExit:n,children:({state:N,defaultStyle:$,transitionStyles:I})=>l.jsxs("div",{ref:C=>C&&k(C),children:[l.jsx("div",{className:"bsc-fixed bsc-left-0 bsc-top-0 bsc-h-full bsc-w-full bsc-bg-mono-dark-1",style:{zIndex:w,...I[N],...J[N]}}),l.jsxs("div",{className:"dark:bsck-border-mono-light-1 bsc-fixed bsc-bottom-0 bsc-left-0 bsc-w-full bsc-bg-white dark:bsc-border-t dark:bsc-border-solid dark:bsc-bg-mono-dark-1 dark:bsc-text-mono-light-1",style:{zIndex:y,...$,...I[N]},children:[l.jsx("div",{className:"bsc-w-full",children:p}),l.jsx(l.Fragment,{children:l.jsx(Ve,{buttonType:"primary",fullWidth:!0,onClick:()=>S(!1),className:"bsc-text-xs bsc-font-bold",children:i})})]})]})}),t)};var wa=(e=>(e[e.TopLeft=0]="TopLeft",e[e.TopRight=1]="TopRight",e[e.BottomLeft=2]="BottomLeft",e[e.BottomRight=3]="BottomRight",e))(wa||{}),Ta=(e=>(e[e.TopLeft=0]="TopLeft",e[e.TopRight=1]="TopRight",e[e.BottomLeft=2]="BottomLeft",e[e.BottomRight=3]="BottomRight",e))(Ta||{});class xe{static positionToTarget(r,t=2){const n=r.getBoundingClientRect();let s=0,a=0;const o=window.scrollY;switch(t){case 2:s=n.top+n.height+o,a=n.left;break;case 0:s=n.top+o,a=n.left;break;case 3:s=n.top+n.height+o,a=n.left+n.width;break;case 1:s=n.top+o,a=n.left+n.width}return{top:s,left:a}}static positionElementToTarget(r,t,n=0,s=2){let{left:a,top:o}=xe.positionToTarget(t,s);const i=r.getBoundingClientRect();switch(n){case 0:break;case 1:a=a-i.width;break;case 2:o=o-i.height;break;case 3:o=o-i.height,a=a-i.width;break}return{top:o,left:a}}static canPositionElementOnScreenWithTarget(r,t){const n=xe.getScreenDimensions(),s=r.getBoundingClientRect(),a=xe.positionElementToTarget(r,t,0,2);if(a.left+s.width<n.width&&a.top+s.height<n.height||xe.positionElementToTarget(r,t,1,3).left>=0&&a.top+s.height<n.height)return!0;const i=xe.positionElementToTarget(r,t,2,0);if(i.left+s.width<n.width&&i.top>=0)return!0;const c=xe.positionElementToTarget(r,t,3,1);return c.left>=0&&c.top>=0}static canPositionElementOnScreen(r){const t=xe.getScreenDimensions(),n=r.getBoundingClientRect();return n.width<=t.width&&n.height<=t.height}static positionElementToTargetOnScreen(r,t,n=0,s=2){const{left:a,top:o}=xe.positionElementToTarget(r,t,n,s),i=r.getBoundingClientRect(),c=xe.determineOffScreenLocation(i);if(c){if(n===0&&s===2){if(c.right&&!c.bottom)return xe.positionElementToTarget(r,t,1,3);if(c.bottom&&!c.right)return xe.positionElementToTarget(r,t,2,0);if(c.right&&c.bottom)return xe.positionElementToTarget(r,t,3,1)}else if(n===1&&s===3){if(c.left&&!c.bottom)return xe.positionElementToTarget(r,t,0,2);if(c.bottom&&!c.left)return xe.positionElementToTarget(r,t,3,1);if(c.left&&c.bottom)return xe.positionElementToTarget(r,t,2,0)}}return{top:o,left:a}}static determineOffScreenLocation(r){const t=xe.getScreenDimensions(),n={left:r.left<0,top:r.top<0,right:r.left+r.width>t.width,bottom:r.top+r.height>t.height};return n.left||n.top||n.right||n.bottom?n:void 0}static getScreenDimensions(){return{width:window.innerWidth,height:Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)}}}const Sa=({visible:e,target:r,targetPosition:t=wa.BottomLeft,elementAlignment:n=Ta.TopLeft,shouldTargetCloseOverlay:s=!0,shouldMatchTargetWidth:a=!1,shouldScrollCloseOverlay:o=!1,shouldCheckZIndex:i=!1,shouldRemainOnScreen:c=!1,unmountWhenHidden:f=!1,transitionDuration:h=400,showTransitionOptions:p="cubic-bezier(0, 0, 0.2, 1)",hideTransitionOptions:y="linear",shown:x,hidden:w,isClickedWithin:D,markupCreated:O,children:S})=>{const[R,U]=d.useState(-1),[F,b]=d.useState(e),[A,k]=d.useState(!1),V=d.useRef(!1),B=d.useRef(100),ne=d.useRef({left:0,top:0,width:0}),te=d.useRef(),J=d.useRef(),N=d.useRef(),$=d.useRef(),I=d.useRef(),C=d.useRef(),G=Nn();d.useEffect(()=>(c===!0&&(C.current=new ResizeObserver(v)),()=>{var L,H;c===!0&&(J.current&&((L=C.current)==null||L.unobserve(J.current)),(H=C.current)==null||H.disconnect())}),[]),d.useEffect(()=>{if(r&&(te.current=va(r),o)){const L=G==null?void 0:G.isValidScrollableElement;N.current=Hn(te.current,{overflow:"scroll, auto",overflowX:"scroll, auto",overflowY:"scroll, auto"},!1,L),N.current.tagName.toLowerCase()==="html"&&(N.current=document)}if(i){const L=Wn("zIndex",H=>parseInt(H)>=100).map(H=>parseInt(H));L.length>0&&(B.current=Math.max(...L)+1)}e!==void 0&&b(e)},[r,e,o,i]);const v=L=>{if(J.current){const H=xe.getScreenDimensions(),P=L[L.length-1].target,W=P.getBoundingClientRect(),Z=xe.determineOffScreenLocation(W);if(Z){if(te.current&&xe.canPositionElementOnScreenWithTarget(P,te.current)){const Te=xe.positionElementToTargetOnScreen(J.current,te.current,n,t);ne.current={...ne.current,...Te}}else Z.right?ne.current.left=H.width-W.width:Z.left&&(ne.current.left=0),Z.bottom?ne.current.top=H.height-W.height:Z.top&&(ne.current.top=0);ee()}}},ee=Vt(()=>{V.current=!V.current,k(V.current)},20),g=()=>{U(B.current)},_=()=>{if(!J.current)return;x==null||x();let L;!s&&te.current&&(L=[te.current]);const H=P=>{P?D==null||D():b(!1)};$.current=na(J.current,H,L),o&&(I.current=_l(P=>J.current&&Xa(P,J.current)&&b(!1),100,{leading:!0}),N.current&&N.current.addEventListener("scroll",I.current))},z=()=>{N.current&&I.current&&(N.current.removeEventListener("scroll",I.current),I.current=void 0),$.current&&sa($.current)},E=()=>{U(-1),w==null||w()},Y=L=>{var H,P;if(c===!0&&J.current&&((H=C.current)==null||H.unobserve(J.current)),J.current=L,O==null||O(L),te.current){const W=xe.positionElementToTarget(J.current,te.current,n,t);ne.current={...W,width:te.current.offsetWidth},c===!0&&(xe.canPositionElementOnScreenWithTarget(J.current,te.current)||xe.canPositionElementOnScreen(J.current))&&((P=C.current)==null||P.observe(J.current))}},q=d.useMemo(()=>{const L={top:`${ne.current.top}px`,left:`${ne.current.left}px`,zIndex:R};return a&&(L.width=`${ne.current.width}px`),L},[A,R,a]);return l.jsx(ya,{start:F,timeout:h,showTransitionOptions:p,hideTransitionOptions:y,onEntering:g,onEntered:_,onExit:z,onExited:E,unmountOnExit:f,children:({state:L,defaultStyle:H,transitionStyles:P})=>l.jsx("div",{className:"bsc-fixed bsc-border bsc-border-solid bsc-bg-white bsc-shadow dark:bsc-border-mono-light-1 dark:bsc-bg-mono-dark-1 dark:bsc-text-mono-light-1",style:{...q,...H,...P[L]},ref:W=>W&&Y(W),children:S})})};let vr;const bh=new Uint8Array(16);function gh(){if(!vr&&(vr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!vr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return vr(bh)}const _e=[];for(let e=0;e<256;++e)_e.push((e+256).toString(16).slice(1));function yh(e,r=0){return _e[e[r+0]]+_e[e[r+1]]+_e[e[r+2]]+_e[e[r+3]]+"-"+_e[e[r+4]]+_e[e[r+5]]+"-"+_e[e[r+6]]+_e[e[r+7]]+"-"+_e[e[r+8]]+_e[e[r+9]]+"-"+_e[e[r+10]]+_e[e[r+11]]+_e[e[r+12]]+_e[e[r+13]]+_e[e[r+14]]+_e[e[r+15]]}const Pa={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function vh(e,r,t){if(Pa.randomUUID&&!r&&!e)return Pa.randomUUID();e=e||{};const n=e.random||(e.rng||gh)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,r){t=t||0;for(let s=0;s<16;++s)r[t+s]=n[s];return r}return yh(n)}class xr{static create(r){const t=[];let n=0;for(let s=0,a=r.formatParts.length;s<a;s++){const o=r.formatParts[s],i=n,c=i+o.characterCount;t.push({startPosition:i,endPosition:c,...o}),n=c}return t}}class xh{constructor(r,t){m(this,"instanceCollection");m(this,"formatPartList");m(this,"inputSlotCollection");m(this,"currentPartIndex",0);m(this,"currentCursorPosition",0);m(this,"inputElement");m(this,"inputSelection",null);m(this,"inputRange");m(this,"textNode");this.instanceCollection=kt.getInstance(),this.formatPartList=xr.create(r),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(t,r)}getCursorPosition(){return this.currentCursorPosition}getCurrentPartIndex(){return this.currentPartIndex}setInputElement(r){this.inputElement=r}setCursorToCurrentPosition(){this.setCursorSelection(this.currentCursorPosition)}setCursorPosition(r){this.setCursorSelection(r)}setCursorSelection(r,t){this.createInputRangeSelection(),this.inputRange&&this.textNode&&(this.inputRange.setStart(this.textNode,r),this.inputRange.setEnd(this.textNode,t||r),this.currentCursorPosition=t||r,this.setPartIndexByCursorPosition())}findCursorPosition(){var t,n;const r=(t=window.getSelection())==null?void 0:t.getRangeAt(0);if(this.inputElement&&r){const s=document.createTreeWalker(this.inputElement,NodeFilter.SHOW_TEXT,c=>{const f=document.createRange();return f.selectNodeContents(c),f.compareBoundaryPoints(Range.END_TO_END,r)<1?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT});let a=0;for(;s.nextNode();)a+=((n=s.currentNode.textContent)==null?void 0:n.length)||0;r.startContainer.nodeType===Node.TEXT_NODE&&(a+=r.startOffset);const o=this.inputSlotCollection.getLastSlotWithData(),i=o.startPosition+o.partText.length;this.setCursorSelection(a>i?i:a)}}isAtLastPart(){return this.currentPartIndex===this.formatPartList.length-1}moveHome(){const r=this.inputSlotCollection.getFirstSlot();this.setCursorSelection(r.startPosition)}moveEnd(){const r=this.inputSlotCollection.getLastSlotWithData(),t=r.startPosition+r.partText.length;this.setCursorSelection(t)}moveCursorLeft(){if(this.currentCursorPosition>0){const r=this.currentCursorPosition-1;let t=this.formatPartList[this.currentPartIndex];if(r>=t.startPosition&&r<=t.endPosition)this.setCursorSelection(r);else for(let n=this.currentPartIndex-1;n>=0;n--)t=this.formatPartList[n],r>=t.startPosition&&r<=t.endPosition&&(t.isSeparator?this.setCursorSelection(this.formatPartList[n-1].endPosition):this.setCursorSelection(r))}}moveCursorRight(){const r=this.inputSlotCollection.getLastSlotWithData(),t=r.startPosition+r.partText.length;if(this.currentCursorPosition<t){const n=this.currentCursorPosition+1;let s=this.formatPartList[this.currentPartIndex];if(n>=s.startPosition&&n<=s.endPosition)this.setCursorSelection(n);else for(let a=this.currentPartIndex+1,o=this.formatPartList.length;a<o;a++)s=this.formatPartList[a],n>=s.startPosition&&n<=s.endPosition&&(s.isSeparator?this.setCursorSelection(this.formatPartList[a+1].startPosition):this.setCursorSelection(n))}}moveToNextInputPart(){if(this.currentPartIndex<this.formatPartList.length-1){const r=this.findNextEditablePart();r&&(this.currentPartIndex=r.partIndex,this.setCursorSelection(r.startPosition))}}moveToPreviousInputPart(){if(this.currentPartIndex>0){const r=this.findPreviousEditablePart();r&&(this.currentPartIndex=r.partIndex,this.setCursorSelection(r.endPosition))}}findNextEditablePart(){return this.inputSlotCollection.getNextSlot(this.currentPartIndex)}findPreviousEditablePart(){return this.inputSlotCollection.getPreviousSlot(this.currentPartIndex)}setPartIndexByCursorPosition(){for(let r=0;r<this.formatPartList.length;r++){const t=this.formatPartList[r];if(this.currentCursorPosition>=t.startPosition&&this.currentCursorPosition<=t.endPosition){if(t.isSeparator){this.currentCursorPosition=this.formatPartList[r+1].startPosition,this.currentPartIndex=r+1;break}this.currentPartIndex=r;break}}}createInputRangeSelection(){var r,t;this.inputElement&&(this.inputSelection=window.getSelection(),this.inputRange=document.createRange(),(r=this.inputSelection)==null||r.removeAllRanges(),this.inputRange.selectNodeContents(this.inputElement),this.inputRange.collapse(!0),(t=this.inputSelection)==null||t.addRange(this.inputRange),this.inputElement.firstChild&&(this.textNode=this.inputElement.firstChild))}}class wh{static create(r){const t=[];for(let n=0,s=r.length;n<s;n++){const a=r[n];a.isSeparator||t.push({partIndex:n,partText:"",isComplete:!1,...a})}return t}}class Th{constructor(r){m(this,"inputSlots");this.inputSlots=wh.create(xr.create(r))}clearAllSlots(){for(let r=0,t=this.inputSlots.length;r<t;r++)this.inputSlots[r].partText=""}getSlot(r){return this.inputSlots.find(t=>t.partIndex===r)}getFirstSlot(){return this.inputSlots[0]}getNextSlot(r){const t=this.inputSlots.findIndex(n=>n.partIndex===r);if(t>-1&&t+1<this.inputSlots.length)return this.inputSlots[t+1]}getPreviousSlot(r){const t=this.inputSlots.findIndex(n=>n.partIndex===r);if(t>-1&&t-1>=0)return this.inputSlots[t-1]}getLastSlotWithData(){const r=this.inputSlots.findIndex(n=>!n.isComplete);let t=r;for(let n=r+1,s=this.inputSlots.length;n<s;n++)this.inputSlots[n].partText.length>0&&(t=n);return this.inputSlots[t>-1?t:0]}allSlotsCompleted(){return this.inputSlots.every(r=>r.isComplete)}allSlotsEmpty(){return this.inputSlots.every(r=>r.partText.length===0)}}class kt{static getInstance(){return this.instance||(this.instance=new Sh),this.instance}}m(kt,"instance");class Sh{constructor(){m(this,"navigatorInstances");m(this,"inputSlotInstances");this.navigatorInstances={},this.inputSlotInstances={}}getNavigatorInstance(r,t){return this.navigatorInstances[r]||(this.navigatorInstances[r]=new xh(t,r)),this.navigatorInstances[r]}getInputSlotInstance(r,t){return this.inputSlotInstances[r]||(this.inputSlotInstances[r]=new Th(t)),this.inputSlotInstances[r]}removeInstances(r){this.navigatorInstances[r]&&delete this.navigatorInstances[r],this.inputSlotInstances[r]&&delete this.inputSlotInstances[r]}}class Tn{constructor(r,t){m(this,"instanceCollection");m(this,"formatPartList");m(this,"inputSlotCollection");m(this,"inputElement");this.instanceCollection=kt.getInstance(),this.formatPartList=xr.create(r),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(t,r)}setInputElement(r){this.inputElement=r}render(){var t;let r="";for(let n=0,s=this.formatPartList.length;n<s;n++){const a=this.formatPartList[n];if(a.isSeparator)r+=a.inputText;else{const o=this.inputSlotCollection.getSlot(n);o&&(r+=o.partText+((t=o.inputText)==null?void 0:t.repeat(o.characterCount-o.partText.length)))}}this.inputElement&&(this.inputElement.innerHTML=r)}}var qe=(e=>(e[e.Text=0]="Text",e[e.Numeric=1]="Numeric",e))(qe||{});class Ea{constructor(){m(this,"numberKeys",["0","1","2","3","4","5","6","7","8","9"]);m(this,"movementKeys",["ArrowLeft","ArrowRight","Home","End"]);m(this,"editingKeys",["Backspace","Delete"]);m(this,"ignoreKeys",["Shift","Alt","Control","Fn","Meta"])}isNumberKey(r){return this.numberKeys.includes(r)}isMovementKey(r){return this.movementKeys.includes(r.key)}isEditingKey(r){return this.editingKeys.includes(r.key)}isIgnoreKey(r){return this.ignoreKeys.includes(r.key)}}class Ph{constructor(r){m(this,"_currentIndex",0);m(this,"index",0);m(this,"formatParts");this.formatParts=xr.create(r)}get currentIndex(){return this._currentIndex}hasNext(){return this.index<this.formatParts.length}next(){if(this.index<this.formatParts.length)return this._currentIndex=this.index++,this.formatParts[this._currentIndex]}peek(){if(this.index<this.formatParts.length)return this.formatParts[this.index]}reset(){this.index=0}}class ka{constructor(r,t){m(this,"instanceCollection");m(this,"inputSlotCollection");m(this,"formatNavigator");m(this,"keyTypeChecker");m(this,"formatRenderer");m(this,"formatPartList");this.format=r,this.instanceCollection=kt.getInstance(),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(t,r),this.formatNavigator=this.instanceCollection.getNavigatorInstance(t,r),this.keyTypeChecker=new Ea,this.formatRenderer=new Tn(r,t),this.formatPartList=new Ph(r)}setInputElement(r){this.formatRenderer.setInputElement(r)}processKeyPress(r){if(this.keyTypeChecker.isEditingKey(r)){this.processEditRules(r);return}this.processInputRules(r)}processInputValue(r){var n;this.inputSlotCollection.clearAllSlots(),this.formatPartList.reset();let t=0;for(;this.formatPartList.hasNext();){const s=this.formatPartList.next();if(s&&!s.isSeparator)if(((n=this.formatPartList.peek())==null?void 0:n.isSeparator)===!0){const a=this.formatPartList.currentIndex,o=this.formatPartList.next();if(o&&o.inputText){const i=r.indexOf(o.inputText,t),c=this.inputSlotCollection.getSlot(a);if(c&&i>-1){const f=i-t>c.characterCount?t+c.characterCount:i;c.partText=r.substring(t,f),this.processSlotRules(c),t=i+o.characterCount}}}else{const a=this.inputSlotCollection.getSlot(this.formatPartList.currentIndex);a&&(a.partText=r.substring(t,t+a.characterCount),this.processSlotRules(a))}}}processEditRules(r){const t=this.inputSlotCollection.getSlot(this.formatNavigator.getCurrentPartIndex());if(!t)return;const n=this.formatNavigator.getCursorPosition(),s=n-t.startPosition,a=this.format.deleteShiftsFormatPart||!1;switch(r.key){case"Backspace":{if(!(t.startPosition===n))t.partText=t.partText.substring(0,s-1)+t.partText.substring(s),a&&this.shiftFormatParts(t),this.formatRenderer.render(),this.formatNavigator.moveCursorLeft(),this.processSlotRules(t,!0);else{this.processSlotRules(t,!0);const i=this.inputSlotCollection.getPreviousSlot(t.partIndex);i&&(i.partText=i.partText.substring(0,i.partText.length-1),a&&this.shiftFormatParts(i),this.formatRenderer.render(),this.formatNavigator.setCursorPosition(i.startPosition+i.partText.length),this.processSlotRules(i,!0))}break}case"Delete":t.partText=t.partText.substring(0,s)+t.partText.substring(s+1),a&&this.shiftFormatParts(t),this.formatRenderer.render(),this.formatNavigator.setCursorToCurrentPosition(),this.processSlotRules(t,!0);break}}shiftFormatParts(r){let t=r,n;for(;(n=this.inputSlotCollection.getNextSlot(t.partIndex))!==void 0;){const s=n.partText.substring(0,1);n.partText=n.partText.substring(1),t.partText=t.partText+s,t=n}}processInputRules(r){const t=this.inputSlotCollection.getSlot(this.formatNavigator.getCurrentPartIndex());if(!t)return;const{key:n}=r,s=t.characterCount,a=t.partText;if(t.valueType===qe.Numeric){if(!this.keyTypeChecker.isNumberKey(n))return;const o=t.maximumValue,i=t.exceedingMaximumValueCausesTab||!1,c=t.padWithZeros||!1,f=parseInt(this.createNewValue(t,n));if(o&&f>o)if(i){c&&(t.partText=t.partText.padStart(s,"0")),t.isComplete=!0;const h=this.inputSlotCollection.getNextSlot(t.partIndex);h&&!h.isComplete&&(h.partText=n),this.formatRenderer.render(),h&&this.formatNavigator.setCursorPosition(h.isComplete?h.startPosition:h.startPosition+1)}else return;else a.length+1===s?(this.addToInputSlot(n),t.isComplete=!0,this.formatRenderer.render(),this.formatNavigator.isAtLastPart()?this.formatNavigator.moveCursorRight():this.formatNavigator.moveToNextInputPart()):a.length+1<s&&(this.addToInputSlot(n),this.formatRenderer.render(),this.formatNavigator.moveCursorRight())}else a.length+1===s?(this.addToInputSlot(n),t.isComplete=!0,this.formatRenderer.render(),this.formatNavigator.isAtLastPart()?this.formatNavigator.moveCursorRight():this.formatNavigator.moveToNextInputPart()):(this.addToInputSlot(n),this.formatRenderer.render(),this.formatNavigator.moveCursorRight())}addToInputSlot(r){const t=this.inputSlotCollection.getSlot(this.formatNavigator.getCurrentPartIndex());t&&(t.partText=this.createNewValue(t,r))}createNewValue(r,t){const n=r.partText,s=this.formatNavigator.getCursorPosition();if(s>=r.startPosition+r.partText.length)return n+t;{const a=s-r.startPosition;return n.substring(0,a)+t+n.substring(a)}}processSlotRules(r,t=!1){const n=r.characterCount,s=r.allCharactersRequired||!1;if(r.valueType===qe.Numeric){const a=r.minimumValue,o=r.maximumValue;if(s)r.isComplete=r.partText.length===n;else if(a!==void 0&&o!==void 0){const i=r.padWithZeros||!1,c=parseInt(r.partText);r.isComplete=c>=a&&c<=o,r.isComplete&&i&&!t&&(r.partText=r.partText.padStart(n,"0"))}else r.isComplete=r.partText.length>0}else s?r.isComplete=r.partText.length===n:r.isComplete=r.partText.length>0}}class Eh{constructor(r,t){m(this,"instanceCollection");m(this,"formatNavigator");m(this,"ruleProcessor");m(this,"keyTypeChecker");m(this,"formatRenderer");this.format=r,this.instanceCollection=kt.getInstance(),this.formatNavigator=this.instanceCollection.getNavigatorInstance(t,r),this.ruleProcessor=new ka(r,t),this.keyTypeChecker=new Ea,this.formatRenderer=new Tn(r,t)}setInputElement(r){this.ruleProcessor.setInputElement(r),this.formatRenderer.setInputElement(r)}processMovementKey(r){const{key:t,metaKey:n}=r;switch(t){case"ArrowLeft":n?this.formatNavigator.moveHome():this.formatNavigator.moveCursorLeft();break;case"ArrowRight":n?this.formatNavigator.moveEnd():this.formatNavigator.moveCursorRight();break;case"Home":this.formatNavigator.moveHome();break;case"End":this.formatNavigator.moveEnd();break}}processKeyPress(r){return this.keyTypeChecker.isIgnoreKey(r)?!1:this.keyTypeChecker.isMovementKey(r)?(this.processMovementKey(r),!1):(this.ruleProcessor.processKeyPress(r),!0)}}class kh{constructor(r,t=""){m(this,"instanceId");m(this,"instanceCollection");m(this,"keyProcessor");m(this,"formatNavigator");m(this,"formatRenderer");m(this,"inputSlotCollection");m(this,"inputRuleProcessor");m(this,"previousOutputValue","");m(this,"inputElementSet",!1);m(this,"isInputFocused",!1);m(this,"inputElement");m(this,"onFormatChange");this.inputValue=t,this.instanceId=vh(),this.instanceCollection=kt.getInstance(),this.keyProcessor=new Eh(r,this.instanceId),this.formatNavigator=this.instanceCollection.getNavigatorInstance(this.instanceId,r),this.formatRenderer=new Tn(r,this.instanceId),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(this.instanceId,r),this.inputRuleProcessor=new ka(r,this.instanceId)}inputElementCreated(r){this.keyProcessor.setInputElement(r),this.formatNavigator.setInputElement(r),this.formatRenderer.setInputElement(r),this.inputElement=r,this.inputElementSet=!0,this.inputElementSet&&this.inputValue.length>0&&this.inputValuePassed(this.inputValue)}inputFocused(){this.isInputFocused=!0,this.formatRenderer.render(),setTimeout(()=>this.formatNavigator.findCursorPosition())}inputBlurred(){this.isInputFocused=!1}inputValuePassed(r){this.inputValue=r,this.inputElementSet&&(this.inputValue.length>0?this.inputRuleProcessor.processInputValue(r):(this.inputSlotCollection.clearAllSlots(),this.previousOutputValue=void 0),setTimeout(()=>{var t;this.formatRenderer.render(),this.isInputFocused&&this.formatNavigator.setCursorToCurrentPosition(),this.inputValue.length>0&&(this.previousOutputValue=(t=this.inputElement)==null?void 0:t.innerHTML)}))}registerFormatChangeEvent(r){this.onFormatChange=r}mouseUpHandler(){this.formatNavigator.findCursorPosition()}keyDownHandler(r){r.key!=="Tab"&&(r.preventDefault(),r.stopPropagation(),this.keyProcessor.processKeyPress(r)&&this.inputElement&&this.onFormatChange&&(this.inputSlotCollection.allSlotsCompleted()&&this.previousOutputValue!==this.inputElement.innerHTML?(this.previousOutputValue=this.inputElement.innerHTML,this.onFormatChange(this.inputElement.innerHTML)):this.inputSlotCollection.allSlotsEmpty()&&this.previousOutputValue!==void 0&&(this.previousOutputValue=void 0,this.onFormatChange())))}dispose(){this.instanceCollection.removeInstances(this.instanceId)}}const Ch=(e,r)=>{const{value:t="",format:n,readOnly:s=!1,debounceTime:a=800,fillContainer:o=!0,leftElement:i,rightElement:c,className:f,leftElementClassName:h,rightElementClassName:p,isSingleLine:y=!1,allowSingleLineScroll:x=!1,isInputValid:w,onChange:D,onFocus:O,onBlur:S,onElementCreate:R,onLeftElementClick:U,onRightElementClick:F}=e,[b,A]=d.useState(!0),k=d.useRef(),V=d.useRef(),B=d.useRef();d.useEffect(()=>()=>{var v;(v=B.current)==null||v.dispose()},[]),d.useEffect(()=>{var v;(v=B.current)==null||v.inputValuePassed(t)},[t]),d.useEffect(()=>{var v,ee,g;(v=B.current)==null||v.dispose(),n&&(B.current=new kh(n,t),V.current&&((ee=B.current)==null||ee.inputElementCreated(V.current)),(g=B.current)==null||g.registerFormatChangeEvent(ne))},[n]);const ne=d.useCallback(v=>{w?w(v)?(A(!0),D==null||D(v)):A(!1):D==null||D(v)},[D]),te=d.useCallback(v=>{var ee;(ee=B.current)==null||ee.inputFocused(),O==null||O(v)},[O]),J=d.useCallback(v=>{var ee;(ee=B.current)==null||ee.inputBlurred(),S==null||S(v)},[S]),N=d.useCallback(()=>{var v;(v=B.current)==null||v.mouseUpHandler()},[]),$=d.useCallback(v=>{var ee;(ee=B.current)==null||ee.keyDownHandler(v)},[]),I=d.useCallback(v=>{var ee,g,_,z,E,Y,q,L,H;(g=(ee=k.current)==null?void 0:ee.inputElement)==null||g.removeEventListener("keydown",$),(z=(_=k.current)==null?void 0:_.inputElement)==null||z.removeEventListener("mouseup",N),k.current=v,(Y=(E=k.current)==null?void 0:E.inputElement)==null||Y.addEventListener("keydown",$),(L=(q=k.current)==null?void 0:q.inputElement)==null||L.addEventListener("mouseup",N),V.current=(H=k.current)==null?void 0:H.inputElement},[]),C=d.useCallback(()=>{var v;(v=k.current)==null||v.focus()},[]);d.useImperativeHandle(r,()=>({focus:C}));const G=ie(f,{"!bsc-border-error":!b});return l.jsx(hr,{ref:v=>v&&I(v),readOnly:s,debounceTime:a,fillContainer:o,leftElement:i,rightElement:c,className:G,leftElementClassName:h,rightElementClassName:p,isSingleLine:y,allowSingleLineScroll:x,onFocus:te,onBlur:J,onElementCreate:R,onLeftElementClick:U,onRightElementClick:F})},Ca=d.forwardRef(Ch),Sn=d.createContext(void 0);function Da(e,r,t=!0){var y,x;const n=qs(e),s=Hs(e),a=Of(e);let o=an(s)-(((y=r.options)==null?void 0:y.weekStartsOn)||0);o=o===-1?6:o;const i=an(a)-(((x=r.options)==null?void 0:x.weekStartsOn)||0),c=Ll({start:s,end:a}),f=n+o>35?6:5,h=Oa(f,7,{dayValue:null,isCurrent:!0});let p=1;for(let w=0,D=f;w<D;w++){for(let O=w>0?0:o;O<7;O++){const S=c[p-1];if(S.setHours(e.getHours(),e.getMinutes(),e.getSeconds()),h[w][O].dayValue=S,++p>n)break}if(p>n)break}if(o>0&&t)for(let w=0;w<o;w++)h[0][w].dayValue=kd(s,o-w),h[0][w].isCurrent=!1;if(i>-1&&t)for(let w=6;w>i;w--)h[f-1][w].dayValue=Tt(a,w-i),h[f-1][w].isCurrent=!1;return h}function Oa(e,r,t){const n=[];for(let s=0,a=e;s<a;s++){const o=[];for(let i=0,c=r;i<c;i++){const f=Dh(t)?t:{...t};o.push(f)}n.push(o)}return n}function Dh(e){const r=typeof e;return r==="string"||r==="number"||r==="boolean"||e instanceof Date}function Oh(e){var n;const r=Cd(new Date,((n=e.options)==null?void 0:n.weekStartsOn)||0),t=[];for(let s=0;s<7;s++)t.push(Tt(r,s).toLocaleDateString(e.code,{weekday:"short"}));return t}function _h(e){const r=new Date(Date.UTC(2020,0,1)),t=[[{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""}],[{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""}],[{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""}]];let n=0;for(let s=0;s<3;s++)for(let a=0;a<4;a++)t[s][a]={monthNumber:n,monthName:ct(r,n++).toLocaleDateString(e.code,{month:"short"})};return t}function Nh(e,r){const t=new Date(e.getTime()),n=Math.floor(t.getFullYear()/10)*10;t.setFullYear(n);const s=$l({start:t,end:pr(t,9)}),a=Oa(3,4,"");let o=0;for(let i=0;i<3;i++)for(let c=0;c<4&&(a[i][c]=s[o++].toLocaleDateString(r.code,{year:"numeric"}),o!==s.length);c++);return a}function Ih(e){const r=new Date;return r.setHours(0,0,0,0),r.toLocaleTimeString(e.code)}function jh(e,r,t){return e.getTime()>=r.getTime()&&e.getTime()<=t.getTime()}async function _a(e){return(await import(`/node_modules/date-fns/locale/${Mh(e)}`)).default}function Mh(e){const[r,t]=e.split("-");switch(r){case"af":return"af";case"ar":switch(t){case"DZ":return"ar-DZ";case"EG":return"ar-EG";case"MA":return"ar-MA";case"SA":return"ar-SA";case"TN":return"ar-TN";default:return"ar"}case"az":return"az";case"be":switch(t){case"tarask":return"be-tarask";default:return"be"}case"bg":return"bg";case"bn":return"bn";case"bs":return"bs";case"ca":return"ca";case"cs":return"cs";case"cy":return"cy";case"da":return"da";case"de":switch(t){case"AT":return"de-AT";default:return"de"}case"el":return"el";case"en":switch(t){case"AU":return"en-AU";case"CA":return"en-CA";case"GB":return"en-GB";case"IE":return"en-IE";case"IN":return"en-IN";case"NZ":return"en-NZ";case"US":return"en-US";default:return"en-ZA"}case"eo":return"eo";case"es":return"es";case"et":return"et";case"eu":return"eu";case"fa":return"fa-IR";case"fi":return"fi";case"fr":switch(t){case"CA":return"fr-CA";case"CH":return"fr-CH";default:return"fr"}case"fy":return"fy";case"gd":return"gd";case"gl":return"gl";case"gu":return"gu";case"he":return"he";case"hi":return"hi";case"hr":return"hr";case"ht":return"ht";case"hu":return"hu";case"hy":return"hy";case"id":return"id";case"is":return"is";case"it":switch(t){case"CH":return"it-CH";default:return"it"}case"ja":switch(t){case"Hira":return"ja-Hira";default:return"ja"}case"ka":return"ka";case"kk":return"kk";case"km":return"km";case"kn":return"kn";case"ko":return"ko";case"lb":return"lb";case"lt":return"lt";case"lv":return"lv";case"mk":return"mk";case"mn":return"mn";case"ms":return"ms";case"mt":return"mt";case"nb":return"nb";case"nl":switch(t){case"BE":return"nl-BE";default:return"nl"}case"nn":return"nn";case"oc":return"oc";case"pl":return"pl";case"pt":switch(t){case"BR":return"pt-BR";default:return"pt"}case"ro":return"ro";case"ru":return"ru";case"sk":return"sk";case"sl":return"sl";case"sq":return"sq";case"sr":switch(t){case"Latn":return"sr-Latn";default:return"sr"}case"sv":return"sv";case"ta":return"ta";case"te":return"te";case"th":return"th";case"tr":return"tr";case"ug":return"ug";case"uk":return"uk";case"uz":switch(t){case"Cyrl":return"uz-Cyrl";default:return"uz"}case"vi":return"vi";case"zh":switch(t){case"CN":return"zh-CN";case"HK":return"zh-HK";default:return"zh-TW"}default:return"en-AU"}}function Zt(e,r){const t=Dd(e);if(isNaN(t.valueOf())){let n=Ue(e,"P pp",new Date,{locale:r});return!isNaN(n.valueOf())||(n=Ue(e,"Pp",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=Ue(e,"P HH:mm",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=Ue(e,"P hh:mm a..aaa",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=Ue(e,"P HH:mm:ss",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=Ue(e,"P hh:mm:ss a..aaa",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=Ue(e,"P",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=Ue(e,"P p",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=Ue(e,"pp",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=Ue(e,"p",new Date,{locale:r}),!isNaN(n.valueOf()))?n:void 0}return t}function Pn(e,r){const t=e.split("-");if(t.length!==2)return;const n=Zt(t[0].trim(),r);if(!n)return;const s=Zt(t[1].trim(),r);if(s)return[n,s]}var me=(e=>(e[e.DateTime=0]="DateTime",e[e.DateOnly=1]="DateOnly",e[e.TimeOnly=2]="TimeOnly",e[e.DateRange=3]="DateRange",e))(me||{}),Oe=(e=>(e[e.DaySelector=0]="DaySelector",e[e.MonthSelector=1]="MonthSelector",e[e.YearSelector=2]="YearSelector",e[e.TimeSelector=3]="TimeSelector",e[e.DateRangeSelector=4]="DateRangeSelector",e))(Oe||{}),Qt=(e=>(e[e.Day=0]="Day",e[e.Month=1]="Month",e[e.Year=2]="Year",e[e.Range=3]="Range",e))(Qt||{}),Kt=(e=>(e[e.Short=0]="Short",e[e.Medium=1]="Medium",e[e.Long=2]="Long",e))(Kt||{}),Pe=(e=>(e[e.TwelveHour=0]="TwelveHour",e[e.TwentyFourHour=1]="TwentyFourHour",e))(Pe||{}),rt=(e=>(e[e.Normal=0]="Normal",e[e.Range=1]="Range",e))(rt||{}),wr=(e=>(e[e.Right=0]="Right",e[e.Left=1]="Left",e[e.None=2]="None",e))(wr||{}),ue=(e=>(e[e.SetDateSelector=0]="SetDateSelector",e[e.SetViewDate=1]="SetViewDate",e[e.SetSelectedDate=2]="SetSelectedDate",e[e.SetSelectedDateRange=3]="SetSelectedDateRange",e[e.SetSelectedStartDate=4]="SetSelectedStartDate",e[e.SetSelectedEndDate=5]="SetSelectedEndDate",e[e.SetTimeFormat=6]="SetTimeFormat",e[e.ClearDates=7]="ClearDates",e[e.InitializeDates=8]="InitializeDates",e))(ue||{});const Rh=(e,r)=>{switch(r.type){case 0:return r.dateSelector!==void 0?{...e,currentSelector:r.dateSelector,currentViewDate:r.viewDate||e.currentViewDate}:{...e};case 1:return{...e,currentViewDate:r.viewDate||new Date,dateInitialized:!0};case 2:return{...e,selectedDate:r.selectedDate||e.selectedDate,currentViewDate:r.viewDate||e.currentViewDate};case 3:return{...e,selectedStartDate:r.selectedStartDate||e.selectedStartDate,selectedEndDate:r.selectedEndDate||e.selectedEndDate};case 4:return{...e,selectedStartDate:r.selectedStartDate,selectedEndDate:void 0};case 5:return{...e,selectedEndDate:r.selectedEndDate};case 6:return{...e,timeFormat:r.timeFormat||e.timeFormat};case 7:return{currentSelector:e.currentSelector,currentViewDate:e.currentViewDate,timeFormat:e.timeFormat,dateInitialized:!0};case 8:{const t={...e,currentViewDate:Ah(r.initialDate),dateInitialized:!0};return Array.isArray(r.initialDate)?{...t,selectedStartDate:r.initialDate[0],selectedEndDate:r.initialDate[1]}:{...t,selectedDate:r.initialDate}}default:return{...e,currentSelector:Oe.DaySelector}}};function Ah(e){return e?Array.isArray(e)?e[0]:e:new Date}const Tr=({viewDate:e,selectedDate:r,selectedStartDate:t,selectedEndDate:n,selectionMode:s=rt.Normal,locale:a,onDateSelected:o,selectableDate:i,isValidDate:c,dispatcher:f})=>{var I;const[h,p]=d.useState(!1),[y,x]=d.useState(),[w,D]=d.useState(),[O,S]=d.useState(),[R,U]=d.useState(),F=d.useRef(),b=d.useRef(),A=d.useContext(Sn),k=d.useMemo(()=>A.calendarTemplate,[A.calendarTemplate]),V=async()=>a||await _a(Yn());d.useEffect(()=>{V().then(C=>{F.current=C,b.current=Oh(F.current),p(!0)}).catch(C=>console.error(C))},[]),d.useEffect(()=>{e&&F.current&&S(Da(e,F.current,s===rt.Normal))},[e,h]),d.useEffect(()=>{U(r?new Date(r.getFullYear(),r.getMonth(),r.getDate()):void 0)},[r]),d.useEffect(()=>{x(t?new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0).getTime():void 0),D(n?new Date(n.getFullYear(),n.getMonth(),n.getDate(),23,59,59).getTime():void 0)},[t,n]),d.useEffect(()=>{F.current&&a&&(F.current=a,S(Da(e,F.current,s===rt.Normal)))},[a]);const B=C=>{if(s===rt.Normal)f==null||f({type:ue.SetSelectedDate,selectedDate:C,viewDate:C}),o==null||o(C);else{if(!o)throw new Error("Range selection mode requires onDateSelected to be set");!t||_f(C,t)?o(C):t&&!n?o(C,{setEndDate:!0}):t&&n&&o(C)}},ne=C=>(R==null?void 0:R.toLocaleDateString())===C.toLocaleDateString(),te=C=>{if(y&&w){const G=C.getTime();return G>=y&&G<=w}return!1},J={viewDate:e,selectedDate:r,selectedStartDate:t,selectedEndDate:n,selectionMode:s,locale:a,weekDays:b.current,monthMatrix:O,selectableDate:i,isValidDate:c,onDateClicked:B,isSelectedDate:ne,isInSelectedDateRange:te},$=k||((C,G)=>l.jsx("div",{className:"bc-dt-calendar bsc-w-full",children:G}));return l.jsx(ut,{props:J,template:$,children:l.jsxs("div",{className:"bc-dt-day-row bsc-grid bsc-min-w-[329px] bsc-grid-cols-7 bsc-gap-3",children:[(I=b.current)==null?void 0:I.map((C,G)=>l.jsx("div",{className:"bc-dt-day-cell bsc-text-center bsc-font-bold",children:C},G)),O==null?void 0:O.map((C,G)=>C.map((v,ee)=>{var z,E;const g=v.dayValue!==null&&(i===void 0||i(v.dayValue)),_=ie("bsc-text-center bsc-py-1",{"bsc-text-gray-3":!v.isCurrent,"bsc-bg-primary-3 dark:bsc-bg-mono-light-1 dark:bsc-text-mono-dark-1":v&&v.dayValue&&(R&&ne(v.dayValue)||y&&!w&&Ys(y,v.dayValue)||y&&w&&te(v.dayValue)),"bsc-cursor-pointer":g,"bsc-text-error bsc-cursor-not-allowed":!g,"bsc-bg-primary-5 dark:bsc-bg-mono-light-3 dark:bsc-text-mono-dark-1":v.dayValue&&Ed(v.dayValue)&&!(ne(v.dayValue)||te(v.dayValue))},"bc-dt-date-cell");return l.jsx("div",{className:_,onClick:()=>v&&v.dayValue&&g&&(c===void 0||c(v.dayValue))&&B(v.dayValue),children:(E=v.dayValue)==null?void 0:E.getDate().toLocaleString((z=F.current)==null?void 0:z.code)},G.toString()+ee.toString())}))]})})},Sr=({title:e,scrollerType:r,onTitleClicked:t,onMovePrevious:n,onMoveNext:s})=>{const o=d.useContext(Sn).dateScrollerTemplate,i={title:e,scrollerType:r,onTitleClicked:t,onMovePrevious:n,onMoveNext:s},f=o||((h,p)=>l.jsx("div",{className:"bc-dt-scroller bsc-flex bsc-w-full bsc-flex-row bsc-items-center bsc-px-2 bsc-py-1",children:p}));return l.jsxs(ut,{props:i,template:f,children:[l.jsx("div",{className:"bc-dt-scroller-left bsc-flex-shrink bsc-cursor-pointer",children:l.jsx(Ve,{className:"bsc-bg-transparent focus:bsc-outline-none",onClick:n,children:l.jsx(Le,{icon:"chevronLeft",size:Ie.Regular})})}),l.jsx("div",{className:"bc-dt-scroller-title bsc-flex-grow bsc-cursor-pointer bsc-text-center",onClick:t,children:e}),l.jsx("div",{className:"bc-dt-scroller-right bsc-flex-shrink bsc-cursor-pointer",children:l.jsx(Ve,{className:"bsc-bg-transparent focus:bsc-outline-none",onClick:s,children:l.jsx(Le,{icon:"chevronRight",size:Ie.Regular})})})]})},Lh=({selectedDate:e,viewDate:r,locale:t,showTimeSelector:n,selectableDate:s,isValidDate:a,onChange:o,dispatcher:i})=>{const c=()=>{r&&i({type:ue.SetViewDate,viewDate:Js(r,1)})},f=()=>{r&&i({type:ue.SetViewDate,viewDate:ct(r,1)})},h=()=>{i({type:ue.SetDateSelector,dateSelector:Oe.MonthSelector})},p=()=>{i({type:ue.SetDateSelector,dateSelector:Oe.TimeSelector})},y=()=>r?r.toLocaleDateString(t.code,{month:"long",year:"numeric"}):"";return l.jsxs("div",{className:"bc-dt-day-selector bsc-p-2",children:[l.jsx(Sr,{title:y(),scrollerType:Qt.Day,onTitleClicked:h,onMovePrevious:c,onMoveNext:f}),l.jsx(Tr,{viewDate:r,selectedDate:e,locale:t,selectableDate:s,isValidDate:a,onDateSelected:o,dispatcher:i}),n&&l.jsx("div",{className:"bc-dt-time-value-wrapper bsc-flex bsc-w-full bsc-flex-row bsc-justify-center bsc-p-2",children:l.jsx("div",{className:"bc-dt-time-value bsc-cursor-pointer bsc-p-2 hover:bsc-bg-gray-4 dark:bsc-bg-mono-dark-1 dark:bsc-text-mono-light-1 dark:hover:bsc-bg-mono-light-2 dark:hover:bsc-text-mono-dark-2",onClick:p,children:(e==null?void 0:e.toLocaleTimeString(t.code))||Ih(t)})})]})},$h=({viewDate:e,locale:r,dateSelection:t=me.DateTime,dispatcher:n})=>{const s=d.useRef(_h(r)),a=()=>{const h=ea(e,1);n({type:ue.SetViewDate,viewDate:h})},o=()=>{const h=pr(e,1);n({type:ue.SetViewDate,viewDate:h})},i=h=>{n({type:ue.SetDateSelector,dateSelector:t!==me.DateRange?Oe.DaySelector:Oe.DateRangeSelector,viewDate:Bd(e,h)})},c=()=>e.toLocaleDateString(r.code,{year:"numeric"}),f=()=>{n({type:ue.SetDateSelector,dateSelector:Oe.YearSelector})};return l.jsxs("div",{className:"bc-dt-month-selector bsc-p-2",style:{minWidth:"20rem"},children:[l.jsx(Sr,{title:c(),scrollerType:Qt.Month,onTitleClicked:f,onMovePrevious:a,onMoveNext:o}),l.jsx("div",{className:"bc-dt-month-grid bsc-grid bsc-w-full bsc-grid-cols-4 bsc-gap-4",children:s.current.map((h,p)=>h.map((y,x)=>l.jsx("div",{className:"bc-dt-month-cell bsc-cursor-pointer bsc-text-center",onClick:()=>i(y.monthNumber),children:y.monthName},p.toString()+x.toString())))})]})},Fh=({viewDate:e,selectedStartDate:r,selectedEndDate:t,locale:n,onChange:s,dispatcher:a})=>{const o=gr("screen and (max-device-width: 40rem)"),i=ct(e,1),c=(x,w)=>{!w||!w.setEndDate?a({type:ue.SetSelectedStartDate,selectedStartDate:x}):(a({type:ue.SetSelectedEndDate,selectedEndDate:x}),r&&(s==null||s([r,x])))},f=()=>{a({type:ue.SetDateSelector,dateSelector:Oe.MonthSelector})},h=()=>o?`${e.toLocaleDateString(n.code,{month:"long"})} ${e.toLocaleDateString(n.code,{year:"numeric"})}`:`${e.toLocaleDateString(n.code,{month:"long"})} ${e.toLocaleDateString(n.code,{year:"numeric"})} - ${i.toLocaleDateString(n.code,{month:"long"})} ${i.toLocaleDateString(n.code,{year:"numeric"})}`,p=()=>{e&&a({type:ue.SetViewDate,viewDate:Js(e,1)})},y=()=>{e&&a({type:ue.SetViewDate,viewDate:ct(e,1)})};return l.jsxs("div",{className:"bc-dt-range-selector bsc-flex bsc-flex-col",children:[l.jsx("div",{className:"bc-dt-range-scroller-wrapper bsc-flex-shrink",children:l.jsx(Sr,{title:h(),scrollerType:Qt.Range,onTitleClicked:f,onMovePrevious:p,onMoveNext:y})}),l.jsx("div",{className:"bsc-flex-grow",children:l.jsx(fn,{mobileMarkup:l.jsx("div",{className:"bc-dt-range-calendar bsc-px-2 bsc-py-1",children:l.jsx(Tr,{viewDate:e,selectedStartDate:r,selectedEndDate:t,selectionMode:rt.Range,onDateSelected:c,locale:n,dispatcher:a})}),aboveMobileMarkup:l.jsxs("div",{className:"bc-dt-range-wrapper bsc-flex bsc-flex-row bsc-px-2 bsc-py-1",children:[l.jsx("div",{className:"bc-dt-range-calendar-1 bsc-border-r bsc-border-solid bsc-border-gray-3 bsc-pr-4",children:l.jsx(Tr,{viewDate:e,selectedStartDate:r,selectedEndDate:t,selectionMode:rt.Range,onDateSelected:c,locale:n,dispatcher:a})}),l.jsx("div",{className:"bc-dt-range-calendar-2 bsc-pl-4",children:l.jsx(Tr,{viewDate:i,selectedStartDate:r,selectedEndDate:t,selectionMode:rt.Range,onDateSelected:c,locale:n,dispatcher:a})})]})})})]})},Yh=({viewDate:e,showDateSelector:r,locale:t,timeFormat:n=Pe.TwelveHour,timeConstraints:s,onChange:a,dispatcher:o})=>{const i=d.useRef(n===Pe.TwelveHour?11:23),c=d.useRef(n===Pe.TwelveHour?["12","01","02","03","04","05","06","07","08","09","10","11"]:["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23"]),f=d.useRef(Ka(0,59,N=>N.toString().padStart(2,"0"))),h=d.useRef(["AM","PM"]),p=d.useRef(Pl(e)),y=N=>N>11?N-12:N,[x,w]=d.useState(y(e.getHours())),[D,O]=d.useState(e.getMinutes()),[S,R]=d.useState(e.getHours()<=12?0:1),U=d.useRef(e.toLocaleDateString(t.code));d.useEffect(()=>{const N=e.getHours(),$=e.getMinutes();if(N!==x&&w(n===Pe.TwelveHour?y(N):N),$!==D&&O($),n===Pe.TwelveHour){const I=N<=11?0:1;I!==S&&R(I)}},[e]);const F=()=>{var I;const N=((I=s==null?void 0:s.hours)==null?void 0:I.step)||1,$=x<i.current?x+N:0;w($),B($,D,S)},b=()=>{var I;const N=((I=s==null?void 0:s.hours)==null?void 0:I.step)||1,$=x>0?x-N:i.current;w($),B($,D,S)},A=()=>{var I,C,G;const N=((I=s==null?void 0:s.minutes)==null?void 0:I.step)||1,$=D+N<(((C=s==null?void 0:s.minutes)==null?void 0:C.max)||59)?D+N:((G=s==null?void 0:s.minutes)==null?void 0:G.min)||0;O($),B(x,$,S)},k=()=>{var I,C,G;const N=((I=s==null?void 0:s.minutes)==null?void 0:I.step)||1,$=D-N>=(((C=s==null?void 0:s.minutes)==null?void 0:C.min)||0)?D-N:(((G=s==null?void 0:s.minutes)==null?void 0:G.max)||60)-N;O($),B(x,$,S)},V=()=>{const N=S===0?1:0;R(N),B(x,D,N)},B=(N,$,I)=>{const C=n===Pe.TwelveHour&&I===1?N+12:N;p.current.setHours(C,$),o({type:ue.SetSelectedDate,selectedDate:p.current,viewDate:p.current}),a==null||a(p.current)},ne=()=>{o({type:ue.SetDateSelector,dateSelector:Oe.DaySelector})},te=ie("bsc-w-full bsc-grid bsc-grid-rows-3 bsc-gap-4 bc-dt-time-grid",{"bsc-grid-cols-4":n===Pe.TwelveHour,"bsc-grid-cols-3":n===Pe.TwentyFourHour}),J=ie("bsc-text-center bsc-cursor-pointer hover:bsc-bg-gray-4 dark:bsc-text-mono-light-1 dark:hover:bsc-bg-mono-light-1 dark:hover:bsc-text-mono-dark-1 bc-dt-time-date-value",{"bsc-col-span-4":n===Pe.TwelveHour,"bsc-col-span-3":n===Pe.TwentyFourHour});return l.jsx("div",{className:"bc-dt-time-selector bsc-flex bsc-flex-row bsc-justify-center bsc-p-2",style:{minWidth:n===Pe.TwelveHour?"15rem":"11rem"},children:l.jsxs("div",{className:te,children:[r&&l.jsx("div",{className:J,onClick:ne,children:U.current}),l.jsx("div",{className:"bc-dt-time-hour-increase bsc-cursor-pointer bsc-text-center",children:l.jsx(Ve,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:F,children:l.jsx(Le,{icon:"chevronUp",size:Ie.Regular})})}),l.jsx("div",{}),l.jsx("div",{className:"bc-dt-time-minute-increase bsc-cursor-pointer bsc-text-center",children:l.jsx(Ve,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:A,children:l.jsx(Le,{icon:"chevronUp",size:Ie.Regular})})}),n===Pe.TwelveHour&&l.jsx("div",{className:"bc-dt-time-meridian-increase bsc-cursor-pointer bsc-text-center",children:l.jsx(Ve,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:V,children:l.jsx(Le,{icon:"chevronUp",size:Ie.Regular})})}),l.jsx("div",{className:"bc-dt-time-hour-value bsc-text-center",children:c.current[x]}),l.jsx("div",{className:"bc-dt-time-separator bsc-text-center",children:":"}),l.jsx("div",{className:"bc-dt-time-minute-value bsc-text-center",children:f.current[D]}),n===Pe.TwelveHour&&l.jsx("div",{className:"bc-dt-time-meridian-value bsc-text-center",children:h.current[S]}),l.jsx("div",{className:"bc-dt-time-hour-decrease bsc-cursor-pointer bsc-text-center",children:l.jsx(Ve,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:b,children:l.jsx(Le,{icon:"chevronDown",size:Ie.Regular})})}),l.jsx("div",{}),l.jsx("div",{className:"bc-dt-time-minute-decrease bsc-cursor-pointer bsc-text-center",children:l.jsx(Ve,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:k,children:l.jsx(Le,{icon:"chevronDown",size:Ie.Regular})})}),n===Pe.TwelveHour&&l.jsx("div",{className:"bc-dt-time-meridian-decrease bsc-cursor-pointer bsc-text-center",children:l.jsx(Ve,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:V,children:l.jsx(Le,{icon:"chevronDown",size:Ie.Regular})})})]})})},Hh=({viewDate:e,locale:r,dispatcher:t})=>{const n=Nh(e,r),s=()=>{const c=ea(e,10);t({type:ue.SetViewDate,viewDate:c})},a=()=>{const c=pr(e,10);t({type:ue.SetViewDate,viewDate:c})},o=c=>{const f=parseInt(c);t({type:ue.SetDateSelector,dateSelector:Oe.MonthSelector,viewDate:zd(e,f)})},i=()=>`${n[0][0].toString()} - ${n[2][1].toString()}`;return l.jsxs("div",{className:"bc-dt-year-selector",style:{minWidth:"20rem"},children:[l.jsx(Sr,{title:i(),scrollerType:Qt.Year,onMovePrevious:s,onMoveNext:a}),l.jsx("div",{className:"bc-dt-year-wrapper bsc-w-full",children:l.jsx("div",{className:"bc-dt-year-grid bsc-grid bsc-grid-cols-4 bsc-gap-4",children:n.map((c,f)=>c.map((h,p)=>h.length>0?l.jsx("div",{className:"bc-dt-year-cell bsc-cursor-pointer bsc-text-center",onClick:()=>o(h),children:h},f.toString()+p.toString()):l.jsx("div",{},f.toString()+p.toString())))})})]})};class Wh{constructor(r,t){m(this,"dateFormat");m(this,"timeFormat");m(this,"use24HourTime");m(this,"monthPart");m(this,"dayPart");m(this,"yearPart");m(this,"twelveHourPart");m(this,"twentyFourHourPart");m(this,"minutePart");m(this,"meridianPart");this.dateSelection=r;const n=2023,s=12,a=20,i=new Date(n,s-1,a).toLocaleDateString(t,{year:"numeric",month:"numeric",day:"numeric"});this.dateFormat=i.replace(`${n}`,"YYYY").replace(`${s}`,"MM").replace(`${a}`,"DD");const c=new Date,f=18,h=24,p=37,y=317;c.setHours(f,h,p,y);const x=c.toLocaleTimeString(t);this.use24HourTime=x.startsWith("18"),this.timeFormat=x.replace(`${this.use24HourTime?f:"6"}`,"HH").replace(`${h}`,"MM").replace(`${p}`,"SS").replace(`${y}`,"LLL"),this.createDateParts()}get is24HourTime(){return this.use24HourTime}createInputFormat(){const r={deleteShiftsFormatPart:!1,formatParts:[]};switch(this.dateSelection){case me.DateOnly:return this.createDateFormat(r);case me.TimeOnly:return this.createTimeFormat(r);case me.DateRange:return this.createDateRangeFormat(r);case me.DateTime:return this.createDateTimeFormat(r)}}createDateFormat(r){return this.dateFormat.startsWith("MM")?r.formatParts.push(...this.createMonthDayYearFormatParts()):this.dateFormat.startsWith("DD")?r.formatParts.push(...this.createDayMonthYearFormatParts()):r.formatParts.push(...this.createYearMonthDayFormatParts()),r}createTimeFormat(r){return this.use24HourTime?r.formatParts.push(...this.createTwentyFourHourFormatParts()):r.formatParts.push(...this.createTwelveHourFormatParts()),r}createDateRangeFormat(r){const t=[];this.dateFormat.startsWith("MM")?t.push(...this.createMonthDayYearFormatParts()):this.dateFormat.startsWith("DD")?t.push(...this.createDayMonthYearFormatParts()):t.push(...this.createYearMonthDayFormatParts());const n={characterCount:3,placeholder:" - ",inputText:" - ",isSeparator:!0};return r.formatParts.push(...t,n,...t),r}createDateTimeFormat(r){this.dateFormat.startsWith("MM")?r.formatParts.push(...this.createMonthDayYearFormatParts()):this.dateFormat.startsWith("DD")?r.formatParts.push(...this.createDayMonthYearFormatParts()):r.formatParts.push(...this.createYearMonthDayFormatParts());const t={characterCount:1,placeholder:" ",inputText:" ",isSeparator:!0};return r.formatParts.push(t),this.use24HourTime?r.formatParts.push(...this.createTwentyFourHourFormatParts()):r.formatParts.push(...this.createTwelveHourFormatParts()),r}createMonthDayYearFormatParts(){if(this.monthPart&&this.dayPart&&this.yearPart){let r=this.dateFormat.replace("MM",""),t=r.indexOf("DD"),n=r.substring(0,t);r=r.replace(n,"").replace("DD","");const s={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};t=r.indexOf("YYYY"),n=r.substring(0,t);const a={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};return[this.monthPart,s,this.dayPart,a,this.yearPart]}return[]}createDayMonthYearFormatParts(){if(this.monthPart&&this.dayPart&&this.yearPart){let r=this.dateFormat.replace("DD",""),t=r.indexOf("MM"),n=r.substring(0,t);r=r.replace(n,"").replace("MM","");const s={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};t=r.indexOf("YYYY"),n=r.substring(0,t);const a={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};return[this.dayPart,s,this.monthPart,a,this.yearPart]}return[]}createYearMonthDayFormatParts(){if(this.monthPart&&this.dayPart&&this.yearPart){let r=this.dateFormat.replace("YYYY",""),t=r.indexOf("MM"),n=r.substring(0,t);r=r.replace(n,"").replace("MM","");const s={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};t=r.indexOf("DD"),n=r.substring(0,t);const a={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};return[this.yearPart,s,this.monthPart,a,this.dayPart]}return[]}createTwelveHourFormatParts(){if(this.twelveHourPart&&this.minutePart&&this.meridianPart){const r=this.timeFormat.replace("HH",""),t=r.indexOf("MM"),n=r.substring(0,t),s={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0},a={characterCount:1,placeholder:" ",inputText:" ",isSeparator:!0};return[this.twelveHourPart,s,this.minutePart,a,this.meridianPart]}return[]}createTwentyFourHourFormatParts(){if(this.twentyFourHourPart&&this.minutePart){const r=this.timeFormat.replace("HH",""),t=r.indexOf("MM"),n=r.substring(0,t),s={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};return[this.twentyFourHourPart,s,this.minutePart]}return[]}createDateParts(){this.monthPart={characterCount:2,placeholder:"M",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:qe.Numeric,minimumValue:1,maximumValue:12,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.dayPart={characterCount:2,placeholder:"D",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:qe.Numeric,minimumValue:1,maximumValue:31,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.yearPart={characterCount:4,placeholder:"Y",inputText:"_",isSeparator:!1,allCharactersRequired:!0,valueType:qe.Numeric},this.twelveHourPart={characterCount:2,placeholder:"H",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:qe.Numeric,minimumValue:1,maximumValue:12,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.twentyFourHourPart={characterCount:2,placeholder:"H",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:qe.Numeric,minimumValue:0,maximumValue:23,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.minutePart={characterCount:2,placeholder:"M",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:qe.Numeric,minimumValue:0,maximumValue:59,exceedingMaximumValueCausesError:!0,padWithZeros:!0},this.meridianPart={characterCount:2,inputText:"_",isSeparator:!1,valueType:qe.Text,possibleValues:["AM","PM"]}}}const Vh=(e,r)=>{var a;const[t,n]=d.useState(),s=d.useRef();return d.useEffect(()=>{r&&!t&&(s.current=new Wh(e,r),n(s.current.createInputFormat()))},[r]),[t,(a=s.current)==null?void 0:a.is24HourTime]},Bh=({value:e,readOnly:r=!1,label:t,useDefaultDateValue:n=!1,useFormattedInput:s=!1,allowClear:a=!1,closeSelector:o=!1,locale:i,className:c,dateSelection:f=me.DateTime,dateFormat:h,timeConstraints:p,icon:y,iconPosition:x=wr.Right,inputElement:w,selectableDate:D,isValidDate:O,onChange:S,calendarTemplate:R,dateScrollerTemplate:U,inputTemplate:F,wrapperTemplate:b})=>{const[A,k]=d.useState(!1),[V,B]=d.useState(),[ne,te]=d.useState(),[J,N,$]=Qa(f),I=d.useRef(),C=d.useRef(!1),G=d.useRef(i||Yn()),v=d.useRef(),ee=d.useRef(),g=d.useRef(),[_,z]=Vh(f,V),E=d.useRef({calendarTemplate:R,dateScrollerTemplate:U});d.useEffect(()=>{G.current&&q(G.current)},[G]),d.useEffect(()=>{i&&q(i)},[i]),d.useEffect(()=>{if(e){const Q=L();W({type:ue.InitializeDates,initialDate:Q})}else W({type:ue.ClearDates})},[e,v.current]),d.useEffect(()=>{z&&W({type:ue.SetTimeFormat,timeFormat:z?Pe.TwentyFourHour:Pe.TwelveHour})},[z]),d.useEffect(()=>{w&&(ee.current=w)},[w]),d.useEffect(()=>{W({type:ue.SetDateSelector,dateSelector:Y()})},[J]);const Y=d.useCallback(()=>$.current===me.TimeOnly?Oe.TimeSelector:$.current===me.DateTime||$.current===me.DateOnly?Oe.DaySelector:Oe.DateRangeSelector,[]),q=Q=>{_a(Q).then(ce=>{B(ce.code),v.current=ce;const Ae=L();W(e||n?{type:ue.InitializeDates,initialDate:Array.isArray(Ae)?Ae[0]:Ae}:{type:ue.SetViewDate,viewDate:Array.isArray(Ae)?Ae[0]:Ae})}).catch(ce=>console.error(ce))},L=()=>{const Q=new Date;return Q.setHours(0,0,0,0),e?typeof e=="string"?$.current!==me.DateRange?Zt(e,v.current):Pn(e,v.current):e:Q},H={currentSelector:Y(),currentViewDate:new Date,timeFormat:Pe.TwelveHour,dateInitialized:!1},[P,W]=d.useReducer(Rh,H),Z=()=>{Or(),k(!0)},Te=d.useMemo(()=>Vt(()=>{k(!1)},250),[]),j=d.useMemo(()=>Vt(()=>{Te.cancel()},5),[Te]),je=Q=>{const ce=Q.target.innerText;ht(ce)},nt=Q=>{if(Q){const ce=$.current!==me.DateRange?Zt(Q,v.current):Pn(Q,v.current);return ce?O?Array.isArray(ce)?ce.every(Ae=>O(Ae)):O(ce):!0:!1}else return!0},Xe=Q=>{ht(Q||"")},ht=Q=>{const ce=$.current!==me.DateRange?Zt(Q,v.current):Pn(Q,v.current);ce?(Array.isArray(ce)?(jh(ce[0],Hs(P.currentViewDate),Al(ct(P.currentViewDate,1)))||W({type:ue.SetViewDate,viewDate:ce[0]}),W({type:ue.SetSelectedDateRange,selectedStartDate:ce[0],selectedEndDate:ce[1]})):W({type:ue.SetSelectedDate,selectedDate:ce,viewDate:ce}),S==null||S(ce)):Q===""&&(W({type:ue.ClearDates}),S==null||S())},Dr=Q=>{$.current===me.DateOnly&&o===!0&&k(!1),S==null||S(Q)},Jt=()=>{Or(),k(!A)},pt=()=>{W({type:ue.ClearDates}),k(!1),S==null||S()},er=(Q,ce)=>{(!ee.current||I.current!==ce)&&(ee.current=Q,I.current=ce,C.current=!0)},Or=()=>{(!g.current||C.current)&&ee.current&&(g.current=ee.current,te(ee.current),C.current=!1)},Dt=()=>{k(!1),W({type:ue.SetDateSelector,dateSelector:Y()})},En=()=>{switch(h){case Kt.Short:return"short";case Kt.Medium:return"medium";case Kt.Long:return"long";default:return}},Ot=()=>{var ce,Ae,Nt,rr,Je,It,jt,nr,Mr,sr,Rr,ar;const Q=En();switch($.current){case me.DateTime:return P.selectedDate?Q?P.selectedDate.toLocaleString((ce=v.current)==null?void 0:ce.code,{dateStyle:Q,timeStyle:Q}):P.selectedDate.toLocaleString((Ae=v.current)==null?void 0:Ae.code):"";case me.DateOnly:return P.selectedDate?Q?P.selectedDate.toLocaleDateString((Nt=v.current)==null?void 0:Nt.code,{dateStyle:Q}):P.selectedDate.toLocaleDateString((rr=v.current)==null?void 0:rr.code):"";case me.TimeOnly:return P.selectedDate?Q?P.selectedDate.toLocaleTimeString((Je=v.current)==null?void 0:Je.code,{timeStyle:Q,hour12:P.timeFormat===Pe.TwelveHour,hourCycle:P.timeFormat===Pe.TwentyFourHour?"h23":void 0}):P.selectedDate.toLocaleTimeString((It=v.current)==null?void 0:It.code,{hour12:P.timeFormat===Pe.TwelveHour,hourCycle:P.timeFormat===Pe.TwentyFourHour?"h23":void 0}):"";case me.DateRange:return P.selectedStartDate&&P.selectedEndDate?Q?`${P.selectedStartDate.toLocaleDateString((jt=v.current)==null?void 0:jt.code,{dateStyle:Q})} - ${P.selectedEndDate.toLocaleDateString((nr=v.current)==null?void 0:nr.code,{dateStyle:Q})}`:`${P.selectedStartDate.toLocaleDateString((Mr=v.current)==null?void 0:Mr.code)} - ${P.selectedEndDate.toLocaleDateString((sr=v.current)==null?void 0:sr.code)}`:"";default:return P.selectedDate?Q?P.selectedDate.toLocaleString((Rr=v.current)==null?void 0:Rr.code,{dateStyle:Q,timeStyle:Q}):P.selectedDate.toLocaleString((ar=v.current)==null?void 0:ar.code):""}},mt=J===me.DateTime||J===me.DateOnly||J===me.DateRange,_r=J===me.DateTime||J===me.TimeOnly,We=x===wr.None?{}:x===wr.Right?{rightElement:l.jsxs("div",{className:"bsc-flex bsc-text-black dark:bsc-text-mono-light-1",children:[a&&!r&&l.jsx("div",{children:l.jsx(Le,{icon:"close",size:Ie.Small,className:"bsc-cursor-pointer bsc-text-sm",onClick:pt})}),l.jsx("div",{className:"bsc-ml-2",onClick:r?void 0:Jt,children:y||l.jsx(Le,{icon:"calendar",size:Ie.Small,className:r?void 0:"bsc-cursor-pointer"})})]}),rightElementClassName:"bsc-justify-center"}:{leftElement:l.jsxs("div",{className:"bsc-flex bsc-text-black dark:bsc-text-mono-light-1",children:[l.jsx("div",{className:"bsc-mr-2",onClick:r?void 0:Jt,children:y||l.jsx(Le,{icon:"calendar",size:Ie.Small,className:r?void 0:"bsc-cursor-pointer"})}),a&&!r&&l.jsx("div",{children:l.jsx(Le,{icon:"close",size:Ie.Small,className:"bsc-cursor-pointer bsc-text-sm",onClick:pt})})]}),leftElementClassName:"bsc-justify-center"},kn={setDateSelector:Q=>N(Q)},Nr=b||((Q,ce)=>l.jsx(l.Fragment,{children:ce})),_t=()=>l.jsx(ut,{props:kn,template:Nr,children:l.jsxs(l.Fragment,{children:[P.currentSelector===Oe.DaySelector&&mt&&P.dateInitialized&&v.current&&l.jsx(Lh,{selectedDate:P.selectedDate,viewDate:P.currentViewDate,locale:v.current,showTimeSelector:$.current===me.DateTime,selectableDate:D,isValidDate:O,dispatcher:W,onChange:Dr}),P.currentSelector===Oe.MonthSelector&&mt&&P.dateInitialized&&v.current&&l.jsx($h,{viewDate:P.currentViewDate,locale:v.current,dateSelection:$.current,dispatcher:W}),P.currentSelector===Oe.YearSelector&&mt&&P.dateInitialized&&v.current&&l.jsx(Hh,{viewDate:P.currentViewDate,locale:v.current,dispatcher:W}),P.currentSelector===Oe.TimeSelector&&_r&&P.dateInitialized&&v.current&&l.jsx(Yh,{viewDate:P.currentViewDate,showDateSelector:$.current===me.DateTime,locale:v.current,timeFormat:P.timeFormat,timeConstraints:p,onChange:S,dispatcher:W}),P.currentSelector===Oe.DateRangeSelector&&mt&&P.dateInitialized&&v.current&&l.jsx(Fh,{viewDate:P.currentViewDate,selectedStartDate:P.selectedStartDate,selectedEndDate:P.selectedEndDate,locale:v.current,onChange:S,dispatcher:W})]})}),Ir={label:t,readOnly:r,allowClear:a,getValue:Ot,onFocus:Z,onInput:je,iconPosition:x,iconElement:We.rightElement||We.leftElement},jr=F||((Q,ce)=>l.jsx(l.Fragment,{children:ce})),tr=ie("bsc-text-left",{"bc-read-only bsc-bg-gray-4 dark:bsc-bg-mono-dark-3":r,"bsc-bg-white dark:bsc-bg-mono-dark-1":!r},"bc-dt-input",c);return l.jsx(Sn.Provider,{value:E.current,children:l.jsxs("div",{className:"bc-date-time",children:[t&&l.jsx(Ge,{label:t,readOnly:r,className:"bc-dt-label"}),l.jsx(fn,{mobileMarkup:l.jsxs(l.Fragment,{children:[l.jsx(ut,{props:Ir,template:jr,children:l.jsx(hr,{value:Ot(),readOnly:r,inputMode:"none",className:tr,onFocus:Z,onElementCreate:Q=>er(Q,!1),...We})}),l.jsx(xa,{visible:A,target:ne,hidden:Dt,unmountWhenHidden:!0,children:_t()})]}),aboveMobileMarkup:l.jsxs(l.Fragment,{children:[l.jsx(ut,{props:Ir,template:jr,children:s===!1?l.jsx(hr,{value:Ot(),readOnly:r,className:tr,onFocus:Z,onBlur:Te,onInput:je,onElementCreate:Q=>er(Q,!1),...We}):l.jsx(Ca,{value:Ot(),readOnly:r,className:tr,format:_,isInputValid:nt,onFocus:Z,onBlur:Te,onChange:Xe,onElementCreate:Q=>er(Q,!0),...We})}),l.jsx(Sa,{visible:A,target:ne,shouldTargetCloseOverlay:!1,shouldScrollCloseOverlay:!0,shouldCheckZIndex:!0,shouldRemainOnScreen:!0,hidden:Dt,isClickedWithin:j,unmountWhenHidden:!0,children:_t()})]})})]})})};function dt(e,r){var t,n;if(typeof r=="function")n=r(e),n!==void 0&&(e=n);else if(Array.isArray(r))for(t=0;t<r.length;t++)n=r[t](e),n!==void 0&&(e=n);return e}function zh(e,r){return e[0]==="-"&&Array.isArray(r)&&/^-\d+$/.test(e)?r.length+parseInt(e,10):e}function Uh(e){return/^\d+$/.test(e)}function Pr(e){return Object.prototype.toString.call(e)==="[object Object]"}function Xt(e){return Object(e)===e}function Er(e){return Object.keys(e).length===0}var qh=["__proto__","prototype","constructor"],Gh=function(e){return qh.indexOf(e)===-1};function kr(e,r){e.indexOf("[")>=0&&(e=e.replace(/\[/g,r).replace(/]/g,""));var t=e.split(r),n=t.filter(Gh);if(n.length!==t.length)throw Error("Refusing to update blacklisted property "+e);return t}var Na=Object.prototype.hasOwnProperty;function ae(e,r,t,n){if(!(this instanceof ae))return new ae(e,r,t,n);typeof r>"u"&&(r=!1),typeof t>"u"&&(t=!0),typeof n>"u"&&(n=!0),this.separator=e||".",this.override=r,this.useArray=t,this.useBrackets=n,this.keepArray=!1,this.cleanup=[]}var Ct=new ae(".",!1,!0,!0);function He(e){return function(){return Ct[e].apply(Ct,arguments)}}ae.prototype._fill=function(e,r,t,n){var s=e.shift();if(e.length>0){if(r[s]=r[s]||(this.useArray&&Uh(e[0])?[]:{}),!Xt(r[s]))if(this.override)r[s]={};else{if(!(Xt(t)&&Er(t)))throw new Error("Trying to redefine `"+s+"` which is a "+typeof r[s]);return}this._fill(e,r[s],t,n)}else{if(!this.override&&Xt(r[s])&&!Er(r[s])){if(!(Xt(t)&&Er(t)))throw new Error("Trying to redefine non-empty obj['"+s+"']");return}r[s]=dt(t,n)}},ae.prototype.object=function(e,r){var t=this;return Object.keys(e).forEach(function(n){var s=r===void 0?null:r[n],a=kr(n,t.separator).join(t.separator);a.indexOf(t.separator)!==-1?(t._fill(a.split(t.separator),e,e[n],s),delete e[n]):e[n]=dt(e[n],s)}),e},ae.prototype.str=function(e,r,t,n){var s=kr(e,this.separator).join(this.separator);return e.indexOf(this.separator)!==-1?this._fill(s.split(this.separator),t,r,n):t[e]=dt(r,n),t},ae.prototype.pick=function(e,r,t,n){var s,a,o,i,c;for(a=kr(e,this.separator),s=0;s<a.length;s++)if(i=zh(a[s],r),r&&typeof r=="object"&&i in r){if(s===a.length-1)return t?(o=r[i],n&&Array.isArray(r)?r.splice(i,1):delete r[i],Array.isArray(r)&&(c=a.slice(0,-1).join("."),this.cleanup.indexOf(c)===-1&&this.cleanup.push(c)),o):r[i];r=r[i]}else return;return t&&Array.isArray(r)&&(r=r.filter(function(f){return f!==void 0})),r},ae.prototype.delete=function(e,r){return this.remove(e,r,!0)},ae.prototype.remove=function(e,r,t){var n;if(this.cleanup=[],Array.isArray(e)){for(n=0;n<e.length;n++)this.pick(e[n],r,!0,t);return t||this._cleanup(r),r}else return this.pick(e,r,!0,t)},ae.prototype._cleanup=function(e){var r,t,n,s;if(this.cleanup.length){for(t=0;t<this.cleanup.length;t++)n=this.cleanup[t].split("."),s=n.splice(0,-1).join("."),r=s?this.pick(s,e):e,r=r[n[0]].filter(function(a){return a!==void 0}),this.set(this.cleanup[t],r,e);this.cleanup=[]}},ae.prototype.del=ae.prototype.remove,ae.prototype.move=function(e,r,t,n,s){return typeof n=="function"||Array.isArray(n)?this.set(r,dt(this.pick(e,t,!0),n),t,s):(s=n,this.set(r,this.pick(e,t,!0),t,s)),t},ae.prototype.transfer=function(e,r,t,n,s,a){return typeof s=="function"||Array.isArray(s)?this.set(r,dt(this.pick(e,t,!0),s),n,a):(a=s,this.set(r,this.pick(e,t,!0),n,a)),n},ae.prototype.copy=function(e,r,t,n,s,a){return typeof s=="function"||Array.isArray(s)?this.set(r,dt(JSON.parse(JSON.stringify(this.pick(e,t,!1))),s),n,a):(a=s,this.set(r,this.pick(e,t,!1),n,a)),n},ae.prototype.set=function(e,r,t,n){var s,a,o,i;if(typeof r>"u")return t;for(o=kr(e,this.separator),s=0;s<o.length;s++){if(i=o[s],s===o.length-1)if(n&&Pr(r)&&Pr(t[i]))for(a in r)Na.call(r,a)&&(t[i][a]=r[a]);else if(n&&Array.isArray(t[i])&&Array.isArray(r))for(var c=0;c<r.length;c++)t[o[s]].push(r[c]);else t[i]=r;else(!Na.call(t,i)||!Pr(t[i])&&!Array.isArray(t[i]))&&(/^\d+$/.test(o[s+1])?t[i]=[]:t[i]={});t=t[i]}return t},ae.prototype.transform=function(e,r,t){return r=r||{},t=t||{},Object.keys(e).forEach((function(n){this.set(e[n],this.pick(n,r),t)}).bind(this)),t},ae.prototype.dot=function(e,r,t){r=r||{},t=t||[];var n=Array.isArray(e);return Object.keys(e).forEach((function(s){var a=n&&this.useBrackets?"["+s+"]":s;if(Xt(e[s])&&(Pr(e[s])&&!Er(e[s])||Array.isArray(e[s])&&!this.keepArray&&e[s].length!==0))if(n&&this.useBrackets){var o=t[t.length-1]||"";return this.dot(e[s],r,t.slice(0,-1).concat(o+a))}else return this.dot(e[s],r,t.concat(a));else n&&this.useBrackets?r[t.join(this.separator).concat("["+s+"]")]=e[s]:r[t.concat(a).join(this.separator)]=e[s]}).bind(this)),r},ae.pick=He("pick"),ae.move=He("move"),ae.transfer=He("transfer"),ae.transform=He("transform"),ae.copy=He("copy"),ae.object=He("object"),ae.str=He("str"),ae.set=He("set"),ae.delete=He("delete"),ae.del=ae.remove=He("remove"),ae.dot=He("dot"),["override","overwrite"].forEach(function(e){Object.defineProperty(ae,e,{get:function(){return Ct.override},set:function(r){Ct.override=!!r}})}),["useArray","keepArray","useBrackets"].forEach(function(e){Object.defineProperty(ae,e,{get:function(){return Ct[e]},set:function(r){Ct[e]=r}})}),ae._process=dt;var Zh=ae;const Cr=Ar(Zh),Qh=({name:e,label:r,value:t,data:n,textField:s,valueField:a,readOnly:o=!1,orientation:i=Ne.Horizontal,isMultiSelect:c=!1,className:f,onChange:h,itemTemplate:p})=>{const[y,x]=d.useState(),[w,D]=d.useState([]),O=cr(()=>n,[n]),S=d.useId();d.useEffect(()=>{if(c){const I=Array.isArray(t)?t.map(C=>C.toString()):t?[String(t)]:void 0;D(I??[])}else t&&x(t.toString())},[t]);const R=I=>c?w.findIndex(C=>C===I)>-1:y===I,U=I=>{const C=I.toString();if(c){const G=R(C);let v;G?v=w.filter(ee=>ee!=C):v=[...w,C],D(v),h==null||h({name:e,value:v})}else C!==y&&(x(C),h==null||h({name:e,value:C}))},F=I=>{const{value:C}=I.target;x(C),h==null||h({name:e,value:C})},b=I=>{const{value:C,checked:G}=I.target;let v;G?v=[...w,C]:v=w.filter(ee=>ee!=C),D(v),h==null||h({name:e,value:v})},A=(I,C,G,v)=>l.jsxs("label",{htmlFor:I,className:v,children:[l.jsx("input",{id:I,name:e,value:G,type:"checkbox",onChange:b,checked:R(G),className:"bsc-appearance-none"}),C]},I),k=(I,C,G,v)=>l.jsxs("label",{htmlFor:I,className:v,children:[l.jsx("input",{id:I,name:e,value:G,type:"radio",onChange:F,checked:R(G),className:"bsc-appearance-none"}),C]},I),V=or($t.FocusWithin),B=d.useCallback((I,C)=>l.jsx(l.Fragment,{children:C}),[]),ne=p||B,te=(I,C,G)=>{const v=`element_${S}_${C}`,ee=Cr.pick(s,I),g=String(Cr.pick(a,I)),_=C===0,z=C===G.length-1,E=ie("bc-group-button-item bsc-cursor-pointer bsc-border-solid bsc-p-2 bsc-font-medium",{"has-[:checked]:bsc-bg-primary-1 has-[:checked]:dark:bsc-bg-mono-light-1 has-[:checked]:bsc-text-white has-[:checked]:dark:bsc-text-mono-dark-1 dark:bsc-text-mono-light-1 bsc-text-gray-2 bsc-border-gray-3 dark:bsc-border-mono-light-2":!o,"bc-read-only has-[:checked]:bsc-bg-primary-4 has-[:checked]:dark:bsc-bg-mono-light-3 has-[:checked]:bsc-text-gray-5 has-[:checked]:dark:bsc-text-mono-dark-3 dark:bsc-text-mono-light-3 bsc-text-gray-3 bsc-border-gray-4 dark:bsc-border-mono-light-3 bsc-pointer-events-none":o,"bsc-border-t bsc-border-l bsc-border-b bsc-rounded-l-md bsc-pl-2":_&&i===Ne.Horizontal,"bsc-border-t bsc-border-r bsc-border-l bsc-border-b bsc-rounded-r-md bsc-pr-2":z&&i===Ne.Horizontal,"bsc-border-t bsc-border-b":!_&&!z&&i===Ne.Horizontal,"bsc-border-l":!_&&i===Ne.Horizontal,"bsc-border-l bsc-border-r bsc-border-t bsc-rounded-t-md":_&&i===Ne.Vertical,"bsc-border bsc-rounded-b-md":z&&i===Ne.Vertical,"bsc-border-t bsc-border-l bsc-border-r":!_&&!z&&i===Ne.Vertical},V),Y={itemId:v,selectedValue:c?w:y,itemText:ee,itemValue:g,itemData:I,itemStyles:E,isSelected:R(g),isFirstItem:_,isLastItem:z,onItemChanged:U};return c?l.jsx(ut,{props:Y,template:ne,children:A(v,ee,g,E)}):l.jsx(ut,{props:Y,template:ne,children:k(v,ee,g,E)})},J=ie("bsc-flex bsc-flex-col bsc-gap-2",f),N=ie("bsc-flex",{"bsc-flex-col [width:max-content]":i===Ne.Vertical}),$=I=>l.jsx("div",{className:N,children:I.map(te)});return l.jsxs("div",{className:J,children:[r&&l.jsx(Ge,{label:r,readOnly:o}),O&&$(O)]})},Kh=d.memo(Qh),Xh=({id:e,name:r,label:t,value:n,checked:s=!1,labelLocation:a=Re.Right,readOnly:o=!1,useAnimation:i,onChange:c})=>{const f=$r(i),h=d.useCallback(x=>{c==null||c(x)},[c]),p=ie("bc-radio-item-wrapper bsc-flex bsc-items-center *:bsc-cursor-pointer",{"bc-read-only":o}),y=ie("bc-radio-item-outer bsc-relative *:bsc-size-[21px]",{"bsc-pl-1":a===Re.Left,"bsc-pr-1":a===Re.Right,"bsc-radio-item-animate":!o&&f,"bsc-radio-item":!o,"bc-read-only bsc-radio-item-read-only":o});return l.jsxs("div",{className:p,children:[a===Re.Left&&l.jsx(Ge,{label:t,htmlFor:e,readOnly:o}),l.jsxs("label",{className:y,children:[l.jsx("input",{id:e,name:r,value:n,type:"radio",checked:s,onChange:h,className:"bc-radio-item-input-hidden bsc-hidden"}),l.jsxs("svg",{viewBox:"0 0 30 30",preserveAspectRatio:"xMidYMid meet",className:"bc-radio-item-svg",children:[l.jsx("circle",{cx:15,cy:15,r:13}),l.jsx("circle",{cx:"50%",cy:"50%",r:7})]})]}),a===Re.Right&&l.jsx(Ge,{label:t,htmlFor:e,readOnly:o})]})},Jh=d.memo(Xh),ep=({name:e,label:r,value:t,data:n,textField:s,valueField:a,readOnly:o=!1,labelLocation:i=Re.Right,orientation:c=Ne.Vertical,className:f,useAnimation:h,onChange:p})=>{const[y,x]=d.useState(t),w=cr(()=>n,[n]),D=d.useId(),O=d.useCallback(b=>{const A=b.target.value;x(A),p==null||p({name:e,value:A,originalEvent:b})},[e]),S=(b,A)=>{const k=`${D}_radio_${A}`,V=Cr.pick(a,b);return l.jsx(Jh,{id:k,name:e,label:Cr.pick(s,b),value:V,checked:V==y,labelLocation:i,readOnly:o,useAnimation:h,onChange:O},k)},R=ie("bc-radio-container bsc-flex bsc-flex-col bsc-gap-1",f),U=ie("bc-radio-wrapper bsc-flex bsc-gap-1",{"bsc-flex-col":c===Ne.Vertical,"[&>*]:bsc-pr-2":c===Ne.Horizontal}),F=b=>l.jsx("div",{className:U,children:b.map(S)});return l.jsxs("div",{className:R,children:[r&&l.jsx(Ge,{label:r,readOnly:o}),w&&F(w)]})},tp=d.memo(ep),rp=({name:e,label:r,value:t,checked:n=!1,readOnly:s=!1,useAnimation:a,className:o,onChange:i})=>{const[c,f]=d.useState(!1),h=d.useId(),p=$r(a);d.useEffect(()=>{f(n)},[n]);const y=S=>{const{checked:R}=S.target;f(R),i==null||i({originalEvent:S,name:e||S.target.name,value:t||S.target.value,checked:R})},x=ie("bc-toggle-wrapper bsc-flex bsc-flex-col",o),w=or($t.FocusWithin),D=ie("bc-toggle-container bsc-toggle-switch bsc-flex bsc-mt-0.5 bsc-relative bsc-w-[70px] bsc-h-[30px] bsc-rounded-full [transition:background-color_1s]",{"bsc-cursor-pointer bsc-bg-gray-3 dark:bsc-bg-mono-dark-3 has-[:checked]:bsc-bg-primary-1 has-[:checked]:dark:bsc-bg-mono-light-2":!s,"bc-read-only bsc-pointer-events-none bsc-bg-gray-4 dark:bsc-bg-mono-dark-2 has-[:checked]:bsc-bg-primary-4 has-[:checked]:dark:bsc-bg-mono-light-3":s},w),O=ie("bc-toggle-switch bsc-absolute bsc-rounded-full dark:bsc-border dark:bsc-border-solid dark:bsc-border-mono-dark-1 bsc-w-[22px] bsc-h-[22px] bsc-top-[4px] bsc-left-[4px]",{"bsc-bg-white bsc-cursor-pointer":!s,"bc-read-only bsc-bg-gray-5 bsc-pointer-events-none":s,"[transition:0.3s]":!s&&p});return l.jsxs("div",{className:x,children:[r&&l.jsx(Ge,{label:r,htmlFor:h,readOnly:s}),l.jsxs("label",{className:D,children:[l.jsx("input",{id:h,name:e,value:t,type:"checkbox",checked:c,onChange:y,className:"bsc-appearance-none"}),l.jsx("div",{id:"switch",className:O})]})]})},np=d.memo(rp),bp="";X.BeeSoftProvider=Fa,X.Button=Ve,X.Checkbox=Vn,X.CheckboxGroup=po,X.ContentEditableInput=hr,X.DateFormatType=Kt,X.DateSelectionType=me,X.DateTime=Bh,X.FormGroupItemOrientation=Ne,X.FormattedInput=Ca,X.GroupButton=Kh,X.MediaQuery=fn,X.MobileOverlayPanel=xa,X.OverlayPanel=Sa,X.RadioButton=tp,X.SelectionLabelLocation=Re,X.Toggle=np,X.applyBeeSoftTheme=ro,X.createBeeSoftTheme=no,Object.defineProperty(X,Symbol.toStringTag,{value:"Module"})});
49
+ */var gn,fa;function ih(){if(fa)return gn;fa=1;var e=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;function n(a){if(a==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}function s(){try{if(!Object.assign)return!1;var a=new String("abc");if(a[5]="de",Object.getOwnPropertyNames(a)[0]==="5")return!1;for(var o={},i=0;i<10;i++)o["_"+String.fromCharCode(i)]=i;var c=Object.getOwnPropertyNames(o).map(function(h){return o[h]});if(c.join("")!=="0123456789")return!1;var f={};return"abcdefghijklmnopqrst".split("").forEach(function(h){f[h]=h}),Object.keys(Object.assign({},f)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return gn=s()?Object.assign:function(a,o){for(var i,c=n(a),f,h=1;h<arguments.length;h++){i=Object(arguments[h]);for(var p in i)r.call(i,p)&&(c[p]=i[p]);if(e){f=e(i);for(var y=0;y<f.length;y++)t.call(i,f[y])&&(c[f[y]]=i[f[y]])}}return c},gn}var yn,da;function vn(){if(da)return yn;da=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return yn=e,yn}var xn,ha;function pa(){return ha||(ha=1,xn=Function.call.bind(Object.prototype.hasOwnProperty)),xn}var wn,ma;function ch(){if(ma)return wn;ma=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var r=vn(),t={},n=pa();e=function(a){var o="Warning: "+a;typeof console<"u"&&console.error(o);try{throw new Error(o)}catch{}}}function s(a,o,i,c,f){if(process.env.NODE_ENV!=="production"){for(var h in a)if(n(a,h)){var p;try{if(typeof a[h]!="function"){var y=Error((c||"React class")+": "+i+" type `"+h+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[h]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw y.name="Invariant Violation",y}p=a[h](o,h,c,i,null,r)}catch(w){p=w}if(p&&!(p instanceof Error)&&e((c||"React class")+": type specification of "+i+" `"+h+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof p+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),p instanceof Error&&!(p.message in t)){t[p.message]=!0;var x=f?f():"";e("Failed "+i+" type: "+p.message+(x??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(t={})},wn=s,wn}var Tn,ba;function uh(){if(ba)return Tn;ba=1;var e=la(),r=ih(),t=vn(),n=pa(),s=ch(),a=function(){};process.env.NODE_ENV!=="production"&&(a=function(i){var c="Warning: "+i;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}});function o(){return null}return Tn=function(i,c){var f=typeof Symbol=="function"&&Symbol.iterator,h="@@iterator";function p(g){var D=g&&(f&&g[f]||g[h]);if(typeof D=="function")return D}var y="<<anonymous>>",x={array:S("array"),bigint:S("bigint"),bool:S("boolean"),func:S("function"),number:S("number"),object:S("object"),string:S("string"),symbol:S("symbol"),any:R(),arrayOf:z,element:F(),elementType:b(),instanceOf:A,node:ne(),objectOf:W,oneOf:k,oneOfType:V,shape:X,exact:N};function w(g,D){return g===D?g!==0||1/g===1/D:g!==g&&D!==D}function O(g,D){this.message=g,this.data=D&&typeof D=="object"?D:{},this.stack=""}O.prototype=Error.prototype;function _(g){if(process.env.NODE_ENV!=="production")var D={},B=0;function P(G,L,H,U,J,E,se){if(U=U||y,E=E||H,se!==t){if(c){var I=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw I.name="Invariant Violation",I}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Ne=U+":"+H;!D[Ne]&&B<3&&(a("You are manually calling a React.PropTypes validation function for the `"+E+"` prop on `"+U+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),D[Ne]=!0,B++)}}return L[H]==null?G?L[H]===null?new O("The "+J+" `"+E+"` is marked as required "+("in `"+U+"`, but its value is `null`.")):new O("The "+J+" `"+E+"` is marked as required in "+("`"+U+"`, but its value is `undefined`.")):null:g(L,H,U,J,E)}var Y=P.bind(null,!1);return Y.isRequired=P.bind(null,!0),Y}function S(g){function D(B,P,Y,G,L,H){var U=B[P],J=C(U);if(J!==g){var E=q(U);return new O("Invalid "+G+" `"+L+"` of type "+("`"+E+"` supplied to `"+Y+"`, expected ")+("`"+g+"`."),{expectedType:g})}return null}return _(D)}function R(){return _(o)}function z(g){function D(B,P,Y,G,L){if(typeof g!="function")return new O("Property `"+L+"` of component `"+Y+"` has invalid PropType notation inside arrayOf.");var H=B[P];if(!Array.isArray(H)){var U=C(H);return new O("Invalid "+G+" `"+L+"` of type "+("`"+U+"` supplied to `"+Y+"`, expected an array."))}for(var J=0;J<H.length;J++){var E=g(H,J,Y,G,L+"["+J+"]",t);if(E instanceof Error)return E}return null}return _(D)}function F(){function g(D,B,P,Y,G){var L=D[B];if(!i(L)){var H=C(L);return new O("Invalid "+Y+" `"+G+"` of type "+("`"+H+"` supplied to `"+P+"`, expected a single ReactElement."))}return null}return _(g)}function b(){function g(D,B,P,Y,G){var L=D[B];if(!e.isValidElementType(L)){var H=C(L);return new O("Invalid "+Y+" `"+G+"` of type "+("`"+H+"` supplied to `"+P+"`, expected a single ReactElement type."))}return null}return _(g)}function A(g){function D(B,P,Y,G,L){if(!(B[P]instanceof g)){var H=g.name||y,U=ee(B[P]);return new O("Invalid "+G+" `"+L+"` of type "+("`"+U+"` supplied to `"+Y+"`, expected ")+("instance of `"+H+"`."))}return null}return _(D)}function k(g){if(!Array.isArray(g))return process.env.NODE_ENV!=="production"&&(arguments.length>1?a("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):a("Invalid argument supplied to oneOf, expected an array.")),o;function D(B,P,Y,G,L){for(var H=B[P],U=0;U<g.length;U++)if(w(H,g[U]))return null;var J=JSON.stringify(g,function(se,I){var Ne=q(I);return Ne==="symbol"?String(I):I});return new O("Invalid "+G+" `"+L+"` of value `"+String(H)+"` "+("supplied to `"+Y+"`, expected one of "+J+"."))}return _(D)}function W(g){function D(B,P,Y,G,L){if(typeof g!="function")return new O("Property `"+L+"` of component `"+Y+"` has invalid PropType notation inside objectOf.");var H=B[P],U=C(H);if(U!=="object")return new O("Invalid "+G+" `"+L+"` of type "+("`"+U+"` supplied to `"+Y+"`, expected an object."));for(var J in H)if(n(H,J)){var E=g(H,J,Y,G,L+"."+J,t);if(E instanceof Error)return E}return null}return _(D)}function V(g){if(!Array.isArray(g))return process.env.NODE_ENV!=="production"&&a("Invalid argument supplied to oneOfType, expected an instance of array."),o;for(var D=0;D<g.length;D++){var B=g[D];if(typeof B!="function")return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+v(B)+" at index "+D+"."),o}function P(Y,G,L,H,U){for(var J=[],E=0;E<g.length;E++){var se=g[E],I=se(Y,G,L,H,U,t);if(I==null)return null;I.data&&n(I.data,"expectedType")&&J.push(I.data.expectedType)}var Ne=J.length>0?", expected one of type ["+J.join(", ")+"]":"";return new O("Invalid "+H+" `"+U+"` supplied to "+("`"+L+"`"+Ne+"."))}return _(P)}function ne(){function g(D,B,P,Y,G){return $(D[B])?null:new O("Invalid "+Y+" `"+G+"` supplied to "+("`"+P+"`, expected a ReactNode."))}return _(g)}function te(g,D,B,P,Y){return new O((g||"React class")+": "+D+" type `"+B+"."+P+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+Y+"`.")}function X(g){function D(B,P,Y,G,L){var H=B[P],U=C(H);if(U!=="object")return new O("Invalid "+G+" `"+L+"` of type `"+U+"` "+("supplied to `"+Y+"`, expected `object`."));for(var J in g){var E=g[J];if(typeof E!="function")return te(Y,G,L,J,q(E));var se=E(H,J,Y,G,L+"."+J,t);if(se)return se}return null}return _(D)}function N(g){function D(B,P,Y,G,L){var H=B[P],U=C(H);if(U!=="object")return new O("Invalid "+G+" `"+L+"` of type `"+U+"` "+("supplied to `"+Y+"`, expected `object`."));var J=r({},B[P],g);for(var E in J){var se=g[E];if(n(g,E)&&typeof se!="function")return te(Y,G,L,E,q(se));if(!se)return new O("Invalid "+G+" `"+L+"` key `"+E+"` supplied to `"+Y+"`.\nBad object: "+JSON.stringify(B[P],null," ")+`
50
+ Valid keys: `+JSON.stringify(Object.keys(g),null," "));var I=se(H,E,Y,G,L+"."+E,t);if(I)return I}return null}return _(D)}function $(g){switch(typeof g){case"number":case"string":case"undefined":return!0;case"boolean":return!g;case"object":if(Array.isArray(g))return g.every($);if(g===null||i(g))return!0;var D=p(g);if(D){var B=D.call(g),P;if(D!==g.entries){for(;!(P=B.next()).done;)if(!$(P.value))return!1}else for(;!(P=B.next()).done;){var Y=P.value;if(Y&&!$(Y[1]))return!1}}else return!1;return!0;default:return!1}}function j(g,D){return g==="symbol"?!0:D?D["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&D instanceof Symbol:!1}function C(g){var D=typeof g;return Array.isArray(g)?"array":g instanceof RegExp?"object":j(D,g)?"symbol":D}function q(g){if(typeof g>"u"||g===null)return""+g;var D=C(g);if(D==="object"){if(g instanceof Date)return"date";if(g instanceof RegExp)return"regexp"}return D}function v(g){var D=q(g);switch(D){case"array":case"object":return"an "+D;case"boolean":case"date":case"regexp":return"a "+D;default:return D}}function ee(g){return!g.constructor||!g.constructor.name?y:g.constructor.name}return x.checkPropTypes=s,x.resetWarningCache=s.resetWarningCache,x.PropTypes=x,x},Tn}var Sn,ga;function lh(){if(ga)return Sn;ga=1;var e=vn();function r(){}function t(){}return t.resetWarningCache=r,Sn=function(){function n(o,i,c,f,h,p){if(p!==e){var y=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw y.name="Invariant Violation",y}}n.isRequired=n;function s(){return n}var a={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:s,element:n,elementType:n,instanceOf:s,node:n,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:t,resetWarningCache:r};return a.PropTypes=a,a},Sn}if(process.env.NODE_ENV!=="production"){var fh=la(),dh=!0;bn.exports=uh()(fh.isElement,dh)}else bn.exports=lh()();var hh=bn.exports;const re=Fr(hh),ya={disabled:!1};var ph=process.env.NODE_ENV!=="production"?re.oneOfType([re.number,re.shape({enter:re.number,exit:re.number,appear:re.number}).isRequired]):null;process.env.NODE_ENV!=="production"&&re.oneOfType([re.string,re.shape({enter:re.string,exit:re.string,active:re.string}),re.shape({enter:re.string,enterDone:re.string,enterActive:re.string,exit:re.string,exitDone:re.string,exitActive:re.string})]);const va=d.createContext(null);var mh=function(r){return r.scrollTop},Ut="unmounted",ft="exited",dt="entering",Pt="entered",Pn="exiting",Xe=function(e){sh(r,e);function r(n,s){var a;a=e.call(this,n,s)||this;var o=s,i=o&&!o.isMounting?n.enter:n.appear,c;return a.appearStatus=null,n.in?i?(c=ft,a.appearStatus=dt):c=Pt:n.unmountOnExit||n.mountOnEnter?c=Ut:c=ft,a.state={status:c},a.nextCallback=null,a}r.getDerivedStateFromProps=function(s,a){var o=s.in;return o&&a.status===Ut?{status:ft}:null};var t=r.prototype;return t.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},t.componentDidUpdate=function(s){var a=null;if(s!==this.props){var o=this.state.status;this.props.in?o!==dt&&o!==Pt&&(a=dt):(o===dt||o===Pt)&&(a=Pn)}this.updateStatus(!1,a)},t.componentWillUnmount=function(){this.cancelNextCallback()},t.getTimeouts=function(){var s=this.props.timeout,a,o,i;return a=o=i=s,s!=null&&typeof s!="number"&&(a=s.exit,o=s.enter,i=s.appear!==void 0?s.appear:o),{exit:a,enter:o,appear:i}},t.updateStatus=function(s,a){if(s===void 0&&(s=!1),a!==null)if(this.cancelNextCallback(),a===dt){if(this.props.unmountOnExit||this.props.mountOnEnter){var o=this.props.nodeRef?this.props.nodeRef.current:Fe.findDOMNode(this);o&&mh(o)}this.performEnter(s)}else this.performExit();else this.props.unmountOnExit&&this.state.status===ft&&this.setState({status:Ut})},t.performEnter=function(s){var a=this,o=this.props.enter,i=this.context?this.context.isMounting:s,c=this.props.nodeRef?[i]:[Fe.findDOMNode(this),i],f=c[0],h=c[1],p=this.getTimeouts(),y=i?p.appear:p.enter;if(!s&&!o||ya.disabled){this.safeSetState({status:Pt},function(){a.props.onEntered(f)});return}this.props.onEnter(f,h),this.safeSetState({status:dt},function(){a.props.onEntering(f,h),a.onTransitionEnd(y,function(){a.safeSetState({status:Pt},function(){a.props.onEntered(f,h)})})})},t.performExit=function(){var s=this,a=this.props.exit,o=this.getTimeouts(),i=this.props.nodeRef?void 0:Fe.findDOMNode(this);if(!a||ya.disabled){this.safeSetState({status:ft},function(){s.props.onExited(i)});return}this.props.onExit(i),this.safeSetState({status:Pn},function(){s.props.onExiting(i),s.onTransitionEnd(o.exit,function(){s.safeSetState({status:ft},function(){s.props.onExited(i)})})})},t.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},t.safeSetState=function(s,a){a=this.setNextCallback(a),this.setState(s,a)},t.setNextCallback=function(s){var a=this,o=!0;return this.nextCallback=function(i){o&&(o=!1,a.nextCallback=null,s(i))},this.nextCallback.cancel=function(){o=!1},this.nextCallback},t.onTransitionEnd=function(s,a){this.setNextCallback(a);var o=this.props.nodeRef?this.props.nodeRef.current:Fe.findDOMNode(this),i=s==null&&!this.props.addEndListener;if(!o||i){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var c=this.props.nodeRef?[this.nextCallback]:[o,this.nextCallback],f=c[0],h=c[1];this.props.addEndListener(f,h)}s!=null&&setTimeout(this.nextCallback,s)},t.render=function(){var s=this.state.status;if(s===Ut)return null;var a=this.props,o=a.children;a.in,a.mountOnEnter,a.unmountOnExit,a.appear,a.enter,a.exit,a.timeout,a.addEndListener,a.onEnter,a.onEntering,a.onEntered,a.onExit,a.onExiting,a.onExited,a.nodeRef;var i=nh(a,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return d.createElement(va.Provider,{value:null},typeof o=="function"?o(s,i):d.cloneElement(d.Children.only(o),i))},r}(d.Component);Xe.contextType=va,Xe.propTypes=process.env.NODE_ENV!=="production"?{nodeRef:re.shape({current:typeof Element>"u"?re.any:function(e,r,t,n,s,a){var o=e[r];return re.instanceOf(o&&"ownerDocument"in o?o.ownerDocument.defaultView.Element:Element)(e,r,t,n,s,a)}}),children:re.oneOfType([re.func.isRequired,re.element.isRequired]).isRequired,in:re.bool,mountOnEnter:re.bool,unmountOnExit:re.bool,appear:re.bool,enter:re.bool,exit:re.bool,timeout:function(r){var t=ph;r.addEndListener||(t=t.isRequired);for(var n=arguments.length,s=new Array(n>1?n-1:0),a=1;a<n;a++)s[a-1]=arguments[a];return t.apply(void 0,[r].concat(s))},addEndListener:re.func,onEnter:re.func,onEntering:re.func,onEntered:re.func,onExit:re.func,onExiting:re.func,onExited:re.func}:{};function Et(){}Xe.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Et,onEntering:Et,onEntered:Et,onExit:Et,onExiting:Et,onExited:Et},Xe.UNMOUNTED=Ut,Xe.EXITED=ft,Xe.ENTERING=dt,Xe.ENTERED=Pt,Xe.EXITING=Pn;const bh=Xe,xa=({start:e,timeout:r=400,defaultStyle:t,transitionStyles:n,showTransitionOptions:s="cubic-bezier(0, 0, 0.2, 1)",hideTransitionOptions:a="linear",unmountOnExit:o=!1,onEntering:i,onEntered:c,onExit:f,onExited:h,children:p})=>{const y=t||{transition:`opacity ${r}ms ${s}`,opacity:0},x=n||{entering:{opacity:1},entered:{opacity:1},exiting:{transition:`opacity ${r}ms ${a}`,opacity:0},exited:{transition:`opacity ${r}ms ${a}`,opacity:0},unmounted:{}};return l.jsx(bh,{in:e,timeout:r,onEntering:i,onEntered:c,onExit:f,onExited:h,unmountOnExit:o,children:w=>p({state:w,defaultStyle:y,transitionStyles:x})})};function wa(e){return e.target?e.target:e}const Ta=({visible:e,target:r,appendTo:t=document.body,unmountWhenHidden:n=!1,transitionDuration:s=400,showTransitionOptions:a="cubic-bezier(0, 0, 0.2, 1)",hideTransitionOptions:o="linear",approveText:i="DONE",shown:c,hidden:f,isClickedWithin:h,children:p})=>{const[y,x]=d.useState(-1),[w,O]=d.useState(-1),[_,S]=d.useState(e),R=d.useRef(100),z=d.useRef(101),F=d.useRef(),b=d.useRef(),A=d.useRef();d.useEffect(()=>{r&&(F.current=wa(r));const N=Bn("zIndex",$=>$==="auto"||$==="-1"?!1:parseInt($)>100).map($=>parseInt($,10));N.length>0&&(R.current=Math.max(...N)+1,z.current=Math.max(...N)+2),S(e)},[e,r]);const k=N=>{b.current=N},W=()=>{O(R.current),x(z.current)},V=()=>{if(!b.current)return;c==null||c();let N;F.current&&(N=[F.current]);const $=j=>{j?h==null||h():S(!1)};A.current=aa(b.current,$,N)},ne=()=>{A.current&&oa(A.current)},te=()=>{O(-1),x(-1),f==null||f()},X={entering:{opacity:.5},entered:{opacity:.5}};return Fe.createPortal(l.jsx(xa,{start:_,timeout:s,showTransitionOptions:a,hideTransitionOptions:o,onEntering:W,onEntered:V,onExit:ne,onExited:te,unmountOnExit:n,children:({state:N,defaultStyle:$,transitionStyles:j})=>l.jsxs("div",{ref:C=>C&&k(C),children:[l.jsx("div",{className:"bsc-fixed bsc-left-0 bsc-top-0 bsc-h-full bsc-w-full bsc-bg-mono-dark-1",style:{zIndex:w,...j[N],...X[N]}}),l.jsxs("div",{className:"dark:bsck-border-mono-light-1 bsc-fixed bsc-bottom-0 bsc-left-0 bsc-w-full bsc-bg-white dark:bsc-border-t dark:bsc-border-solid dark:bsc-bg-mono-dark-1 dark:bsc-text-mono-light-1",style:{zIndex:y,...$,...j[N]},children:[l.jsx("div",{className:"bsc-w-full",children:p}),l.jsx(l.Fragment,{children:l.jsx(We,{buttonType:"primary",fullWidth:!0,onClick:()=>S(!1),className:"bsc-text-xs bsc-font-bold",children:i})})]})]})}),t)};var Sa=(e=>(e[e.TopLeft=0]="TopLeft",e[e.TopRight=1]="TopRight",e[e.BottomLeft=2]="BottomLeft",e[e.BottomRight=3]="BottomRight",e))(Sa||{}),Pa=(e=>(e[e.TopLeft=0]="TopLeft",e[e.TopRight=1]="TopRight",e[e.BottomLeft=2]="BottomLeft",e[e.BottomRight=3]="BottomRight",e))(Pa||{});class we{static positionToTarget(r,t=2){const n=r.getBoundingClientRect();let s=0,a=0;const o=window.scrollY;switch(t){case 2:s=n.top+n.height+o,a=n.left;break;case 0:s=n.top+o,a=n.left;break;case 3:s=n.top+n.height+o,a=n.left+n.width;break;case 1:s=n.top+o,a=n.left+n.width}return{top:s,left:a}}static positionElementToTarget(r,t,n=0,s=2){let{left:a,top:o}=we.positionToTarget(t,s);const i=r.getBoundingClientRect();switch(n){case 0:break;case 1:a=a-i.width;break;case 2:o=o-i.height;break;case 3:o=o-i.height,a=a-i.width;break}return{top:o,left:a}}static canPositionElementOnScreenWithTarget(r,t){const n=we.getScreenDimensions(),s=r.getBoundingClientRect(),a=we.positionElementToTarget(r,t,0,2);if(a.left+s.width<n.width&&a.top+s.height<n.height||we.positionElementToTarget(r,t,1,3).left>=0&&a.top+s.height<n.height)return!0;const i=we.positionElementToTarget(r,t,2,0);if(i.left+s.width<n.width&&i.top>=0)return!0;const c=we.positionElementToTarget(r,t,3,1);return c.left>=0&&c.top>=0}static canPositionElementOnScreen(r){const t=we.getScreenDimensions(),n=r.getBoundingClientRect();return n.width<=t.width&&n.height<=t.height}static positionElementToTargetOnScreen(r,t,n=0,s=2){const{left:a,top:o}=we.positionElementToTarget(r,t,n,s),i=r.getBoundingClientRect(),c=we.determineOffScreenLocation(i);if(c){if(n===0&&s===2){if(c.right&&!c.bottom)return we.positionElementToTarget(r,t,1,3);if(c.bottom&&!c.right)return we.positionElementToTarget(r,t,2,0);if(c.right&&c.bottom)return we.positionElementToTarget(r,t,3,1)}else if(n===1&&s===3){if(c.left&&!c.bottom)return we.positionElementToTarget(r,t,0,2);if(c.bottom&&!c.left)return we.positionElementToTarget(r,t,3,1);if(c.left&&c.bottom)return we.positionElementToTarget(r,t,2,0)}}return{top:o,left:a}}static determineOffScreenLocation(r){const t=we.getScreenDimensions(),n={left:r.left<0,top:r.top<0,right:r.left+r.width>t.width,bottom:r.top+r.height>t.height};return n.left||n.top||n.right||n.bottom?n:void 0}static getScreenDimensions(){return{width:window.innerWidth,height:Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)}}}const Ea=({visible:e,target:r,targetPosition:t=Sa.BottomLeft,elementAlignment:n=Pa.TopLeft,shouldTargetCloseOverlay:s=!0,shouldMatchTargetWidth:a=!1,shouldScrollCloseOverlay:o=!1,shouldCheckZIndex:i=!1,shouldRemainOnScreen:c=!1,unmountWhenHidden:f=!1,transitionDuration:h=400,showTransitionOptions:p="cubic-bezier(0, 0, 0.2, 1)",hideTransitionOptions:y="linear",shown:x,hidden:w,isClickedWithin:O,markupCreated:_,children:S})=>{const[R,z]=d.useState(-1),[F,b]=d.useState(e),[A,k]=d.useState(!1),W=d.useRef(!1),V=d.useRef(100),ne=d.useRef({left:0,top:0,width:0}),te=d.useRef(),X=d.useRef(),N=d.useRef(),$=d.useRef(),j=d.useRef(),C=d.useRef(),q=jn();d.useEffect(()=>(c===!0&&(C.current=new ResizeObserver(v)),()=>{var L,H;c===!0&&(X.current&&((L=C.current)==null||L.unobserve(X.current)),(H=C.current)==null||H.disconnect())}),[]),d.useEffect(()=>{if(r&&(te.current=wa(r),o)){const L=q==null?void 0:q.isValidScrollableElement;N.current=Vn(te.current,{overflow:"scroll, auto",overflowX:"scroll, auto",overflowY:"scroll, auto"},!1,L),N.current.tagName.toLowerCase()==="html"&&(N.current=document)}if(i){const L=Bn("zIndex",H=>parseInt(H)>=100).map(H=>parseInt(H));L.length>0&&(V.current=Math.max(...L)+1)}e!==void 0&&b(e)},[r,e,o,i]);const v=L=>{if(X.current){const H=we.getScreenDimensions(),U=L[L.length-1].target,J=U.getBoundingClientRect(),E=we.determineOffScreenLocation(J);if(E){if(te.current&&we.canPositionElementOnScreenWithTarget(U,te.current)){const se=we.positionElementToTargetOnScreen(X.current,te.current,n,t);ne.current={...ne.current,...se}}else E.right?ne.current.left=H.width-J.width:E.left&&(ne.current.left=0),E.bottom?ne.current.top=H.height-J.height:E.top&&(ne.current.top=0);ee()}}},ee=Ht(()=>{W.current=!W.current,k(W.current)},20),g=()=>{z(V.current)},D=()=>{if(!X.current)return;x==null||x();let L;!s&&te.current&&(L=[te.current]);const H=U=>{U?O==null||O():b(!1)};$.current=aa(X.current,H,L),o&&(j.current=Nl(U=>X.current&&Ja(U,X.current)&&b(!1),100,{leading:!0}),N.current&&N.current.addEventListener("scroll",j.current))},B=()=>{N.current&&j.current&&(N.current.removeEventListener("scroll",j.current),j.current=void 0),$.current&&oa($.current)},P=()=>{z(-1),w==null||w()},Y=L=>{var H,U;if(c===!0&&X.current&&((H=C.current)==null||H.unobserve(X.current)),X.current=L,_==null||_(L),te.current){const J=we.positionElementToTarget(X.current,te.current,n,t);ne.current={...J,width:te.current.offsetWidth},c===!0&&(we.canPositionElementOnScreenWithTarget(X.current,te.current)||we.canPositionElementOnScreen(X.current))&&((U=C.current)==null||U.observe(X.current))}},G=d.useMemo(()=>{const L={top:`${ne.current.top}px`,left:`${ne.current.left}px`,zIndex:R};return a&&(L.width=`${ne.current.width}px`),L},[A,R,a]);return l.jsx(xa,{start:F,timeout:h,showTransitionOptions:p,hideTransitionOptions:y,onEntering:g,onEntered:D,onExit:B,onExited:P,unmountOnExit:f,children:({state:L,defaultStyle:H,transitionStyles:U})=>l.jsx("div",{className:"bsc-fixed bsc-border bsc-border-solid bsc-bg-white bsc-shadow dark:bsc-border-mono-light-1 dark:bsc-bg-mono-dark-1 dark:bsc-text-mono-light-1",style:{...G,...H,...U[L]},ref:J=>J&&Y(J),children:S})})};let br;const gh=new Uint8Array(16);function yh(){if(!br&&(br=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!br))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return br(gh)}const _e=[];for(let e=0;e<256;++e)_e.push((e+256).toString(16).slice(1));function vh(e,r=0){return _e[e[r+0]]+_e[e[r+1]]+_e[e[r+2]]+_e[e[r+3]]+"-"+_e[e[r+4]]+_e[e[r+5]]+"-"+_e[e[r+6]]+_e[e[r+7]]+"-"+_e[e[r+8]]+_e[e[r+9]]+"-"+_e[e[r+10]]+_e[e[r+11]]+_e[e[r+12]]+_e[e[r+13]]+_e[e[r+14]]+_e[e[r+15]]}const ka={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function xh(e,r,t){if(ka.randomUUID&&!r&&!e)return ka.randomUUID();e=e||{};const n=e.random||(e.rng||yh)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,r){t=t||0;for(let s=0;s<16;++s)r[t+s]=n[s];return r}return vh(n)}class gr{static create(r){const t=[];let n=0;for(let s=0,a=r.formatParts.length;s<a;s++){const o=r.formatParts[s],i=n,c=i+o.characterCount;t.push({startPosition:i,endPosition:c,...o}),n=c}return t}}class wh{constructor(r,t){m(this,"instanceCollection");m(this,"formatPartList");m(this,"inputSlotCollection");m(this,"currentPartIndex",0);m(this,"currentCursorPosition",0);m(this,"inputElement");m(this,"inputSelection",null);m(this,"inputRange");m(this,"textNode");this.instanceCollection=kt.getInstance(),this.formatPartList=gr.create(r),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(t,r)}getCursorPosition(){return this.currentCursorPosition}getCurrentPartIndex(){return this.currentPartIndex}setInputElement(r){this.inputElement=r}setCursorToCurrentPosition(){this.setCursorSelection(this.currentCursorPosition)}setCursorPosition(r){this.setCursorSelection(r)}setCursorSelection(r,t){this.createInputRangeSelection(),this.inputRange&&this.textNode&&(this.inputRange.setStart(this.textNode,r),this.inputRange.setEnd(this.textNode,t||r),this.currentCursorPosition=t||r,this.setPartIndexByCursorPosition())}findCursorPosition(){var t,n;const r=(t=window.getSelection())==null?void 0:t.getRangeAt(0);if(this.inputElement&&r){const s=document.createTreeWalker(this.inputElement,NodeFilter.SHOW_TEXT,c=>{const f=document.createRange();return f.selectNodeContents(c),f.compareBoundaryPoints(Range.END_TO_END,r)<1?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT});let a=0;for(;s.nextNode();)a+=((n=s.currentNode.textContent)==null?void 0:n.length)||0;r.startContainer.nodeType===Node.TEXT_NODE&&(a+=r.startOffset);const o=this.inputSlotCollection.getLastSlotWithData(),i=o.startPosition+o.partText.length;this.setCursorSelection(a>i?i:a)}}isAtLastPart(){return this.currentPartIndex===this.formatPartList.length-1}moveHome(){const r=this.inputSlotCollection.getFirstSlot();this.setCursorSelection(r.startPosition)}moveEnd(){const r=this.inputSlotCollection.getLastSlotWithData(),t=r.startPosition+r.partText.length;this.setCursorSelection(t)}moveCursorLeft(){if(this.currentCursorPosition>0){const r=this.currentCursorPosition-1;let t=this.formatPartList[this.currentPartIndex];if(r>=t.startPosition&&r<=t.endPosition)this.setCursorSelection(r);else for(let n=this.currentPartIndex-1;n>=0;n--)t=this.formatPartList[n],r>=t.startPosition&&r<=t.endPosition&&(t.isSeparator?this.setCursorSelection(this.formatPartList[n-1].endPosition):this.setCursorSelection(r))}}moveCursorRight(){const r=this.inputSlotCollection.getLastSlotWithData(),t=r.startPosition+r.partText.length;if(this.currentCursorPosition<t){const n=this.currentCursorPosition+1;let s=this.formatPartList[this.currentPartIndex];if(n>=s.startPosition&&n<=s.endPosition)this.setCursorSelection(n);else for(let a=this.currentPartIndex+1,o=this.formatPartList.length;a<o;a++)s=this.formatPartList[a],n>=s.startPosition&&n<=s.endPosition&&(s.isSeparator?this.setCursorSelection(this.formatPartList[a+1].startPosition):this.setCursorSelection(n))}}moveToNextInputPart(){if(this.currentPartIndex<this.formatPartList.length-1){const r=this.findNextEditablePart();r&&(this.currentPartIndex=r.partIndex,this.setCursorSelection(r.startPosition))}}moveToPreviousInputPart(){if(this.currentPartIndex>0){const r=this.findPreviousEditablePart();r&&(this.currentPartIndex=r.partIndex,this.setCursorSelection(r.endPosition))}}findNextEditablePart(){return this.inputSlotCollection.getNextSlot(this.currentPartIndex)}findPreviousEditablePart(){return this.inputSlotCollection.getPreviousSlot(this.currentPartIndex)}setPartIndexByCursorPosition(){for(let r=0;r<this.formatPartList.length;r++){const t=this.formatPartList[r];if(this.currentCursorPosition>=t.startPosition&&this.currentCursorPosition<=t.endPosition){if(t.isSeparator){this.currentCursorPosition=this.formatPartList[r+1].startPosition,this.currentPartIndex=r+1;break}this.currentPartIndex=r;break}}}createInputRangeSelection(){var r,t;this.inputElement&&(this.inputSelection=window.getSelection(),this.inputRange=document.createRange(),(r=this.inputSelection)==null||r.removeAllRanges(),this.inputRange.selectNodeContents(this.inputElement),this.inputRange.collapse(!0),(t=this.inputSelection)==null||t.addRange(this.inputRange),this.inputElement.firstChild&&(this.textNode=this.inputElement.firstChild))}}class Th{static create(r){const t=[];for(let n=0,s=r.length;n<s;n++){const a=r[n];a.isSeparator||t.push({partIndex:n,partText:"",isComplete:!1,...a})}return t}}class Sh{constructor(r){m(this,"inputSlots");this.inputSlots=Th.create(gr.create(r))}clearAllSlots(){for(let r=0,t=this.inputSlots.length;r<t;r++)this.inputSlots[r].partText=""}getSlot(r){return this.inputSlots.find(t=>t.partIndex===r)}getFirstSlot(){return this.inputSlots[0]}getNextSlot(r){const t=this.inputSlots.findIndex(n=>n.partIndex===r);if(t>-1&&t+1<this.inputSlots.length)return this.inputSlots[t+1]}getPreviousSlot(r){const t=this.inputSlots.findIndex(n=>n.partIndex===r);if(t>-1&&t-1>=0)return this.inputSlots[t-1]}getLastSlotWithData(){const r=this.inputSlots.findIndex(n=>!n.isComplete);let t=r;for(let n=r+1,s=this.inputSlots.length;n<s;n++)this.inputSlots[n].partText.length>0&&(t=n);return this.inputSlots[t>-1?t:0]}allSlotsCompleted(){return this.inputSlots.every(r=>r.isComplete)}allSlotsEmpty(){return this.inputSlots.every(r=>r.partText.length===0)}}class kt{static getInstance(){return this.instance||(this.instance=new Ph),this.instance}}m(kt,"instance");class Ph{constructor(){m(this,"navigatorInstances");m(this,"inputSlotInstances");this.navigatorInstances={},this.inputSlotInstances={}}getNavigatorInstance(r,t){return this.navigatorInstances[r]||(this.navigatorInstances[r]=new wh(t,r)),this.navigatorInstances[r]}getInputSlotInstance(r,t){return this.inputSlotInstances[r]||(this.inputSlotInstances[r]=new Sh(t)),this.inputSlotInstances[r]}removeInstances(r){this.navigatorInstances[r]&&delete this.navigatorInstances[r],this.inputSlotInstances[r]&&delete this.inputSlotInstances[r]}}class En{constructor(r,t){m(this,"instanceCollection");m(this,"formatPartList");m(this,"inputSlotCollection");m(this,"inputElement");this.instanceCollection=kt.getInstance(),this.formatPartList=gr.create(r),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(t,r)}setInputElement(r){this.inputElement=r}render(){var t;let r="";for(let n=0,s=this.formatPartList.length;n<s;n++){const a=this.formatPartList[n];if(a.isSeparator)r+=a.inputText;else{const o=this.inputSlotCollection.getSlot(n);o&&(r+=o.partText+((t=o.inputText)==null?void 0:t.repeat(o.characterCount-o.partText.length)))}}this.inputElement&&(this.inputElement.innerHTML=r)}}var Ue=(e=>(e[e.Text=0]="Text",e[e.Numeric=1]="Numeric",e))(Ue||{});class Ca{constructor(){m(this,"numberKeys",["0","1","2","3","4","5","6","7","8","9"]);m(this,"movementKeys",["ArrowLeft","ArrowRight","Home","End"]);m(this,"editingKeys",["Backspace","Delete"]);m(this,"ignoreKeys",["Shift","Alt","Control","Fn","Meta"])}isNumberKey(r){return this.numberKeys.includes(r)}isMovementKey(r){return this.movementKeys.includes(r.key)}isEditingKey(r){return this.editingKeys.includes(r.key)}isIgnoreKey(r){return this.ignoreKeys.includes(r.key)}}class Eh{constructor(r){m(this,"_currentIndex",0);m(this,"index",0);m(this,"formatParts");this.formatParts=gr.create(r)}get currentIndex(){return this._currentIndex}hasNext(){return this.index<this.formatParts.length}next(){if(this.index<this.formatParts.length)return this._currentIndex=this.index++,this.formatParts[this._currentIndex]}peek(){if(this.index<this.formatParts.length)return this.formatParts[this.index]}reset(){this.index=0}}class Da{constructor(r,t){m(this,"instanceCollection");m(this,"inputSlotCollection");m(this,"formatNavigator");m(this,"keyTypeChecker");m(this,"formatRenderer");m(this,"formatPartList");this.format=r,this.instanceCollection=kt.getInstance(),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(t,r),this.formatNavigator=this.instanceCollection.getNavigatorInstance(t,r),this.keyTypeChecker=new Ca,this.formatRenderer=new En(r,t),this.formatPartList=new Eh(r)}setInputElement(r){this.formatRenderer.setInputElement(r)}processKeyPress(r){if(this.keyTypeChecker.isEditingKey(r)){this.processEditRules(r);return}this.processInputRules(r)}processInputValue(r){var n;this.inputSlotCollection.clearAllSlots(),this.formatPartList.reset();let t=0;for(;this.formatPartList.hasNext();){const s=this.formatPartList.next();if(s&&!s.isSeparator)if(((n=this.formatPartList.peek())==null?void 0:n.isSeparator)===!0){const a=this.formatPartList.currentIndex,o=this.formatPartList.next();if(o&&o.inputText){const i=r.indexOf(o.inputText,t),c=this.inputSlotCollection.getSlot(a);if(c&&i>-1){const f=i-t>c.characterCount?t+c.characterCount:i;c.partText=r.substring(t,f),this.processSlotRules(c),t=i+o.characterCount}}}else{const a=this.inputSlotCollection.getSlot(this.formatPartList.currentIndex);a&&(a.partText=r.substring(t,t+a.characterCount),this.processSlotRules(a))}}}processEditRules(r){const t=this.inputSlotCollection.getSlot(this.formatNavigator.getCurrentPartIndex());if(!t)return;const n=this.formatNavigator.getCursorPosition(),s=n-t.startPosition,a=this.format.deleteShiftsFormatPart||!1;switch(r.key){case"Backspace":{if(!(t.startPosition===n))t.partText=t.partText.substring(0,s-1)+t.partText.substring(s),a&&this.shiftFormatParts(t),this.formatRenderer.render(),this.formatNavigator.moveCursorLeft(),this.processSlotRules(t,!0);else{this.processSlotRules(t,!0);const i=this.inputSlotCollection.getPreviousSlot(t.partIndex);i&&(i.partText=i.partText.substring(0,i.partText.length-1),a&&this.shiftFormatParts(i),this.formatRenderer.render(),this.formatNavigator.setCursorPosition(i.startPosition+i.partText.length),this.processSlotRules(i,!0))}break}case"Delete":t.partText=t.partText.substring(0,s)+t.partText.substring(s+1),a&&this.shiftFormatParts(t),this.formatRenderer.render(),this.formatNavigator.setCursorToCurrentPosition(),this.processSlotRules(t,!0);break}}shiftFormatParts(r){let t=r,n;for(;(n=this.inputSlotCollection.getNextSlot(t.partIndex))!==void 0;){const s=n.partText.substring(0,1);n.partText=n.partText.substring(1),t.partText=t.partText+s,t=n}}processInputRules(r){const t=this.inputSlotCollection.getSlot(this.formatNavigator.getCurrentPartIndex());if(!t)return;const{key:n}=r,s=t.characterCount,a=t.partText;if(t.valueType===Ue.Numeric){if(!this.keyTypeChecker.isNumberKey(n))return;const o=t.maximumValue,i=t.exceedingMaximumValueCausesTab||!1,c=t.padWithZeros||!1,f=parseInt(this.createNewValue(t,n));if(o&&f>o)if(i){c&&(t.partText=t.partText.padStart(s,"0")),t.isComplete=!0;const h=this.inputSlotCollection.getNextSlot(t.partIndex);h&&!h.isComplete&&(h.partText=n),this.formatRenderer.render(),h&&this.formatNavigator.setCursorPosition(h.isComplete?h.startPosition:h.startPosition+1)}else return;else a.length+1===s?(this.addToInputSlot(n),t.isComplete=!0,this.formatRenderer.render(),this.formatNavigator.isAtLastPart()?this.formatNavigator.moveCursorRight():this.formatNavigator.moveToNextInputPart()):a.length+1<s&&(this.addToInputSlot(n),this.formatRenderer.render(),this.formatNavigator.moveCursorRight())}else a.length+1===s?(this.addToInputSlot(n),t.isComplete=!0,this.formatRenderer.render(),this.formatNavigator.isAtLastPart()?this.formatNavigator.moveCursorRight():this.formatNavigator.moveToNextInputPart()):(this.addToInputSlot(n),this.formatRenderer.render(),this.formatNavigator.moveCursorRight())}addToInputSlot(r){const t=this.inputSlotCollection.getSlot(this.formatNavigator.getCurrentPartIndex());t&&(t.partText=this.createNewValue(t,r))}createNewValue(r,t){const n=r.partText,s=this.formatNavigator.getCursorPosition();if(s>=r.startPosition+r.partText.length)return n+t;{const a=s-r.startPosition;return n.substring(0,a)+t+n.substring(a)}}processSlotRules(r,t=!1){const n=r.characterCount,s=r.allCharactersRequired||!1;if(r.valueType===Ue.Numeric){const a=r.minimumValue,o=r.maximumValue;if(s)r.isComplete=r.partText.length===n;else if(a!==void 0&&o!==void 0){const i=r.padWithZeros||!1,c=parseInt(r.partText);r.isComplete=c>=a&&c<=o,r.isComplete&&i&&!t&&(r.partText=r.partText.padStart(n,"0"))}else r.isComplete=r.partText.length>0}else s?r.isComplete=r.partText.length===n:r.isComplete=r.partText.length>0}}class kh{constructor(r,t){m(this,"instanceCollection");m(this,"formatNavigator");m(this,"ruleProcessor");m(this,"keyTypeChecker");m(this,"formatRenderer");this.format=r,this.instanceCollection=kt.getInstance(),this.formatNavigator=this.instanceCollection.getNavigatorInstance(t,r),this.ruleProcessor=new Da(r,t),this.keyTypeChecker=new Ca,this.formatRenderer=new En(r,t)}setInputElement(r){this.ruleProcessor.setInputElement(r),this.formatRenderer.setInputElement(r)}processMovementKey(r){const{key:t,metaKey:n}=r;switch(t){case"ArrowLeft":n?this.formatNavigator.moveHome():this.formatNavigator.moveCursorLeft();break;case"ArrowRight":n?this.formatNavigator.moveEnd():this.formatNavigator.moveCursorRight();break;case"Home":this.formatNavigator.moveHome();break;case"End":this.formatNavigator.moveEnd();break}}processKeyPress(r){return this.keyTypeChecker.isIgnoreKey(r)?!1:this.keyTypeChecker.isMovementKey(r)?(this.processMovementKey(r),!1):(this.ruleProcessor.processKeyPress(r),!0)}}class Ch{constructor(r,t=""){m(this,"instanceId");m(this,"instanceCollection");m(this,"keyProcessor");m(this,"formatNavigator");m(this,"formatRenderer");m(this,"inputSlotCollection");m(this,"inputRuleProcessor");m(this,"previousOutputValue","");m(this,"inputElementSet",!1);m(this,"isInputFocused",!1);m(this,"inputElement");m(this,"onFormatChange");this.inputValue=t,this.instanceId=xh(),this.instanceCollection=kt.getInstance(),this.keyProcessor=new kh(r,this.instanceId),this.formatNavigator=this.instanceCollection.getNavigatorInstance(this.instanceId,r),this.formatRenderer=new En(r,this.instanceId),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(this.instanceId,r),this.inputRuleProcessor=new Da(r,this.instanceId)}inputElementCreated(r){this.keyProcessor.setInputElement(r),this.formatNavigator.setInputElement(r),this.formatRenderer.setInputElement(r),this.inputElement=r,this.inputElementSet=!0,this.inputElementSet&&this.inputValue.length>0&&this.inputValuePassed(this.inputValue)}inputFocused(){this.isInputFocused=!0,this.formatRenderer.render(),setTimeout(()=>this.formatNavigator.findCursorPosition())}inputBlurred(){this.isInputFocused=!1}inputValuePassed(r){this.inputValue=r,this.inputElementSet&&(this.inputValue.length>0?this.inputRuleProcessor.processInputValue(r):(this.inputSlotCollection.clearAllSlots(),this.previousOutputValue=void 0),setTimeout(()=>{var t;this.formatRenderer.render(),this.isInputFocused&&this.formatNavigator.setCursorToCurrentPosition(),this.inputValue.length>0&&(this.previousOutputValue=(t=this.inputElement)==null?void 0:t.innerHTML)}))}registerFormatChangeEvent(r){this.onFormatChange=r}mouseUpHandler(){this.formatNavigator.findCursorPosition()}keyDownHandler(r){r.key!=="Tab"&&(r.preventDefault(),r.stopPropagation(),this.keyProcessor.processKeyPress(r)&&this.inputElement&&this.onFormatChange&&(this.inputSlotCollection.allSlotsCompleted()&&this.previousOutputValue!==this.inputElement.innerHTML?(this.previousOutputValue=this.inputElement.innerHTML,this.onFormatChange(this.inputElement.innerHTML)):this.inputSlotCollection.allSlotsEmpty()&&this.previousOutputValue!==void 0&&(this.previousOutputValue=void 0,this.onFormatChange())))}dispose(){this.instanceCollection.removeInstances(this.instanceId)}}const Dh=(e,r)=>{const{value:t="",format:n,readOnly:s=!1,debounceTime:a=800,fillContainer:o=!0,leftElement:i,rightElement:c,className:f,leftElementClassName:h,rightElementClassName:p,isSingleLine:y=!1,allowSingleLineScroll:x=!1,isInputValid:w,onChange:O,onFocus:_,onBlur:S,onElementCreate:R,onLeftElementClick:z,onRightElementClick:F}=e,[b,A]=d.useState(!0),k=d.useRef(),W=d.useRef(),V=d.useRef();d.useEffect(()=>()=>{var v;(v=V.current)==null||v.dispose()},[]),d.useEffect(()=>{var v;(v=V.current)==null||v.inputValuePassed(t)},[t]),d.useEffect(()=>{var v,ee,g;(v=V.current)==null||v.dispose(),n&&(V.current=new Ch(n,t),W.current&&((ee=V.current)==null||ee.inputElementCreated(W.current)),(g=V.current)==null||g.registerFormatChangeEvent(ne))},[n]);const ne=d.useCallback(v=>{w?w(v)?(A(!0),O==null||O(v)):A(!1):O==null||O(v)},[O]),te=d.useCallback(v=>{var ee;(ee=V.current)==null||ee.inputFocused(),_==null||_(v)},[_]),X=d.useCallback(v=>{var ee;(ee=V.current)==null||ee.inputBlurred(),S==null||S(v)},[S]),N=d.useCallback(()=>{var v;(v=V.current)==null||v.mouseUpHandler()},[]),$=d.useCallback(v=>{var ee;(ee=V.current)==null||ee.keyDownHandler(v)},[]),j=d.useCallback(v=>{var ee,g,D,B,P,Y,G,L,H;(g=(ee=k.current)==null?void 0:ee.inputElement)==null||g.removeEventListener("keydown",$),(B=(D=k.current)==null?void 0:D.inputElement)==null||B.removeEventListener("mouseup",N),k.current=v,(Y=(P=k.current)==null?void 0:P.inputElement)==null||Y.addEventListener("keydown",$),(L=(G=k.current)==null?void 0:G.inputElement)==null||L.addEventListener("mouseup",N),W.current=(H=k.current)==null?void 0:H.inputElement},[]),C=d.useCallback(()=>{var v;(v=k.current)==null||v.focus()},[]);d.useImperativeHandle(r,()=>({focus:C}));const q=ue(f,{"!bsc-border-error":!b});return l.jsx(lr,{ref:v=>v&&j(v),readOnly:s,debounceTime:a,fillContainer:o,leftElement:i,rightElement:c,className:q,leftElementClassName:h,rightElementClassName:p,isSingleLine:y,allowSingleLineScroll:x,onFocus:te,onBlur:X,onElementCreate:R,onLeftElementClick:z,onRightElementClick:F})},Oa=d.forwardRef(Dh),kn=d.createContext(void 0);function _a(e,r,t=!0){var y,x;const n=Zs(e),s=Vs(e),a=_f(e);let o=un(s)-(((y=r.options)==null?void 0:y.weekStartsOn)||0);o=o===-1?6:o;const i=un(a)-(((x=r.options)==null?void 0:x.weekStartsOn)||0),c=$l({start:s,end:a}),f=n+o>35?6:5,h=Na(f,7,{dayValue:null,isCurrent:!0});let p=1;for(let w=0,O=f;w<O;w++){for(let _=w>0?0:o;_<7;_++){const S=c[p-1];if(S.setHours(e.getHours(),e.getMinutes(),e.getSeconds()),h[w][_].dayValue=S,++p>n)break}if(p>n)break}if(o>0&&t)for(let w=0;w<o;w++)h[0][w].dayValue=Cd(s,o-w),h[0][w].isCurrent=!1;if(i>-1&&t)for(let w=6;w>i;w--)h[f-1][w].dayValue=Tt(a,w-i),h[f-1][w].isCurrent=!1;return h}function Na(e,r,t){const n=[];for(let s=0,a=e;s<a;s++){const o=[];for(let i=0,c=r;i<c;i++){const f=Oh(t)?t:{...t};o.push(f)}n.push(o)}return n}function Oh(e){const r=typeof e;return r==="string"||r==="number"||r==="boolean"||e instanceof Date}function _h(e){var n;const r=Dd(new Date,((n=e.options)==null?void 0:n.weekStartsOn)||0),t=[];for(let s=0;s<7;s++)t.push(Tt(r,s).toLocaleDateString(e.code,{weekday:"short"}));return t}function Nh(e){const r=new Date(Date.UTC(2020,0,1)),t=[[{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""}],[{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""}],[{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""}]];let n=0;for(let s=0;s<3;s++)for(let a=0;a<4;a++)t[s][a]={monthNumber:n,monthName:ut(r,n++).toLocaleDateString(e.code,{month:"short"})};return t}function Ih(e,r){const t=new Date(e.getTime()),n=Math.floor(t.getFullYear()/10)*10;t.setFullYear(n);const s=Fl({start:t,end:fr(t,9)}),a=Na(3,4,"");let o=0;for(let i=0;i<3;i++)for(let c=0;c<4&&(a[i][c]=s[o++].toLocaleDateString(r.code,{year:"numeric"}),o!==s.length);c++);return a}function jh(e){const r=new Date;return r.setHours(0,0,0,0),r.toLocaleTimeString(e.code)}function Mh(e,r,t){return e.getTime()>=r.getTime()&&e.getTime()<=t.getTime()}async function Ia(e){return(await import(`/node_modules/date-fns/locale/${Rh(e)}`)).default}function Rh(e){const[r,t]=e.split("-");switch(r){case"af":return"af";case"ar":switch(t){case"DZ":return"ar-DZ";case"EG":return"ar-EG";case"MA":return"ar-MA";case"SA":return"ar-SA";case"TN":return"ar-TN";default:return"ar"}case"az":return"az";case"be":switch(t){case"tarask":return"be-tarask";default:return"be"}case"bg":return"bg";case"bn":return"bn";case"bs":return"bs";case"ca":return"ca";case"cs":return"cs";case"cy":return"cy";case"da":return"da";case"de":switch(t){case"AT":return"de-AT";default:return"de"}case"el":return"el";case"en":switch(t){case"AU":return"en-AU";case"CA":return"en-CA";case"GB":return"en-GB";case"IE":return"en-IE";case"IN":return"en-IN";case"NZ":return"en-NZ";case"US":return"en-US";default:return"en-ZA"}case"eo":return"eo";case"es":return"es";case"et":return"et";case"eu":return"eu";case"fa":return"fa-IR";case"fi":return"fi";case"fr":switch(t){case"CA":return"fr-CA";case"CH":return"fr-CH";default:return"fr"}case"fy":return"fy";case"gd":return"gd";case"gl":return"gl";case"gu":return"gu";case"he":return"he";case"hi":return"hi";case"hr":return"hr";case"ht":return"ht";case"hu":return"hu";case"hy":return"hy";case"id":return"id";case"is":return"is";case"it":switch(t){case"CH":return"it-CH";default:return"it"}case"ja":switch(t){case"Hira":return"ja-Hira";default:return"ja"}case"ka":return"ka";case"kk":return"kk";case"km":return"km";case"kn":return"kn";case"ko":return"ko";case"lb":return"lb";case"lt":return"lt";case"lv":return"lv";case"mk":return"mk";case"mn":return"mn";case"ms":return"ms";case"mt":return"mt";case"nb":return"nb";case"nl":switch(t){case"BE":return"nl-BE";default:return"nl"}case"nn":return"nn";case"oc":return"oc";case"pl":return"pl";case"pt":switch(t){case"BR":return"pt-BR";default:return"pt"}case"ro":return"ro";case"ru":return"ru";case"sk":return"sk";case"sl":return"sl";case"sq":return"sq";case"sr":switch(t){case"Latn":return"sr-Latn";default:return"sr"}case"sv":return"sv";case"ta":return"ta";case"te":return"te";case"th":return"th";case"tr":return"tr";case"ug":return"ug";case"uk":return"uk";case"uz":switch(t){case"Cyrl":return"uz-Cyrl";default:return"uz"}case"vi":return"vi";case"zh":switch(t){case"CN":return"zh-CN";case"HK":return"zh-HK";default:return"zh-TW"}default:return"en-AU"}}function qt(e,r){const t=Od(e);if(isNaN(t.valueOf())){let n=ze(e,"P pp",new Date,{locale:r});return!isNaN(n.valueOf())||(n=ze(e,"Pp",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=ze(e,"P HH:mm",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=ze(e,"P hh:mm a..aaa",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=ze(e,"P HH:mm:ss",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=ze(e,"P hh:mm:ss a..aaa",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=ze(e,"P",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=ze(e,"P p",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=ze(e,"pp",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=ze(e,"p",new Date,{locale:r}),!isNaN(n.valueOf()))?n:void 0}return t}function Cn(e,r){const t=e.split("-");if(t.length!==2)return;const n=qt(t[0].trim(),r);if(!n)return;const s=qt(t[1].trim(),r);if(s)return[n,s]}var be=(e=>(e[e.DateTime=0]="DateTime",e[e.DateOnly=1]="DateOnly",e[e.TimeOnly=2]="TimeOnly",e[e.DateRange=3]="DateRange",e))(be||{}),Oe=(e=>(e[e.DaySelector=0]="DaySelector",e[e.MonthSelector=1]="MonthSelector",e[e.YearSelector=2]="YearSelector",e[e.TimeSelector=3]="TimeSelector",e[e.DateRangeSelector=4]="DateRangeSelector",e))(Oe||{}),Gt=(e=>(e[e.Day=0]="Day",e[e.Month=1]="Month",e[e.Year=2]="Year",e[e.Range=3]="Range",e))(Gt||{}),Zt=(e=>(e[e.Short=0]="Short",e[e.Medium=1]="Medium",e[e.Long=2]="Long",e))(Zt||{}),Pe=(e=>(e[e.TwelveHour=0]="TwelveHour",e[e.TwentyFourHour=1]="TwentyFourHour",e))(Pe||{}),rt=(e=>(e[e.Normal=0]="Normal",e[e.Range=1]="Range",e))(rt||{}),yr=(e=>(e[e.Right=0]="Right",e[e.Left=1]="Left",e[e.None=2]="None",e))(yr||{}),le=(e=>(e[e.SetDateSelector=0]="SetDateSelector",e[e.SetViewDate=1]="SetViewDate",e[e.SetSelectedDate=2]="SetSelectedDate",e[e.SetSelectedDateRange=3]="SetSelectedDateRange",e[e.SetSelectedStartDate=4]="SetSelectedStartDate",e[e.SetSelectedEndDate=5]="SetSelectedEndDate",e[e.SetTimeFormat=6]="SetTimeFormat",e[e.ClearDates=7]="ClearDates",e[e.InitializeDates=8]="InitializeDates",e))(le||{});const Ah=(e,r)=>{switch(r.type){case 0:return r.dateSelector!==void 0?{...e,currentSelector:r.dateSelector,currentViewDate:r.viewDate||e.currentViewDate}:{...e};case 1:return{...e,currentViewDate:r.viewDate||new Date,dateInitialized:!0};case 2:return{...e,selectedDate:r.selectedDate||e.selectedDate,currentViewDate:r.viewDate||e.currentViewDate};case 3:return{...e,selectedStartDate:r.selectedStartDate||e.selectedStartDate,selectedEndDate:r.selectedEndDate||e.selectedEndDate};case 4:return{...e,selectedStartDate:r.selectedStartDate,selectedEndDate:void 0};case 5:return{...e,selectedEndDate:r.selectedEndDate};case 6:return{...e,timeFormat:r.timeFormat||e.timeFormat};case 7:return{currentSelector:e.currentSelector,currentViewDate:e.currentViewDate,timeFormat:e.timeFormat,dateInitialized:!0};case 8:{const t={...e,currentViewDate:Lh(r.initialDate),dateInitialized:!0};return Array.isArray(r.initialDate)?{...t,selectedStartDate:r.initialDate[0],selectedEndDate:r.initialDate[1]}:{...t,selectedDate:r.initialDate}}default:return{...e,currentSelector:Oe.DaySelector}}};function Lh(e){return e?Array.isArray(e)?e[0]:e:new Date}const vr=({viewDate:e,selectedDate:r,selectedStartDate:t,selectedEndDate:n,selectionMode:s=rt.Normal,locale:a,onDateSelected:o,selectableDate:i,isValidDate:c,dispatcher:f})=>{var j;const[h,p]=d.useState(!1),[y,x]=d.useState(),[w,O]=d.useState(),[_,S]=d.useState(),[R,z]=d.useState(),F=d.useRef(),b=d.useRef(),A=d.useContext(kn),k=d.useMemo(()=>A.calendarTemplate,[A.calendarTemplate]),W=async()=>a||await Ia(Wn());d.useEffect(()=>{W().then(C=>{F.current=C,b.current=_h(F.current),p(!0)}).catch(C=>console.error(C))},[]),d.useEffect(()=>{e&&F.current&&S(_a(e,F.current,s===rt.Normal))},[e,h]),d.useEffect(()=>{z(r?new Date(r.getFullYear(),r.getMonth(),r.getDate()):void 0)},[r]),d.useEffect(()=>{x(t?new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0).getTime():void 0),O(n?new Date(n.getFullYear(),n.getMonth(),n.getDate(),23,59,59).getTime():void 0)},[t,n]),d.useEffect(()=>{F.current&&a&&(F.current=a,S(_a(e,F.current,s===rt.Normal)))},[a]);const V=C=>{if(s===rt.Normal)f==null||f({type:le.SetSelectedDate,selectedDate:C,viewDate:C}),o==null||o(C);else{if(!o)throw new Error("Range selection mode requires onDateSelected to be set");!t||Nf(C,t)?o(C):t&&!n?o(C,{setEndDate:!0}):t&&n&&o(C)}},ne=C=>(R==null?void 0:R.toLocaleDateString())===C.toLocaleDateString(),te=C=>{if(y&&w){const q=C.getTime();return q>=y&&q<=w}return!1},X={viewDate:e,selectedDate:r,selectedStartDate:t,selectedEndDate:n,selectionMode:s,locale:a,weekDays:b.current,monthMatrix:_,selectableDate:i,isValidDate:c,onDateClicked:V,isSelectedDate:ne,isInSelectedDateRange:te},$=k||((C,q)=>l.jsx("div",{className:"bc-dt-calendar bsc-w-full",children:q}));return l.jsx(lt,{props:X,template:$,children:l.jsxs("div",{className:"bc-dt-day-row bsc-grid bsc-min-w-[329px] bsc-grid-cols-7 bsc-gap-3",children:[(j=b.current)==null?void 0:j.map((C,q)=>l.jsx("div",{className:"bc-dt-day-cell bsc-text-center bsc-font-bold",children:C},q)),_==null?void 0:_.map((C,q)=>C.map((v,ee)=>{var B,P;const g=v.dayValue!==null&&(i===void 0||i(v.dayValue)),D=ue("bsc-text-center bsc-py-1",{"bsc-text-gray-3":!v.isCurrent,"bsc-bg-primary-3 dark:bsc-bg-mono-light-1 dark:bsc-text-mono-dark-1":v&&v.dayValue&&(R&&ne(v.dayValue)||y&&!w&&Ws(y,v.dayValue)||y&&w&&te(v.dayValue)),"bsc-cursor-pointer":g,"bsc-text-error bsc-cursor-not-allowed":!g,"bsc-bg-primary-5 dark:bsc-bg-mono-light-3 dark:bsc-text-mono-dark-1":v.dayValue&&kd(v.dayValue)&&!(ne(v.dayValue)||te(v.dayValue))},"bc-dt-date-cell");return l.jsx("div",{className:D,onClick:()=>v&&v.dayValue&&g&&(c===void 0||c(v.dayValue))&&V(v.dayValue),children:(P=v.dayValue)==null?void 0:P.getDate().toLocaleString((B=F.current)==null?void 0:B.code)},q.toString()+ee.toString())}))]})})},xr=({title:e,scrollerType:r,onTitleClicked:t,onMovePrevious:n,onMoveNext:s})=>{const o=d.useContext(kn).dateScrollerTemplate,i={title:e,scrollerType:r,onTitleClicked:t,onMovePrevious:n,onMoveNext:s},f=o||((h,p)=>l.jsx("div",{className:"bc-dt-scroller bsc-flex bsc-w-full bsc-flex-row bsc-items-center bsc-px-2 bsc-py-1",children:p}));return l.jsxs(lt,{props:i,template:f,children:[l.jsx("div",{className:"bc-dt-scroller-left bsc-flex-shrink bsc-cursor-pointer",children:l.jsx(We,{className:"bsc-bg-transparent focus:bsc-outline-none",onClick:n,children:l.jsx(Le,{icon:"chevronLeft",size:je.Regular})})}),l.jsx("div",{className:"bc-dt-scroller-title bsc-flex-grow bsc-cursor-pointer bsc-text-center",onClick:t,children:e}),l.jsx("div",{className:"bc-dt-scroller-right bsc-flex-shrink bsc-cursor-pointer",children:l.jsx(We,{className:"bsc-bg-transparent focus:bsc-outline-none",onClick:s,children:l.jsx(Le,{icon:"chevronRight",size:je.Regular})})})]})},$h=({selectedDate:e,viewDate:r,locale:t,showTimeSelector:n,selectableDate:s,isValidDate:a,onChange:o,dispatcher:i})=>{const c=()=>{r&&i({type:le.SetViewDate,viewDate:ta(r,1)})},f=()=>{r&&i({type:le.SetViewDate,viewDate:ut(r,1)})},h=()=>{i({type:le.SetDateSelector,dateSelector:Oe.MonthSelector})},p=()=>{i({type:le.SetDateSelector,dateSelector:Oe.TimeSelector})},y=()=>r?r.toLocaleDateString(t.code,{month:"long",year:"numeric"}):"";return l.jsxs("div",{className:"bc-dt-day-selector bsc-p-2",children:[l.jsx(xr,{title:y(),scrollerType:Gt.Day,onTitleClicked:h,onMovePrevious:c,onMoveNext:f}),l.jsx(vr,{viewDate:r,selectedDate:e,locale:t,selectableDate:s,isValidDate:a,onDateSelected:o,dispatcher:i}),n&&l.jsx("div",{className:"bc-dt-time-value-wrapper bsc-flex bsc-w-full bsc-flex-row bsc-justify-center bsc-p-2",children:l.jsx("div",{className:"bc-dt-time-value bsc-cursor-pointer bsc-p-2 hover:bsc-bg-gray-4 dark:bsc-bg-mono-dark-1 dark:bsc-text-mono-light-1 dark:hover:bsc-bg-mono-light-2 dark:hover:bsc-text-mono-dark-2",onClick:p,children:(e==null?void 0:e.toLocaleTimeString(t.code))||jh(t)})})]})},Fh=({viewDate:e,locale:r,dateSelection:t=be.DateTime,dispatcher:n})=>{const s=d.useRef(Nh(r)),a=()=>{const h=ra(e,1);n({type:le.SetViewDate,viewDate:h})},o=()=>{const h=fr(e,1);n({type:le.SetViewDate,viewDate:h})},i=h=>{n({type:le.SetDateSelector,dateSelector:t!==be.DateRange?Oe.DaySelector:Oe.DateRangeSelector,viewDate:zd(e,h)})},c=()=>e.toLocaleDateString(r.code,{year:"numeric"}),f=()=>{n({type:le.SetDateSelector,dateSelector:Oe.YearSelector})};return l.jsxs("div",{className:"bc-dt-month-selector bsc-p-2",style:{minWidth:"20rem"},children:[l.jsx(xr,{title:c(),scrollerType:Gt.Month,onTitleClicked:f,onMovePrevious:a,onMoveNext:o}),l.jsx("div",{className:"bc-dt-month-grid bsc-grid bsc-w-full bsc-grid-cols-4 bsc-gap-4",children:s.current.map((h,p)=>h.map((y,x)=>l.jsx("div",{className:"bc-dt-month-cell bsc-cursor-pointer bsc-text-center",onClick:()=>i(y.monthNumber),children:y.monthName},p.toString()+x.toString())))})]})},Yh=({viewDate:e,selectedStartDate:r,selectedEndDate:t,locale:n,onChange:s,dispatcher:a})=>{const o=pr("screen and (max-device-width: 40rem)"),i=ut(e,1),c=(x,w)=>{!w||!w.setEndDate?a({type:le.SetSelectedStartDate,selectedStartDate:x}):(a({type:le.SetSelectedEndDate,selectedEndDate:x}),r&&(s==null||s([r,x])))},f=()=>{a({type:le.SetDateSelector,dateSelector:Oe.MonthSelector})},h=()=>o?`${e.toLocaleDateString(n.code,{month:"long"})} ${e.toLocaleDateString(n.code,{year:"numeric"})}`:`${e.toLocaleDateString(n.code,{month:"long"})} ${e.toLocaleDateString(n.code,{year:"numeric"})} - ${i.toLocaleDateString(n.code,{month:"long"})} ${i.toLocaleDateString(n.code,{year:"numeric"})}`,p=()=>{e&&a({type:le.SetViewDate,viewDate:ta(e,1)})},y=()=>{e&&a({type:le.SetViewDate,viewDate:ut(e,1)})};return l.jsxs("div",{className:"bc-dt-range-selector bsc-flex bsc-flex-col",children:[l.jsx("div",{className:"bc-dt-range-scroller-wrapper bsc-flex-shrink",children:l.jsx(xr,{title:h(),scrollerType:Gt.Range,onTitleClicked:f,onMovePrevious:p,onMoveNext:y})}),l.jsx("div",{className:"bsc-flex-grow",children:l.jsx(pn,{mobileMarkup:l.jsx("div",{className:"bc-dt-range-calendar bsc-px-2 bsc-py-1",children:l.jsx(vr,{viewDate:e,selectedStartDate:r,selectedEndDate:t,selectionMode:rt.Range,onDateSelected:c,locale:n,dispatcher:a})}),aboveMobileMarkup:l.jsxs("div",{className:"bc-dt-range-wrapper bsc-flex bsc-flex-row bsc-px-2 bsc-py-1",children:[l.jsx("div",{className:"bc-dt-range-calendar-1 bsc-border-r bsc-border-solid bsc-border-gray-3 bsc-pr-4",children:l.jsx(vr,{viewDate:e,selectedStartDate:r,selectedEndDate:t,selectionMode:rt.Range,onDateSelected:c,locale:n,dispatcher:a})}),l.jsx("div",{className:"bc-dt-range-calendar-2 bsc-pl-4",children:l.jsx(vr,{viewDate:i,selectedStartDate:r,selectedEndDate:t,selectionMode:rt.Range,onDateSelected:c,locale:n,dispatcher:a})})]})})})]})},Hh=({viewDate:e,showDateSelector:r,locale:t,timeFormat:n=Pe.TwelveHour,timeConstraints:s,onChange:a,dispatcher:o})=>{const i=d.useRef(n===Pe.TwelveHour?11:23),c=d.useRef(n===Pe.TwelveHour?["12","01","02","03","04","05","06","07","08","09","10","11"]:["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23"]),f=d.useRef(Xa(0,59,N=>N.toString().padStart(2,"0"))),h=d.useRef(["AM","PM"]),p=d.useRef(El(e)),y=N=>N>11?N-12:N,[x,w]=d.useState(y(e.getHours())),[O,_]=d.useState(e.getMinutes()),[S,R]=d.useState(e.getHours()<=12?0:1),z=d.useRef(e.toLocaleDateString(t.code));d.useEffect(()=>{const N=e.getHours(),$=e.getMinutes();if(N!==x&&w(n===Pe.TwelveHour?y(N):N),$!==O&&_($),n===Pe.TwelveHour){const j=N<=11?0:1;j!==S&&R(j)}},[e]);const F=()=>{var j;const N=((j=s==null?void 0:s.hours)==null?void 0:j.step)||1,$=x<i.current?x+N:0;w($),V($,O,S)},b=()=>{var j;const N=((j=s==null?void 0:s.hours)==null?void 0:j.step)||1,$=x>0?x-N:i.current;w($),V($,O,S)},A=()=>{var j,C,q;const N=((j=s==null?void 0:s.minutes)==null?void 0:j.step)||1,$=O+N<(((C=s==null?void 0:s.minutes)==null?void 0:C.max)||59)?O+N:((q=s==null?void 0:s.minutes)==null?void 0:q.min)||0;_($),V(x,$,S)},k=()=>{var j,C,q;const N=((j=s==null?void 0:s.minutes)==null?void 0:j.step)||1,$=O-N>=(((C=s==null?void 0:s.minutes)==null?void 0:C.min)||0)?O-N:(((q=s==null?void 0:s.minutes)==null?void 0:q.max)||60)-N;_($),V(x,$,S)},W=()=>{const N=S===0?1:0;R(N),V(x,O,N)},V=(N,$,j)=>{const C=n===Pe.TwelveHour&&j===1?N+12:N;p.current.setHours(C,$),o({type:le.SetSelectedDate,selectedDate:p.current,viewDate:p.current}),a==null||a(p.current)},ne=()=>{o({type:le.SetDateSelector,dateSelector:Oe.DaySelector})},te=ue("bsc-w-full bsc-grid bsc-grid-rows-3 bsc-gap-4 bc-dt-time-grid",{"bsc-grid-cols-4":n===Pe.TwelveHour,"bsc-grid-cols-3":n===Pe.TwentyFourHour}),X=ue("bsc-text-center bsc-cursor-pointer hover:bsc-bg-gray-4 dark:bsc-text-mono-light-1 dark:hover:bsc-bg-mono-light-1 dark:hover:bsc-text-mono-dark-1 bc-dt-time-date-value",{"bsc-col-span-4":n===Pe.TwelveHour,"bsc-col-span-3":n===Pe.TwentyFourHour});return l.jsx("div",{className:"bc-dt-time-selector bsc-flex bsc-flex-row bsc-justify-center bsc-p-2",style:{minWidth:n===Pe.TwelveHour?"15rem":"11rem"},children:l.jsxs("div",{className:te,children:[r&&l.jsx("div",{className:X,onClick:ne,children:z.current}),l.jsx("div",{className:"bc-dt-time-hour-increase bsc-cursor-pointer bsc-text-center",children:l.jsx(We,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:F,children:l.jsx(Le,{icon:"chevronUp",size:je.Regular})})}),l.jsx("div",{}),l.jsx("div",{className:"bc-dt-time-minute-increase bsc-cursor-pointer bsc-text-center",children:l.jsx(We,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:A,children:l.jsx(Le,{icon:"chevronUp",size:je.Regular})})}),n===Pe.TwelveHour&&l.jsx("div",{className:"bc-dt-time-meridian-increase bsc-cursor-pointer bsc-text-center",children:l.jsx(We,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:W,children:l.jsx(Le,{icon:"chevronUp",size:je.Regular})})}),l.jsx("div",{className:"bc-dt-time-hour-value bsc-text-center",children:c.current[x]}),l.jsx("div",{className:"bc-dt-time-separator bsc-text-center",children:":"}),l.jsx("div",{className:"bc-dt-time-minute-value bsc-text-center",children:f.current[O]}),n===Pe.TwelveHour&&l.jsx("div",{className:"bc-dt-time-meridian-value bsc-text-center",children:h.current[S]}),l.jsx("div",{className:"bc-dt-time-hour-decrease bsc-cursor-pointer bsc-text-center",children:l.jsx(We,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:b,children:l.jsx(Le,{icon:"chevronDown",size:je.Regular})})}),l.jsx("div",{}),l.jsx("div",{className:"bc-dt-time-minute-decrease bsc-cursor-pointer bsc-text-center",children:l.jsx(We,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:k,children:l.jsx(Le,{icon:"chevronDown",size:je.Regular})})}),n===Pe.TwelveHour&&l.jsx("div",{className:"bc-dt-time-meridian-decrease bsc-cursor-pointer bsc-text-center",children:l.jsx(We,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:W,children:l.jsx(Le,{icon:"chevronDown",size:je.Regular})})})]})})},Wh=({viewDate:e,locale:r,dispatcher:t})=>{const n=Ih(e,r),s=()=>{const c=ra(e,10);t({type:le.SetViewDate,viewDate:c})},a=()=>{const c=fr(e,10);t({type:le.SetViewDate,viewDate:c})},o=c=>{const f=parseInt(c);t({type:le.SetDateSelector,dateSelector:Oe.MonthSelector,viewDate:Ud(e,f)})},i=()=>`${n[0][0].toString()} - ${n[2][1].toString()}`;return l.jsxs("div",{className:"bc-dt-year-selector",style:{minWidth:"20rem"},children:[l.jsx(xr,{title:i(),scrollerType:Gt.Year,onMovePrevious:s,onMoveNext:a}),l.jsx("div",{className:"bc-dt-year-wrapper bsc-w-full",children:l.jsx("div",{className:"bc-dt-year-grid bsc-grid bsc-grid-cols-4 bsc-gap-4",children:n.map((c,f)=>c.map((h,p)=>h.length>0?l.jsx("div",{className:"bc-dt-year-cell bsc-cursor-pointer bsc-text-center",onClick:()=>o(h),children:h},f.toString()+p.toString()):l.jsx("div",{},f.toString()+p.toString())))})})]})};class Vh{constructor(r,t){m(this,"dateFormat");m(this,"timeFormat");m(this,"use24HourTime");m(this,"monthPart");m(this,"dayPart");m(this,"yearPart");m(this,"twelveHourPart");m(this,"twentyFourHourPart");m(this,"minutePart");m(this,"meridianPart");this.dateSelection=r;const n=2023,s=12,a=20,i=new Date(n,s-1,a).toLocaleDateString(t,{year:"numeric",month:"numeric",day:"numeric"});this.dateFormat=i.replace(`${n}`,"YYYY").replace(`${s}`,"MM").replace(`${a}`,"DD");const c=new Date,f=18,h=24,p=37,y=317;c.setHours(f,h,p,y);const x=c.toLocaleTimeString(t);this.use24HourTime=x.startsWith("18"),this.timeFormat=x.replace(`${this.use24HourTime?f:"6"}`,"HH").replace(`${h}`,"MM").replace(`${p}`,"SS").replace(`${y}`,"LLL"),this.createDateParts()}get is24HourTime(){return this.use24HourTime}createInputFormat(){const r={deleteShiftsFormatPart:!1,formatParts:[]};switch(this.dateSelection){case be.DateOnly:return this.createDateFormat(r);case be.TimeOnly:return this.createTimeFormat(r);case be.DateRange:return this.createDateRangeFormat(r);case be.DateTime:return this.createDateTimeFormat(r)}}createDateFormat(r){return this.dateFormat.startsWith("MM")?r.formatParts.push(...this.createMonthDayYearFormatParts()):this.dateFormat.startsWith("DD")?r.formatParts.push(...this.createDayMonthYearFormatParts()):r.formatParts.push(...this.createYearMonthDayFormatParts()),r}createTimeFormat(r){return this.use24HourTime?r.formatParts.push(...this.createTwentyFourHourFormatParts()):r.formatParts.push(...this.createTwelveHourFormatParts()),r}createDateRangeFormat(r){const t=[];this.dateFormat.startsWith("MM")?t.push(...this.createMonthDayYearFormatParts()):this.dateFormat.startsWith("DD")?t.push(...this.createDayMonthYearFormatParts()):t.push(...this.createYearMonthDayFormatParts());const n={characterCount:3,placeholder:" - ",inputText:" - ",isSeparator:!0};return r.formatParts.push(...t,n,...t),r}createDateTimeFormat(r){this.dateFormat.startsWith("MM")?r.formatParts.push(...this.createMonthDayYearFormatParts()):this.dateFormat.startsWith("DD")?r.formatParts.push(...this.createDayMonthYearFormatParts()):r.formatParts.push(...this.createYearMonthDayFormatParts());const t={characterCount:1,placeholder:" ",inputText:" ",isSeparator:!0};return r.formatParts.push(t),this.use24HourTime?r.formatParts.push(...this.createTwentyFourHourFormatParts()):r.formatParts.push(...this.createTwelveHourFormatParts()),r}createMonthDayYearFormatParts(){if(this.monthPart&&this.dayPart&&this.yearPart){let r=this.dateFormat.replace("MM",""),t=r.indexOf("DD"),n=r.substring(0,t);r=r.replace(n,"").replace("DD","");const s={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};t=r.indexOf("YYYY"),n=r.substring(0,t);const a={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};return[this.monthPart,s,this.dayPart,a,this.yearPart]}return[]}createDayMonthYearFormatParts(){if(this.monthPart&&this.dayPart&&this.yearPart){let r=this.dateFormat.replace("DD",""),t=r.indexOf("MM"),n=r.substring(0,t);r=r.replace(n,"").replace("MM","");const s={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};t=r.indexOf("YYYY"),n=r.substring(0,t);const a={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};return[this.dayPart,s,this.monthPart,a,this.yearPart]}return[]}createYearMonthDayFormatParts(){if(this.monthPart&&this.dayPart&&this.yearPart){let r=this.dateFormat.replace("YYYY",""),t=r.indexOf("MM"),n=r.substring(0,t);r=r.replace(n,"").replace("MM","");const s={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};t=r.indexOf("DD"),n=r.substring(0,t);const a={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};return[this.yearPart,s,this.monthPart,a,this.dayPart]}return[]}createTwelveHourFormatParts(){if(this.twelveHourPart&&this.minutePart&&this.meridianPart){const r=this.timeFormat.replace("HH",""),t=r.indexOf("MM"),n=r.substring(0,t),s={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0},a={characterCount:1,placeholder:" ",inputText:" ",isSeparator:!0};return[this.twelveHourPart,s,this.minutePart,a,this.meridianPart]}return[]}createTwentyFourHourFormatParts(){if(this.twentyFourHourPart&&this.minutePart){const r=this.timeFormat.replace("HH",""),t=r.indexOf("MM"),n=r.substring(0,t),s={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};return[this.twentyFourHourPart,s,this.minutePart]}return[]}createDateParts(){this.monthPart={characterCount:2,placeholder:"M",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:Ue.Numeric,minimumValue:1,maximumValue:12,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.dayPart={characterCount:2,placeholder:"D",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:Ue.Numeric,minimumValue:1,maximumValue:31,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.yearPart={characterCount:4,placeholder:"Y",inputText:"_",isSeparator:!1,allCharactersRequired:!0,valueType:Ue.Numeric},this.twelveHourPart={characterCount:2,placeholder:"H",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:Ue.Numeric,minimumValue:1,maximumValue:12,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.twentyFourHourPart={characterCount:2,placeholder:"H",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:Ue.Numeric,minimumValue:0,maximumValue:23,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.minutePart={characterCount:2,placeholder:"M",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:Ue.Numeric,minimumValue:0,maximumValue:59,exceedingMaximumValueCausesError:!0,padWithZeros:!0},this.meridianPart={characterCount:2,inputText:"_",isSeparator:!1,valueType:Ue.Text,possibleValues:["AM","PM"]}}}const Bh=(e,r)=>{var a;const[t,n]=d.useState(),s=d.useRef();return d.useEffect(()=>{r&&!t&&(s.current=new Vh(e,r),n(s.current.createInputFormat()))},[r]),[t,(a=s.current)==null?void 0:a.is24HourTime]},zh=({value:e,readOnly:r=!1,label:t,useDefaultDateValue:n=!1,useFormattedInput:s=!1,allowClear:a=!1,closeSelector:o=!1,locale:i,className:c,dateSelection:f=be.DateTime,dateFormat:h,timeConstraints:p,icon:y,iconPosition:x=yr.Right,inputElement:w,selectableDate:O,isValidDate:_,onChange:S,calendarTemplate:R,dateScrollerTemplate:z,inputTemplate:F,wrapperTemplate:b})=>{const[A,k]=d.useState(!1),[W,V]=d.useState(),[ne,te]=d.useState(),[X,N,$]=Ka(f),j=d.useRef(),C=d.useRef(!1),q=d.useRef(i||Wn()),v=d.useRef(),ee=d.useRef(),g=d.useRef(),D=d.useRef(null),B=d.useRef(null),[P,Y]=Bh(f,W),G=d.useRef({calendarTemplate:R,dateScrollerTemplate:z});d.useEffect(()=>{q.current&&H(q.current)},[q]),d.useEffect(()=>{i&&H(i)},[i]),d.useEffect(()=>{if(e){const Z=U();se({type:le.InitializeDates,initialDate:Z})}else se({type:le.ClearDates})},[e,v.current]),d.useEffect(()=>{Y&&se({type:le.SetTimeFormat,timeFormat:Y?Pe.TwentyFourHour:Pe.TwelveHour})},[Y]),d.useEffect(()=>{w&&(ee.current=w)},[w]),d.useEffect(()=>{se({type:le.SetDateSelector,dateSelector:L()})},[X]);const L=d.useCallback(()=>$.current===be.TimeOnly?Oe.TimeSelector:$.current===be.DateTime||$.current===be.DateOnly?Oe.DaySelector:Oe.DateRangeSelector,[]),H=Z=>{Ia(Z).then(oe=>{V(oe.code),v.current=oe;const Re=U();se(e||n?{type:le.InitializeDates,initialDate:Array.isArray(Re)?Re[0]:Re}:{type:le.SetViewDate,viewDate:Array.isArray(Re)?Re[0]:Re})}).catch(oe=>console.error(oe))},U=()=>{const Z=new Date;return Z.setHours(0,0,0,0),e?typeof e=="string"?$.current!==be.DateRange?qt(e,v.current):Cn(e,v.current):e:Z},J={currentSelector:L(),currentViewDate:new Date,timeFormat:Pe.TwelveHour,dateInitialized:!1},[E,se]=d.useReducer(Ah,J),I=()=>{Dr(),k(!0)},Ne=d.useMemo(()=>Ht(()=>{k(!1)},250),[]),nt=d.useMemo(()=>Ht(()=>{Ne.cancel()},5),[Ne]),qe=Z=>{const oe=Z.target.innerText;Kt(oe)},Dt=Z=>{if(Z){const oe=$.current!==be.DateRange?qt(Z,v.current):Cn(Z,v.current);return oe?_?Array.isArray(oe)?oe.every(Re=>_(Re)):_(oe):!0:!1}else return!0},Er=Z=>{Kt(Z||"")},Kt=Z=>{const oe=$.current!==be.DateRange?qt(Z,v.current):Cn(Z,v.current);oe?(Array.isArray(oe)?(Mh(oe[0],Vs(E.currentViewDate),Ll(ut(E.currentViewDate,1)))||se({type:le.SetViewDate,viewDate:oe[0]}),se({type:le.SetSelectedDateRange,selectedStartDate:oe[0],selectedEndDate:oe[1]})):se({type:le.SetSelectedDate,selectedDate:oe,viewDate:oe}),S==null||S(oe)):Z===""&&(se({type:le.ClearDates}),S==null||S())},Ot=Z=>{$.current===be.DateOnly&&o===!0&&k(!1),S==null||S(Z)},kr=()=>{Dr(),k(!A),B.current?B.current.focus():D.current&&D.current.focus()},Cr=()=>{se({type:le.ClearDates}),k(!1),S==null||S()},pt=(Z,oe)=>{(!ee.current||j.current!==oe)&&(ee.current=Z,j.current=oe,C.current=!0)},Dr=()=>{(!g.current||C.current)&&ee.current&&(g.current=ee.current,te(ee.current),C.current=!1)},Or=()=>{k(!1),se({type:le.SetDateSelector,dateSelector:L()})},_r=()=>{switch(h){case Zt.Short:return"short";case Zt.Medium:return"medium";case Zt.Long:return"long";default:return}},mt=()=>{var oe,Re,Je,_t,Nt,Jt,Ar,er,Lr,tr,rr,$r;const Z=_r();switch($.current){case be.DateTime:return E.selectedDate?Z?E.selectedDate.toLocaleString((oe=v.current)==null?void 0:oe.code,{dateStyle:Z,timeStyle:Z}):E.selectedDate.toLocaleString((Re=v.current)==null?void 0:Re.code):"";case be.DateOnly:return E.selectedDate?Z?E.selectedDate.toLocaleDateString((Je=v.current)==null?void 0:Je.code,{dateStyle:Z}):E.selectedDate.toLocaleDateString((_t=v.current)==null?void 0:_t.code):"";case be.TimeOnly:return E.selectedDate?Z?E.selectedDate.toLocaleTimeString((Nt=v.current)==null?void 0:Nt.code,{timeStyle:Z,hour12:E.timeFormat===Pe.TwelveHour,hourCycle:E.timeFormat===Pe.TwentyFourHour?"h23":void 0}):E.selectedDate.toLocaleTimeString((Jt=v.current)==null?void 0:Jt.code,{hour12:E.timeFormat===Pe.TwelveHour,hourCycle:E.timeFormat===Pe.TwentyFourHour?"h23":void 0}):"";case be.DateRange:return E.selectedStartDate&&E.selectedEndDate?Z?`${E.selectedStartDate.toLocaleDateString((Ar=v.current)==null?void 0:Ar.code,{dateStyle:Z})} - ${E.selectedEndDate.toLocaleDateString((er=v.current)==null?void 0:er.code,{dateStyle:Z})}`:`${E.selectedStartDate.toLocaleDateString((Lr=v.current)==null?void 0:Lr.code)} - ${E.selectedEndDate.toLocaleDateString((tr=v.current)==null?void 0:tr.code)}`:"";default:return E.selectedDate?Z?E.selectedDate.toLocaleString((rr=v.current)==null?void 0:rr.code,{dateStyle:Z,timeStyle:Z}):E.selectedDate.toLocaleString(($r=v.current)==null?void 0:$r.code):""}},Ge=X===be.DateTime||X===be.DateOnly||X===be.DateRange,Dn=X===be.DateTime||X===be.TimeOnly,st=x===yr.None?{}:x===yr.Right?{rightElement:l.jsxs("div",{className:"bsc-flex bsc-text-black dark:bsc-text-mono-light-1",children:[a&&!r&&l.jsx("div",{children:l.jsx(Le,{icon:"close",size:je.Small,className:"bsc-cursor-pointer bsc-text-sm",onClick:Cr})}),l.jsx("div",{className:"bsc-ml-2",onClick:r?void 0:kr,children:y||l.jsx(Le,{icon:"calendar",size:je.Small,className:r?void 0:"bsc-cursor-pointer"})})]}),rightElementClassName:"bsc-justify-center"}:{leftElement:l.jsxs("div",{className:"bsc-flex bsc-text-black dark:bsc-text-mono-light-1",children:[l.jsx("div",{className:"bsc-mr-2",onClick:r?void 0:kr,children:y||l.jsx(Le,{icon:"calendar",size:je.Small,className:r?void 0:"bsc-cursor-pointer"})}),a&&!r&&l.jsx("div",{children:l.jsx(Le,{icon:"close",size:je.Small,className:"bsc-cursor-pointer bsc-text-sm",onClick:Cr})})]}),leftElementClassName:"bsc-justify-center"},Nr={setDateSelector:Z=>N(Z)},On=b||((Z,oe)=>l.jsx(l.Fragment,{children:oe})),jr=()=>l.jsx(lt,{props:Nr,template:On,children:l.jsxs(l.Fragment,{children:[E.currentSelector===Oe.DaySelector&&Ge&&E.dateInitialized&&v.current&&l.jsx($h,{selectedDate:E.selectedDate,viewDate:E.currentViewDate,locale:v.current,showTimeSelector:$.current===be.DateTime,selectableDate:O,isValidDate:_,dispatcher:se,onChange:Ot}),E.currentSelector===Oe.MonthSelector&&Ge&&E.dateInitialized&&v.current&&l.jsx(Fh,{viewDate:E.currentViewDate,locale:v.current,dateSelection:$.current,dispatcher:se}),E.currentSelector===Oe.YearSelector&&Ge&&E.dateInitialized&&v.current&&l.jsx(Wh,{viewDate:E.currentViewDate,locale:v.current,dispatcher:se}),E.currentSelector===Oe.TimeSelector&&Dn&&E.dateInitialized&&v.current&&l.jsx(Hh,{viewDate:E.currentViewDate,showDateSelector:$.current===be.DateTime,locale:v.current,timeFormat:E.timeFormat,timeConstraints:p,onChange:S,dispatcher:se}),E.currentSelector===Oe.DateRangeSelector&&Ge&&E.dateInitialized&&v.current&&l.jsx(Yh,{viewDate:E.currentViewDate,selectedStartDate:E.selectedStartDate,selectedEndDate:E.selectedEndDate,locale:v.current,onChange:S,dispatcher:se})]})}),Mr={label:t,readOnly:r,allowClear:a,getValue:mt,onFocus:I,onInput:qe,iconPosition:x,iconElement:st.rightElement||st.leftElement},Rr=F||((Z,oe)=>l.jsx(l.Fragment,{children:oe})),Xt=ue("bsc-text-left",{"bc-read-only bsc-bg-gray-4 dark:bsc-bg-mono-dark-3":r,"bsc-bg-white dark:bsc-bg-mono-dark-1":!r},"bc-dt-input",c);return l.jsx(kn.Provider,{value:G.current,children:l.jsxs("div",{className:"bc-date-time",children:[t&&l.jsx(Ze,{label:t,readOnly:r,className:"bc-dt-label"}),l.jsx(pn,{mobileMarkup:l.jsxs(l.Fragment,{children:[l.jsx(lt,{props:Mr,template:Rr,children:l.jsx(lr,{ref:D,value:mt(),readOnly:r,inputMode:"none",className:Xt,onFocus:I,onElementCreate:Z=>pt(Z,!1),...st})}),l.jsx(Ta,{visible:A,target:ne,hidden:Or,unmountWhenHidden:!0,children:jr()})]}),aboveMobileMarkup:l.jsxs(l.Fragment,{children:[l.jsx(lt,{props:Mr,template:Rr,children:s===!1?l.jsx(lr,{ref:D,value:mt(),readOnly:r,className:Xt,onFocus:I,onBlur:Ne,onInput:qe,onElementCreate:Z=>pt(Z,!1),...st}):l.jsx(Oa,{ref:B,value:mt(),readOnly:r,className:Xt,format:P,isInputValid:Dt,onFocus:I,onBlur:Ne,onChange:Er,onElementCreate:Z=>pt(Z,!0),...st})}),l.jsx(Ea,{visible:A,target:ne,shouldTargetCloseOverlay:!1,shouldScrollCloseOverlay:!0,shouldCheckZIndex:!0,shouldRemainOnScreen:!0,hidden:Or,isClickedWithin:nt,unmountWhenHidden:!0,children:jr()})]})})]})})};function ht(e,r){var t,n;if(typeof r=="function")n=r(e),n!==void 0&&(e=n);else if(Array.isArray(r))for(t=0;t<r.length;t++)n=r[t](e),n!==void 0&&(e=n);return e}function Uh(e,r){return e[0]==="-"&&Array.isArray(r)&&/^-\d+$/.test(e)?r.length+parseInt(e,10):e}function qh(e){return/^\d+$/.test(e)}function wr(e){return Object.prototype.toString.call(e)==="[object Object]"}function Qt(e){return Object(e)===e}function Tr(e){return Object.keys(e).length===0}var Gh=["__proto__","prototype","constructor"],Zh=function(e){return Gh.indexOf(e)===-1};function Sr(e,r){e.indexOf("[")>=0&&(e=e.replace(/\[/g,r).replace(/]/g,""));var t=e.split(r),n=t.filter(Zh);if(n.length!==t.length)throw Error("Refusing to update blacklisted property "+e);return t}var ja=Object.prototype.hasOwnProperty;function ie(e,r,t,n){if(!(this instanceof ie))return new ie(e,r,t,n);typeof r>"u"&&(r=!1),typeof t>"u"&&(t=!0),typeof n>"u"&&(n=!0),this.separator=e||".",this.override=r,this.useArray=t,this.useBrackets=n,this.keepArray=!1,this.cleanup=[]}var Ct=new ie(".",!1,!0,!0);function He(e){return function(){return Ct[e].apply(Ct,arguments)}}ie.prototype._fill=function(e,r,t,n){var s=e.shift();if(e.length>0){if(r[s]=r[s]||(this.useArray&&qh(e[0])?[]:{}),!Qt(r[s]))if(this.override)r[s]={};else{if(!(Qt(t)&&Tr(t)))throw new Error("Trying to redefine `"+s+"` which is a "+typeof r[s]);return}this._fill(e,r[s],t,n)}else{if(!this.override&&Qt(r[s])&&!Tr(r[s])){if(!(Qt(t)&&Tr(t)))throw new Error("Trying to redefine non-empty obj['"+s+"']");return}r[s]=ht(t,n)}},ie.prototype.object=function(e,r){var t=this;return Object.keys(e).forEach(function(n){var s=r===void 0?null:r[n],a=Sr(n,t.separator).join(t.separator);a.indexOf(t.separator)!==-1?(t._fill(a.split(t.separator),e,e[n],s),delete e[n]):e[n]=ht(e[n],s)}),e},ie.prototype.str=function(e,r,t,n){var s=Sr(e,this.separator).join(this.separator);return e.indexOf(this.separator)!==-1?this._fill(s.split(this.separator),t,r,n):t[e]=ht(r,n),t},ie.prototype.pick=function(e,r,t,n){var s,a,o,i,c;for(a=Sr(e,this.separator),s=0;s<a.length;s++)if(i=Uh(a[s],r),r&&typeof r=="object"&&i in r){if(s===a.length-1)return t?(o=r[i],n&&Array.isArray(r)?r.splice(i,1):delete r[i],Array.isArray(r)&&(c=a.slice(0,-1).join("."),this.cleanup.indexOf(c)===-1&&this.cleanup.push(c)),o):r[i];r=r[i]}else return;return t&&Array.isArray(r)&&(r=r.filter(function(f){return f!==void 0})),r},ie.prototype.delete=function(e,r){return this.remove(e,r,!0)},ie.prototype.remove=function(e,r,t){var n;if(this.cleanup=[],Array.isArray(e)){for(n=0;n<e.length;n++)this.pick(e[n],r,!0,t);return t||this._cleanup(r),r}else return this.pick(e,r,!0,t)},ie.prototype._cleanup=function(e){var r,t,n,s;if(this.cleanup.length){for(t=0;t<this.cleanup.length;t++)n=this.cleanup[t].split("."),s=n.splice(0,-1).join("."),r=s?this.pick(s,e):e,r=r[n[0]].filter(function(a){return a!==void 0}),this.set(this.cleanup[t],r,e);this.cleanup=[]}},ie.prototype.del=ie.prototype.remove,ie.prototype.move=function(e,r,t,n,s){return typeof n=="function"||Array.isArray(n)?this.set(r,ht(this.pick(e,t,!0),n),t,s):(s=n,this.set(r,this.pick(e,t,!0),t,s)),t},ie.prototype.transfer=function(e,r,t,n,s,a){return typeof s=="function"||Array.isArray(s)?this.set(r,ht(this.pick(e,t,!0),s),n,a):(a=s,this.set(r,this.pick(e,t,!0),n,a)),n},ie.prototype.copy=function(e,r,t,n,s,a){return typeof s=="function"||Array.isArray(s)?this.set(r,ht(JSON.parse(JSON.stringify(this.pick(e,t,!1))),s),n,a):(a=s,this.set(r,this.pick(e,t,!1),n,a)),n},ie.prototype.set=function(e,r,t,n){var s,a,o,i;if(typeof r>"u")return t;for(o=Sr(e,this.separator),s=0;s<o.length;s++){if(i=o[s],s===o.length-1)if(n&&wr(r)&&wr(t[i]))for(a in r)ja.call(r,a)&&(t[i][a]=r[a]);else if(n&&Array.isArray(t[i])&&Array.isArray(r))for(var c=0;c<r.length;c++)t[o[s]].push(r[c]);else t[i]=r;else(!ja.call(t,i)||!wr(t[i])&&!Array.isArray(t[i]))&&(/^\d+$/.test(o[s+1])?t[i]=[]:t[i]={});t=t[i]}return t},ie.prototype.transform=function(e,r,t){return r=r||{},t=t||{},Object.keys(e).forEach((function(n){this.set(e[n],this.pick(n,r),t)}).bind(this)),t},ie.prototype.dot=function(e,r,t){r=r||{},t=t||[];var n=Array.isArray(e);return Object.keys(e).forEach((function(s){var a=n&&this.useBrackets?"["+s+"]":s;if(Qt(e[s])&&(wr(e[s])&&!Tr(e[s])||Array.isArray(e[s])&&!this.keepArray&&e[s].length!==0))if(n&&this.useBrackets){var o=t[t.length-1]||"";return this.dot(e[s],r,t.slice(0,-1).concat(o+a))}else return this.dot(e[s],r,t.concat(a));else n&&this.useBrackets?r[t.join(this.separator).concat("["+s+"]")]=e[s]:r[t.concat(a).join(this.separator)]=e[s]}).bind(this)),r},ie.pick=He("pick"),ie.move=He("move"),ie.transfer=He("transfer"),ie.transform=He("transform"),ie.copy=He("copy"),ie.object=He("object"),ie.str=He("str"),ie.set=He("set"),ie.delete=He("delete"),ie.del=ie.remove=He("remove"),ie.dot=He("dot"),["override","overwrite"].forEach(function(e){Object.defineProperty(ie,e,{get:function(){return Ct.override},set:function(r){Ct.override=!!r}})}),["useArray","keepArray","useBrackets"].forEach(function(e){Object.defineProperty(ie,e,{get:function(){return Ct[e]},set:function(r){Ct[e]=r}})}),ie._process=ht;var Qh=ie;const Pr=Fr(Qh),Kh=({name:e,label:r,value:t,data:n,textField:s,valueField:a,readOnly:o=!1,orientation:i=Ie.Horizontal,isMultiSelect:c=!1,className:f,onChange:h,itemTemplate:p})=>{const[y,x]=d.useState(),[w,O]=d.useState([]),_=ar(()=>n,[n]),S=d.useId();d.useEffect(()=>{if(c){const j=Array.isArray(t)?t.map(C=>C.toString()):t?[String(t)]:void 0;O(j??[])}else t&&x(t.toString())},[t]);const R=j=>c?w.findIndex(C=>C===j)>-1:y===j,z=j=>{const C=j.toString();if(c){const q=R(C);let v;q?v=w.filter(ee=>ee!=C):v=[...w,C],O(v),h==null||h({name:e,value:v})}else C!==y&&(x(C),h==null||h({name:e,value:C}))},F=j=>{const{value:C}=j.target;x(C),h==null||h({name:e,value:C})},b=j=>{const{value:C,checked:q}=j.target;let v;q?v=[...w,C]:v=w.filter(ee=>ee!=C),O(v),h==null||h({name:e,value:v})},A=(j,C,q,v)=>l.jsxs("label",{htmlFor:j,className:v,children:[l.jsx("input",{id:j,name:e,value:q,type:"checkbox",onChange:b,checked:R(q),className:"bsc-appearance-none"}),C]},j),k=(j,C,q,v)=>l.jsxs("label",{htmlFor:j,className:v,children:[l.jsx("input",{id:j,name:e,value:q,type:"radio",onChange:F,checked:R(q),className:"bsc-appearance-none"}),C]},j),W=nr(At.FocusWithin),V=d.useCallback((j,C)=>l.jsx(l.Fragment,{children:C}),[]),ne=p||V,te=(j,C,q)=>{const v=`element_${S}_${C}`,ee=Pr.pick(s,j),g=String(Pr.pick(a,j)),D=C===0,B=C===q.length-1,P=ue("bc-group-button-item bsc-cursor-pointer bsc-border-solid bsc-p-2 bsc-font-medium",{"has-[:checked]:bsc-bg-primary-1 has-[:checked]:dark:bsc-bg-mono-light-1 has-[:checked]:bsc-text-white has-[:checked]:dark:bsc-text-mono-dark-1 dark:bsc-text-mono-light-1 bsc-text-gray-2 bsc-border-gray-3 dark:bsc-border-mono-light-2":!o,"bc-read-only has-[:checked]:bsc-bg-primary-4 has-[:checked]:dark:bsc-bg-mono-light-3 has-[:checked]:bsc-text-gray-5 has-[:checked]:dark:bsc-text-mono-dark-3 dark:bsc-text-mono-light-3 bsc-text-gray-3 bsc-border-gray-4 dark:bsc-border-mono-light-3 bsc-pointer-events-none":o,"bsc-border-t bsc-border-l bsc-border-b bsc-rounded-l-md bsc-pl-2":D&&i===Ie.Horizontal,"bsc-border-t bsc-border-r bsc-border-l bsc-border-b bsc-rounded-r-md bsc-pr-2":B&&i===Ie.Horizontal,"bsc-border-t bsc-border-b":!D&&!B&&i===Ie.Horizontal,"bsc-border-l":!D&&i===Ie.Horizontal,"bsc-border-l bsc-border-r bsc-border-t bsc-rounded-t-md":D&&i===Ie.Vertical,"bsc-border bsc-rounded-b-md":B&&i===Ie.Vertical,"bsc-border-t bsc-border-l bsc-border-r":!D&&!B&&i===Ie.Vertical},W),Y={itemId:v,selectedValue:c?w:y,itemText:ee,itemValue:g,itemData:j,itemStyles:P,isSelected:R(g),isFirstItem:D,isLastItem:B,onItemChanged:z};return c?l.jsx(lt,{props:Y,template:ne,children:A(v,ee,g,P)}):l.jsx(lt,{props:Y,template:ne,children:k(v,ee,g,P)})},X=ue("bsc-flex bsc-flex-col bsc-gap-2",f),N=ue("bsc-flex",{"bsc-flex-col [width:max-content]":i===Ie.Vertical}),$=j=>l.jsx("div",{className:N,children:j.map(te)});return l.jsxs("div",{className:X,children:[r&&l.jsx(Ze,{label:r,readOnly:o}),_&&$(_)]})},Xh=d.memo(Kh),Jh=({id:e,name:r,label:t,value:n,checked:s=!1,labelLocation:a=Ae.Right,readOnly:o=!1,useAnimation:i,onChange:c})=>{const f=Hr(i),h=d.useCallback(x=>{c==null||c(x)},[c]),p=ue("bc-radio-item-wrapper bsc-flex bsc-items-center *:bsc-cursor-pointer",{"bc-read-only":o}),y=ue("bc-radio-item-outer bsc-relative *:bsc-size-[21px]",{"bsc-pl-1":a===Ae.Left,"bsc-pr-1":a===Ae.Right,"bsc-radio-item-animate":!o&&f,"bsc-radio-item":!o,"bc-read-only bsc-radio-item-read-only":o});return l.jsxs("div",{className:p,children:[a===Ae.Left&&l.jsx(Ze,{label:t,htmlFor:e,readOnly:o}),l.jsxs("label",{className:y,children:[l.jsx("input",{id:e,name:r,value:n,type:"radio",checked:s,onChange:h,className:"bc-radio-item-input-hidden bsc-hidden"}),l.jsxs("svg",{viewBox:"0 0 30 30",preserveAspectRatio:"xMidYMid meet",className:"bc-radio-item-svg",children:[l.jsx("circle",{cx:15,cy:15,r:13}),l.jsx("circle",{cx:"50%",cy:"50%",r:7})]})]}),a===Ae.Right&&l.jsx(Ze,{label:t,htmlFor:e,readOnly:o})]})},ep=d.memo(Jh),tp=({name:e,label:r,value:t,data:n,textField:s,valueField:a,readOnly:o=!1,labelLocation:i=Ae.Right,orientation:c=Ie.Vertical,className:f,useAnimation:h,onChange:p})=>{const[y,x]=d.useState(t),w=ar(()=>n,[n]),O=d.useId(),_=d.useCallback(b=>{const A=b.target.value;x(A),p==null||p({name:e,value:A,originalEvent:b})},[e]),S=(b,A)=>{const k=`${O}_radio_${A}`,W=Pr.pick(a,b);return l.jsx(ep,{id:k,name:e,label:Pr.pick(s,b),value:W,checked:W==y,labelLocation:i,readOnly:o,useAnimation:h,onChange:_},k)},R=ue("bc-radio-container bsc-flex bsc-flex-col bsc-gap-1",f),z=ue("bc-radio-wrapper bsc-flex bsc-gap-1",{"bsc-flex-col":c===Ie.Vertical,"[&>*]:bsc-pr-2":c===Ie.Horizontal}),F=b=>l.jsx("div",{className:z,children:b.map(S)});return l.jsxs("div",{className:R,children:[r&&l.jsx(Ze,{label:r,readOnly:o}),w&&F(w)]})},rp=d.memo(tp),np=({name:e,label:r,value:t,checked:n=!1,readOnly:s=!1,useAnimation:a,className:o,onChange:i})=>{const[c,f]=d.useState(!1),h=d.useId(),p=Hr(a);d.useEffect(()=>{f(n)},[n]);const y=S=>{const{checked:R}=S.target;f(R),i==null||i({originalEvent:S,name:e||S.target.name,value:t||S.target.value,checked:R})},x=ue("bc-toggle-wrapper bsc-flex bsc-flex-col",o),w=nr(At.FocusWithin),O=ue("bc-toggle-container bsc-toggle-switch bsc-flex bsc-mt-0.5 bsc-relative bsc-w-[70px] bsc-h-[30px] bsc-rounded-full [transition:background-color_1s]",{"bsc-cursor-pointer bsc-bg-gray-3 dark:bsc-bg-mono-dark-3 has-[:checked]:bsc-bg-primary-1 has-[:checked]:dark:bsc-bg-mono-light-2":!s,"bc-read-only bsc-pointer-events-none bsc-bg-gray-4 dark:bsc-bg-mono-dark-2 has-[:checked]:bsc-bg-primary-4 has-[:checked]:dark:bsc-bg-mono-light-3":s},w),_=ue("bc-toggle-switch bsc-absolute bsc-rounded-full dark:bsc-border dark:bsc-border-solid dark:bsc-border-mono-dark-1 bsc-w-[22px] bsc-h-[22px] bsc-top-[4px] bsc-left-[4px]",{"bsc-bg-white bsc-cursor-pointer":!s,"bc-read-only bsc-bg-gray-5 bsc-pointer-events-none":s,"[transition:0.3s]":!s&&p});return l.jsxs("div",{className:x,children:[r&&l.jsx(Ze,{label:r,htmlFor:h,readOnly:s}),l.jsxs("label",{className:O,children:[l.jsx("input",{id:h,name:e,value:t,type:"checkbox",checked:c,onChange:y,className:"bsc-appearance-none"}),l.jsx("div",{id:"switch",className:_})]})]})},sp=d.memo(np),bp="";K.BeeSoftProvider=Ya,K.Button=We,K.Checkbox=zn,K.CheckboxGroup=mo,K.ContentEditableInput=lr,K.DateFormatType=Zt,K.DateSelectionType=be,K.DateTime=zh,K.FormGroupItemOrientation=Ie,K.FormattedInput=Oa,K.GroupButton=Xh,K.MediaQuery=pn,K.MobileOverlayPanel=Ta,K.OverlayPanel=Ea,K.RadioButton=rp,K.SelectionLabelLocation=Ae,K.Toggle=sp,K.applyBeeSoftTheme=no,K.createBeeSoftTheme=so,Object.defineProperty(K,Symbol.toStringTag,{value:"Module"})});