beesoft-components 0.9.6 → 0.10.0
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.es.js +5634 -4351
- package/dist/index.es.js.gz +0 -0
- package/dist/index.umd.js +49 -16
- package/dist/index.umd.js.gz +0 -0
- package/dist/style.css +1 -1
- package/dist/style.css.gz +0 -0
- package/package.json +2 -1
- package/types/index.d.ts +5 -44
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(se,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):(se=typeof globalThis<"u"?globalThis:se||self,d(se.BeeSoftComponents={},se.React,se.ReactDOM))})(this,function(se,d,Je){"use strict";var Bm=Object.defineProperty;var Um=(se,d,Je)=>d in se?Bm(se,d,{enumerable:!0,configurable:!0,writable:!0,value:Je}):se[d]=Je;var b=(se,d,Je)=>(Um(se,typeof d!="symbol"?d+"":d,Je),Je);function Xi(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const lr=Xi(d);function hn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var pn={exports:{}},fr={};/**
|
|
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
|
|
9
|
+
*/var ys;function Ji(){if(ys)return fr;ys=1;var e=d,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function i(a,u,f){var h,g={},x=null,v=null;f!==void 0&&(x=""+f),u.key!==void 0&&(x=""+u.key),u.ref!==void 0&&(v=u.ref);for(h in u)n.call(u,h)&&!o.hasOwnProperty(h)&&(g[h]=u[h]);if(a&&a.defaultProps)for(h in u=a.defaultProps,u)g[h]===void 0&&(g[h]=u[h]);return{$$typeof:t,type:a,key:x,ref:v,props:g,_owner:s.current}}return fr.Fragment=r,fr.jsx=i,fr.jsxs=i,fr}var dr={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,42 +14,75 @@
|
|
|
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
|
|
18
|
-
`+
|
|
19
|
-
`),
|
|
20
|
-
`),
|
|
21
|
-
`+
|
|
17
|
+
*/var vs;function ea(){return vs||(vs=1,process.env.NODE_ENV!=="production"&&function(){var e=d,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),a=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),v=Symbol.for("react.offscreen"),T=Symbol.iterator,I="@@iterator";function j(c){if(c===null||typeof c!="object")return null;var m=T&&c[T]||c[I];return typeof m=="function"?m:null}var E=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function D(c){{for(var m=arguments.length,w=new Array(m>1?m-1:0),$=1;$<m;$++)w[$-1]=arguments[$];Q("error",c,w)}}function Q(c,m,w){{var $=E.ReactDebugCurrentFrame,Z=$.getStackAddendum();Z!==""&&(m+="%s",w=w.concat([Z]));var G=w.map(function(W){return String(W)});G.unshift("Warning: "+m),Function.prototype.apply.call(console[c],console,G)}}var U=!1,y=!1,F=!1,k=!1,q=!1,z;z=Symbol.for("react.module.reference");function oe(c){return!!(typeof c=="string"||typeof c=="function"||c===n||c===o||q||c===s||c===f||c===h||k||c===v||U||y||F||typeof c=="object"&&c!==null&&(c.$$typeof===x||c.$$typeof===g||c.$$typeof===i||c.$$typeof===a||c.$$typeof===u||c.$$typeof===z||c.getModuleId!==void 0))}function ce(c,m,w){var $=c.displayName;if($)return $;var Z=m.displayName||m.name||"";return Z!==""?w+"("+Z+")":w}function ne(c){return c.displayName||"Context"}function M(c){if(c==null)return null;if(typeof c.tag=="number"&&D("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case n:return"Fragment";case r:return"Portal";case o:return"Profiler";case s:return"StrictMode";case f:return"Suspense";case h:return"SuspenseList"}if(typeof c=="object")switch(c.$$typeof){case a:var m=c;return ne(m)+".Consumer";case i:var w=c;return ne(w._context)+".Provider";case u:return ce(c,c.render,"ForwardRef");case g:var $=c.displayName||null;return $!==null?$:M(c.type)||"Memo";case x:{var Z=c,G=Z._payload,W=Z._init;try{return M(W(G))}catch{return null}}}return null}var H=Object.assign,L=0,O,J,R,ge,S,N,C;function P(){}P.__reactDisabledLog=!0;function V(){{if(L===0){O=console.log,J=console.info,R=console.warn,ge=console.error,S=console.group,N=console.groupCollapsed,C=console.groupEnd;var c={configurable:!0,enumerable:!0,value:P,writable:!0};Object.defineProperties(console,{info:c,log:c,warn:c,error:c,group:c,groupCollapsed:c,groupEnd:c})}L++}}function X(){{if(L--,L===0){var c={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:H({},c,{value:O}),info:H({},c,{value:J}),warn:H({},c,{value:R}),error:H({},c,{value:ge}),group:H({},c,{value:S}),groupCollapsed:H({},c,{value:N}),groupEnd:H({},c,{value:C})})}L<0&&D("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Y=E.ReactCurrentDispatcher,B;function K(c,m,w){{if(B===void 0)try{throw Error()}catch(Z){var $=Z.stack.trim().match(/\n( *(at )?)/);B=$&&$[1]||""}return`
|
|
18
|
+
`+B+c}}var re=!1,_;{var ie=typeof WeakMap=="function"?WeakMap:Map;_=new ie}function A(c,m){if(!c||re)return"";{var w=_.get(c);if(w!==void 0)return w}var $;re=!0;var Z=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var G;G=Y.current,Y.current=null,V();try{if(m){var W=function(){throw Error()};if(Object.defineProperty(W.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(W,[])}catch(Fe){$=Fe}Reflect.construct(c,[],W)}else{try{W.call()}catch(Fe){$=Fe}c.call(W.prototype)}}else{try{throw Error()}catch(Fe){$=Fe}c()}}catch(Fe){if(Fe&&$&&typeof Fe.stack=="string"){for(var te=Fe.stack.split(`
|
|
19
|
+
`),de=$.stack.split(`
|
|
20
|
+
`),ae=te.length-1,me=de.length-1;ae>=1&&me>=0&&te[ae]!==de[me];)me--;for(;ae>=1&&me>=0;ae--,me--)if(te[ae]!==de[me]){if(ae!==1||me!==1)do if(ae--,me--,me<0||te[ae]!==de[me]){var Ae=`
|
|
21
|
+
`+te[ae].replace(" at new "," at ");return c.displayName&&Ae.includes("<anonymous>")&&(Ae=Ae.replace("<anonymous>",c.displayName)),typeof c=="function"&&_.set(c,Ae),Ae}while(ae>=1&&me>=0);break}}}finally{re=!1,Y.current=G,X(),Error.prepareStackTrace=Z}var ze=c?c.displayName||c.name:"",Ne=ze?K(ze):"";return typeof c=="function"&&_.set(c,Ne),Ne}function De(c,m,w){return A(c,!1)}function Ge(c){var m=c.prototype;return!!(m&&m.isReactComponent)}function $e(c,m,w){if(c==null)return"";if(typeof c=="function")return A(c,Ge(c));if(typeof c=="string")return K(c);switch(c){case f:return K("Suspense");case h:return K("SuspenseList")}if(typeof c=="object")switch(c.$$typeof){case u:return De(c.render);case g:return $e(c.type,m,w);case x:{var $=c,Z=$._payload,G=$._init;try{return $e(G(Z),m,w)}catch{}}}return""}var Be=Object.prototype.hasOwnProperty,ft={},rt=E.ReactDebugCurrentFrame;function Ue(c){if(c){var m=c._owner,w=$e(c.type,c._source,m?m.type:null);rt.setExtraStackFrame(w)}else rt.setExtraStackFrame(null)}function tr(c,m,w,$,Z){{var G=Function.call.bind(Be);for(var W in c)if(G(c,W)){var te=void 0;try{if(typeof c[W]!="function"){var de=Error(($||"React class")+": "+w+" type `"+W+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof c[W]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw de.name="Invariant Violation",de}te=c[W](m,W,$,w,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(ae){te=ae}te&&!(te instanceof Error)&&(Ue(Z),D("%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).",$||"React class",w,W,typeof te),Ue(null)),te instanceof Error&&!(te.message in ft)&&(ft[te.message]=!0,Ue(Z),D("Failed %s type: %s",w,te.message),Ue(null))}}}var rr=Array.isArray;function nt(c){return rr(c)}function nr(c){{var m=typeof Symbol=="function"&&Symbol.toStringTag,w=m&&c[Symbol.toStringTag]||c.constructor.name||"Object";return w}}function sr(c){try{return It(c),!1}catch{return!0}}function It(c){return""+c}function dt(c){if(sr(c))return D("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",nr(c)),It(c)}var Ze=E.ReactCurrentOwner,Mr={key:!0,ref:!0,__self:!0,__source:!0},st,jt,or;or={};function Rr(c){if(Be.call(c,"ref")){var m=Object.getOwnPropertyDescriptor(c,"ref").get;if(m&&m.isReactWarning)return!1}return c.ref!==void 0}function ir(c){if(Be.call(c,"key")){var m=Object.getOwnPropertyDescriptor(c,"key").get;if(m&&m.isReactWarning)return!1}return c.key!==void 0}function ar(c,m){if(typeof c.ref=="string"&&Ze.current&&m&&Ze.current.stateNode!==m){var w=M(Ze.current.type);or[w]||(D('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',M(Ze.current.type),c.ref),or[w]=!0)}}function ln(c,m){{var w=function(){st||(st=!0,D("%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)",m))};w.isReactWarning=!0,Object.defineProperty(c,"key",{get:w,configurable:!0})}}function cr(c,m){{var w=function(){jt||(jt=!0,D("%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)",m))};w.isReactWarning=!0,Object.defineProperty(c,"ref",{get:w,configurable:!0})}}var Mt=function(c,m,w,$,Z,G,W){var te={$$typeof:t,type:c,key:m,ref:w,props:W,_owner:G};return te._store={},Object.defineProperty(te._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(te,"_self",{configurable:!1,enumerable:!1,writable:!1,value:$}),Object.defineProperty(te,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Z}),Object.freeze&&(Object.freeze(te.props),Object.freeze(te)),te};function ee(c,m,w,$,Z){{var G,W={},te=null,de=null;w!==void 0&&(dt(w),te=""+w),ir(m)&&(dt(m.key),te=""+m.key),Rr(m)&&(de=m.ref,ar(m,Z));for(G in m)Be.call(m,G)&&!Mr.hasOwnProperty(G)&&(W[G]=m[G]);if(c&&c.defaultProps){var ae=c.defaultProps;for(G in ae)W[G]===void 0&&(W[G]=ae[G])}if(te||de){var me=typeof c=="function"?c.displayName||c.name||"Unknown":c;te&&ln(W,me),de&&cr(W,me)}return Mt(c,te,de,Z,$,Ze.current,W)}}var le=E.ReactCurrentOwner,Me=E.ReactDebugCurrentFrame;function Qe(c){if(c){var m=c._owner,w=$e(c.type,c._source,m?m.type:null);Me.setExtraStackFrame(w)}else Me.setExtraStackFrame(null)}var ht;ht=!1;function yt(c){return typeof c=="object"&&c!==null&&c.$$typeof===t}function Rt(){{if(le.current){var c=M(le.current.type);if(c)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+
|
|
23
|
+
Check the render method of \``+c+"`."}return""}}function At(c){{if(c!==void 0){var m=c.fileName.replace(/^.*[\\\/]/,""),w=c.lineNumber;return`
|
|
24
24
|
|
|
25
|
-
Check your code at `+
|
|
25
|
+
Check your code at `+m+":"+w+"."}return""}}var Lt={};function $t(c){{var m=Rt();if(!m){var w=typeof c=="string"?c:c.displayName||c.name;w&&(m=`
|
|
26
26
|
|
|
27
|
-
Check the top-level render call using <`+
|
|
27
|
+
Check the top-level render call using <`+w+">.")}return m}}function St(c,m){{if(!c._store||c._store.validated||c.key!=null)return;c._store.validated=!0;var w=$t(m);if(Lt[w])return;Lt[w]=!0;var $="";c&&c._owner&&c._owner!==le.current&&($=" It was passed a child from "+M(c._owner.type)+"."),Qe(c),D('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',w,$),Qe(null)}}function Ft(c,m){{if(typeof c!="object")return;if(nt(c))for(var w=0;w<c.length;w++){var $=c[w];yt($)&&St($,m)}else if(yt(c))c._store&&(c._store.validated=!0);else if(c){var Z=j(c);if(typeof Z=="function"&&Z!==c.entries)for(var G=Z.call(c),W;!(W=G.next()).done;)yt(W.value)&&St(W.value,m)}}}function ur(c){{var m=c.type;if(m==null||typeof m=="string")return;var w;if(typeof m=="function")w=m.propTypes;else if(typeof m=="object"&&(m.$$typeof===u||m.$$typeof===g))w=m.propTypes;else return;if(w){var $=M(m);tr(w,c.props,"prop",$,c)}else if(m.PropTypes!==void 0&&!ht){ht=!0;var Z=M(m);D("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Z||"Unknown")}typeof m.getDefaultProps=="function"&&!m.getDefaultProps.isReactClassApproved&&D("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function fn(c){{for(var m=Object.keys(c.props),w=0;w<m.length;w++){var $=m[w];if($!=="children"&&$!=="key"){Qe(c),D("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",$),Qe(null);break}}c.ref!==null&&(Qe(c),D("Invalid attribute `ref` supplied to `React.Fragment`."),Qe(null))}}var Ar={};function dn(c,m,w,$,Z,G){{var W=oe(c);if(!W){var te="";(c===void 0||typeof c=="object"&&c!==null&&Object.keys(c).length===0)&&(te+=" 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 de=At(Z);de?te+=de:te+=Rt();var ae;c===null?ae="null":nt(c)?ae="array":c!==void 0&&c.$$typeof===t?(ae="<"+(M(c.type)||"Unknown")+" />",te=" Did you accidentally export a JSX literal instead of a component?"):ae=typeof c,D("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",ae,te)}var me=ee(c,m,w,Z,G);if(me==null)return me;if(W){var Ae=m.children;if(Ae!==void 0)if($)if(nt(Ae)){for(var ze=0;ze<Ae.length;ze++)Ft(Ae[ze],c);Object.freeze&&Object.freeze(Ae)}else D("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 Ft(Ae,c)}if(Be.call(m,"key")){var Ne=M(c),Fe=Object.keys(m).filter(function(Wm){return Wm!=="key"}),Lr=Fe.length>0?"{key: someKey, "+Fe.join(": ..., ")+": ...}":"{key: someKey}";if(!Ar[Ne+Lr]){var bs=Fe.length>0?"{"+Fe.join(": ..., ")+": ...}":"{}";D(`A props object containing a "key" prop is being spread into JSX:
|
|
28
28
|
let props = %s;
|
|
29
29
|
<%s {...props} />
|
|
30
30
|
React keys must be passed directly to JSX without using spread:
|
|
31
31
|
let props = %s;
|
|
32
|
-
<%s key={someKey} {...props} />`,
|
|
32
|
+
<%s key={someKey} {...props} />`,Lr,Ne,bs,Ne),Ar[Ne+Lr]=!0}}return c===n?fn(me):ur(me),me}}function ps(c,m,w){return dn(c,m,w,!0)}function ms(c,m,w){return dn(c,m,w,!1)}var gs=ms,l=ps;dr.Fragment=n,dr.jsx=gs,dr.jsxs=l}()),dr}process.env.NODE_ENV==="production"?pn.exports=Ji():pn.exports=ea();var p=pn.exports;const xs=d.createContext(void 0),ws=()=>d.useContext(xs),ta=({overlayKeepOnScreen:e=!0,useAnimations:t=!0,mobileMediaQuery:r,tabletMediaQuery:n,desktopMediaQuery:s,isValidScrollableElement:o,children:i})=>{const a={overlayKeepOnScreen:e,useAnimations:t,mobileMediaQuery:r,tabletMediaQuery:n,desktopMediaQuery:s,isValidScrollableElement:o};return p.jsx(xs.Provider,{value:a,children:i})};var Ve=(e=>(e[e.Vertical=0]="Vertical",e[e.Horizontal=1]="Horizontal",e))(Ve||{}),qe=(e=>(e[e.Right=0]="Right",e[e.Left=1]="Left",e))(qe||{}),Ps={exports:{}};/*!
|
|
33
33
|
Copyright (c) 2018 Jed Watson.
|
|
34
34
|
Licensed under the MIT License (MIT), see
|
|
35
35
|
http://jedwatson.github.io/classnames
|
|
36
|
-
*/(function(e){(function(){var r={}.hasOwnProperty;function t(){for(var o="",i=0;i<arguments.length;i++){var a=arguments[i];a&&(o=s(o,n(a)))}return o}function n(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return t.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var i="";for(var a in o)r.call(o,a)&&o[a]&&(i=s(i,a));return i}function s(o,i){return i?o?o+" "+i:o+i:o}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})($n);var Uo=$n.exports;const le=Hr(Uo);var Ft=(e=>(e[e.Focus=0]="Focus",e[e.FocusWithin=1]="FocusWithin",e))(Ft||{});const ir=(e=1)=>f.useMemo(()=>le("dark:bsc-ring-mono-light-2 dark:bsc-ring-offset-mono-dark-1",{"focus-within:bsc-ring focus-within:bsc-ring-primary-2 focus-within:bsc-ring-offset-2 focus-within:bsc-ring-opacity-50":e===1,"focus:bsc-ring focus:bsc-ring-primary-2 focus:bsc-ring-offset-2 focus:bsc-ring-opacity-50":e===0}),[e]),zo=(e,r)=>{const t=f.useRef(null),{buttonType:n,buttonStyle:s="flat",type:o="button",disabled:i=!1,form:a,fullWidth:c=!1,onClick:d,className:h,children:p}=e,v=()=>{d==null||d()},y=()=>{var O;(O=t.current)==null||O.click()};f.useImperativeHandle(r,()=>({click:y}));const x=ir(Ft.Focus),D=le("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",x,{"bsc-w-full":c,"bc-disabled bsc-bg-gray-3 bsc-text-gray-2 bsc-pointer-events-none":i,"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:o,onClick:v,disabled:i,form:a,className:D,children:p})},Ve=f.forwardRef(zo),Wr=e=>{const[r,t]=f.useState(!0),n=Fn();return f.useEffect(()=>{e!==void 0?t(e):n&&n.useAnimations!==void 0&&t(n.useAnimations)},[n,e]),r},Hn=f.createContext(void 0),Yn=()=>f.useContext(Hn),qo=({children:e})=>{const r=f.useId(),t=f.useMemo(()=>({sharedId:r}),[r]);return l.jsx(Hn.Provider,{value:t,children:e})},ar=e=>e==null?!1:typeof e=="object",Wn=e=>e instanceof Date,Vn=e=>typeof e=="function",Bn=e=>{const r=typeof e;return r==="string"||r==="number"||r==="boolean"||r==="bigint"},Vr=e=>{if(!ar(e))return e;const r={},t=Object.keys(e);for(let n=0,s=t.length;n<s;n++){const o=t[n],i=e[o];Bn(i)||Vn(i)?r[o]=i:Wn(i)?r[o]=new Date(i.getTime()):Array.isArray(i)?r[o]=Br(i):ar(i)&&(r[o]=Vr(i))}return r},Br=e=>{let r=e.length;const t=new Array(r);for(;r--!==0;){const n=e[r];Bn(n)||Vn(n)?t[r]=n:Wn(n)?t[r]=new Date(n.getTime()):ar(n)&&!Array.isArray(n)?t[r]=Vr(n):Array.isArray(n)?t[r]=Br(n):t[r]=n}return t},Go=e=>ar(e)?Array.isArray(e)?Br(e):Vr(e):e;function Ko(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Zo=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,o;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(o=Object.keys(r),n=o.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[s]))return!1;for(s=n;s--!==0;){var i=o[s];if(!e(r[i],t[i]))return!1}return!0}return r!==r&&t!==t};const Un=Ko(Zo);function Qo(e,r){for(let t=e.length;t--!==0;)if(!Un(e[t],r[t]))return!0;return!1}const cr=(e,r)=>{const t=f.useRef([]),n=t.current.length>0&&t.current[0]&&Qo(t.current[0],r);return(t.current.length===0||n)&&(t.current=[Go(r),e()]),t.current[1]},zn=e=>{const r=f.useRef();let t=!1;r.current!==void 0&&(t=!Un(r.current,e));const n={changed:t,previousValue:r.current};return r.current=e,n},Xo=e=>typeof e=="function",Jo=e=>{const[r,t]=f.useState({value:e,initial:!0}),n=f.useRef(e);return[r,s=>{if(!Xo(s))t({value:s,initial:!1});else{const o=s(n.current);n.current=o,t({value:o,initial:!1})}}]},ei=e=>{const[r,t]=Jo(e),n=f.useRef({value:e,initial:!0});return n.current!==r&&(n.current=r),[r,t,n]},ti=e=>{const[r,t]=f.useState(e),n=f.useRef(e);return n.current!==r&&(n.current=r),[r,t,n]};function qn(){return window.navigator.languages?window.navigator.languages[0]:window.navigator.language}function ri(e,r,t){const n=[];for(let s=e;s<=r;s++)n.push(t?t(s):s);return n}function ni(e,r){const t=e.target;return t?!r.isSameNode(t)&&!r.contains(t):!1}function si(e,r){return e.isSameNode(r)||e.contains(r)}function oi(e,r){const t=Object.entries(r),n=getComputedStyle(e);for(let s=0,o=t.length;s<o;s++){const[i,a]=t[s];if(typeof a=="string"&&a.indexOf(",")>-1){if(!a.split(",").map(d=>d.trim()).includes(n[i]))return!1}else if(n[i]!==a)return!1}return!0}function ii(e,r){const t=Object.entries(r),n=getComputedStyle(e);for(let s=0,o=t.length;s<o;s++){const[i,a]=t[s];if(typeof a=="string"&&a.indexOf(",")>-1){if(a.split(",").map(d=>d.trim()).includes(n[i]))return!0}else if(n[i]===a)return!0}return!1}function Gn(e,r,t=!1,n){if(t&&oi(e,r)){if(!n||(n==null?void 0:n(e))===!0)return e}else if(!t&&ii(e,r)&&(!n||(n==null?void 0:n(e))===!0))return e;return e.parentElement?Gn(e.parentElement,r,t,n):e}function Kn(e,r){const t=Array.from(document.querySelectorAll("body *")),n=[];for(let s=0,o=t.length;s<o;s++){const i=getComputedStyle(t[s]);i[e]&&r(i[e])&&n.push(i[e])}return n}function yp(e){return e}function ai(e){const r=document.documentElement;Object.keys(e).forEach(t=>{r.style.setProperty(t,e[t])})}function ci(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 ui=f.createContext(void 0),li=()=>f.useContext(ui),fi=({id:e,name:r,value:t,type:n,checked:s,readOnly:o,className:i})=>l.jsx("input",{id:e,name:r,value:t,type:n,checked:s,onChange:()=>{},readOnly:o,disabled:o,className:i}),di=({type:e,props:r,renderProps:t,signalName:n,onSignalRetrieved:s,children:o,className:i})=>{const a=li(),{id:c,name:d}=cr(()=>{const h=r;return{id:h.id,name:h.name}},[r]);return f.useEffect(()=>{a&&n&&a[n]&&s&&s(a[n])},[a]),l.jsxs(l.Fragment,{children:[c&&d&&e&&l.jsx(fi,{id:c,name:d,type:e,className:i,...r}),o&&o(t)]})},hi=(e,r)=>{const{name:t,value:n,checked:s=!1,partial:o=!1,onChange:i,children:a,labelStyles:c,className:d}=e,h=Yn(),p=f.useId(),[v,y,x]=ei({checked:!1,partial:!1}),D=zn(s),O=zn(o),P={id:(h==null?void 0:h.sharedId)||e.id||p,...e,...v.value};f.useEffect(()=>{if(v.initial)y({checked:o?!0:s,partial:o});else{const g=D.changed?s:v.value.checked,L=O.changed?o:v.value.partial;y({checked:L?!0:g,partial:L})}},[s,o]);const R=g=>{var C;const L=((C=x.current)==null?void 0:C.value.partial)===!0?!0:g.target.checked;y({checked:L,partial:!1}),i==null||i({originalEvent:g,name:t||g.target.name,value:n,checked:L})},z=g=>{var C;const L={checked:g?!0:((C=x.current)==null?void 0:C.value.checked)||!1,partial:g};y(L)},$=g=>{y({checked:g,partial:!1})};return f.useImperativeHandle(r,()=>({setPartiallyChecked:z,setChecked:$})),l.jsx("label",{className:c,onChange:g=>R(g),children:l.jsx(di,{id:p,name:t,type:"checkbox",props:P,renderProps:v.value,className:d,children:a})})},pi=f.memo(f.forwardRef(hi)),mi=({label:e,htmlFor:r,className:t})=>{const n=Yn(),s=f.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=le("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(mi,{label:e,htmlFor:r,className:s})},gi=(e,r)=>{const{name:t,label:n,value:s,readOnly:o=!1,checked:i=!1,partial:a=!1,labelLocation:c=Ae.Right,className:d,useAnimation:h,onChange:p}=e,v=Wr(h),y=le("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":o},d),x=le("bc-checkbox-label bsc-cursor-pointer",{"bsc-ml-2":c===Ae.Right,"bsc-mr-2":c===Ae.Left}),D=ir(Ft.FocusWithin),O=le("bc-checkbox-outer bsc-relative bsc-rounded *:bsc-block *:bsc-size-[21px]",{"bsc-checkbox-animate":!o&&v,"bc-read-only bsc-checkbox-no-animate":o||!o&&!v},D),P=le("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]":v,"bsc-checkbox":!o,"bc-read-only bsc-checkbox-read-only":o}),R=le("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":!o,"bc-read-only bsc-fill-primary-4 dark:bsc-fill-mono-light-3":o});return l.jsx(qo,{children:l.jsxs("div",{className:y,children:[n&&c===Ae.Left&&l.jsx(Ze,{label:n,readOnly:o,className:x}),l.jsx(pi,{ref:r,name:t,value:s,checked:i,partial:a,readOnly:o,className:P,labelStyles:O,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:o,className:x})]})})},Zn=f.memo(f.forwardRef(gi)),bi=({name:e,label:r,value:t,data:n,textField:s,valueField:o,readOnly:i=!1,orientation:a=Ie.Vertical,className:c,onChange:d})=>{const[h,p]=f.useState([]),v=cr(()=>n,[n]);f.useEffect(()=>{p(t??[])},[t]);const y=R=>{const{value:z,checked:$}=R;let g;$?g=[...h,z]:g=h.filter(L=>L!==z),p(g),d==null||d({name:e,value:g})},x=(R,z)=>l.jsx(Zn,{name:e,label:R[s],value:R[o],checked:h.some($=>$===R[o]),readOnly:i,onChange:$=>$&&y($),className:"bsc-mr-3"},`${e}_checkbox_${z}`),D=le("bsc-flex bsc-flex-col bsc-gap-1",c),O=le("bsc-flex bsc-gap-1",{"bsc-flex-col":a===Ie.Vertical}),P=R=>l.jsx("div",{className:O,children:R.map(x)});return l.jsxs("div",{className:D,children:[r&&l.jsx(Ze,{label:r,readOnly:i}),v&&P(v)]})},yi=f.memo(bi);var vi=typeof global=="object"&&global&&global.Object===Object&&global;const Qn=vi;var xi=typeof self=="object"&&self&&self.Object===Object&&self,wi=Qn||xi||Function("return this")();const Ye=wi;var Pi=Ye.Symbol;const yt=Pi;var Xn=Object.prototype,Ti=Xn.hasOwnProperty,Si=Xn.toString,$t=yt?yt.toStringTag:void 0;function Ei(e){var r=Ti.call(e,$t),t=e[$t];try{e[$t]=void 0;var n=!0}catch{}var s=Si.call(e);return n&&(r?e[$t]=t:delete e[$t]),s}var Ci=Object.prototype,ki=Ci.toString;function Di(e){return ki.call(e)}var Oi="[object Null]",Ni="[object Undefined]",Jn=yt?yt.toStringTag:void 0;function vt(e){return e==null?e===void 0?Ni:Oi:Jn&&Jn in Object(e)?Ei(e):Di(e)}function xt(e){return e!=null&&typeof e=="object"}var _i="[object Symbol]";function Ii(e){return typeof e=="symbol"||xt(e)&&vt(e)==_i}var ji=Array.isArray;const Ur=ji;var Mi=/\s/;function Ri(e){for(var r=e.length;r--&&Mi.test(e.charAt(r)););return r}var Li=/^\s+/;function Ai(e){return e&&e.slice(0,Ri(e)+1).replace(Li,"")}function Qe(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}var es=0/0,Fi=/^[-+]0x[0-9a-f]+$/i,$i=/^0b[01]+$/i,Hi=/^0o[0-7]+$/i,Yi=parseInt;function ts(e){if(typeof e=="number")return e;if(Ii(e))return es;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=Ai(e);var t=$i.test(e);return t||Hi.test(e)?Yi(e.slice(2),t?2:8):Fi.test(e)?es:+e}var Wi="[object AsyncFunction]",Vi="[object Function]",Bi="[object GeneratorFunction]",Ui="[object Proxy]";function rs(e){if(!Qe(e))return!1;var r=vt(e);return r==Vi||r==Bi||r==Wi||r==Ui}var zi=Ye["__core-js_shared__"];const zr=zi;var ns=function(){var e=/[^.]+$/.exec(zr&&zr.keys&&zr.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function qi(e){return!!ns&&ns in e}var Gi=Function.prototype,Ki=Gi.toString;function it(e){if(e!=null){try{return Ki.call(e)}catch{}try{return e+""}catch{}}return""}var Zi=/[\\^$.*+?()[\]{}|]/g,Qi=/^\[object .+?Constructor\]$/,Xi=Function.prototype,Ji=Object.prototype,ea=Xi.toString,ta=Ji.hasOwnProperty,ra=RegExp("^"+ea.call(ta).replace(Zi,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function na(e){if(!Qe(e)||qi(e))return!1;var r=rs(e)?ra:Qi;return r.test(it(e))}function sa(e,r){return e==null?void 0:e[r]}function at(e,r){var t=sa(e,r);return na(t)?t:void 0}var oa=at(Ye,"WeakMap");const qr=oa;var ss=Object.create,ia=function(){function e(){}return function(r){if(!Qe(r))return{};if(ss)return ss(r);e.prototype=r;var t=new e;return e.prototype=void 0,t}}();const aa=ia;function ca(e,r){var t=-1,n=e.length;for(r||(r=Array(n));++t<n;)r[t]=e[t];return r}var ua=function(){try{var e=at(Object,"defineProperty");return e({},"",{}),e}catch{}}();const os=ua;function la(e,r){for(var t=-1,n=e==null?0:e.length;++t<n&&r(e[t],t,e)!==!1;);return e}var fa=9007199254740991,da=/^(?:0|[1-9]\d*)$/;function ha(e,r){var t=typeof e;return r=r??fa,!!r&&(t=="number"||t!="symbol"&&da.test(e))&&e>-1&&e%1==0&&e<r}function is(e,r,t){r=="__proto__"&&os?os(e,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[r]=t}function as(e,r){return e===r||e!==e&&r!==r}var pa=Object.prototype,ma=pa.hasOwnProperty;function cs(e,r,t){var n=e[r];(!(ma.call(e,r)&&as(n,t))||t===void 0&&!(r in e))&&is(e,r,t)}function ur(e,r,t,n){var s=!t;t||(t={});for(var o=-1,i=r.length;++o<i;){var a=r[o],c=n?n(t[a],e[a],a,t,e):void 0;c===void 0&&(c=e[a]),s?is(t,a,c):cs(t,a,c)}return t}var ga=9007199254740991;function us(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ga}function ls(e){return e!=null&&us(e.length)&&!rs(e)}var ba=Object.prototype;function Gr(e){var r=e&&e.constructor,t=typeof r=="function"&&r.prototype||ba;return e===t}function ya(e,r){for(var t=-1,n=Array(e);++t<e;)n[t]=r(t);return n}var va="[object Arguments]";function fs(e){return xt(e)&&vt(e)==va}var ds=Object.prototype,xa=ds.hasOwnProperty,wa=ds.propertyIsEnumerable,Pa=fs(function(){return arguments}())?fs:function(e){return xt(e)&&xa.call(e,"callee")&&!wa.call(e,"callee")};const Ta=Pa;function Sa(){return!1}var hs=typeof J=="object"&&J&&!J.nodeType&&J,ps=hs&&typeof module=="object"&&module&&!module.nodeType&&module,Ea=ps&&ps.exports===hs,ms=Ea?Ye.Buffer:void 0,Ca=ms?ms.isBuffer:void 0,ka=Ca||Sa;const gs=ka;var Da="[object Arguments]",Oa="[object Array]",Na="[object Boolean]",_a="[object Date]",Ia="[object Error]",ja="[object Function]",Ma="[object Map]",Ra="[object Number]",La="[object Object]",Aa="[object RegExp]",Fa="[object Set]",$a="[object String]",Ha="[object WeakMap]",Ya="[object ArrayBuffer]",Wa="[object DataView]",Va="[object Float32Array]",Ba="[object Float64Array]",Ua="[object Int8Array]",za="[object Int16Array]",qa="[object Int32Array]",Ga="[object Uint8Array]",Ka="[object Uint8ClampedArray]",Za="[object Uint16Array]",Qa="[object Uint32Array]",xe={};xe[Va]=xe[Ba]=xe[Ua]=xe[za]=xe[qa]=xe[Ga]=xe[Ka]=xe[Za]=xe[Qa]=!0,xe[Da]=xe[Oa]=xe[Ya]=xe[Na]=xe[Wa]=xe[_a]=xe[Ia]=xe[ja]=xe[Ma]=xe[Ra]=xe[La]=xe[Aa]=xe[Fa]=xe[$a]=xe[Ha]=!1;function Xa(e){return xt(e)&&us(e.length)&&!!xe[vt(e)]}function Kr(e){return function(r){return e(r)}}var bs=typeof J=="object"&&J&&!J.nodeType&&J,Ht=bs&&typeof module=="object"&&module&&!module.nodeType&&module,Ja=Ht&&Ht.exports===bs,Zr=Ja&&Qn.process,ec=function(){try{var e=Ht&&Ht.require&&Ht.require("util").types;return e||Zr&&Zr.binding&&Zr.binding("util")}catch{}}();const wt=ec;var ys=wt&&wt.isTypedArray,tc=ys?Kr(ys):Xa;const rc=tc;var nc=Object.prototype,sc=nc.hasOwnProperty;function vs(e,r){var t=Ur(e),n=!t&&Ta(e),s=!t&&!n&&gs(e),o=!t&&!n&&!s&&rc(e),i=t||n||s||o,a=i?ya(e.length,String):[],c=a.length;for(var d in e)(r||sc.call(e,d))&&!(i&&(d=="length"||s&&(d=="offset"||d=="parent")||o&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||ha(d,c)))&&a.push(d);return a}function xs(e,r){return function(t){return e(r(t))}}var oc=xs(Object.keys,Object);const ic=oc;var ac=Object.prototype,cc=ac.hasOwnProperty;function uc(e){if(!Gr(e))return ic(e);var r=[];for(var t in Object(e))cc.call(e,t)&&t!="constructor"&&r.push(t);return r}function Qr(e){return ls(e)?vs(e):uc(e)}function lc(e){var r=[];if(e!=null)for(var t in Object(e))r.push(t);return r}var fc=Object.prototype,dc=fc.hasOwnProperty;function hc(e){if(!Qe(e))return lc(e);var r=Gr(e),t=[];for(var n in e)n=="constructor"&&(r||!dc.call(e,n))||t.push(n);return t}function Xr(e){return ls(e)?vs(e,!0):hc(e)}var pc=at(Object,"create");const Yt=pc;function mc(){this.__data__=Yt?Yt(null):{},this.size=0}function gc(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}var bc="__lodash_hash_undefined__",yc=Object.prototype,vc=yc.hasOwnProperty;function xc(e){var r=this.__data__;if(Yt){var t=r[e];return t===bc?void 0:t}return vc.call(r,e)?r[e]:void 0}var wc=Object.prototype,Pc=wc.hasOwnProperty;function Tc(e){var r=this.__data__;return Yt?r[e]!==void 0:Pc.call(r,e)}var Sc="__lodash_hash_undefined__";function Ec(e,r){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=Yt&&r===void 0?Sc:r,this}function ct(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])}}ct.prototype.clear=mc,ct.prototype.delete=gc,ct.prototype.get=xc,ct.prototype.has=Tc,ct.prototype.set=Ec;function Cc(){this.__data__=[],this.size=0}function lr(e,r){for(var t=e.length;t--;)if(as(e[t][0],r))return t;return-1}var kc=Array.prototype,Dc=kc.splice;function Oc(e){var r=this.__data__,t=lr(r,e);if(t<0)return!1;var n=r.length-1;return t==n?r.pop():Dc.call(r,t,1),--this.size,!0}function Nc(e){var r=this.__data__,t=lr(r,e);return t<0?void 0:r[t][1]}function _c(e){return lr(this.__data__,e)>-1}function Ic(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 Xe(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])}}Xe.prototype.clear=Cc,Xe.prototype.delete=Oc,Xe.prototype.get=Nc,Xe.prototype.has=_c,Xe.prototype.set=Ic;var jc=at(Ye,"Map");const Wt=jc;function Mc(){this.size=0,this.__data__={hash:new ct,map:new(Wt||Xe),string:new ct}}function Rc(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 Rc(r)?t[typeof r=="string"?"string":"hash"]:t.map}function Lc(e){var r=fr(this,e).delete(e);return this.size-=r?1:0,r}function Ac(e){return fr(this,e).get(e)}function Fc(e){return fr(this,e).has(e)}function $c(e,r){var t=fr(this,e),n=t.size;return t.set(e,r),this.size+=t.size==n?0:1,this}function Pt(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])}}Pt.prototype.clear=Mc,Pt.prototype.delete=Lc,Pt.prototype.get=Ac,Pt.prototype.has=Fc,Pt.prototype.set=$c;function ws(e,r){for(var t=-1,n=r.length,s=e.length;++t<n;)e[s+t]=r[t];return e}var Hc=xs(Object.getPrototypeOf,Object);const Ps=Hc;function Yc(){this.__data__=new Xe,this.size=0}function Wc(e){var r=this.__data__,t=r.delete(e);return this.size=r.size,t}function Vc(e){return this.__data__.get(e)}function Bc(e){return this.__data__.has(e)}var Uc=200;function zc(e,r){var t=this.__data__;if(t instanceof Xe){var n=t.__data__;if(!Wt||n.length<Uc-1)return n.push([e,r]),this.size=++t.size,this;t=this.__data__=new Pt(n)}return t.set(e,r),this.size=t.size,this}function Tt(e){var r=this.__data__=new Xe(e);this.size=r.size}Tt.prototype.clear=Yc,Tt.prototype.delete=Wc,Tt.prototype.get=Vc,Tt.prototype.has=Bc,Tt.prototype.set=zc;function qc(e,r){return e&&ur(r,Qr(r),e)}function Gc(e,r){return e&&ur(r,Xr(r),e)}var Ts=typeof J=="object"&&J&&!J.nodeType&&J,Ss=Ts&&typeof module=="object"&&module&&!module.nodeType&&module,Kc=Ss&&Ss.exports===Ts,Es=Kc?Ye.Buffer:void 0,Cs=Es?Es.allocUnsafe:void 0;function Zc(e,r){if(r)return e.slice();var t=e.length,n=Cs?Cs(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,o=[];++t<n;){var i=e[t];r(i,t,e)&&(o[s++]=i)}return o}function ks(){return[]}var Xc=Object.prototype,Jc=Xc.propertyIsEnumerable,Ds=Object.getOwnPropertySymbols,eu=Ds?function(e){return e==null?[]:(e=Object(e),Qc(Ds(e),function(r){return Jc.call(e,r)}))}:ks;const Jr=eu;function tu(e,r){return ur(e,Jr(e),r)}var ru=Object.getOwnPropertySymbols,nu=ru?function(e){for(var r=[];e;)ws(r,Jr(e)),e=Ps(e);return r}:ks;const Os=nu;function su(e,r){return ur(e,Os(e),r)}function Ns(e,r,t){var n=r(e);return Ur(e)?n:ws(n,t(e))}function ou(e){return Ns(e,Qr,Jr)}function iu(e){return Ns(e,Xr,Os)}var au=at(Ye,"DataView");const en=au;var cu=at(Ye,"Promise");const tn=cu;var uu=at(Ye,"Set");const rn=uu;var _s="[object Map]",lu="[object Object]",Is="[object Promise]",js="[object Set]",Ms="[object WeakMap]",Rs="[object DataView]",fu=it(en),du=it(Wt),hu=it(tn),pu=it(rn),mu=it(qr),ut=vt;(en&&ut(new en(new ArrayBuffer(1)))!=Rs||Wt&&ut(new Wt)!=_s||tn&&ut(tn.resolve())!=Is||rn&&ut(new rn)!=js||qr&&ut(new qr)!=Ms)&&(ut=function(e){var r=vt(e),t=r==lu?e.constructor:void 0,n=t?it(t):"";if(n)switch(n){case fu:return Rs;case du:return _s;case hu:return Is;case pu:return js;case mu:return Ms}return r});const nn=ut;var gu=Object.prototype,bu=gu.hasOwnProperty;function yu(e){var r=e.length,t=new e.constructor(r);return r&&typeof e[0]=="string"&&bu.call(e,"index")&&(t.index=e.index,t.input=e.input),t}var vu=Ye.Uint8Array;const Ls=vu;function sn(e){var r=new e.constructor(e.byteLength);return new Ls(r).set(new Ls(e)),r}function xu(e,r){var t=r?sn(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.byteLength)}var wu=/\w*$/;function Pu(e){var r=new e.constructor(e.source,wu.exec(e));return r.lastIndex=e.lastIndex,r}var As=yt?yt.prototype:void 0,Fs=As?As.valueOf:void 0;function Tu(e){return Fs?Object(Fs.call(e)):{}}function Su(e,r){var t=r?sn(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}var Eu="[object Boolean]",Cu="[object Date]",ku="[object Map]",Du="[object Number]",Ou="[object RegExp]",Nu="[object Set]",_u="[object String]",Iu="[object Symbol]",ju="[object ArrayBuffer]",Mu="[object DataView]",Ru="[object Float32Array]",Lu="[object Float64Array]",Au="[object Int8Array]",Fu="[object Int16Array]",$u="[object Int32Array]",Hu="[object Uint8Array]",Yu="[object Uint8ClampedArray]",Wu="[object Uint16Array]",Vu="[object Uint32Array]";function Bu(e,r,t){var n=e.constructor;switch(r){case ju:return sn(e);case Eu:case Cu:return new n(+e);case Mu:return xu(e,t);case Ru:case Lu:case Au:case Fu:case $u:case Hu:case Yu:case Wu:case Vu:return Su(e,t);case ku:return new n;case Du:case _u:return new n(e);case Ou:return Pu(e);case Nu:return new n;case Iu:return Tu(e)}}function Uu(e){return typeof e.constructor=="function"&&!Gr(e)?aa(Ps(e)):{}}var zu="[object Map]";function qu(e){return xt(e)&&nn(e)==zu}var $s=wt&&wt.isMap,Gu=$s?Kr($s):qu;const Ku=Gu;var Zu="[object Set]";function Qu(e){return xt(e)&&nn(e)==Zu}var Hs=wt&&wt.isSet,Xu=Hs?Kr(Hs):Qu;const Ju=Xu;var el=1,tl=2,rl=4,Ys="[object Arguments]",nl="[object Array]",sl="[object Boolean]",ol="[object Date]",il="[object Error]",Ws="[object Function]",al="[object GeneratorFunction]",cl="[object Map]",ul="[object Number]",Vs="[object Object]",ll="[object RegExp]",fl="[object Set]",dl="[object String]",hl="[object Symbol]",pl="[object WeakMap]",ml="[object ArrayBuffer]",gl="[object DataView]",bl="[object Float32Array]",yl="[object Float64Array]",vl="[object Int8Array]",xl="[object Int16Array]",wl="[object Int32Array]",Pl="[object Uint8Array]",Tl="[object Uint8ClampedArray]",Sl="[object Uint16Array]",El="[object Uint32Array]",ye={};ye[Ys]=ye[nl]=ye[ml]=ye[gl]=ye[sl]=ye[ol]=ye[bl]=ye[yl]=ye[vl]=ye[xl]=ye[wl]=ye[cl]=ye[ul]=ye[Vs]=ye[ll]=ye[fl]=ye[dl]=ye[hl]=ye[Pl]=ye[Tl]=ye[Sl]=ye[El]=!0,ye[il]=ye[Ws]=ye[pl]=!1;function dr(e,r,t,n,s,o){var i,a=r&el,c=r&tl,d=r&rl;if(t&&(i=s?t(e,n,s,o):t(e)),i!==void 0)return i;if(!Qe(e))return e;var h=Ur(e);if(h){if(i=yu(e),!a)return ca(e,i)}else{var p=nn(e),v=p==Ws||p==al;if(gs(e))return Zc(e,a);if(p==Vs||p==Ys||v&&!s){if(i=c||v?{}:Uu(e),!a)return c?su(e,Gc(i,e)):tu(e,qc(i,e))}else{if(!ye[p])return s?e:{};i=Bu(e,p,a)}}o||(o=new Tt);var y=o.get(e);if(y)return y;o.set(e,i),Ju(e)?e.forEach(function(O){i.add(dr(O,r,t,O,e,o))}):Ku(e)&&e.forEach(function(O,P){i.set(P,dr(O,r,t,P,e,o))});var x=d?c?iu:ou:c?Xr:Qr,D=h?void 0:x(e);return la(D||e,function(O,P){D&&(P=O,O=e[P]),cs(i,P,dr(O,r,t,P,e,o))}),i}var Cl=1,kl=4;function Dl(e){return dr(e,Cl|kl)}var Ol=function(){return Ye.Date.now()};const on=Ol;var Nl="Expected a function",_l=Math.max,Il=Math.min;function Vt(e,r,t){var n,s,o,i,a,c,d=0,h=!1,p=!1,v=!0;if(typeof e!="function")throw new TypeError(Nl);r=ts(r)||0,Qe(t)&&(h=!!t.leading,p="maxWait"in t,o=p?_l(ts(t.maxWait)||0,r):o,v="trailing"in t?!!t.trailing:v);function y(L){var C=n,U=s;return n=s=void 0,d=L,i=e.apply(U,C),i}function x(L){return d=L,a=setTimeout(P,r),h?y(L):i}function D(L){var C=L-c,U=L-d,B=r-C;return p?Il(B,o-U):B}function O(L){var C=L-c,U=L-d;return c===void 0||C>=r||C<0||p&&U>=o}function P(){var L=on();if(O(L))return R(L);a=setTimeout(P,D(L))}function R(L){return a=void 0,v&&n?y(L):(n=s=void 0,i)}function z(){a!==void 0&&clearTimeout(a),d=0,n=c=s=a=void 0}function $(){return a===void 0?i:R(on())}function g(){var L=on(),C=O(L);if(n=arguments,s=this,c=L,C){if(a===void 0)return x(c);if(p)return clearTimeout(a),a=setTimeout(P,r),y(c)}return a===void 0&&(a=setTimeout(P,r)),i}return g.cancel=z,g.flush=$,g}var jl="Expected a function";function Ml(e,r,t){var n=!0,s=!0;if(typeof e!="function")throw new TypeError(jl);return Qe(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 Rl=(e,r)=>{const{value:t,readOnly:n=!1,debounceTime:s=800,fillContainer:o=!0,leftElement:i,rightElement:a,className:c,leftElementClassName:d,rightElementClassName:h,isSingleLine:p=!0,allowSingleLineScroll:v=!1,inputMode:y,placeholder:x,onFocus:D,onBlur:O,onInput:P,onInnerTextChange:R,onInnerHTMLChange:z,onElementCreate:$,onLeftElementClick:g,onRightElementClick:L}=e,C=f.useRef("bsc-flex-grow focus:bsc-outline-none"),U=f.useRef("bsc-text-gray-4"),B=f.useRef(),se=f.useCallback(S=>{const H=S.target,K=H.innerHTML;H.className=`${C.current}`,x&&K===x&&(H.innerHTML=""),D==null||D(S)},[x,D]),re=f.useCallback(S=>{const H=S.target.innerHTML;if(x&&H===""){const K=S.target;K.innerHTML=x,K.className=`${C.current} ${U.current}`}O==null||O(S)},[x,O]),ee=f.useCallback(S=>{var H,K;(H=B.current)==null||H.removeEventListener("focus",se),(K=B.current)==null||K.removeEventListener("blur",re),x&&S&&S!==document.activeElement&&S.innerHTML===""&&(S.innerHTML=x,S.className=`${C.current} ${U.current}`),S.addEventListener("focus",se),S.addEventListener("blur",re),B.current=S},[x]),I=f.useCallback(S=>{$==null||$(S)},[$]),F=S=>{g==null||g(S)},j=S=>{L==null||L(S)},k=Vt(S=>{P==null||P(S),R==null||R(S.target.innerText),z==null||z(S.target.innerHTML)},s),G=f.useCallback(S=>{B.current&&(B.current.innerText=S)},[]),N=f.useCallback(S=>{B.current&&(B.current.innerHTML=S)},[]),W=f.useCallback(()=>{var S;(S=B.current)==null||S.focus()},[]);f.useImperativeHandle(r,()=>({inputElement:B.current,setInnerText:G,setInnerHTML:N,focus:W}));const b=le({"bsc-w-full ":o},"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&&v,"bsc-overflow-hidden bsc-whitespace-pre":p&&!v},c),T=le("bsc-flex-shrink",{"bsc-mr-2":i},d),V=le("bsc-flex-shrink",{"bsc-ml-2":a},h);return l.jsxs("div",{className:b,ref:S=>S&&I(S),children:[i&&l.jsx("div",{className:T,onClick:F,children:i}),l.jsx("div",{ref:S=>S&&ee(S),className:C.current,contentEditable:!n,suppressContentEditableWarning:!0,inputMode:y,onInput:k,children:t}),a&&l.jsx("div",{className:V,onClick:j,children:a})]})},hr=f.forwardRef(Rl);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 St(e,r){const t=fe(e);return isNaN(r)?ve(e,NaN):(r&&t.setDate(t.getDate()+r),t)}function tt(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 o=s.getDate();return n>=o?s:(t.setFullYear(s.getFullYear(),s.getMonth(),n),t)}const Bs=6048e5,an=6e4,cn=36e5,Ll=1e3;let Al={};function Bt(){return Al}function rt(e,r){var a,c,d,h;const t=Bt(),n=(r==null?void 0:r.weekStartsOn)??((c=(a=r==null?void 0:r.locale)==null?void 0:a.options)==null?void 0:c.weekStartsOn)??t.weekStartsOn??((h=(d=t.locale)==null?void 0:d.options)==null?void 0:h.weekStartsOn)??0,s=fe(e),o=s.getDay(),i=(o<n?7:0)+o-n;return s.setDate(s.getDate()-i),s.setHours(0,0,0,0),s}function Et(e){return rt(e,{weekStartsOn:1})}function Fl(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=Et(n),o=ve(e,0);o.setFullYear(t,0,4),o.setHours(0,0,0,0);const i=Et(o);return r.getTime()>=s.getTime()?t+1:r.getTime()>=i.getTime()?t:t-1}function Us(e){const r=fe(e);return r.setHours(0,0,0,0),r}function zs(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 $l(e){const r=Fl(e),t=ve(e,0);return t.setFullYear(r,0,4),t.setHours(0,0,0,0),Et(t)}function Ut(e,r){return tt(e,r*12)}function qs(e,r){const t=Us(e),n=Us(r);return+t==+n}function Hl(e){const r=fe(e),t=r.getMonth();return r.setFullYear(r.getFullYear(),t+1,0),r.setHours(23,59,59,999),r}function Yl(e,r){const t=fe(e.start),n=fe(e.end);let s=+t>+n;const o=s?+t:+n,i=s?n:t;i.setHours(0,0,0,0);let a=(r==null?void 0:r.step)??1;if(!a)return[];a<0&&(a=-a,s=!s);const c=[];for(;+i<=o;)c.push(fe(i)),i.setDate(i.getDate()+a),i.setHours(0,0,0,0);return s?c.reverse():c}function Gs(e){const r=fe(e);return r.setDate(1),r.setHours(0,0,0,0),r}function Wl(e,r){const t=fe(e.start),n=fe(e.end);let s=+t>+n;const o=s?+t:+n,i=s?n:t;i.setHours(0,0,0,0),i.setMonth(0,1);let a=(r==null?void 0:r.step)??1;if(!a)return[];a<0&&(a=-a,s=!s);const c=[];for(;+i<=o;)c.push(fe(i)),i.setFullYear(i.getFullYear()+a);return s?c.reverse():c}const Vl={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"}},Bl=(e,r,t)=>{let n;const s=Vl[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 un(e){return(r={})=>{const t=r.width?String(r.width):e.defaultWidth;return e.formats[t]||e.formats[e.defaultWidth]}}const Ul={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},zl={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ql={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Gl={date:un({formats:Ul,defaultWidth:"full"}),time:un({formats:zl,defaultWidth:"full"}),dateTime:un({formats:ql,defaultWidth:"full"})},Kl={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Zl=(e,r,t,n)=>Kl[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 i=e.defaultFormattingWidth||e.defaultWidth,a=t!=null&&t.width?String(t.width):i;s=e.formattingValues[a]||e.formattingValues[i]}else{const i=e.defaultWidth,a=t!=null&&t.width?String(t.width):e.defaultWidth;s=e.values[a]||e.values[i]}const o=e.argumentCallback?e.argumentCallback(r):r;return s[o]}}const Ql={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Xl={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Jl={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"]},ef={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"]},tf={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"}},rf={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"}},nf={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:Xl,defaultWidth:"wide",argumentCallback:e=>e-1}),month:zt({values:Jl,defaultWidth:"wide"}),day:zt({values:ef,defaultWidth:"wide"}),dayPeriod:zt({values:tf,defaultWidth:"wide",formattingValues:rf,defaultFormattingWidth:"wide"})};function qt(e){return(r,t={})=>{const n=t.width,s=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],o=r.match(s);if(!o)return null;const i=o[0],a=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(a)?of(a,p=>p.test(i)):sf(a,p=>p.test(i));let d;d=e.valueCallback?e.valueCallback(c):c,d=t.valueCallback?t.valueCallback(d):d;const h=r.slice(i.length);return{value:d,rest:h}}}function sf(e,r){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&r(e[t]))return t}function of(e,r){for(let t=0;t<e.length;t++)if(r(e[t]))return t}function af(e){return(r,t={})=>{const n=r.match(e.matchPattern);if(!n)return null;const s=n[0],o=r.match(e.parsePattern);if(!o)return null;let i=e.valueCallback?e.valueCallback(o[0]):o[0];i=t.valueCallback?t.valueCallback(i):i;const a=r.slice(s.length);return{value:i,rest:a}}}const cf=/^(\d+)(th|st|nd|rd)?/i,uf=/\d+/i,lf={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},ff={any:[/^b/i,/^(a|c)/i]},df={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},hf={any:[/1/i,/2/i,/3/i,/4/i]},pf={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},mf={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]},gf={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},bf={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]},yf={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},vf={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}},xf={ordinalNumber:af({matchPattern:cf,parsePattern:uf,valueCallback:e=>parseInt(e,10)}),era:qt({matchPatterns:lf,defaultMatchWidth:"wide",parsePatterns:ff,defaultParseWidth:"any"}),quarter:qt({matchPatterns:df,defaultMatchWidth:"wide",parsePatterns:hf,defaultParseWidth:"any",valueCallback:e=>e+1}),month:qt({matchPatterns:pf,defaultMatchWidth:"wide",parsePatterns:mf,defaultParseWidth:"any"}),day:qt({matchPatterns:gf,defaultMatchWidth:"wide",parsePatterns:bf,defaultParseWidth:"any"}),dayPeriod:qt({matchPatterns:yf,defaultMatchWidth:"any",parsePatterns:vf,defaultParseWidth:"any"})},wf={code:"en-US",formatDistance:Bl,formatLong:Gl,formatRelative:Zl,localize:nf,match:xf,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Pf(e){const r=fe(e),t=+Et(r)-+$l(r);return Math.round(t/Bs)+1}function Ks(e,r){var h,p,v,y;const t=fe(e),n=t.getFullYear(),s=Bt(),o=(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??((y=(v=s.locale)==null?void 0:v.options)==null?void 0:y.firstWeekContainsDate)??1,i=ve(e,0);i.setFullYear(n+1,0,o),i.setHours(0,0,0,0);const a=rt(i,r),c=ve(e,0);c.setFullYear(n,0,o),c.setHours(0,0,0,0);const d=rt(c,r);return t.getTime()>=a.getTime()?n+1:t.getTime()>=d.getTime()?n:n-1}function Tf(e,r){var a,c,d,h;const t=Bt(),n=(r==null?void 0:r.firstWeekContainsDate)??((c=(a=r==null?void 0:r.locale)==null?void 0:a.options)==null?void 0:c.firstWeekContainsDate)??t.firstWeekContainsDate??((h=(d=t.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??1,s=Ks(e,r),o=ve(e,0);return o.setFullYear(s,0,n),o.setHours(0,0,0,0),rt(o,r)}function Sf(e,r){const t=fe(e),n=+rt(t,r)-+Tf(t,r);return Math.round(n/Bs)+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"})}},Qs=(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"})}},Xs={p:Qs,P:(e,r)=>{const t=e.match(/(P+)(p+)?/)||[],n=t[1],s=t[2];if(!s)return Zs(e,r);let o;switch(n){case"P":o=r.dateTime({width:"short"});break;case"PP":o=r.dateTime({width:"medium"});break;case"PPP":o=r.dateTime({width:"long"});break;case"PPPP":default:o=r.dateTime({width:"full"});break}return o.replace("{{date}}",Zs(n,r)).replace("{{time}}",Qs(s,r))}},Ef=/^D+$/,Cf=/^Y+$/,kf=["D","DD","YY","YYYY"];function Df(e){return Ef.test(e)}function Of(e){return Cf.test(e)}function Js(e,r,t){const n=Nf(e,r,t);if(console.warn(n),kf.includes(e))throw new RangeError(n)}function Nf(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 ln(e){return fe(e).getDay()}function eo(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 _f(){return Object.assign({},Bt())}function If(e){let t=fe(e).getDay();return t===0&&(t=7),t}function jf(e){const r=fe(e),t=r.getMonth();return r.setFullYear(r.getFullYear(),t+1,0),r.setHours(0,0,0,0),r}function Mf(e,r){const t=fe(e),n=fe(r);return+t<+n}function Rf(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 Lf=10;class to{constructor(){m(this,"subPriority",0)}validate(r,t){return!0}}class Af extends to{constructor(r,t,n,s,o){super(),this.value=r,this.validateValue=t,this.setValue=n,this.priority=s,o&&(this.subPriority=o)}validate(r,t){return this.validateValue(r,this.value,t)}set(r,t,n){return this.setValue(r,t,this.value,n)}}class Ff extends to{constructor(){super(...arguments);m(this,"priority",Lf);m(this,"subPriority",-1)}set(t,n){return n.timestampIsSet?t:ve(t,Rf(t,Date))}}class de{run(r,t,n,s){const o=this.parse(r,t,n,s);return o?{setter:new Af(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}validate(r,t,n){return!0}}class $f 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}/},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 Ce(e,r){return e&&{value:r(e.value),rest:e.rest}}function Pe(e,r){const t=r.match(e);return t?{value:parseInt(t[0],10),rest:r.slice(t[0].length)}:null}function Ue(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,o=t[3]?parseInt(t[3],10):0,i=t[5]?parseInt(t[5],10):0;return{value:n*(s*cn+o*an+i*Ll),rest:r.slice(t[0].length)}}function ro(e){return Pe(Ee.anyDigitsSigned,e)}function Te(e,r){switch(e){case 1:return Pe(Ee.singleDigit,r);case 2:return Pe(Ee.twoDigits,r);case 3:return Pe(Ee.threeDigits,r);case 4:return Pe(Ee.fourDigits,r);default:return Pe(new RegExp("^\\d{1,"+e+"}"),r)}}function pr(e,r){switch(e){case 1:return Pe(Ee.singleDigitSigned,r);case 2:return Pe(Ee.twoDigitsSigned,r);case 3:return Pe(Ee.threeDigitsSigned,r);case 4:return Pe(Ee.fourDigitsSigned,r);default:return Pe(new RegExp("^-?\\d{1,"+e+"}"),r)}}function fn(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 no(e,r){const t=r>0,n=t?r:1-r;let s;if(n<=50)s=e||100;else{const o=n+50,i=Math.trunc(o/100)*100,a=e>=o%100;s=e+i-(a?100:0)}return t?s:1-s}function so(e){return e%400===0||e%4===0&&e%100!==0}class Hf 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 o=i=>({year:i,isTwoDigitYear:n==="yy"});switch(n){case"y":return Ce(Te(4,t),o);case"yo":return Ce(s.ordinalNumber(t,{unit:"year"}),o);default:return Ce(Te(n.length,t),o)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,s){const o=t.getFullYear();if(s.isTwoDigitYear){const a=no(s.year,o);return t.setFullYear(a,0,1),t.setHours(0,0,0,0),t}const i=!("era"in n)||n.era===1?s.year:1-s.year;return t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}}class Yf 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 o=i=>({year:i,isTwoDigitYear:n==="YY"});switch(n){case"Y":return Ce(Te(4,t),o);case"Yo":return Ce(s.ordinalNumber(t,{unit:"year"}),o);default:return Ce(Te(n.length,t),o)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,s,o){const i=Ks(t,o);if(s.isTwoDigitYear){const c=no(s.year,i);return t.setFullYear(c,0,o.firstWeekContainsDate),t.setHours(0,0,0,0),rt(t,o)}const a=!("era"in n)||n.era===1?s.year:1-s.year;return t.setFullYear(a,0,o.firstWeekContainsDate),t.setHours(0,0,0,0),rt(t,o)}}class Wf 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 pr(n==="R"?4:n.length,t)}set(t,n,s){const o=ve(t,0);return o.setFullYear(s,0,4),o.setHours(0,0,0,0),Et(o)}}class Vf 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 pr(n==="u"?4:n.length,t)}set(t,n,s){return t.setFullYear(s,0,1),t.setHours(0,0,0,0),t}}class Bf 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 Te(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 Uf 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 Te(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 zf 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 o=i=>i-1;switch(n){case"M":return Ce(Pe(Ee.month,t),o);case"MM":return Ce(Te(2,t),o);case"Mo":return Ce(s.ordinalNumber(t,{unit:"month"}),o);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 qf 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 o=i=>i-1;switch(n){case"L":return Ce(Pe(Ee.month,t),o);case"LL":return Ce(Te(2,t),o);case"Lo":return Ce(s.ordinalNumber(t,{unit:"month"}),o);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 Gf(e,r,t){const n=fe(e),s=Sf(n,t)-r;return n.setDate(n.getDate()-s*7),n}class Kf 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 Pe(Ee.week,t);case"wo":return s.ordinalNumber(t,{unit:"week"});default:return Te(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,s,o){return rt(Gf(t,s,o),o)}}function Zf(e,r){const t=fe(e),n=Pf(t)-r;return t.setDate(t.getDate()-n*7),t}class Qf 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 Pe(Ee.week,t);case"Io":return s.ordinalNumber(t,{unit:"week"});default:return Te(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,s){return Et(Zf(t,s))}}const Xf=[31,28,31,30,31,30,31,31,30,31,30,31],Jf=[31,29,31,30,31,30,31,31,30,31,30,31];class ed 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 Pe(Ee.date,t);case"do":return s.ordinalNumber(t,{unit:"date"});default:return Te(n.length,t)}}validate(t,n){const s=t.getFullYear(),o=so(s),i=t.getMonth();return o?n>=1&&n<=Jf[i]:n>=1&&n<=Xf[i]}set(t,n,s){return t.setDate(s),t.setHours(0,0,0,0),t}}class td 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 Pe(Ee.dayOfYear,t);case"Do":return s.ordinalNumber(t,{unit:"date"});default:return Te(n.length,t)}}validate(t,n){const s=t.getFullYear();return so(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 dn(e,r,t){var p,v,y,x;const n=Bt(),s=(t==null?void 0:t.weekStartsOn)??((v=(p=t==null?void 0:t.locale)==null?void 0:p.options)==null?void 0:v.weekStartsOn)??n.weekStartsOn??((x=(y=n.locale)==null?void 0:y.options)==null?void 0:x.weekStartsOn)??0,o=fe(e),i=o.getDay(),c=(r%7+7)%7,d=7-s,h=r<0||r>6?r-(i+d)%7:(c+d)%7-(i+d)%7;return St(o,h)}class rd 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,o){return t=dn(t,s,o),t.setHours(0,0,0,0),t}}class nd 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,o){const i=a=>{const c=Math.floor((a-1)/7)*7;return(a+o.weekStartsOn+6)%7+c};switch(n){case"e":case"ee":return Ce(Te(n.length,t),i);case"eo":return Ce(s.ordinalNumber(t,{unit:"day"}),i);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,o){return t=dn(t,s,o),t.setHours(0,0,0,0),t}}class sd 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,o){const i=a=>{const c=Math.floor((a-1)/7)*7;return(a+o.weekStartsOn+6)%7+c};switch(n){case"c":case"cc":return Ce(Te(n.length,t),i);case"co":return Ce(s.ordinalNumber(t,{unit:"day"}),i);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,o){return t=dn(t,s,o),t.setHours(0,0,0,0),t}}function od(e,r){const t=fe(e),n=If(t),s=r-n;return St(t,s)}class id 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 o=i=>i===0?7:i;switch(n){case"i":case"ii":return Te(n.length,t);case"io":return s.ordinalNumber(t,{unit:"day"});case"iii":return Ce(s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"}),o);case"iiiii":return Ce(s.day(t,{width:"narrow",context:"formatting"}),o);case"iiiiii":return Ce(s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"}),o);case"iiii":default:return Ce(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"}),o)}}validate(t,n){return n>=1&&n<=7}set(t,n,s){return t=od(t,s),t.setHours(0,0,0,0),t}}class ad 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(fn(s),0,0,0),t}}class cd 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(fn(s),0,0,0),t}}class ud 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(fn(s),0,0,0),t}}class ld 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 Pe(Ee.hour12h,t);case"ho":return s.ordinalNumber(t,{unit:"hour"});default:return Te(n.length,t)}}validate(t,n){return n>=1&&n<=12}set(t,n,s){const o=t.getHours()>=12;return o&&s<12?t.setHours(s+12,0,0,0):!o&&s===12?t.setHours(0,0,0,0):t.setHours(s,0,0,0),t}}class fd 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 Pe(Ee.hour23h,t);case"Ho":return s.ordinalNumber(t,{unit:"hour"});default:return Te(n.length,t)}}validate(t,n){return n>=0&&n<=23}set(t,n,s){return t.setHours(s,0,0,0),t}}class dd 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 Pe(Ee.hour11h,t);case"Ko":return s.ordinalNumber(t,{unit:"hour"});default:return Te(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 hd 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 Pe(Ee.hour24h,t);case"ko":return s.ordinalNumber(t,{unit:"hour"});default:return Te(n.length,t)}}validate(t,n){return n>=1&&n<=24}set(t,n,s){const o=s<=24?s%24:s;return t.setHours(o,0,0,0),t}}class pd extends de{constructor(){super(...arguments);m(this,"priority",60);m(this,"incompatibleTokens",["t","T"])}parse(t,n,s){switch(n){case"m":return Pe(Ee.minute,t);case"mo":return s.ordinalNumber(t,{unit:"minute"});default:return Te(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,s){return t.setMinutes(s,0,0),t}}class md extends de{constructor(){super(...arguments);m(this,"priority",50);m(this,"incompatibleTokens",["t","T"])}parse(t,n,s){switch(n){case"s":return Pe(Ee.second,t);case"so":return s.ordinalNumber(t,{unit:"second"});default:return Te(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,s){return t.setSeconds(s,0),t}}class gd extends de{constructor(){super(...arguments);m(this,"priority",30);m(this,"incompatibleTokens",["t","T"])}parse(t,n){const s=o=>Math.trunc(o*Math.pow(10,-n.length+3));return Ce(Te(n.length,t),s)}set(t,n,s){return t.setMilliseconds(s),t}}class bd extends de{constructor(){super(...arguments);m(this,"priority",10);m(this,"incompatibleTokens",["t","T","x"])}parse(t,n){switch(n){case"X":return Ue(Be.basicOptionalMinutes,t);case"XX":return Ue(Be.basic,t);case"XXXX":return Ue(Be.basicOptionalSeconds,t);case"XXXXX":return Ue(Be.extendedOptionalSeconds,t);case"XXX":default:return Ue(Be.extended,t)}}set(t,n,s){return n.timestampIsSet?t:ve(t,t.getTime()-zs(t)-s)}}class yd extends de{constructor(){super(...arguments);m(this,"priority",10);m(this,"incompatibleTokens",["t","T","X"])}parse(t,n){switch(n){case"x":return Ue(Be.basicOptionalMinutes,t);case"xx":return Ue(Be.basic,t);case"xxxx":return Ue(Be.basicOptionalSeconds,t);case"xxxxx":return Ue(Be.extendedOptionalSeconds,t);case"xxx":default:return Ue(Be.extended,t)}}set(t,n,s){return n.timestampIsSet?t:ve(t,t.getTime()-zs(t)-s)}}class vd extends de{constructor(){super(...arguments);m(this,"priority",40);m(this,"incompatibleTokens","*")}parse(t){return ro(t)}set(t,n,s){return[ve(t,s*1e3),{timestampIsSet:!0}]}}class xd extends de{constructor(){super(...arguments);m(this,"priority",20);m(this,"incompatibleTokens","*")}parse(t){return ro(t)}set(t,n,s){return[ve(t,s),{timestampIsSet:!0}]}}const wd={G:new $f,y:new Hf,Y:new Yf,R:new Wf,u:new Vf,Q:new Bf,q:new Uf,M:new zf,L:new qf,w:new Kf,I:new Qf,d:new ed,D:new td,E:new rd,e:new nd,c:new sd,i:new id,a:new ad,b:new cd,B:new ud,h:new ld,H:new fd,K:new dd,k:new hd,m:new pd,s:new md,S:new gd,X:new bd,x:new yd,t:new vd,T:new xd},Pd=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Td=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Sd=/^'([^]*?)'?$/,Ed=/''/g,Cd=/\S/,kd=/[a-zA-Z]/;function ze(e,r,t,n){var D,O,P,R,z,$,g,L;const s=_f(),o=(n==null?void 0:n.locale)??s.locale??wf,i=(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=(P=s.locale)==null?void 0:P.options)==null?void 0:R.firstWeekContainsDate)??1,a=(n==null?void 0:n.weekStartsOn)??(($=(z=n==null?void 0:n.locale)==null?void 0:z.options)==null?void 0:$.weekStartsOn)??s.weekStartsOn??((L=(g=s.locale)==null?void 0:g.options)==null?void 0:L.weekStartsOn)??0;if(r==="")return e===""?fe(t):ve(t,NaN);const c={firstWeekContainsDate:i,weekStartsOn:a,locale:o},d=[new Ff],h=r.match(Td).map(C=>{const U=C[0];if(U in Xs){const B=Xs[U];return B(C,o.formatLong)}return C}).join("").match(Pd),p=[];for(let C of h){!(n!=null&&n.useAdditionalWeekYearTokens)&&Of(C)&&Js(C,r,e),!(n!=null&&n.useAdditionalDayOfYearTokens)&&Df(C)&&Js(C,r,e);const U=C[0],B=wd[U];if(B){const{incompatibleTokens:se}=B;if(Array.isArray(se)){const ee=p.find(I=>se.includes(I.token)||I.token===U);if(ee)throw new RangeError(`The format string mustn't contain \`${ee.fullToken}\` and \`${C}\` at the same time`)}else if(B.incompatibleTokens==="*"&&p.length>0)throw new RangeError(`The format string mustn't contain \`${C}\` and any other token at the same time`);p.push({token:U,fullToken:C});const re=B.run(e,C,o.match,c);if(!re)return ve(t,NaN);d.push(re.setter),e=re.rest}else{if(U.match(kd))throw new RangeError("Format string contains an unescaped latin alphabet character `"+U+"`");if(C==="''"?C="'":U==="'"&&(C=Dd(C)),e.indexOf(C)===0)e=e.slice(C.length);else return ve(t,NaN)}}if(e.length>0&&Cd.test(e))return ve(t,NaN);const v=d.map(C=>C.priority).sort((C,U)=>U-C).filter((C,U,B)=>B.indexOf(C)===U).map(C=>d.filter(U=>U.priority===C).sort((U,B)=>B.subPriority-U.subPriority)).map(C=>C[0]);let y=fe(t);if(isNaN(y.getTime()))return ve(t,NaN);const x={};for(const C of v){if(!C.validate(y,c))return ve(t,NaN);const U=C.set(y,x,c);Array.isArray(U)?(y=U[0],Object.assign(x,U[1])):y=U}return ve(t,y)}function Dd(e){return e.match(Sd)[1].replace(Ed,"'")}function Od(e){return qs(e,Date.now())}function Nd(e,r){return St(e,-r)}function _d(e,r){let t=r-ln(e);return t<=0&&(t+=7),St(e,t)}function Id(e,r){const t=(r==null?void 0:r.additionalDigits)??2,n=Ld(e);let s;if(n.date){const c=Ad(n.date,t);s=Fd(c.restDateString,c.year)}if(!s||isNaN(s.getTime()))return new Date(NaN);const o=s.getTime();let i=0,a;if(n.time&&(i=$d(n.time),isNaN(i)))return new Date(NaN);if(n.timezone){if(a=Hd(n.timezone),isNaN(a))return new Date(NaN)}else{const c=new Date(o+i),d=new Date(0);return d.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),d.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),d}return new Date(o+i+a)}const mr={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},jd=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Md=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Rd=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Ld(e){const r={},t=e.split(mr.dateTimeDelimiter);let n;if(t.length>2)return r;if(/:/.test(t[0])?n=t[0]:(r.date=t[0],n=t[1],mr.timeZoneDelimiter.test(r.date)&&(r.date=e.split(mr.timeZoneDelimiter)[0],n=e.substr(r.date.length,e.length))),n){const s=mr.timezone.exec(n);s?(r.time=n.replace(s[1],""),r.timezone=s[1]):r.time=n}return r}function Ad(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,o=n[2]?parseInt(n[2]):null;return{year:o===null?s:o*100,restDateString:e.slice((n[1]||n[2]).length)}}function Fd(e,r){if(r===null)return new Date(NaN);const t=e.match(jd);if(!t)return new Date(NaN);const n=!!t[4],s=Gt(t[1]),o=Gt(t[2])-1,i=Gt(t[3]),a=Gt(t[4]),c=Gt(t[5])-1;if(n)return Ud(r,a,c)?Yd(r,a,c):new Date(NaN);{const d=new Date(0);return!Vd(r,o,i)||!Bd(r,s)?new Date(NaN):(d.setUTCFullYear(r,o,Math.max(s,i)),d)}}function Gt(e){return e?parseInt(e):1}function $d(e){const r=e.match(Md);if(!r)return NaN;const t=hn(r[1]),n=hn(r[2]),s=hn(r[3]);return zd(t,n,s)?t*cn+n*an+s*1e3:NaN}function hn(e){return e&&parseFloat(e.replace(",","."))||0}function Hd(e){if(e==="Z")return 0;const r=e.match(Rd);if(!r)return 0;const t=r[1]==="+"?-1:1,n=parseInt(r[2]),s=r[3]&&parseInt(r[3])||0;return qd(n,s)?t*(n*cn+s*an):NaN}function Yd(e,r,t){const n=new Date(0);n.setUTCFullYear(e,0,4);const s=n.getUTCDay()||7,o=(r-1)*7+t+1-s;return n.setUTCDate(n.getUTCDate()+o),n}const Wd=[31,null,31,30,31,30,31,31,30,31,30,31];function oo(e){return e%400===0||e%4===0&&e%100!==0}function Vd(e,r,t){return r>=0&&r<=11&&t>=1&&t<=(Wd[r]||(oo(e)?29:28))}function Bd(e,r){return r>=1&&r<=(oo(e)?366:365)}function Ud(e,r,t){return r>=1&&r<=53&&t>=0&&t<=6}function zd(e,r,t){return e===24?r===0&&t===0:t>=0&&t<60&&r>=0&&r<60&&e>=0&&e<25}function qd(e,r){return r>=0&&r<=59}function Gd(e,r){const t=fe(e),n=t.getFullYear(),s=t.getDate(),o=ve(e,0);o.setFullYear(n,r,15),o.setHours(0,0,0,0);const i=eo(o);return t.setMonth(r,Math.min(s,i)),t}function Kd(e,r){const t=fe(e);return isNaN(+t)?ve(e,NaN):(t.setFullYear(r),t)}function pn(e,r){return tt(e,-r)}function mn(e,r){return Ut(e,-r)}var je=(e=>(e[e.Regular=24]="Regular",e[e.Small=20]="Small",e))(je||{});const io=({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"})}),Zd=({className:e})=>{const r=le("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=le("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"})})},Xd=({className:e})=>{const r=le("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"})})},Jd=({className:e})=>{const r=le("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"})})},eh=({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"})}),Fe=({icon:e,size:r=je.Regular,onClick:t,className:n})=>{const s=f.useRef({calendar:io,chevronDown:Zd,chevronLeft:Qd,chevronRight:Xd,chevronUp:Jd,close:eh}),o=f.useMemo(()=>s.current[e]||io,[e]),i=le({"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(o,{className:i})})},lt=({template:e,props:r,children:t})=>e(r,t);function th(e,r){if(r===e)return!1;const t=Object.values(r),n=Object.values(e);if(t.length!==n.length||t.some((o,i)=>o!==n[i]))return!0;const s=Object.keys(e);return Object.keys(r).some((o,i)=>o!==s[i])}function rh(e,r){return e.matches[r]=!1,e.mediaQueries[r]={},e}function ao(e){const r=Object.keys(e);return typeof window>"u"?r.reduce(rh,{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 nh(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 ao(r.queries)}}function sh(e){const r=Rt.useRef(e),[t,n]=Rt.useReducer(nh,e,ao);Rt.useEffect(()=>{th(e,r.current)&&(n({type:"setQueries",queries:e}),r.current=e)},[e]);function s(){return n({type:"updateMatches"})}function o(c){const d=s;return typeof c.addListener<"u"?c.addListener(d):c.addEventListener("change",d),d}Rt.useEffect(()=>{const c=Object.values(t.mediaQueries),d=c.map(o);function h(p,v){typeof p.addListener<"u"?p.removeListener(d[v]):p.removeEventListener("change",d[v])}return()=>{c.forEach(h)}},[t.mediaQueries]);const{matches:i}=t,a=Rt.useMemo(()=>Object.values(i),[i]);return{matches:i,matchesAny:a.some(Boolean),matchesAll:a.length>0&&a.every(Boolean)}}function gr(e){return sh(oh(e)).matchesAll}const gn={};function oh(e){return gn[e]===void 0&&(gn[e]={default:e}),gn[e]}const bn=({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:o,desktopMarkup:i})=>{const a=gr(e),c=gr(r),d=gr(t);return(()=>a&&n?n:!a&&s?s:c&&o?o:d&&i?i:(console.error("Invalid media settings"),null))()};function co(e,r,t){const n=o=>{const i=o.target,a=e.style.display!=="hidden";e&&a&&!si(e,i)&&!s(t,i)&&r(!1),r(!0)},s=(o,i)=>{if(!o)return!1;for(let a=0,c=o.length;a<c;a++)if(o[a].isSameNode(i)||o[a].contains(i))return!0;return!1};return document.addEventListener("mousedown",n),n}function uo(e){document.removeEventListener("mousedown",e)}function ih(e,r){if(e==null)return{};var t={},n=Object.keys(e),s,o;for(o=0;o<n.length;o++)s=n[o],!(r.indexOf(s)>=0)&&(t[s]=e[s]);return t}function yn(e,r){return yn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},yn(e,r)}function ah(e,r){e.prototype=Object.create(r.prototype),e.prototype.constructor=e,yn(e,r)}var vn={exports:{}},br={exports:{}},pe={};/** @license React v16.13.1
|
|
36
|
+
*/(function(e){(function(){var t={}.hasOwnProperty;function r(){for(var o="",i=0;i<arguments.length;i++){var a=arguments[i];a&&(o=s(o,n(a)))}return o}function n(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return r.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var i="";for(var a in o)t.call(o,a)&&o[a]&&(i=s(i,a));return i}function s(o,i){return i?o?o+" "+i:o+i:o}e.exports?(r.default=r,e.exports=r):window.classNames=r})()})(Ps);var ra=Ps.exports;const pe=hn(ra);var hr=(e=>(e[e.Focus=0]="Focus",e[e.FocusWithin=1]="FocusWithin",e))(hr||{});const $r=(e=1)=>d.useMemo(()=>pe("dark:bsc-ring-mono-light-2 dark:bsc-ring-offset-mono-dark-1",{"focus-within:bsc-ring focus-within:bsc-ring-primary-2 focus-within:bsc-ring-offset-2 focus-within:bsc-ring-opacity-50":e===1,"focus:bsc-ring focus:bsc-ring-primary-2 focus:bsc-ring-offset-2 focus:bsc-ring-opacity-50":e===0}),[e]),na=(e,t)=>{const r=d.useRef(null),{buttonType:n,buttonStyle:s="flat",type:o="button",disabled:i=!1,form:a,fullWidth:u=!1,onClick:f,className:h,children:g}=e,x=()=>{f==null||f()},v=()=>{var j;(j=r.current)==null||j.click()};d.useImperativeHandle(t,()=>({click:v}));const T=$r(hr.Focus),I=pe("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",T,{"bsc-w-full":u,"bc-disabled bsc-bg-gray-3 bsc-text-gray-2 bsc-pointer-events-none":i,"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 p.jsx("button",{ref:r,type:o,onClick:x,disabled:i,form:a,className:I,children:g})},ot=d.forwardRef(na);var mn={exports:{}},pr={};/**
|
|
37
|
+
* @license React
|
|
38
|
+
* react-jsx-runtime.production.min.js
|
|
39
|
+
*
|
|
40
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
41
|
+
*
|
|
42
|
+
* This source code is licensed under the MIT license found in the
|
|
43
|
+
* LICENSE file in the root directory of this source tree.
|
|
44
|
+
*/var Ss;function sa(){if(Ss)return pr;Ss=1;var e=d,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function i(a,u,f){var h,g={},x=null,v=null;f!==void 0&&(x=""+f),u.key!==void 0&&(x=""+u.key),u.ref!==void 0&&(v=u.ref);for(h in u)n.call(u,h)&&!o.hasOwnProperty(h)&&(g[h]=u[h]);if(a&&a.defaultProps)for(h in u=a.defaultProps,u)g[h]===void 0&&(g[h]=u[h]);return{$$typeof:t,type:a,key:x,ref:v,props:g,_owner:s.current}}return pr.Fragment=r,pr.jsx=i,pr.jsxs=i,pr}var Fr={};/**
|
|
45
|
+
* @license React
|
|
46
|
+
* react-jsx-runtime.development.js
|
|
47
|
+
*
|
|
48
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
49
|
+
*
|
|
50
|
+
* This source code is licensed under the MIT license found in the
|
|
51
|
+
* LICENSE file in the root directory of this source tree.
|
|
52
|
+
*/var Ts;function oa(){return Ts||(Ts=1,process.env.NODE_ENV!=="production"&&function(){var e=d,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),a=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),v=Symbol.for("react.offscreen"),T=Symbol.iterator,I="@@iterator";function j(l){if(l===null||typeof l!="object")return null;var c=T&&l[T]||l[I];return typeof c=="function"?c:null}var E=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function D(l){{for(var c=arguments.length,m=new Array(c>1?c-1:0),w=1;w<c;w++)m[w-1]=arguments[w];Q("error",l,m)}}function Q(l,c,m){{var w=E.ReactDebugCurrentFrame,$=w.getStackAddendum();$!==""&&(c+="%s",m=m.concat([$]));var Z=m.map(function(G){return String(G)});Z.unshift("Warning: "+c),Function.prototype.apply.call(console[l],console,Z)}}var U=!1,y=!1,F=!1,k=!1,q=!1,z;z=Symbol.for("react.module.reference");function oe(l){return!!(typeof l=="string"||typeof l=="function"||l===n||l===o||q||l===s||l===f||l===h||k||l===v||U||y||F||typeof l=="object"&&l!==null&&(l.$$typeof===x||l.$$typeof===g||l.$$typeof===i||l.$$typeof===a||l.$$typeof===u||l.$$typeof===z||l.getModuleId!==void 0))}function ce(l,c,m){var w=l.displayName;if(w)return w;var $=c.displayName||c.name||"";return $!==""?m+"("+$+")":m}function ne(l){return l.displayName||"Context"}function M(l){if(l==null)return null;if(typeof l.tag=="number"&&D("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case n:return"Fragment";case r:return"Portal";case o:return"Profiler";case s:return"StrictMode";case f:return"Suspense";case h:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case a:var c=l;return ne(c)+".Consumer";case i:var m=l;return ne(m._context)+".Provider";case u:return ce(l,l.render,"ForwardRef");case g:var w=l.displayName||null;return w!==null?w:M(l.type)||"Memo";case x:{var $=l,Z=$._payload,G=$._init;try{return M(G(Z))}catch{return null}}}return null}var H=Object.assign,L=0,O,J,R,ge,S,N,C;function P(){}P.__reactDisabledLog=!0;function V(){{if(L===0){O=console.log,J=console.info,R=console.warn,ge=console.error,S=console.group,N=console.groupCollapsed,C=console.groupEnd;var l={configurable:!0,enumerable:!0,value:P,writable:!0};Object.defineProperties(console,{info:l,log:l,warn:l,error:l,group:l,groupCollapsed:l,groupEnd:l})}L++}}function X(){{if(L--,L===0){var l={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:H({},l,{value:O}),info:H({},l,{value:J}),warn:H({},l,{value:R}),error:H({},l,{value:ge}),group:H({},l,{value:S}),groupCollapsed:H({},l,{value:N}),groupEnd:H({},l,{value:C})})}L<0&&D("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Y=E.ReactCurrentDispatcher,B;function K(l,c,m){{if(B===void 0)try{throw Error()}catch($){var w=$.stack.trim().match(/\n( *(at )?)/);B=w&&w[1]||""}return`
|
|
53
|
+
`+B+l}}var re=!1,_;{var ie=typeof WeakMap=="function"?WeakMap:Map;_=new ie}function A(l,c){if(!l||re)return"";{var m=_.get(l);if(m!==void 0)return m}var w;re=!0;var $=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Z;Z=Y.current,Y.current=null,V();try{if(c){var G=function(){throw Error()};if(Object.defineProperty(G.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(G,[])}catch(Ne){w=Ne}Reflect.construct(l,[],G)}else{try{G.call()}catch(Ne){w=Ne}l.call(G.prototype)}}else{try{throw Error()}catch(Ne){w=Ne}l()}}catch(Ne){if(Ne&&w&&typeof Ne.stack=="string"){for(var W=Ne.stack.split(`
|
|
54
|
+
`),te=w.stack.split(`
|
|
55
|
+
`),de=W.length-1,ae=te.length-1;de>=1&&ae>=0&&W[de]!==te[ae];)ae--;for(;de>=1&&ae>=0;de--,ae--)if(W[de]!==te[ae]){if(de!==1||ae!==1)do if(de--,ae--,ae<0||W[de]!==te[ae]){var me=`
|
|
56
|
+
`+W[de].replace(" at new "," at ");return l.displayName&&me.includes("<anonymous>")&&(me=me.replace("<anonymous>",l.displayName)),typeof l=="function"&&_.set(l,me),me}while(de>=1&&ae>=0);break}}}finally{re=!1,Y.current=Z,X(),Error.prepareStackTrace=$}var Ae=l?l.displayName||l.name:"",ze=Ae?K(Ae):"";return typeof l=="function"&&_.set(l,ze),ze}function De(l,c,m){return A(l,!1)}function Ge(l){var c=l.prototype;return!!(c&&c.isReactComponent)}function $e(l,c,m){if(l==null)return"";if(typeof l=="function")return A(l,Ge(l));if(typeof l=="string")return K(l);switch(l){case f:return K("Suspense");case h:return K("SuspenseList")}if(typeof l=="object")switch(l.$$typeof){case u:return De(l.render);case g:return $e(l.type,c,m);case x:{var w=l,$=w._payload,Z=w._init;try{return $e(Z($),c,m)}catch{}}}return""}var Be=Object.prototype.hasOwnProperty,ft={},rt=E.ReactDebugCurrentFrame;function Ue(l){if(l){var c=l._owner,m=$e(l.type,l._source,c?c.type:null);rt.setExtraStackFrame(m)}else rt.setExtraStackFrame(null)}function tr(l,c,m,w,$){{var Z=Function.call.bind(Be);for(var G in l)if(Z(l,G)){var W=void 0;try{if(typeof l[G]!="function"){var te=Error((w||"React class")+": "+m+" type `"+G+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof l[G]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw te.name="Invariant Violation",te}W=l[G](c,G,w,m,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(de){W=de}W&&!(W instanceof Error)&&(Ue($),D("%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).",w||"React class",m,G,typeof W),Ue(null)),W instanceof Error&&!(W.message in ft)&&(ft[W.message]=!0,Ue($),D("Failed %s type: %s",m,W.message),Ue(null))}}}var rr=Array.isArray;function nt(l){return rr(l)}function nr(l){{var c=typeof Symbol=="function"&&Symbol.toStringTag,m=c&&l[Symbol.toStringTag]||l.constructor.name||"Object";return m}}function sr(l){try{return It(l),!1}catch{return!0}}function It(l){return""+l}function dt(l){if(sr(l))return D("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",nr(l)),It(l)}var Ze=E.ReactCurrentOwner,Mr={key:!0,ref:!0,__self:!0,__source:!0},st,jt;function or(l){if(Be.call(l,"ref")){var c=Object.getOwnPropertyDescriptor(l,"ref").get;if(c&&c.isReactWarning)return!1}return l.ref!==void 0}function Rr(l){if(Be.call(l,"key")){var c=Object.getOwnPropertyDescriptor(l,"key").get;if(c&&c.isReactWarning)return!1}return l.key!==void 0}function ir(l,c){typeof l.ref=="string"&&Ze.current}function ar(l,c){{var m=function(){st||(st=!0,D("%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)",c))};m.isReactWarning=!0,Object.defineProperty(l,"key",{get:m,configurable:!0})}}function ln(l,c){{var m=function(){jt||(jt=!0,D("%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)",c))};m.isReactWarning=!0,Object.defineProperty(l,"ref",{get:m,configurable:!0})}}var cr=function(l,c,m,w,$,Z,G){var W={$$typeof:t,type:l,key:c,ref:m,props:G,_owner:Z};return W._store={},Object.defineProperty(W._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(W,"_self",{configurable:!1,enumerable:!1,writable:!1,value:w}),Object.defineProperty(W,"_source",{configurable:!1,enumerable:!1,writable:!1,value:$}),Object.freeze&&(Object.freeze(W.props),Object.freeze(W)),W};function Mt(l,c,m,w,$){{var Z,G={},W=null,te=null;m!==void 0&&(dt(m),W=""+m),Rr(c)&&(dt(c.key),W=""+c.key),or(c)&&(te=c.ref,ir(c));for(Z in c)Be.call(c,Z)&&!Mr.hasOwnProperty(Z)&&(G[Z]=c[Z]);if(l&&l.defaultProps){var de=l.defaultProps;for(Z in de)G[Z]===void 0&&(G[Z]=de[Z])}if(W||te){var ae=typeof l=="function"?l.displayName||l.name||"Unknown":l;W&&ar(G,ae),te&&ln(G,ae)}return cr(l,W,te,$,w,Ze.current,G)}}var ee=E.ReactCurrentOwner,le=E.ReactDebugCurrentFrame;function Me(l){if(l){var c=l._owner,m=$e(l.type,l._source,c?c.type:null);le.setExtraStackFrame(m)}else le.setExtraStackFrame(null)}var Qe;Qe=!1;function ht(l){return typeof l=="object"&&l!==null&&l.$$typeof===t}function yt(){{if(ee.current){var l=M(ee.current.type);if(l)return`
|
|
57
|
+
|
|
58
|
+
Check the render method of \``+l+"`."}return""}}function Rt(l){return""}var At={};function Lt(l){{var c=yt();if(!c){var m=typeof l=="string"?l:l.displayName||l.name;m&&(c=`
|
|
59
|
+
|
|
60
|
+
Check the top-level render call using <`+m+">.")}return c}}function $t(l,c){{if(!l._store||l._store.validated||l.key!=null)return;l._store.validated=!0;var m=Lt(c);if(At[m])return;At[m]=!0;var w="";l&&l._owner&&l._owner!==ee.current&&(w=" It was passed a child from "+M(l._owner.type)+"."),Me(l),D('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',m,w),Me(null)}}function St(l,c){{if(typeof l!="object")return;if(nt(l))for(var m=0;m<l.length;m++){var w=l[m];ht(w)&&$t(w,c)}else if(ht(l))l._store&&(l._store.validated=!0);else if(l){var $=j(l);if(typeof $=="function"&&$!==l.entries)for(var Z=$.call(l),G;!(G=Z.next()).done;)ht(G.value)&&$t(G.value,c)}}}function Ft(l){{var c=l.type;if(c==null||typeof c=="string")return;var m;if(typeof c=="function")m=c.propTypes;else if(typeof c=="object"&&(c.$$typeof===u||c.$$typeof===g))m=c.propTypes;else return;if(m){var w=M(c);tr(m,l.props,"prop",w,l)}else if(c.PropTypes!==void 0&&!Qe){Qe=!0;var $=M(c);D("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",$||"Unknown")}typeof c.getDefaultProps=="function"&&!c.getDefaultProps.isReactClassApproved&&D("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ur(l){{for(var c=Object.keys(l.props),m=0;m<c.length;m++){var w=c[m];if(w!=="children"&&w!=="key"){Me(l),D("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",w),Me(null);break}}l.ref!==null&&(Me(l),D("Invalid attribute `ref` supplied to `React.Fragment`."),Me(null))}}var fn={};function Ar(l,c,m,w,$,Z){{var G=oe(l);if(!G){var W="";(l===void 0||typeof l=="object"&&l!==null&&Object.keys(l).length===0)&&(W+=" 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 te=Rt();te?W+=te:W+=yt();var de;l===null?de="null":nt(l)?de="array":l!==void 0&&l.$$typeof===t?(de="<"+(M(l.type)||"Unknown")+" />",W=" Did you accidentally export a JSX literal instead of a component?"):de=typeof l,D("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",de,W)}var ae=Mt(l,c,m,$,Z);if(ae==null)return ae;if(G){var me=c.children;if(me!==void 0)if(w)if(nt(me)){for(var Ae=0;Ae<me.length;Ae++)St(me[Ae],l);Object.freeze&&Object.freeze(me)}else D("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 St(me,l)}if(Be.call(c,"key")){var ze=M(l),Ne=Object.keys(c).filter(function(bs){return bs!=="key"}),Fe=Ne.length>0?"{key: someKey, "+Ne.join(": ..., ")+": ...}":"{key: someKey}";if(!fn[ze+Fe]){var Lr=Ne.length>0?"{"+Ne.join(": ..., ")+": ...}":"{}";D(`A props object containing a "key" prop is being spread into JSX:
|
|
61
|
+
let props = %s;
|
|
62
|
+
<%s {...props} />
|
|
63
|
+
React keys must be passed directly to JSX without using spread:
|
|
64
|
+
let props = %s;
|
|
65
|
+
<%s key={someKey} {...props} />`,Fe,ze,Lr,ze),fn[ze+Fe]=!0}}return l===n?ur(ae):Ft(ae),ae}}function dn(l,c,m){return Ar(l,c,m,!0)}function ps(l,c,m){return Ar(l,c,m,!1)}var ms=ps,gs=dn;Fr.Fragment=n,Fr.jsx=ms,Fr.jsxs=gs}()),Fr}var Es;function ia(){return Es||(Es=1,process.env.NODE_ENV==="production"?mn.exports=sa():mn.exports=oa()),mn.exports}var it=ia();const Hr=e=>e==null?!1:typeof e=="object",_s=e=>e instanceof Date,Cs=e=>typeof e=="function",ks=e=>{const t=typeof e;return t==="string"||t==="number"||t==="boolean"||t==="bigint"},gn=e=>{if(!Hr(e))return e;const t={},r=Object.keys(e);for(let n=0,s=r.length;n<s;n++){const o=r[n],i=e[o];ks(i)||Cs(i)?t[o]=i:_s(i)?t[o]=new Date(i.getTime()):Array.isArray(i)?t[o]=bn(i):Hr(i)&&(t[o]=gn(i))}return t},bn=e=>{let t=e.length;const r=new Array(t);for(;t--!==0;){const n=e[t];ks(n)||Cs(n)?r[t]=n:_s(n)?r[t]=new Date(n.getTime()):Hr(n)&&!Array.isArray(n)?r[t]=gn(n):Array.isArray(n)?r[t]=bn(n):r[t]=n}return r},aa=e=>Hr(e)?Array.isArray(e)?bn(e):gn(e):e;function ca(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ua=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,s,o;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!e(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(o=Object.keys(t),n=o.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[s]))return!1;for(s=n;s--!==0;){var i=o[s];if(!e(t[i],r[i]))return!1}return!0}return t!==t&&r!==r};const Os=ca(ua);function la(e,t){for(let r=e.length;r--!==0;)if(!Os(e[r],t[r]))return!0;return!1}const fa=(e,t)=>{const r=d.useRef([]),n=r.current.length>0&&r.current[0]&&la(r.current[0],t);return(r.current.length===0||n)&&(r.current=[aa(t),e()]),r.current[1]},Ds=e=>{const t=d.useRef();let r=!1;t.current!==void 0&&(r=!Os(t.current,e));const n={changed:r,previousValue:t.current};return t.current=e,n},da=e=>typeof e=="function",ha=e=>{const[t,r]=d.useState({value:e,initial:!0}),n=d.useRef(e);return[t,s=>{if(!da(s))r({value:s,initial:!1});else{const o=s(n.current);n.current=o,r({value:o,initial:!1})}}]},pa=e=>{const[t,r]=ha(e),n=d.useRef({value:e,initial:!0});return n.current!==t&&(n.current=t),[t,r,n]};var mr,Ns;mr={__e:function(e,t,r,n){for(var s,o,i;t=t.__;)if((s=t.__c)&&!s.__)try{if((o=s.constructor)&&o.getDerivedStateFromError!=null&&(s.setState(o.getDerivedStateFromError(e)),i=s.__d),s.componentDidCatch!=null&&(s.componentDidCatch(e,n||{}),i=s.__d),i)return s.__E=s}catch(a){e=a}throw e}},Ns=function(e){return e!=null&&e.constructor==null},typeof Promise=="function"&&Promise.prototype.then.bind(Promise.resolve());var yn,Ke,vn,Is,js=0,Ms=[],Re=mr,Rs=Re.__b,As=Re.__r,Ls=Re.diffed,$s=Re.__c,Fs=Re.unmount,Hs=Re.__;function ma(e,t){Re.__h&&Re.__h(Ke,e,js||t),js=0;var r=Ke.__H||(Ke.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Ys(e,t){var r=ma(yn++,7);return ya(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function ga(){for(var e;e=Ms.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Yr),e.__H.__h.forEach(xn),e.__H.__h=[]}catch(t){e.__H.__h=[],Re.__e(t,e.__v)}}Re.__b=function(e){Ke=null,Rs&&Rs(e)},Re.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Hs&&Hs(e,t)},Re.__r=function(e){As&&As(e),yn=0;var t=(Ke=e.__c).__H;t&&(vn===Ke?(t.__h=[],Ke.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(Yr),t.__h.forEach(xn),t.__h=[],yn=0)),vn=Ke},Re.diffed=function(e){Ls&&Ls(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Ms.push(t)!==1&&Is===Re.requestAnimationFrame||((Is=Re.requestAnimationFrame)||ba)(ga)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),vn=Ke=null},Re.__c=function(e,t){t.some(function(r){try{r.__h.forEach(Yr),r.__h=r.__h.filter(function(n){return!n.__||xn(n)})}catch(n){t.some(function(s){s.__h&&(s.__h=[])}),t=[],Re.__e(n,r.__v)}}),$s&&$s(e,t)},Re.unmount=function(e){Fs&&Fs(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{Yr(n)}catch(s){t=s}}),r.__H=void 0,t&&Re.__e(t,r.__v))};var Vs=typeof requestAnimationFrame=="function";function ba(e){var t,r=function(){clearTimeout(n),Vs&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);Vs&&(t=requestAnimationFrame(r))}function Yr(e){var t=Ke,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),Ke=t}function xn(e){var t=Ke;e.__c=e.__(),Ke=t}function ya(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}var va=Symbol.for("preact-signals");function Vr(){if(vt>1)vt--;else{for(var e,t=!1;gr!==void 0;){var r=gr;for(gr=void 0,wn++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&Us(r))try{r.c()}catch(s){t||(e=s,t=!0)}r=n}}if(wn=0,vt--,t)throw e}}function xa(e){if(vt>0)return e();vt++;try{return e()}finally{Vr()}}var we=void 0,gr=void 0,vt=0,wn=0,Wr=0;function Ws(e){if(we!==void 0){var t=e.n;if(t===void 0||t.t!==we)return t={i:0,S:e,p:we.s,n:void 0,t:we,e:void 0,x:void 0,r:t},we.s!==void 0&&(we.s.n=t),we.s=t,e.n=t,32&we.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=we.s,t.n=void 0,we.s.n=t,we.s=t),t}}function He(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}He.prototype.brand=va,He.prototype.h=function(){return!0},He.prototype.S=function(e){this.t!==e&&e.e===void 0&&(e.x=this.t,this.t!==void 0&&(this.t.e=e),this.t=e)},He.prototype.U=function(e){if(this.t!==void 0){var t=e.e,r=e.x;t!==void 0&&(t.x=r,e.e=void 0),r!==void 0&&(r.e=t,e.x=void 0),e===this.t&&(this.t=r)}},He.prototype.subscribe=function(e){var t=this;return yr(function(){var r=t.value,n=we;we=void 0;try{e(r)}finally{we=n}})},He.prototype.valueOf=function(){return this.value},He.prototype.toString=function(){return this.value+""},He.prototype.toJSON=function(){return this.value},He.prototype.peek=function(){var e=we;we=void 0;try{return this.value}finally{we=e}},Object.defineProperty(He.prototype,"value",{get:function(){var e=Ws(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(wn>100)throw new Error("Cycle detected");this.v=e,this.i++,Wr++,vt++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Vr()}}}});function Bs(e){return new He(e)}function Us(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function zs(e){for(var t=e.s;t!==void 0;t=t.n){var r=t.S.n;if(r!==void 0&&(t.r=r),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function qs(e){for(var t=e.s,r=void 0;t!==void 0;){var n=t.p;t.i===-1?(t.S.U(t),n!==void 0&&(n.n=t.n),t.n!==void 0&&(t.n.p=n)):r=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=n}e.s=r}function Ht(e){He.call(this,void 0),this.x=e,this.s=void 0,this.g=Wr-1,this.f=4}(Ht.prototype=new He).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Wr))return!0;if(this.g=Wr,this.f|=1,this.i>0&&!Us(this))return this.f&=-2,!0;var e=we;try{zs(this),we=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(r){this.v=r,this.f|=16,this.i++}return we=e,qs(this),this.f&=-2,!0},Ht.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}He.prototype.S.call(this,e)},Ht.prototype.U=function(e){if(this.t!==void 0&&(He.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}},Ht.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(Ht.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Ws(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function Ks(e){return new Ht(e)}function Gs(e){var t=e.u;if(e.u=void 0,typeof t=="function"){vt++;var r=we;we=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,Pn(e),n}finally{we=r,Vr()}}}function Pn(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Gs(e)}function wa(e){if(we!==this)throw new Error("Out-of-order effect");qs(this),we=e,this.f&=-2,8&this.f&&Pn(this),Vr()}function br(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}br.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}},br.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Gs(this),zs(this),vt++;var e=we;return we=this,wa.bind(this,e)},br.prototype.N=function(){2&this.f||(this.f|=2,this.o=gr,gr=this)},br.prototype.d=function(){this.f|=8,1&this.f||Pn(this)};function yr(e){var t=new br(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}var Zs,Sn,Qs=[];yr(function(){Zs=this.N})();function Yt(e,t){mr[e]=t.bind(null,mr[e]||function(){})}function Br(e){Sn&&Sn(),Sn=e&&e.S()}function Xs(e){var t=this,r=e.data,n=Sa(r);n.value=r;var s=Ys(function(){for(var a=t,u=t.__v;u=u.__;)if(u.__c){u.__c.__$f|=4;break}var f=Ks(function(){var v=n.value.value;return v===0?0:v===!0?"":v||""}),h=Ks(function(){return!Array.isArray(f.value)&&!Ns(f.value)}),g=yr(function(){if(this.N=Js,h.value){var v=f.value;a.__v&&a.__v.__e&&a.__v.__e.nodeType===3&&(a.__v.__e.data=v)}}),x=t.__$u.d;return t.__$u.d=function(){g(),x.call(this)},[h,f]},[]),o=s[0],i=s[1];return o.value?i.peek():i.value}Xs.displayName="_st",Object.defineProperties(He.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Xs},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),Yt("__b",function(e,t){if(typeof t.type=="string"){var r,n=t.props;for(var s in n)if(s!=="children"){var o=n[s];o instanceof He&&(r||(t.__np=r={}),r[s]=o,n[s]=o.peek())}}e(t)}),Yt("__r",function(e,t){Br();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(s){var o;return yr(function(){o=this}),o.c=function(){n.__$f|=1,n.setState({})},o}())),Br(r),e(t)}),Yt("__e",function(e,t,r,n){Br(),e(t,r,n)}),Yt("diffed",function(e,t){Br();var r;if(typeof t.type=="string"&&(r=t.__e)){var n=t.__np,s=t.props;if(n){var o=r.U;if(o)for(var i in o){var a=o[i];a!==void 0&&!(i in n)&&(a.d(),o[i]=void 0)}else o={},r.U=o;for(var u in n){var f=o[u],h=n[u];f===void 0?(f=Pa(r,u,h,s),o[u]=f):f.o(h,s)}}}e(t)});function Pa(e,t,r,n){var s=t in e&&e.ownerSVGElement===void 0,o=Bs(r);return{o:function(i,a){o.value=i,n=a},d:yr(function(){this.N=Js;var i=o.value.value;n[t]!==i&&(n[t]=i,s?e[t]=i:i?e.setAttribute(t,i):e.removeAttribute(t))})}}Yt("unmount",function(e,t){if(typeof t.type=="string"){var r=t.__e;if(r){var n=r.U;if(n){r.U=void 0;for(var s in n){var o=n[s];o&&o.d()}}}}else{var i=t.__c;if(i){var a=i.__$u;a&&(i.__$u=void 0,a.d())}}e(t)}),Yt("__h",function(e,t,r,n){(n<3||n===9)&&(t.__$f|=2),e(t,r,n)});function Sa(e){return Ys(function(){return Bs(e)},[])}var Ta=function(e){queueMicrotask(function(){queueMicrotask(e)})};function Ea(){xa(function(){for(var e;e=Qs.shift();)Zs.call(e)})}function Js(){Qs.push(this)===1&&(mr.requestAnimationFrame||Ta)(Ea)}const _a=d.createContext(void 0),Ca=()=>d.useContext(_a),ka=({id:e,name:t,value:r,type:n,checked:s,readOnly:o,className:i})=>it.jsx("input",{id:e,name:t,value:r,type:n,checked:s,onChange:()=>{},readOnly:o,disabled:o,className:i}),Oa=({type:e,props:t,renderProps:r,signalName:n,onSignalRetrieved:s,children:o,className:i})=>{const a=Ca(),{id:u,name:f}=fa(()=>{const h=t;return{id:h.id,name:h.name}},[t]);return d.useEffect(()=>{a&&n&&a[n]&&s&&s(a[n])},[a]),it.jsxs(it.Fragment,{children:[u&&f&&e&&it.jsx(ka,{id:u,name:f,type:e,className:i,...t}),o&&o(r)]})},eo=d.createContext(void 0),to=()=>d.useContext(eo),Da=(e,t)=>{const{name:r,value:n,checked:s=!1,partial:o=!1,onChange:i,children:a,labelStyles:u,className:f}=e,h=to(),g=d.useId(),[x,v,T]=pa({checked:!1,partial:!1}),I=Ds(s),j=Ds(o),E={id:(h==null?void 0:h.sharedId)||e.id||g,...e,...x.value};d.useEffect(()=>{if(x.initial)v({checked:o?!0:s,partial:o});else{const y=I.changed?s:x.value.checked,F=j.changed?o:x.value.partial;v({checked:F?!0:y,partial:F})}},[s,o]);const D=y=>{var F;const k=((F=T.current)==null?void 0:F.value.partial)===!0?!0:y.target.checked;v({checked:k,partial:!1}),i==null||i({originalEvent:y,name:r||y.target.name,value:n,checked:k})},Q=y=>{var F;const k={checked:y?!0:((F=T.current)==null?void 0:F.value.checked)||!1,partial:y};v(k)},U=y=>{v({checked:y,partial:!1})};return d.useImperativeHandle(t,()=>({setPartiallyChecked:Q,setChecked:U})),it.jsx("label",{className:u,onChange:y=>D(y),children:it.jsx(Oa,{id:g,name:r,type:"checkbox",props:E,renderProps:x.value,className:f,children:a})})},Na=d.memo(d.forwardRef(Da)),Ia=({children:e})=>{const t=d.useId(),r=d.useMemo(()=>({sharedId:t}),[t]);return it.jsx(eo.Provider,{value:r,children:e})},ja=({label:e,htmlFor:t,className:r})=>{const n=to(),s=d.useMemo(()=>(n==null?void 0:n.sharedId)||t,[n==null?void 0:n.sharedId,t]);return it.jsx("label",{htmlFor:s,className:r,children:e})};var ro={exports:{}};/*!
|
|
66
|
+
Copyright (c) 2018 Jed Watson.
|
|
67
|
+
Licensed under the MIT License (MIT), see
|
|
68
|
+
http://jedwatson.github.io/classnames
|
|
69
|
+
*/var no;function Ma(){return no||(no=1,function(e){(function(){var t={}.hasOwnProperty;function r(){for(var o="",i=0;i<arguments.length;i++){var a=arguments[i];a&&(o=s(o,n(a)))}return o}function n(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return r.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var i="";for(var a in o)t.call(o,a)&&o[a]&&(i=s(i,a));return i}function s(o,i){return i?o?o+" "+i:o+i:o}e.exports?(r.default=r,e.exports=r):window.classNames=r})()}(ro)),ro.exports}Ma();const Ra=({intersectionObserver:e,resizeObserver:t,page:r,height:n,children:s})=>{const o=d.useRef();d.useEffect(()=>()=>{o.current&&(e==null||e.unobserve(o.current),t==null||t.unobserve(o.current))},[]),d.useEffect(()=>(o.current&&(e==null||e.observe(o.current)),()=>{o.current&&e&&e.unobserve(o.current)}),[e]);const i=u=>{o.current&&(e==null||e.unobserve(o.current),t==null||t.unobserve(o.current)),e==null||e.observe(u),t==null||t.observe(u),o.current=u},a=n?{height:`${n}px`}:{};return it.jsx("div",{"data-page":r,"data-name":"page",style:a,ref:u=>u&&i(u),children:s})};d.memo(Ra);const Aa=({intersectionObserver:e,page:t})=>{const r=d.useRef();d.useEffect(()=>()=>{r.current&&(e==null||e.unobserve(r.current))},[]);const n=s=>{r.current&&(e==null||e.unobserve(r.current)),e==null||e.observe(s),r.current=s};return it.jsx("div",{"data-page":t,"data-name":"marker",ref:s=>s&&n(s)})};d.memo(Aa);const Tn=e=>{const[t,r]=d.useState(!0),n=ws();return d.useEffect(()=>{e!==void 0?r(e):n&&n.useAnimations!==void 0&&r(n.useAnimations)},[n,e]),t},pt=({label:e,htmlFor:t,readOnly:r=!1,className:n})=>{const s=pe("bc-label",{"bsc-text-black dark:bsc-text-mono-light-1":!r,"bc-read-only bsc-text-gray-4 dark:bsc-text-mono-light-3 bsc-pointer-events-none":r},n);return p.jsx(ja,{label:e,htmlFor:t,className:s})},La=(e,t)=>{const{name:r,label:n,value:s,readOnly:o=!1,checked:i=!1,partial:a=!1,labelLocation:u=qe.Right,className:f,useAnimation:h,onChange:g}=e,x=Tn(h),v=pe("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":o},f),T=pe("bc-checkbox-label bsc-cursor-pointer",{"bsc-ml-2":u===qe.Right,"bsc-mr-2":u===qe.Left}),I=$r(hr.FocusWithin),j=pe("bc-checkbox-outer bsc-relative bsc-rounded *:bsc-block *:bsc-size-[21px]",{"bsc-checkbox-animate":!o&&x,"bc-read-only bsc-checkbox-no-animate":o||!o&&!x},I),E=pe("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]":x,"bsc-checkbox":!o,"bc-read-only bsc-checkbox-read-only":o}),D=pe("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":!o,"bc-read-only bsc-fill-primary-4 dark:bsc-fill-mono-light-3":o});return p.jsx(Ia,{children:p.jsxs("div",{className:v,children:[n&&u===qe.Left&&p.jsx(pt,{label:n,readOnly:o,className:T}),p.jsx(Na,{ref:t,name:r,value:s,checked:i,partial:a,readOnly:o,className:E,labelStyles:j,onChange:g,children:({partial:Q})=>p.jsx("svg",{viewBox:"0 0 21 21",className:D,children:Q?p.jsx("polyline",{points:"6 10.5 16 10.5"}):p.jsx("polyline",{points:"5 10.75 8.5 14.25 16 6"})})}),n&&u===qe.Right&&p.jsx(pt,{label:n,readOnly:o,className:T})]})})},so=d.memo(d.forwardRef(La)),Ur=e=>e==null?!1:typeof e=="object",oo=e=>e instanceof Date,io=e=>typeof e=="function",ao=e=>{const t=typeof e;return t==="string"||t==="number"||t==="boolean"||t==="bigint"},En=e=>{if(!Ur(e))return e;const t={},r=Object.keys(e);for(let n=0,s=r.length;n<s;n++){const o=r[n],i=e[o];ao(i)||io(i)?t[o]=i:oo(i)?t[o]=new Date(i.getTime()):Array.isArray(i)?t[o]=_n(i):Ur(i)&&(t[o]=En(i))}return t},_n=e=>{let t=e.length;const r=new Array(t);for(;t--!==0;){const n=e[t];ao(n)||io(n)?r[t]=n:oo(n)?r[t]=new Date(n.getTime()):Ur(n)&&!Array.isArray(n)?r[t]=En(n):Array.isArray(n)?r[t]=_n(n):r[t]=n}return r},$a=e=>Ur(e)?Array.isArray(e)?_n(e):En(e):e;function Fa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ha=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,s,o;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!e(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(o=Object.keys(t),n=o.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[s]))return!1;for(s=n;s--!==0;){var i=o[s];if(!e(t[i],r[i]))return!1}return!0}return t!==t&&r!==r};const Ya=Fa(Ha);function Va(e,t){for(let r=e.length;r--!==0;)if(!Ya(e[r],t[r]))return!0;return!1}const Cn=(e,t)=>{const r=d.useRef([]),n=r.current.length>0&&r.current[0]&&Va(r.current[0],t);return(r.current.length===0||n)&&(r.current=[$a(t),e()]),r.current[1]},Wa=e=>{const[t,r]=d.useState(e),n=d.useRef(e);return n.current!==t&&(n.current=t),[t,r,n]},Ba=({name:e,label:t,value:r,data:n,textField:s,valueField:o,readOnly:i=!1,orientation:a=Ve.Vertical,className:u,onChange:f})=>{const[h,g]=d.useState([]),x=Cn(()=>n,[n]);d.useEffect(()=>{g(r??[])},[r]);const v=D=>{const{value:Q,checked:U}=D;let y;U?y=[...h,Q]:y=h.filter(F=>F!==Q),g(y),f==null||f({name:e,value:y})},T=(D,Q)=>p.jsx(so,{name:e,label:D[s],value:D[o],checked:h.some(U=>U===D[o]),readOnly:i,onChange:U=>U&&v(U),className:"bsc-mr-3"},`${e}_checkbox_${Q}`),I=pe("bsc-flex bsc-flex-col bsc-gap-1",u),j=pe("bsc-flex bsc-gap-1",{"bsc-flex-col":a===Ve.Vertical}),E=D=>p.jsx("div",{className:j,children:D.map(T)});return p.jsxs("div",{className:I,children:[t&&p.jsx(pt,{label:t,readOnly:i}),x&&E(x)]})},Ua=d.memo(Ba);var za=typeof global=="object"&&global&&global.Object===Object&&global;const co=za;var qa=typeof self=="object"&&self&&self.Object===Object&&self,Ka=co||qa||Function("return this")();const et=Ka;var Ga=et.Symbol;const Vt=Ga;var uo=Object.prototype,Za=uo.hasOwnProperty,Qa=uo.toString,vr=Vt?Vt.toStringTag:void 0;function Xa(e){var t=Za.call(e,vr),r=e[vr];try{e[vr]=void 0;var n=!0}catch{}var s=Qa.call(e);return n&&(t?e[vr]=r:delete e[vr]),s}var Ja=Object.prototype,ec=Ja.toString;function tc(e){return ec.call(e)}var rc="[object Null]",nc="[object Undefined]",lo=Vt?Vt.toStringTag:void 0;function Wt(e){return e==null?e===void 0?nc:rc:lo&&lo in Object(e)?Xa(e):tc(e)}function Bt(e){return e!=null&&typeof e=="object"}var sc="[object Symbol]";function oc(e){return typeof e=="symbol"||Bt(e)&&Wt(e)==sc}var ic=Array.isArray;const kn=ic;var ac=/\s/;function cc(e){for(var t=e.length;t--&&ac.test(e.charAt(t)););return t}var uc=/^\s+/;function lc(e){return e&&e.slice(0,cc(e)+1).replace(uc,"")}function mt(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var fo=0/0,fc=/^[-+]0x[0-9a-f]+$/i,dc=/^0b[01]+$/i,hc=/^0o[0-7]+$/i,pc=parseInt;function ho(e){if(typeof e=="number")return e;if(oc(e))return fo;if(mt(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=mt(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=lc(e);var r=dc.test(e);return r||hc.test(e)?pc(e.slice(2),r?2:8):fc.test(e)?fo:+e}var mc="[object AsyncFunction]",gc="[object Function]",bc="[object GeneratorFunction]",yc="[object Proxy]";function po(e){if(!mt(e))return!1;var t=Wt(e);return t==gc||t==bc||t==mc||t==yc}var vc=et["__core-js_shared__"];const On=vc;var mo=function(){var e=/[^.]+$/.exec(On&&On.keys&&On.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function xc(e){return!!mo&&mo in e}var wc=Function.prototype,Pc=wc.toString;function Tt(e){if(e!=null){try{return Pc.call(e)}catch{}try{return e+""}catch{}}return""}var Sc=/[\\^$.*+?()[\]{}|]/g,Tc=/^\[object .+?Constructor\]$/,Ec=Function.prototype,_c=Object.prototype,Cc=Ec.toString,kc=_c.hasOwnProperty,Oc=RegExp("^"+Cc.call(kc).replace(Sc,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Dc(e){if(!mt(e)||xc(e))return!1;var t=po(e)?Oc:Tc;return t.test(Tt(e))}function Nc(e,t){return e==null?void 0:e[t]}function Et(e,t){var r=Nc(e,t);return Dc(r)?r:void 0}var Ic=Et(et,"WeakMap");const Dn=Ic;var go=Object.create,jc=function(){function e(){}return function(t){if(!mt(t))return{};if(go)return go(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();const Mc=jc;function Rc(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var Ac=function(){try{var e=Et(Object,"defineProperty");return e({},"",{}),e}catch{}}();const bo=Ac;function Lc(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}var $c=9007199254740991,Fc=/^(?:0|[1-9]\d*)$/;function Hc(e,t){var r=typeof e;return t=t??$c,!!t&&(r=="number"||r!="symbol"&&Fc.test(e))&&e>-1&&e%1==0&&e<t}function yo(e,t,r){t=="__proto__"&&bo?bo(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function vo(e,t){return e===t||e!==e&&t!==t}var Yc=Object.prototype,Vc=Yc.hasOwnProperty;function xo(e,t,r){var n=e[t];(!(Vc.call(e,t)&&vo(n,r))||r===void 0&&!(t in e))&&yo(e,t,r)}function zr(e,t,r,n){var s=!r;r||(r={});for(var o=-1,i=t.length;++o<i;){var a=t[o],u=n?n(r[a],e[a],a,r,e):void 0;u===void 0&&(u=e[a]),s?yo(r,a,u):xo(r,a,u)}return r}var Wc=9007199254740991;function wo(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Wc}function Po(e){return e!=null&&wo(e.length)&&!po(e)}var Bc=Object.prototype;function Nn(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Bc;return e===r}function Uc(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var zc="[object Arguments]";function So(e){return Bt(e)&&Wt(e)==zc}var To=Object.prototype,qc=To.hasOwnProperty,Kc=To.propertyIsEnumerable,Gc=So(function(){return arguments}())?So:function(e){return Bt(e)&&qc.call(e,"callee")&&!Kc.call(e,"callee")};const Zc=Gc;function Qc(){return!1}var Eo=typeof se=="object"&&se&&!se.nodeType&&se,_o=Eo&&typeof module=="object"&&module&&!module.nodeType&&module,Xc=_o&&_o.exports===Eo,Co=Xc?et.Buffer:void 0,Jc=Co?Co.isBuffer:void 0,eu=Jc||Qc;const ko=eu;var tu="[object Arguments]",ru="[object Array]",nu="[object Boolean]",su="[object Date]",ou="[object Error]",iu="[object Function]",au="[object Map]",cu="[object Number]",uu="[object Object]",lu="[object RegExp]",fu="[object Set]",du="[object String]",hu="[object WeakMap]",pu="[object ArrayBuffer]",mu="[object DataView]",gu="[object Float32Array]",bu="[object Float64Array]",yu="[object Int8Array]",vu="[object Int16Array]",xu="[object Int32Array]",wu="[object Uint8Array]",Pu="[object Uint8ClampedArray]",Su="[object Uint16Array]",Tu="[object Uint32Array]",Ee={};Ee[gu]=Ee[bu]=Ee[yu]=Ee[vu]=Ee[xu]=Ee[wu]=Ee[Pu]=Ee[Su]=Ee[Tu]=!0,Ee[tu]=Ee[ru]=Ee[pu]=Ee[nu]=Ee[mu]=Ee[su]=Ee[ou]=Ee[iu]=Ee[au]=Ee[cu]=Ee[uu]=Ee[lu]=Ee[fu]=Ee[du]=Ee[hu]=!1;function Eu(e){return Bt(e)&&wo(e.length)&&!!Ee[Wt(e)]}function In(e){return function(t){return e(t)}}var Oo=typeof se=="object"&&se&&!se.nodeType&&se,xr=Oo&&typeof module=="object"&&module&&!module.nodeType&&module,_u=xr&&xr.exports===Oo,jn=_u&&co.process,Cu=function(){try{var e=xr&&xr.require&&xr.require("util").types;return e||jn&&jn.binding&&jn.binding("util")}catch{}}();const Ut=Cu;var Do=Ut&&Ut.isTypedArray,ku=Do?In(Do):Eu;const Ou=ku;var Du=Object.prototype,Nu=Du.hasOwnProperty;function No(e,t){var r=kn(e),n=!r&&Zc(e),s=!r&&!n&&ko(e),o=!r&&!n&&!s&&Ou(e),i=r||n||s||o,a=i?Uc(e.length,String):[],u=a.length;for(var f in e)(t||Nu.call(e,f))&&!(i&&(f=="length"||s&&(f=="offset"||f=="parent")||o&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||Hc(f,u)))&&a.push(f);return a}function Io(e,t){return function(r){return e(t(r))}}var Iu=Io(Object.keys,Object);const ju=Iu;var Mu=Object.prototype,Ru=Mu.hasOwnProperty;function Au(e){if(!Nn(e))return ju(e);var t=[];for(var r in Object(e))Ru.call(e,r)&&r!="constructor"&&t.push(r);return t}function Mn(e){return Po(e)?No(e):Au(e)}function Lu(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var $u=Object.prototype,Fu=$u.hasOwnProperty;function Hu(e){if(!mt(e))return Lu(e);var t=Nn(e),r=[];for(var n in e)n=="constructor"&&(t||!Fu.call(e,n))||r.push(n);return r}function Rn(e){return Po(e)?No(e,!0):Hu(e)}var Yu=Et(Object,"create");const wr=Yu;function Vu(){this.__data__=wr?wr(null):{},this.size=0}function Wu(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Bu="__lodash_hash_undefined__",Uu=Object.prototype,zu=Uu.hasOwnProperty;function qu(e){var t=this.__data__;if(wr){var r=t[e];return r===Bu?void 0:r}return zu.call(t,e)?t[e]:void 0}var Ku=Object.prototype,Gu=Ku.hasOwnProperty;function Zu(e){var t=this.__data__;return wr?t[e]!==void 0:Gu.call(t,e)}var Qu="__lodash_hash_undefined__";function Xu(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=wr&&t===void 0?Qu:t,this}function _t(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}_t.prototype.clear=Vu,_t.prototype.delete=Wu,_t.prototype.get=qu,_t.prototype.has=Zu,_t.prototype.set=Xu;function Ju(){this.__data__=[],this.size=0}function qr(e,t){for(var r=e.length;r--;)if(vo(e[r][0],t))return r;return-1}var el=Array.prototype,tl=el.splice;function rl(e){var t=this.__data__,r=qr(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():tl.call(t,r,1),--this.size,!0}function nl(e){var t=this.__data__,r=qr(t,e);return r<0?void 0:t[r][1]}function sl(e){return qr(this.__data__,e)>-1}function ol(e,t){var r=this.__data__,n=qr(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function gt(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}gt.prototype.clear=Ju,gt.prototype.delete=rl,gt.prototype.get=nl,gt.prototype.has=sl,gt.prototype.set=ol;var il=Et(et,"Map");const Pr=il;function al(){this.size=0,this.__data__={hash:new _t,map:new(Pr||gt),string:new _t}}function cl(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Kr(e,t){var r=e.__data__;return cl(t)?r[typeof t=="string"?"string":"hash"]:r.map}function ul(e){var t=Kr(this,e).delete(e);return this.size-=t?1:0,t}function ll(e){return Kr(this,e).get(e)}function fl(e){return Kr(this,e).has(e)}function dl(e,t){var r=Kr(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function zt(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}zt.prototype.clear=al,zt.prototype.delete=ul,zt.prototype.get=ll,zt.prototype.has=fl,zt.prototype.set=dl;function jo(e,t){for(var r=-1,n=t.length,s=e.length;++r<n;)e[s+r]=t[r];return e}var hl=Io(Object.getPrototypeOf,Object);const Mo=hl;function pl(){this.__data__=new gt,this.size=0}function ml(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function gl(e){return this.__data__.get(e)}function bl(e){return this.__data__.has(e)}var yl=200;function vl(e,t){var r=this.__data__;if(r instanceof gt){var n=r.__data__;if(!Pr||n.length<yl-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new zt(n)}return r.set(e,t),this.size=r.size,this}function qt(e){var t=this.__data__=new gt(e);this.size=t.size}qt.prototype.clear=pl,qt.prototype.delete=ml,qt.prototype.get=gl,qt.prototype.has=bl,qt.prototype.set=vl;function xl(e,t){return e&&zr(t,Mn(t),e)}function wl(e,t){return e&&zr(t,Rn(t),e)}var Ro=typeof se=="object"&&se&&!se.nodeType&&se,Ao=Ro&&typeof module=="object"&&module&&!module.nodeType&&module,Pl=Ao&&Ao.exports===Ro,Lo=Pl?et.Buffer:void 0,$o=Lo?Lo.allocUnsafe:void 0;function Sl(e,t){if(t)return e.slice();var r=e.length,n=$o?$o(r):new e.constructor(r);return e.copy(n),n}function Tl(e,t){for(var r=-1,n=e==null?0:e.length,s=0,o=[];++r<n;){var i=e[r];t(i,r,e)&&(o[s++]=i)}return o}function Fo(){return[]}var El=Object.prototype,_l=El.propertyIsEnumerable,Ho=Object.getOwnPropertySymbols,Cl=Ho?function(e){return e==null?[]:(e=Object(e),Tl(Ho(e),function(t){return _l.call(e,t)}))}:Fo;const An=Cl;function kl(e,t){return zr(e,An(e),t)}var Ol=Object.getOwnPropertySymbols,Dl=Ol?function(e){for(var t=[];e;)jo(t,An(e)),e=Mo(e);return t}:Fo;const Yo=Dl;function Nl(e,t){return zr(e,Yo(e),t)}function Vo(e,t,r){var n=t(e);return kn(e)?n:jo(n,r(e))}function Il(e){return Vo(e,Mn,An)}function jl(e){return Vo(e,Rn,Yo)}var Ml=Et(et,"DataView");const Ln=Ml;var Rl=Et(et,"Promise");const $n=Rl;var Al=Et(et,"Set");const Fn=Al;var Wo="[object Map]",Ll="[object Object]",Bo="[object Promise]",Uo="[object Set]",zo="[object WeakMap]",qo="[object DataView]",$l=Tt(Ln),Fl=Tt(Pr),Hl=Tt($n),Yl=Tt(Fn),Vl=Tt(Dn),Ct=Wt;(Ln&&Ct(new Ln(new ArrayBuffer(1)))!=qo||Pr&&Ct(new Pr)!=Wo||$n&&Ct($n.resolve())!=Bo||Fn&&Ct(new Fn)!=Uo||Dn&&Ct(new Dn)!=zo)&&(Ct=function(e){var t=Wt(e),r=t==Ll?e.constructor:void 0,n=r?Tt(r):"";if(n)switch(n){case $l:return qo;case Fl:return Wo;case Hl:return Bo;case Yl:return Uo;case Vl:return zo}return t});const Hn=Ct;var Wl=Object.prototype,Bl=Wl.hasOwnProperty;function Ul(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&Bl.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var zl=et.Uint8Array;const Ko=zl;function Yn(e){var t=new e.constructor(e.byteLength);return new Ko(t).set(new Ko(e)),t}function ql(e,t){var r=t?Yn(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var Kl=/\w*$/;function Gl(e){var t=new e.constructor(e.source,Kl.exec(e));return t.lastIndex=e.lastIndex,t}var Go=Vt?Vt.prototype:void 0,Zo=Go?Go.valueOf:void 0;function Zl(e){return Zo?Object(Zo.call(e)):{}}function Ql(e,t){var r=t?Yn(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var Xl="[object Boolean]",Jl="[object Date]",ef="[object Map]",tf="[object Number]",rf="[object RegExp]",nf="[object Set]",sf="[object String]",of="[object Symbol]",af="[object ArrayBuffer]",cf="[object DataView]",uf="[object Float32Array]",lf="[object Float64Array]",ff="[object Int8Array]",df="[object Int16Array]",hf="[object Int32Array]",pf="[object Uint8Array]",mf="[object Uint8ClampedArray]",gf="[object Uint16Array]",bf="[object Uint32Array]";function yf(e,t,r){var n=e.constructor;switch(t){case af:return Yn(e);case Xl:case Jl:return new n(+e);case cf:return ql(e,r);case uf:case lf:case ff:case df:case hf:case pf:case mf:case gf:case bf:return Ql(e,r);case ef:return new n;case tf:case sf:return new n(e);case rf:return Gl(e);case nf:return new n;case of:return Zl(e)}}function vf(e){return typeof e.constructor=="function"&&!Nn(e)?Mc(Mo(e)):{}}var xf="[object Map]";function wf(e){return Bt(e)&&Hn(e)==xf}var Qo=Ut&&Ut.isMap,Pf=Qo?In(Qo):wf;const Sf=Pf;var Tf="[object Set]";function Ef(e){return Bt(e)&&Hn(e)==Tf}var Xo=Ut&&Ut.isSet,_f=Xo?In(Xo):Ef;const Cf=_f;var kf=1,Of=2,Df=4,Jo="[object Arguments]",Nf="[object Array]",If="[object Boolean]",jf="[object Date]",Mf="[object Error]",ei="[object Function]",Rf="[object GeneratorFunction]",Af="[object Map]",Lf="[object Number]",ti="[object Object]",$f="[object RegExp]",Ff="[object Set]",Hf="[object String]",Yf="[object Symbol]",Vf="[object WeakMap]",Wf="[object ArrayBuffer]",Bf="[object DataView]",Uf="[object Float32Array]",zf="[object Float64Array]",qf="[object Int8Array]",Kf="[object Int16Array]",Gf="[object Int32Array]",Zf="[object Uint8Array]",Qf="[object Uint8ClampedArray]",Xf="[object Uint16Array]",Jf="[object Uint32Array]",Se={};Se[Jo]=Se[Nf]=Se[Wf]=Se[Bf]=Se[If]=Se[jf]=Se[Uf]=Se[zf]=Se[qf]=Se[Kf]=Se[Gf]=Se[Af]=Se[Lf]=Se[ti]=Se[$f]=Se[Ff]=Se[Hf]=Se[Yf]=Se[Zf]=Se[Qf]=Se[Xf]=Se[Jf]=!0,Se[Mf]=Se[ei]=Se[Vf]=!1;function Gr(e,t,r,n,s,o){var i,a=t&kf,u=t&Of,f=t&Df;if(r&&(i=s?r(e,n,s,o):r(e)),i!==void 0)return i;if(!mt(e))return e;var h=kn(e);if(h){if(i=Ul(e),!a)return Rc(e,i)}else{var g=Hn(e),x=g==ei||g==Rf;if(ko(e))return Sl(e,a);if(g==ti||g==Jo||x&&!s){if(i=u||x?{}:vf(e),!a)return u?Nl(e,wl(i,e)):kl(e,xl(i,e))}else{if(!Se[g])return s?e:{};i=yf(e,g,a)}}o||(o=new qt);var v=o.get(e);if(v)return v;o.set(e,i),Cf(e)?e.forEach(function(j){i.add(Gr(j,t,r,j,e,o))}):Sf(e)&&e.forEach(function(j,E){i.set(E,Gr(j,t,r,E,e,o))});var T=f?u?jl:Il:u?Rn:Mn,I=h?void 0:T(e);return Lc(I||e,function(j,E){I&&(E=j,j=e[E]),xo(i,E,Gr(j,t,r,E,e,o))}),i}var ed=1,td=4;function rd(e){return Gr(e,ed|td)}var nd=function(){return et.Date.now()};const Vn=nd;var sd="Expected a function",od=Math.max,id=Math.min;function Sr(e,t,r){var n,s,o,i,a,u,f=0,h=!1,g=!1,x=!0;if(typeof e!="function")throw new TypeError(sd);t=ho(t)||0,mt(r)&&(h=!!r.leading,g="maxWait"in r,o=g?od(ho(r.maxWait)||0,t):o,x="trailing"in r?!!r.trailing:x);function v(F){var k=n,q=s;return n=s=void 0,f=F,i=e.apply(q,k),i}function T(F){return f=F,a=setTimeout(E,t),h?v(F):i}function I(F){var k=F-u,q=F-f,z=t-k;return g?id(z,o-q):z}function j(F){var k=F-u,q=F-f;return u===void 0||k>=t||k<0||g&&q>=o}function E(){var F=Vn();if(j(F))return D(F);a=setTimeout(E,I(F))}function D(F){return a=void 0,x&&n?v(F):(n=s=void 0,i)}function Q(){a!==void 0&&clearTimeout(a),f=0,n=u=s=a=void 0}function U(){return a===void 0?i:D(Vn())}function y(){var F=Vn(),k=j(F);if(n=arguments,s=this,u=F,k){if(a===void 0)return T(u);if(g)return clearTimeout(a),a=setTimeout(E,t),v(u)}return a===void 0&&(a=setTimeout(E,t)),i}return y.cancel=Q,y.flush=U,y}var ad="Expected a function";function cd(e,t,r){var n=!0,s=!0;if(typeof e!="function")throw new TypeError(ad);return mt(r)&&(n="leading"in r?!!r.leading:n,s="trailing"in r?!!r.trailing:s),Sr(e,t,{leading:n,maxWait:t,trailing:s})}const ud=(e,t)=>{const{value:r,readOnly:n=!1,debounceTime:s=800,fillContainer:o=!0,leftElement:i,rightElement:a,className:u,leftElementClassName:f,rightElementClassName:h,isSingleLine:g=!0,allowSingleLineScroll:x=!1,inputMode:v,placeholder:T,onFocus:I,onBlur:j,onInput:E,onInnerTextChange:D,onInnerHTMLChange:Q,onElementCreate:U,onLeftElementClick:y,onRightElementClick:F}=e,k=d.useRef("bsc-flex-grow focus:bsc-outline-none"),q=d.useRef("bsc-text-gray-4"),z=d.useRef(),oe=d.useCallback(P=>{const V=P.target,X=V.innerHTML;V.className=`${k.current}`,T&&X===T&&(V.innerHTML=""),I==null||I(P)},[T,I]),ce=d.useCallback(P=>{const V=P.target.innerHTML;if(T&&V===""){const X=P.target;X.innerHTML=T,X.className=`${k.current} ${q.current}`}j==null||j(P)},[T,j]),ne=d.useCallback(P=>{var V,X;(V=z.current)==null||V.removeEventListener("focus",oe),(X=z.current)==null||X.removeEventListener("blur",ce),T&&P&&P!==document.activeElement&&P.innerHTML===""&&(P.innerHTML=T,P.className=`${k.current} ${q.current}`),P.addEventListener("focus",oe),P.addEventListener("blur",ce),z.current=P},[T]),M=d.useCallback(P=>{U==null||U(P)},[U]),H=P=>{y==null||y(P)},L=P=>{F==null||F(P)},O=Sr(P=>{E==null||E(P),D==null||D(P.target.innerText),Q==null||Q(P.target.innerHTML)},s),J=d.useCallback(P=>{z.current&&(z.current.innerText=P)},[]),R=d.useCallback(P=>{z.current&&(z.current.innerHTML=P)},[]),ge=d.useCallback(()=>{var P;(P=z.current)==null||P.focus()},[]);d.useImperativeHandle(t,()=>({inputElement:z.current,setInnerText:J,setInnerHTML:R,focus:ge}));const S=pe({"bsc-w-full ":o},"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":g&&x,"bsc-overflow-hidden bsc-whitespace-pre":g&&!x},u),N=pe("bsc-flex-shrink",{"bsc-mr-2":i},f),C=pe("bsc-flex-shrink",{"bsc-ml-2":a},h);return p.jsxs("div",{className:S,ref:P=>P&&M(P),children:[i&&p.jsx("div",{className:N,onClick:H,children:i}),p.jsx("div",{ref:P=>P&&ne(P),className:k.current,contentEditable:!n,suppressContentEditableWarning:!0,inputMode:v,onInput:O,children:r}),a&&p.jsx("div",{className:C,onClick:L,children:a})]})},Zr=d.forwardRef(ud);function be(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function Te(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function Kt(e,t){const r=be(e);return isNaN(t)?Te(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function xt(e,t){const r=be(e);if(isNaN(t))return Te(e,NaN);if(!t)return r;const n=r.getDate(),s=Te(e,r.getTime());s.setMonth(r.getMonth()+t+1,0);const o=s.getDate();return n>=o?s:(r.setFullYear(s.getFullYear(),s.getMonth(),n),r)}const ri=6048e5,Wn=6e4,Bn=36e5,ld=1e3;let fd={};function Tr(){return fd}function wt(e,t){var a,u,f,h;const r=Tr(),n=(t==null?void 0:t.weekStartsOn)??((u=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:u.weekStartsOn)??r.weekStartsOn??((h=(f=r.locale)==null?void 0:f.options)==null?void 0:h.weekStartsOn)??0,s=be(e),o=s.getDay(),i=(o<n?7:0)+o-n;return s.setDate(s.getDate()-i),s.setHours(0,0,0,0),s}function Gt(e){return wt(e,{weekStartsOn:1})}function dd(e){const t=be(e),r=t.getFullYear(),n=Te(e,0);n.setFullYear(r+1,0,4),n.setHours(0,0,0,0);const s=Gt(n),o=Te(e,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const i=Gt(o);return t.getTime()>=s.getTime()?r+1:t.getTime()>=i.getTime()?r:r-1}function ni(e){const t=be(e);return t.setHours(0,0,0,0),t}function si(e){const t=be(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function hd(e){const t=dd(e),r=Te(e,0);return r.setFullYear(t,0,4),r.setHours(0,0,0,0),Gt(r)}function Er(e,t){return xt(e,t*12)}function oi(e,t){const r=ni(e),n=ni(t);return+r==+n}function pd(e){const t=be(e),r=t.getMonth();return t.setFullYear(t.getFullYear(),r+1,0),t.setHours(23,59,59,999),t}function md(e,t){const r=be(e.start),n=be(e.end);let s=+r>+n;const o=s?+r:+n,i=s?n:r;i.setHours(0,0,0,0);let a=(t==null?void 0:t.step)??1;if(!a)return[];a<0&&(a=-a,s=!s);const u=[];for(;+i<=o;)u.push(be(i)),i.setDate(i.getDate()+a),i.setHours(0,0,0,0);return s?u.reverse():u}function ii(e){const t=be(e);return t.setDate(1),t.setHours(0,0,0,0),t}function gd(e,t){const r=be(e.start),n=be(e.end);let s=+r>+n;const o=s?+r:+n,i=s?n:r;i.setHours(0,0,0,0),i.setMonth(0,1);let a=(t==null?void 0:t.step)??1;if(!a)return[];a<0&&(a=-a,s=!s);const u=[];for(;+i<=o;)u.push(be(i)),i.setFullYear(i.getFullYear()+a);return s?u.reverse():u}const bd={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"}},yd=(e,t,r)=>{let n;const s=bd[e];return typeof s=="string"?n=s:t===1?n=s.one:n=s.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function Un(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const vd={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},xd={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},wd={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Pd={date:Un({formats:vd,defaultWidth:"full"}),time:Un({formats:xd,defaultWidth:"full"}),dateTime:Un({formats:wd,defaultWidth:"full"})},Sd={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Td=(e,t,r,n)=>Sd[e];function _r(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let s;if(n==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,a=r!=null&&r.width?String(r.width):i;s=e.formattingValues[a]||e.formattingValues[i]}else{const i=e.defaultWidth,a=r!=null&&r.width?String(r.width):e.defaultWidth;s=e.values[a]||e.values[i]}const o=e.argumentCallback?e.argumentCallback(t):t;return s[o]}}const Ed={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},_d={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Cd={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"]},kd={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"]},Od={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"}},Dd={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"}},Nd={ordinalNumber:(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:_r({values:Ed,defaultWidth:"wide"}),quarter:_r({values:_d,defaultWidth:"wide",argumentCallback:e=>e-1}),month:_r({values:Cd,defaultWidth:"wide"}),day:_r({values:kd,defaultWidth:"wide"}),dayPeriod:_r({values:Od,defaultWidth:"wide",formattingValues:Dd,defaultFormattingWidth:"wide"})};function Cr(e){return(t,r={})=>{const n=r.width,s=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],o=t.match(s);if(!o)return null;const i=o[0],a=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(a)?jd(a,g=>g.test(i)):Id(a,g=>g.test(i));let f;f=e.valueCallback?e.valueCallback(u):u,f=r.valueCallback?r.valueCallback(f):f;const h=t.slice(i.length);return{value:f,rest:h}}}function Id(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function jd(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function Md(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const s=n[0],o=t.match(e.parsePattern);if(!o)return null;let i=e.valueCallback?e.valueCallback(o[0]):o[0];i=r.valueCallback?r.valueCallback(i):i;const a=t.slice(s.length);return{value:i,rest:a}}}const Rd=/^(\d+)(th|st|nd|rd)?/i,Ad=/\d+/i,Ld={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},$d={any:[/^b/i,/^(a|c)/i]},Fd={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Hd={any:[/1/i,/2/i,/3/i,/4/i]},Yd={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},Vd={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]},Wd={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},Bd={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]},Ud={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},zd={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}},qd={ordinalNumber:Md({matchPattern:Rd,parsePattern:Ad,valueCallback:e=>parseInt(e,10)}),era:Cr({matchPatterns:Ld,defaultMatchWidth:"wide",parsePatterns:$d,defaultParseWidth:"any"}),quarter:Cr({matchPatterns:Fd,defaultMatchWidth:"wide",parsePatterns:Hd,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Cr({matchPatterns:Yd,defaultMatchWidth:"wide",parsePatterns:Vd,defaultParseWidth:"any"}),day:Cr({matchPatterns:Wd,defaultMatchWidth:"wide",parsePatterns:Bd,defaultParseWidth:"any"}),dayPeriod:Cr({matchPatterns:Ud,defaultMatchWidth:"any",parsePatterns:zd,defaultParseWidth:"any"})},Kd={code:"en-US",formatDistance:yd,formatLong:Pd,formatRelative:Td,localize:Nd,match:qd,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Gd(e){const t=be(e),r=+Gt(t)-+hd(t);return Math.round(r/ri)+1}function ai(e,t){var h,g,x,v;const r=be(e),n=r.getFullYear(),s=Tr(),o=(t==null?void 0:t.firstWeekContainsDate)??((g=(h=t==null?void 0:t.locale)==null?void 0:h.options)==null?void 0:g.firstWeekContainsDate)??s.firstWeekContainsDate??((v=(x=s.locale)==null?void 0:x.options)==null?void 0:v.firstWeekContainsDate)??1,i=Te(e,0);i.setFullYear(n+1,0,o),i.setHours(0,0,0,0);const a=wt(i,t),u=Te(e,0);u.setFullYear(n,0,o),u.setHours(0,0,0,0);const f=wt(u,t);return r.getTime()>=a.getTime()?n+1:r.getTime()>=f.getTime()?n:n-1}function Zd(e,t){var a,u,f,h;const r=Tr(),n=(t==null?void 0:t.firstWeekContainsDate)??((u=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:u.firstWeekContainsDate)??r.firstWeekContainsDate??((h=(f=r.locale)==null?void 0:f.options)==null?void 0:h.firstWeekContainsDate)??1,s=ai(e,t),o=Te(e,0);return o.setFullYear(s,0,n),o.setHours(0,0,0,0),wt(o,t)}function Qd(e,t){const r=be(e),n=+wt(r,t)-+Zd(r,t);return Math.round(n/ri)+1}const ci=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},ui=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},li={p:ui,P:(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],s=r[2];if(!s)return ci(e,t);let o;switch(n){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",ci(n,t)).replace("{{time}}",ui(s,t))}},Xd=/^D+$/,Jd=/^Y+$/,eh=["D","DD","YY","YYYY"];function th(e){return Xd.test(e)}function rh(e){return Jd.test(e)}function fi(e,t,r){const n=nh(e,t,r);if(console.warn(n),eh.includes(e))throw new RangeError(n)}function nh(e,t,r){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function zn(e){return be(e).getDay()}function di(e){const t=be(e),r=t.getFullYear(),n=t.getMonth(),s=Te(e,0);return s.setFullYear(r,n+1,0),s.setHours(0,0,0,0),s.getDate()}function sh(){return Object.assign({},Tr())}function oh(e){let r=be(e).getDay();return r===0&&(r=7),r}function ih(e){const t=be(e),r=t.getMonth();return t.setFullYear(t.getFullYear(),r+1,0),t.setHours(0,0,0,0),t}function ah(e,t){const r=be(e),n=be(t);return+r<+n}function ch(e,t){const r=t instanceof Date?Te(t,0):new t(0);return r.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),r.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),r}const uh=10;class hi{constructor(){b(this,"subPriority",0)}validate(t,r){return!0}}class lh extends hi{constructor(t,r,n,s,o){super(),this.value=t,this.validateValue=r,this.setValue=n,this.priority=s,o&&(this.subPriority=o)}validate(t,r){return this.validateValue(t,this.value,r)}set(t,r,n){return this.setValue(t,r,this.value,n)}}class fh extends hi{constructor(){super(...arguments);b(this,"priority",uh);b(this,"subPriority",-1)}set(r,n){return n.timestampIsSet?r:Te(r,ch(r,Date))}}class ye{run(t,r,n,s){const o=this.parse(t,r,n,s);return o?{setter:new lh(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}validate(t,r,n){return!0}}class dh extends ye{constructor(){super(...arguments);b(this,"priority",140);b(this,"incompatibleTokens",["R","u","t","T"])}parse(r,n,s){switch(n){case"G":case"GG":case"GGG":return s.era(r,{width:"abbreviated"})||s.era(r,{width:"narrow"});case"GGGGG":return s.era(r,{width:"narrow"});case"GGGG":default:return s.era(r,{width:"wide"})||s.era(r,{width:"abbreviated"})||s.era(r,{width:"narrow"})}}set(r,n,s){return n.era=s,r.setFullYear(s,0,1),r.setHours(0,0,0,0),r}}const Ie={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}/},at={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 je(e,t){return e&&{value:t(e.value),rest:e.rest}}function Ce(e,t){const r=t.match(e);return r?{value:parseInt(r[0],10),rest:t.slice(r[0].length)}:null}function ct(e,t){const r=t.match(e);if(!r)return null;if(r[0]==="Z")return{value:0,rest:t.slice(1)};const n=r[1]==="+"?1:-1,s=r[2]?parseInt(r[2],10):0,o=r[3]?parseInt(r[3],10):0,i=r[5]?parseInt(r[5],10):0;return{value:n*(s*Bn+o*Wn+i*ld),rest:t.slice(r[0].length)}}function pi(e){return Ce(Ie.anyDigitsSigned,e)}function ke(e,t){switch(e){case 1:return Ce(Ie.singleDigit,t);case 2:return Ce(Ie.twoDigits,t);case 3:return Ce(Ie.threeDigits,t);case 4:return Ce(Ie.fourDigits,t);default:return Ce(new RegExp("^\\d{1,"+e+"}"),t)}}function Qr(e,t){switch(e){case 1:return Ce(Ie.singleDigitSigned,t);case 2:return Ce(Ie.twoDigitsSigned,t);case 3:return Ce(Ie.threeDigitsSigned,t);case 4:return Ce(Ie.fourDigitsSigned,t);default:return Ce(new RegExp("^-?\\d{1,"+e+"}"),t)}}function qn(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 mi(e,t){const r=t>0,n=r?t:1-t;let s;if(n<=50)s=e||100;else{const o=n+50,i=Math.trunc(o/100)*100,a=e>=o%100;s=e+i-(a?100:0)}return r?s:1-s}function gi(e){return e%400===0||e%4===0&&e%100!==0}class hh extends ye{constructor(){super(...arguments);b(this,"priority",130);b(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(r,n,s){const o=i=>({year:i,isTwoDigitYear:n==="yy"});switch(n){case"y":return je(ke(4,r),o);case"yo":return je(s.ordinalNumber(r,{unit:"year"}),o);default:return je(ke(n.length,r),o)}}validate(r,n){return n.isTwoDigitYear||n.year>0}set(r,n,s){const o=r.getFullYear();if(s.isTwoDigitYear){const a=mi(s.year,o);return r.setFullYear(a,0,1),r.setHours(0,0,0,0),r}const i=!("era"in n)||n.era===1?s.year:1-s.year;return r.setFullYear(i,0,1),r.setHours(0,0,0,0),r}}class ph extends ye{constructor(){super(...arguments);b(this,"priority",130);b(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(r,n,s){const o=i=>({year:i,isTwoDigitYear:n==="YY"});switch(n){case"Y":return je(ke(4,r),o);case"Yo":return je(s.ordinalNumber(r,{unit:"year"}),o);default:return je(ke(n.length,r),o)}}validate(r,n){return n.isTwoDigitYear||n.year>0}set(r,n,s,o){const i=ai(r,o);if(s.isTwoDigitYear){const u=mi(s.year,i);return r.setFullYear(u,0,o.firstWeekContainsDate),r.setHours(0,0,0,0),wt(r,o)}const a=!("era"in n)||n.era===1?s.year:1-s.year;return r.setFullYear(a,0,o.firstWeekContainsDate),r.setHours(0,0,0,0),wt(r,o)}}class mh extends ye{constructor(){super(...arguments);b(this,"priority",130);b(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(r,n){return Qr(n==="R"?4:n.length,r)}set(r,n,s){const o=Te(r,0);return o.setFullYear(s,0,4),o.setHours(0,0,0,0),Gt(o)}}class gh extends ye{constructor(){super(...arguments);b(this,"priority",130);b(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(r,n){return Qr(n==="u"?4:n.length,r)}set(r,n,s){return r.setFullYear(s,0,1),r.setHours(0,0,0,0),r}}class bh extends ye{constructor(){super(...arguments);b(this,"priority",120);b(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(r,n,s){switch(n){case"Q":case"QQ":return ke(n.length,r);case"Qo":return s.ordinalNumber(r,{unit:"quarter"});case"QQQ":return s.quarter(r,{width:"abbreviated",context:"formatting"})||s.quarter(r,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(r,{width:"wide",context:"formatting"})||s.quarter(r,{width:"abbreviated",context:"formatting"})||s.quarter(r,{width:"narrow",context:"formatting"})}}validate(r,n){return n>=1&&n<=4}set(r,n,s){return r.setMonth((s-1)*3,1),r.setHours(0,0,0,0),r}}class yh extends ye{constructor(){super(...arguments);b(this,"priority",120);b(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(r,n,s){switch(n){case"q":case"qq":return ke(n.length,r);case"qo":return s.ordinalNumber(r,{unit:"quarter"});case"qqq":return s.quarter(r,{width:"abbreviated",context:"standalone"})||s.quarter(r,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(r,{width:"wide",context:"standalone"})||s.quarter(r,{width:"abbreviated",context:"standalone"})||s.quarter(r,{width:"narrow",context:"standalone"})}}validate(r,n){return n>=1&&n<=4}set(r,n,s){return r.setMonth((s-1)*3,1),r.setHours(0,0,0,0),r}}class vh extends ye{constructor(){super(...arguments);b(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);b(this,"priority",110)}parse(r,n,s){const o=i=>i-1;switch(n){case"M":return je(Ce(Ie.month,r),o);case"MM":return je(ke(2,r),o);case"Mo":return je(s.ordinalNumber(r,{unit:"month"}),o);case"MMM":return s.month(r,{width:"abbreviated",context:"formatting"})||s.month(r,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(r,{width:"wide",context:"formatting"})||s.month(r,{width:"abbreviated",context:"formatting"})||s.month(r,{width:"narrow",context:"formatting"})}}validate(r,n){return n>=0&&n<=11}set(r,n,s){return r.setMonth(s,1),r.setHours(0,0,0,0),r}}class xh extends ye{constructor(){super(...arguments);b(this,"priority",110);b(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(r,n,s){const o=i=>i-1;switch(n){case"L":return je(Ce(Ie.month,r),o);case"LL":return je(ke(2,r),o);case"Lo":return je(s.ordinalNumber(r,{unit:"month"}),o);case"LLL":return s.month(r,{width:"abbreviated",context:"standalone"})||s.month(r,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(r,{width:"wide",context:"standalone"})||s.month(r,{width:"abbreviated",context:"standalone"})||s.month(r,{width:"narrow",context:"standalone"})}}validate(r,n){return n>=0&&n<=11}set(r,n,s){return r.setMonth(s,1),r.setHours(0,0,0,0),r}}function wh(e,t,r){const n=be(e),s=Qd(n,r)-t;return n.setDate(n.getDate()-s*7),n}class Ph extends ye{constructor(){super(...arguments);b(this,"priority",100);b(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(r,n,s){switch(n){case"w":return Ce(Ie.week,r);case"wo":return s.ordinalNumber(r,{unit:"week"});default:return ke(n.length,r)}}validate(r,n){return n>=1&&n<=53}set(r,n,s,o){return wt(wh(r,s,o),o)}}function Sh(e,t){const r=be(e),n=Gd(r)-t;return r.setDate(r.getDate()-n*7),r}class Th extends ye{constructor(){super(...arguments);b(this,"priority",100);b(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(r,n,s){switch(n){case"I":return Ce(Ie.week,r);case"Io":return s.ordinalNumber(r,{unit:"week"});default:return ke(n.length,r)}}validate(r,n){return n>=1&&n<=53}set(r,n,s){return Gt(Sh(r,s))}}const Eh=[31,28,31,30,31,30,31,31,30,31,30,31],_h=[31,29,31,30,31,30,31,31,30,31,30,31];class Ch extends ye{constructor(){super(...arguments);b(this,"priority",90);b(this,"subPriority",1);b(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(r,n,s){switch(n){case"d":return Ce(Ie.date,r);case"do":return s.ordinalNumber(r,{unit:"date"});default:return ke(n.length,r)}}validate(r,n){const s=r.getFullYear(),o=gi(s),i=r.getMonth();return o?n>=1&&n<=_h[i]:n>=1&&n<=Eh[i]}set(r,n,s){return r.setDate(s),r.setHours(0,0,0,0),r}}class kh extends ye{constructor(){super(...arguments);b(this,"priority",90);b(this,"subpriority",1);b(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(r,n,s){switch(n){case"D":case"DD":return Ce(Ie.dayOfYear,r);case"Do":return s.ordinalNumber(r,{unit:"date"});default:return ke(n.length,r)}}validate(r,n){const s=r.getFullYear();return gi(s)?n>=1&&n<=366:n>=1&&n<=365}set(r,n,s){return r.setMonth(0,s),r.setHours(0,0,0,0),r}}function Kn(e,t,r){var g,x,v,T;const n=Tr(),s=(r==null?void 0:r.weekStartsOn)??((x=(g=r==null?void 0:r.locale)==null?void 0:g.options)==null?void 0:x.weekStartsOn)??n.weekStartsOn??((T=(v=n.locale)==null?void 0:v.options)==null?void 0:T.weekStartsOn)??0,o=be(e),i=o.getDay(),u=(t%7+7)%7,f=7-s,h=t<0||t>6?t-(i+f)%7:(u+f)%7-(i+f)%7;return Kt(o,h)}class Oh extends ye{constructor(){super(...arguments);b(this,"priority",90);b(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(r,n,s){switch(n){case"E":case"EE":case"EEE":return s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"});case"EEEE":default:return s.day(r,{width:"wide",context:"formatting"})||s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"})}}validate(r,n){return n>=0&&n<=6}set(r,n,s,o){return r=Kn(r,s,o),r.setHours(0,0,0,0),r}}class Dh extends ye{constructor(){super(...arguments);b(this,"priority",90);b(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(r,n,s,o){const i=a=>{const u=Math.floor((a-1)/7)*7;return(a+o.weekStartsOn+6)%7+u};switch(n){case"e":case"ee":return je(ke(n.length,r),i);case"eo":return je(s.ordinalNumber(r,{unit:"day"}),i);case"eee":return s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"});case"eeeee":return s.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"});case"eeee":default:return s.day(r,{width:"wide",context:"formatting"})||s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"})}}validate(r,n){return n>=0&&n<=6}set(r,n,s,o){return r=Kn(r,s,o),r.setHours(0,0,0,0),r}}class Nh extends ye{constructor(){super(...arguments);b(this,"priority",90);b(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(r,n,s,o){const i=a=>{const u=Math.floor((a-1)/7)*7;return(a+o.weekStartsOn+6)%7+u};switch(n){case"c":case"cc":return je(ke(n.length,r),i);case"co":return je(s.ordinalNumber(r,{unit:"day"}),i);case"ccc":return s.day(r,{width:"abbreviated",context:"standalone"})||s.day(r,{width:"short",context:"standalone"})||s.day(r,{width:"narrow",context:"standalone"});case"ccccc":return s.day(r,{width:"narrow",context:"standalone"});case"cccccc":return s.day(r,{width:"short",context:"standalone"})||s.day(r,{width:"narrow",context:"standalone"});case"cccc":default:return s.day(r,{width:"wide",context:"standalone"})||s.day(r,{width:"abbreviated",context:"standalone"})||s.day(r,{width:"short",context:"standalone"})||s.day(r,{width:"narrow",context:"standalone"})}}validate(r,n){return n>=0&&n<=6}set(r,n,s,o){return r=Kn(r,s,o),r.setHours(0,0,0,0),r}}function Ih(e,t){const r=be(e),n=oh(r),s=t-n;return Kt(r,s)}class jh extends ye{constructor(){super(...arguments);b(this,"priority",90);b(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(r,n,s){const o=i=>i===0?7:i;switch(n){case"i":case"ii":return ke(n.length,r);case"io":return s.ordinalNumber(r,{unit:"day"});case"iii":return je(s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"}),o);case"iiiii":return je(s.day(r,{width:"narrow",context:"formatting"}),o);case"iiiiii":return je(s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"}),o);case"iiii":default:return je(s.day(r,{width:"wide",context:"formatting"})||s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"}),o)}}validate(r,n){return n>=1&&n<=7}set(r,n,s){return r=Ih(r,s),r.setHours(0,0,0,0),r}}class Mh extends ye{constructor(){super(...arguments);b(this,"priority",80);b(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(r,n,s){switch(n){case"a":case"aa":case"aaa":return s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(r,{width:"wide",context:"formatting"})||s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"})}}set(r,n,s){return r.setHours(qn(s),0,0,0),r}}class Rh extends ye{constructor(){super(...arguments);b(this,"priority",80);b(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(r,n,s){switch(n){case"b":case"bb":case"bbb":return s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(r,{width:"wide",context:"formatting"})||s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"})}}set(r,n,s){return r.setHours(qn(s),0,0,0),r}}class Ah extends ye{constructor(){super(...arguments);b(this,"priority",80);b(this,"incompatibleTokens",["a","b","t","T"])}parse(r,n,s){switch(n){case"B":case"BB":case"BBB":return s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(r,{width:"wide",context:"formatting"})||s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"})}}set(r,n,s){return r.setHours(qn(s),0,0,0),r}}class Lh extends ye{constructor(){super(...arguments);b(this,"priority",70);b(this,"incompatibleTokens",["H","K","k","t","T"])}parse(r,n,s){switch(n){case"h":return Ce(Ie.hour12h,r);case"ho":return s.ordinalNumber(r,{unit:"hour"});default:return ke(n.length,r)}}validate(r,n){return n>=1&&n<=12}set(r,n,s){const o=r.getHours()>=12;return o&&s<12?r.setHours(s+12,0,0,0):!o&&s===12?r.setHours(0,0,0,0):r.setHours(s,0,0,0),r}}class $h extends ye{constructor(){super(...arguments);b(this,"priority",70);b(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(r,n,s){switch(n){case"H":return Ce(Ie.hour23h,r);case"Ho":return s.ordinalNumber(r,{unit:"hour"});default:return ke(n.length,r)}}validate(r,n){return n>=0&&n<=23}set(r,n,s){return r.setHours(s,0,0,0),r}}class Fh extends ye{constructor(){super(...arguments);b(this,"priority",70);b(this,"incompatibleTokens",["h","H","k","t","T"])}parse(r,n,s){switch(n){case"K":return Ce(Ie.hour11h,r);case"Ko":return s.ordinalNumber(r,{unit:"hour"});default:return ke(n.length,r)}}validate(r,n){return n>=0&&n<=11}set(r,n,s){return r.getHours()>=12&&s<12?r.setHours(s+12,0,0,0):r.setHours(s,0,0,0),r}}class Hh extends ye{constructor(){super(...arguments);b(this,"priority",70);b(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(r,n,s){switch(n){case"k":return Ce(Ie.hour24h,r);case"ko":return s.ordinalNumber(r,{unit:"hour"});default:return ke(n.length,r)}}validate(r,n){return n>=1&&n<=24}set(r,n,s){const o=s<=24?s%24:s;return r.setHours(o,0,0,0),r}}class Yh extends ye{constructor(){super(...arguments);b(this,"priority",60);b(this,"incompatibleTokens",["t","T"])}parse(r,n,s){switch(n){case"m":return Ce(Ie.minute,r);case"mo":return s.ordinalNumber(r,{unit:"minute"});default:return ke(n.length,r)}}validate(r,n){return n>=0&&n<=59}set(r,n,s){return r.setMinutes(s,0,0),r}}class Vh extends ye{constructor(){super(...arguments);b(this,"priority",50);b(this,"incompatibleTokens",["t","T"])}parse(r,n,s){switch(n){case"s":return Ce(Ie.second,r);case"so":return s.ordinalNumber(r,{unit:"second"});default:return ke(n.length,r)}}validate(r,n){return n>=0&&n<=59}set(r,n,s){return r.setSeconds(s,0),r}}class Wh extends ye{constructor(){super(...arguments);b(this,"priority",30);b(this,"incompatibleTokens",["t","T"])}parse(r,n){const s=o=>Math.trunc(o*Math.pow(10,-n.length+3));return je(ke(n.length,r),s)}set(r,n,s){return r.setMilliseconds(s),r}}class Bh extends ye{constructor(){super(...arguments);b(this,"priority",10);b(this,"incompatibleTokens",["t","T","x"])}parse(r,n){switch(n){case"X":return ct(at.basicOptionalMinutes,r);case"XX":return ct(at.basic,r);case"XXXX":return ct(at.basicOptionalSeconds,r);case"XXXXX":return ct(at.extendedOptionalSeconds,r);case"XXX":default:return ct(at.extended,r)}}set(r,n,s){return n.timestampIsSet?r:Te(r,r.getTime()-si(r)-s)}}class Uh extends ye{constructor(){super(...arguments);b(this,"priority",10);b(this,"incompatibleTokens",["t","T","X"])}parse(r,n){switch(n){case"x":return ct(at.basicOptionalMinutes,r);case"xx":return ct(at.basic,r);case"xxxx":return ct(at.basicOptionalSeconds,r);case"xxxxx":return ct(at.extendedOptionalSeconds,r);case"xxx":default:return ct(at.extended,r)}}set(r,n,s){return n.timestampIsSet?r:Te(r,r.getTime()-si(r)-s)}}class zh extends ye{constructor(){super(...arguments);b(this,"priority",40);b(this,"incompatibleTokens","*")}parse(r){return pi(r)}set(r,n,s){return[Te(r,s*1e3),{timestampIsSet:!0}]}}class qh extends ye{constructor(){super(...arguments);b(this,"priority",20);b(this,"incompatibleTokens","*")}parse(r){return pi(r)}set(r,n,s){return[Te(r,s),{timestampIsSet:!0}]}}const Kh={G:new dh,y:new hh,Y:new ph,R:new mh,u:new gh,Q:new bh,q:new yh,M:new vh,L:new xh,w:new Ph,I:new Th,d:new Ch,D:new kh,E:new Oh,e:new Dh,c:new Nh,i:new jh,a:new Mh,b:new Rh,B:new Ah,h:new Lh,H:new $h,K:new Fh,k:new Hh,m:new Yh,s:new Vh,S:new Wh,X:new Bh,x:new Uh,t:new zh,T:new qh},Gh=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Zh=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Qh=/^'([^]*?)'?$/,Xh=/''/g,Jh=/\S/,ep=/[a-zA-Z]/;function ut(e,t,r,n){var I,j,E,D,Q,U,y,F;const s=sh(),o=(n==null?void 0:n.locale)??s.locale??Kd,i=(n==null?void 0:n.firstWeekContainsDate)??((j=(I=n==null?void 0:n.locale)==null?void 0:I.options)==null?void 0:j.firstWeekContainsDate)??s.firstWeekContainsDate??((D=(E=s.locale)==null?void 0:E.options)==null?void 0:D.firstWeekContainsDate)??1,a=(n==null?void 0:n.weekStartsOn)??((U=(Q=n==null?void 0:n.locale)==null?void 0:Q.options)==null?void 0:U.weekStartsOn)??s.weekStartsOn??((F=(y=s.locale)==null?void 0:y.options)==null?void 0:F.weekStartsOn)??0;if(t==="")return e===""?be(r):Te(r,NaN);const u={firstWeekContainsDate:i,weekStartsOn:a,locale:o},f=[new fh],h=t.match(Zh).map(k=>{const q=k[0];if(q in li){const z=li[q];return z(k,o.formatLong)}return k}).join("").match(Gh),g=[];for(let k of h){!(n!=null&&n.useAdditionalWeekYearTokens)&&rh(k)&&fi(k,t,e),!(n!=null&&n.useAdditionalDayOfYearTokens)&&th(k)&&fi(k,t,e);const q=k[0],z=Kh[q];if(z){const{incompatibleTokens:oe}=z;if(Array.isArray(oe)){const ne=g.find(M=>oe.includes(M.token)||M.token===q);if(ne)throw new RangeError(`The format string mustn't contain \`${ne.fullToken}\` and \`${k}\` at the same time`)}else if(z.incompatibleTokens==="*"&&g.length>0)throw new RangeError(`The format string mustn't contain \`${k}\` and any other token at the same time`);g.push({token:q,fullToken:k});const ce=z.run(e,k,o.match,u);if(!ce)return Te(r,NaN);f.push(ce.setter),e=ce.rest}else{if(q.match(ep))throw new RangeError("Format string contains an unescaped latin alphabet character `"+q+"`");if(k==="''"?k="'":q==="'"&&(k=tp(k)),e.indexOf(k)===0)e=e.slice(k.length);else return Te(r,NaN)}}if(e.length>0&&Jh.test(e))return Te(r,NaN);const x=f.map(k=>k.priority).sort((k,q)=>q-k).filter((k,q,z)=>z.indexOf(k)===q).map(k=>f.filter(q=>q.priority===k).sort((q,z)=>z.subPriority-q.subPriority)).map(k=>k[0]);let v=be(r);if(isNaN(v.getTime()))return Te(r,NaN);const T={};for(const k of x){if(!k.validate(v,u))return Te(r,NaN);const q=k.set(v,T,u);Array.isArray(q)?(v=q[0],Object.assign(T,q[1])):v=q}return Te(r,v)}function tp(e){return e.match(Qh)[1].replace(Xh,"'")}function rp(e){return oi(e,Date.now())}function np(e,t){return Kt(e,-t)}function sp(e,t){let r=t-zn(e);return r<=0&&(r+=7),Kt(e,r)}function op(e,t){const r=(t==null?void 0:t.additionalDigits)??2,n=up(e);let s;if(n.date){const u=lp(n.date,r);s=fp(u.restDateString,u.year)}if(!s||isNaN(s.getTime()))return new Date(NaN);const o=s.getTime();let i=0,a;if(n.time&&(i=dp(n.time),isNaN(i)))return new Date(NaN);if(n.timezone){if(a=hp(n.timezone),isNaN(a))return new Date(NaN)}else{const u=new Date(o+i),f=new Date(0);return f.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),f.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),f}return new Date(o+i+a)}const Xr={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},ip=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,ap=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,cp=/^([+-])(\d{2})(?::?(\d{2}))?$/;function up(e){const t={},r=e.split(Xr.dateTimeDelimiter);let n;if(r.length>2)return t;if(/:/.test(r[0])?n=r[0]:(t.date=r[0],n=r[1],Xr.timeZoneDelimiter.test(t.date)&&(t.date=e.split(Xr.timeZoneDelimiter)[0],n=e.substr(t.date.length,e.length))),n){const s=Xr.timezone.exec(n);s?(t.time=n.replace(s[1],""),t.timezone=s[1]):t.time=n}return t}function lp(e,t){const r=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),n=e.match(r);if(!n)return{year:NaN,restDateString:""};const s=n[1]?parseInt(n[1]):null,o=n[2]?parseInt(n[2]):null;return{year:o===null?s:o*100,restDateString:e.slice((n[1]||n[2]).length)}}function fp(e,t){if(t===null)return new Date(NaN);const r=e.match(ip);if(!r)return new Date(NaN);const n=!!r[4],s=kr(r[1]),o=kr(r[2])-1,i=kr(r[3]),a=kr(r[4]),u=kr(r[5])-1;if(n)return yp(t,a,u)?pp(t,a,u):new Date(NaN);{const f=new Date(0);return!gp(t,o,i)||!bp(t,s)?new Date(NaN):(f.setUTCFullYear(t,o,Math.max(s,i)),f)}}function kr(e){return e?parseInt(e):1}function dp(e){const t=e.match(ap);if(!t)return NaN;const r=Gn(t[1]),n=Gn(t[2]),s=Gn(t[3]);return vp(r,n,s)?r*Bn+n*Wn+s*1e3:NaN}function Gn(e){return e&&parseFloat(e.replace(",","."))||0}function hp(e){if(e==="Z")return 0;const t=e.match(cp);if(!t)return 0;const r=t[1]==="+"?-1:1,n=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return xp(n,s)?r*(n*Bn+s*Wn):NaN}function pp(e,t,r){const n=new Date(0);n.setUTCFullYear(e,0,4);const s=n.getUTCDay()||7,o=(t-1)*7+r+1-s;return n.setUTCDate(n.getUTCDate()+o),n}const mp=[31,null,31,30,31,30,31,31,30,31,30,31];function bi(e){return e%400===0||e%4===0&&e%100!==0}function gp(e,t,r){return t>=0&&t<=11&&r>=1&&r<=(mp[t]||(bi(e)?29:28))}function bp(e,t){return t>=1&&t<=(bi(e)?366:365)}function yp(e,t,r){return t>=1&&t<=53&&r>=0&&r<=6}function vp(e,t,r){return e===24?t===0&&r===0:r>=0&&r<60&&t>=0&&t<60&&e>=0&&e<25}function xp(e,t){return t>=0&&t<=59}function wp(e,t){const r=be(e),n=r.getFullYear(),s=r.getDate(),o=Te(e,0);o.setFullYear(n,t,15),o.setHours(0,0,0,0);const i=di(o);return r.setMonth(t,Math.min(s,i)),r}function Pp(e,t){const r=be(e);return isNaN(+r)?Te(e,NaN):(r.setFullYear(t),r)}function Zn(e,t){return xt(e,-t)}function Qn(e,t){return Er(e,-t)}function yi(){return window.navigator.languages?window.navigator.languages[0]:window.navigator.language}function Sp(e,t,r){const n=[];for(let s=e;s<=t;s++)n.push(r?r(s):s);return n}function Tp(e,t){const r=e.target;return r?!t.isSameNode(r)&&!t.contains(r):!1}function Ep(e,t){return e.isSameNode(t)||e.contains(t)}function _p(e,t){const r=Object.entries(t),n=getComputedStyle(e);for(let s=0,o=r.length;s<o;s++){const[i,a]=r[s];if(typeof a=="string"&&a.indexOf(",")>-1){if(!a.split(",").map(f=>f.trim()).includes(n[i]))return!1}else if(n[i]!==a)return!1}return!0}function Cp(e,t){const r=Object.entries(t),n=getComputedStyle(e);for(let s=0,o=r.length;s<o;s++){const[i,a]=r[s];if(typeof a=="string"&&a.indexOf(",")>-1){if(a.split(",").map(f=>f.trim()).includes(n[i]))return!0}else if(n[i]===a)return!0}return!1}function vi(e,t,r=!1,n){if(r&&_p(e,t)){if(!n||(n==null?void 0:n(e))===!0)return e}else if(!r&&Cp(e,t)&&(!n||(n==null?void 0:n(e))===!0))return e;return e.parentElement?vi(e.parentElement,t,r,n):e}function xi(e,t){const r=Array.from(document.querySelectorAll("body *")),n=[];for(let s=0,o=r.length;s<o;s++){const i=getComputedStyle(r[s]);i[e]&&t(i[e])&&n.push(i[e])}return n}function Km(e){return e}function kp(e){const t=document.documentElement;Object.keys(e).forEach(r=>{t.style.setProperty(r,e[r])})}function Op(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"}}var We=(e=>(e[e.Regular=24]="Regular",e[e.Small=20]="Small",e))(We||{});const wi=({className:e})=>p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,children:p.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"})}),Dp=({className:e})=>{const t=pe("bsc-h-6 bsc-w-6",e);return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:t,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})})},Np=({className:e})=>{const t=pe("bsc-h-6 bsc-w-6",e);return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:t,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5 8.25 12l7.5-7.5"})})},Ip=({className:e})=>{const t=pe("bsc-h-6 bsc-w-6",e);return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:t,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"})})},jp=({className:e})=>{const t=pe("bsc-h-6 bsc-w-6",e);return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:t,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"})})},Mp=({className:e})=>p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})}),Xe=({icon:e,size:t=We.Regular,onClick:r,className:n})=>{const s=d.useRef({calendar:wi,chevronDown:Dp,chevronLeft:Np,chevronRight:Ip,chevronUp:jp,close:Mp}),o=d.useMemo(()=>s.current[e]||wi,[e]),i=pe({"bsc-h-[24px] bsc-w-[24px]":t===We.Regular,"bsc-h-[20px] bsc-w-[20px]":t===We.Small},n);return p.jsx("div",{onClick:r,children:p.jsx(o,{className:i})})},kt=({template:e,props:t,children:r})=>e(t,r);function Rp(e,t){if(t===e)return!1;const r=Object.values(t),n=Object.values(e);if(r.length!==n.length||r.some((o,i)=>o!==n[i]))return!0;const s=Object.keys(e);return Object.keys(t).some((o,i)=>o!==s[i])}function Ap(e,t){return e.matches[t]=!1,e.mediaQueries[t]={},e}function Pi(e){const t=Object.keys(e);return typeof window>"u"?t.reduce(Ap,{mediaQueries:{},matches:{}}):t.reduce((r,n)=>{const s=window.matchMedia(e[n]);return r.mediaQueries[n]=s,r.matches[n]=s.matches,r},{mediaQueries:{},matches:{}})}function Lp(e,t){function r(n,s){return n[s]=e.mediaQueries[s].matches,n}switch(t.type){case"updateMatches":return{matches:Object.keys(e.mediaQueries).reduce(r,{}),mediaQueries:e.mediaQueries};case"setQueries":return Pi(t.queries)}}function $p(e){const t=lr.useRef(e),[r,n]=lr.useReducer(Lp,e,Pi);lr.useEffect(()=>{Rp(e,t.current)&&(n({type:"setQueries",queries:e}),t.current=e)},[e]);function s(){return n({type:"updateMatches"})}function o(u){const f=s;return typeof u.addListener<"u"?u.addListener(f):u.addEventListener("change",f),f}lr.useEffect(()=>{const u=Object.values(r.mediaQueries),f=u.map(o);function h(g,x){typeof g.addListener<"u"?g.removeListener(f[x]):g.removeEventListener("change",f[x])}return()=>{u.forEach(h)}},[r.mediaQueries]);const{matches:i}=r,a=lr.useMemo(()=>Object.values(i),[i]);return{matches:i,matchesAny:a.some(Boolean),matchesAll:a.length>0&&a.every(Boolean)}}function Jr(e){return $p(Fp(e)).matchesAll}const Xn={};function Fp(e){return Xn[e]===void 0&&(Xn[e]={default:e}),Xn[e]}const Jn=({mobileQuery:e="screen and (max-device-width: 40rem)",tabletQuery:t="screen and (min-device-width: 40.01rem) and (max-device-width: 63.9375rem)",desktopQuery:r="screen and (min-device-width: 64rem)",mobileMarkup:n,aboveMobileMarkup:s,tabletMarkup:o,desktopMarkup:i})=>{const a=Jr(e),u=Jr(t),f=Jr(r);return(()=>a&&n?n:!a&&s?s:u&&o?o:f&&i?i:(console.error("Invalid media settings"),null))()};function Si(e,t,r){const n=o=>{const i=o.target,a=e.style.display!=="hidden";e&&a&&!Ep(e,i)&&!s(r,i)&&t(!1),t(!0)},s=(o,i)=>{if(!o)return!1;for(let a=0,u=o.length;a<u;a++)if(o[a].isSameNode(i)||o[a].contains(i))return!0;return!1};return document.addEventListener("mousedown",n),n}function Ti(e){document.removeEventListener("mousedown",e)}function Hp(e,t){if(e==null)return{};var r={},n=Object.keys(e),s,o;for(o=0;o<n.length;o++)s=n[o],!(t.indexOf(s)>=0)&&(r[s]=e[s]);return r}function es(e,t){return es=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},es(e,t)}function Yp(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,es(e,t)}var ts={exports:{}},en={exports:{}},ve={};/** @license React v16.13.1
|
|
37
70
|
* react-is.production.min.js
|
|
38
71
|
*
|
|
39
72
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
40
73
|
*
|
|
41
74
|
* This source code is licensed under the MIT license found in the
|
|
42
75
|
* LICENSE file in the root directory of this source tree.
|
|
43
|
-
*/var
|
|
76
|
+
*/var Ei;function Vp(){if(Ei)return ve;Ei=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,f=e?Symbol.for("react.concurrent_mode"):60111,h=e?Symbol.for("react.forward_ref"):60112,g=e?Symbol.for("react.suspense"):60113,x=e?Symbol.for("react.suspense_list"):60120,v=e?Symbol.for("react.memo"):60115,T=e?Symbol.for("react.lazy"):60116,I=e?Symbol.for("react.block"):60121,j=e?Symbol.for("react.fundamental"):60117,E=e?Symbol.for("react.responder"):60118,D=e?Symbol.for("react.scope"):60119;function Q(y){if(typeof y=="object"&&y!==null){var F=y.$$typeof;switch(F){case t:switch(y=y.type,y){case u:case f:case n:case o:case s:case g:return y;default:switch(y=y&&y.$$typeof,y){case a:case h:case T:case v:case i:return y;default:return F}}case r:return F}}}function U(y){return Q(y)===f}return ve.AsyncMode=u,ve.ConcurrentMode=f,ve.ContextConsumer=a,ve.ContextProvider=i,ve.Element=t,ve.ForwardRef=h,ve.Fragment=n,ve.Lazy=T,ve.Memo=v,ve.Portal=r,ve.Profiler=o,ve.StrictMode=s,ve.Suspense=g,ve.isAsyncMode=function(y){return U(y)||Q(y)===u},ve.isConcurrentMode=U,ve.isContextConsumer=function(y){return Q(y)===a},ve.isContextProvider=function(y){return Q(y)===i},ve.isElement=function(y){return typeof y=="object"&&y!==null&&y.$$typeof===t},ve.isForwardRef=function(y){return Q(y)===h},ve.isFragment=function(y){return Q(y)===n},ve.isLazy=function(y){return Q(y)===T},ve.isMemo=function(y){return Q(y)===v},ve.isPortal=function(y){return Q(y)===r},ve.isProfiler=function(y){return Q(y)===o},ve.isStrictMode=function(y){return Q(y)===s},ve.isSuspense=function(y){return Q(y)===g},ve.isValidElementType=function(y){return typeof y=="string"||typeof y=="function"||y===n||y===f||y===o||y===s||y===g||y===x||typeof y=="object"&&y!==null&&(y.$$typeof===T||y.$$typeof===v||y.$$typeof===i||y.$$typeof===a||y.$$typeof===h||y.$$typeof===j||y.$$typeof===E||y.$$typeof===D||y.$$typeof===I)},ve.typeOf=Q,ve}var xe={};/** @license React v16.13.1
|
|
44
77
|
* react-is.development.js
|
|
45
78
|
*
|
|
46
79
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
47
80
|
*
|
|
48
81
|
* This source code is licensed under the MIT license found in the
|
|
49
82
|
* LICENSE file in the root directory of this source tree.
|
|
50
|
-
*/var
|
|
83
|
+
*/var _i;function Wp(){return _i||(_i=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,f=e?Symbol.for("react.concurrent_mode"):60111,h=e?Symbol.for("react.forward_ref"):60112,g=e?Symbol.for("react.suspense"):60113,x=e?Symbol.for("react.suspense_list"):60120,v=e?Symbol.for("react.memo"):60115,T=e?Symbol.for("react.lazy"):60116,I=e?Symbol.for("react.block"):60121,j=e?Symbol.for("react.fundamental"):60117,E=e?Symbol.for("react.responder"):60118,D=e?Symbol.for("react.scope"):60119;function Q(A){return typeof A=="string"||typeof A=="function"||A===n||A===f||A===o||A===s||A===g||A===x||typeof A=="object"&&A!==null&&(A.$$typeof===T||A.$$typeof===v||A.$$typeof===i||A.$$typeof===a||A.$$typeof===h||A.$$typeof===j||A.$$typeof===E||A.$$typeof===D||A.$$typeof===I)}function U(A){if(typeof A=="object"&&A!==null){var De=A.$$typeof;switch(De){case t:var Ge=A.type;switch(Ge){case u:case f:case n:case o:case s:case g:return Ge;default:var $e=Ge&&Ge.$$typeof;switch($e){case a:case h:case T:case v:case i:return $e;default:return De}}case r:return De}}}var y=u,F=f,k=a,q=i,z=t,oe=h,ce=n,ne=T,M=v,H=r,L=o,O=s,J=g,R=!1;function ge(A){return R||(R=!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.")),S(A)||U(A)===u}function S(A){return U(A)===f}function N(A){return U(A)===a}function C(A){return U(A)===i}function P(A){return typeof A=="object"&&A!==null&&A.$$typeof===t}function V(A){return U(A)===h}function X(A){return U(A)===n}function Y(A){return U(A)===T}function B(A){return U(A)===v}function K(A){return U(A)===r}function re(A){return U(A)===o}function _(A){return U(A)===s}function ie(A){return U(A)===g}xe.AsyncMode=y,xe.ConcurrentMode=F,xe.ContextConsumer=k,xe.ContextProvider=q,xe.Element=z,xe.ForwardRef=oe,xe.Fragment=ce,xe.Lazy=ne,xe.Memo=M,xe.Portal=H,xe.Profiler=L,xe.StrictMode=O,xe.Suspense=J,xe.isAsyncMode=ge,xe.isConcurrentMode=S,xe.isContextConsumer=N,xe.isContextProvider=C,xe.isElement=P,xe.isForwardRef=V,xe.isFragment=X,xe.isLazy=Y,xe.isMemo=B,xe.isPortal=K,xe.isProfiler=re,xe.isStrictMode=_,xe.isSuspense=ie,xe.isValidElementType=Q,xe.typeOf=U}()),xe}var Ci;function ki(){return Ci||(Ci=1,process.env.NODE_ENV==="production"?en.exports=Vp():en.exports=Wp()),en.exports}/*
|
|
51
84
|
object-assign
|
|
52
85
|
(c) Sindre Sorhus
|
|
53
86
|
@license MIT
|
|
54
|
-
*/var
|
|
55
|
-
Valid keys: `+JSON.stringify(Object.keys(b),null," "));var _=te(Y,E,H,K,A+"."+E,t);if(_)return _}return null}return O(T)}function F(b){switch(typeof b){case"number":case"string":case"undefined":return!0;case"boolean":return!b;case"object":if(Array.isArray(b))return b.every(F);if(b===null||a(b))return!0;var T=p(b);if(T){var V=T.call(b),S;if(T!==b.entries){for(;!(S=V.next()).done;)if(!F(S.value))return!1}else for(;!(S=V.next()).done;){var H=S.value;if(H&&!F(H[1]))return!1}}else return!1;return!0;default:return!1}}function j(b,T){return b==="symbol"?!0:T?T["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&T instanceof Symbol:!1}function k(b){var T=typeof b;return Array.isArray(b)?"array":b instanceof RegExp?"object":j(T,b)?"symbol":T}function G(b){if(typeof b>"u"||b===null)return""+b;var T=k(b);if(T==="object"){if(b instanceof Date)return"date";if(b instanceof RegExp)return"regexp"}return T}function N(b){var T=G(b);switch(T){case"array":case"object":return"an "+T;case"boolean":case"date":case"regexp":return"a "+T;default:return T}}function W(b){return!b.constructor||!b.constructor.name?v:b.constructor.name}return y.checkPropTypes=s,y.resetWarningCache=s.resetWarningCache,y.PropTypes=y,y},En}var Cn,wo;function hh(){if(wo)return Cn;wo=1;var e=Pn();function r(){}function t(){}return t.resetWarningCache=r,Cn=function(){function n(i,a,c,d,h,p){if(p!==e){var v=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 v.name="Invariant Violation",v}}n.isRequired=n;function s(){return n}var o={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 o.PropTypes=o,o},Cn}if(process.env.NODE_ENV!=="production"){var ph=po(),mh=!0;vn.exports=dh()(ph.isElement,mh)}else vn.exports=hh()();var gh=vn.exports;const ne=Hr(gh),Po={disabled:!1};var bh=process.env.NODE_ENV!=="production"?ne.oneOfType([ne.number,ne.shape({enter:ne.number,exit:ne.number,appear:ne.number}).isRequired]):null;process.env.NODE_ENV!=="production"&&ne.oneOfType([ne.string,ne.shape({enter:ne.string,exit:ne.string,active:ne.string}),ne.shape({enter:ne.string,enterDone:ne.string,enterActive:ne.string,exit:ne.string,exitDone:ne.string,exitActive:ne.string})]);const To=f.createContext(null);var yh=function(r){return r.scrollTop},Kt="unmounted",ft="exited",dt="entering",Ct="entered",kn="exiting",Je=function(e){ah(r,e);function r(n,s){var o;o=e.call(this,n,s)||this;var i=s,a=i&&!i.isMounting?n.enter:n.appear,c;return o.appearStatus=null,n.in?a?(c=ft,o.appearStatus=dt):c=Ct:n.unmountOnExit||n.mountOnEnter?c=Kt:c=ft,o.state={status:c},o.nextCallback=null,o}r.getDerivedStateFromProps=function(s,o){var i=s.in;return i&&o.status===Kt?{status:ft}:null};var t=r.prototype;return t.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},t.componentDidUpdate=function(s){var o=null;if(s!==this.props){var i=this.state.status;this.props.in?i!==dt&&i!==Ct&&(o=dt):(i===dt||i===Ct)&&(o=kn)}this.updateStatus(!1,o)},t.componentWillUnmount=function(){this.cancelNextCallback()},t.getTimeouts=function(){var s=this.props.timeout,o,i,a;return o=i=a=s,s!=null&&typeof s!="number"&&(o=s.exit,i=s.enter,a=s.appear!==void 0?s.appear:i),{exit:o,enter:i,appear:a}},t.updateStatus=function(s,o){if(s===void 0&&(s=!1),o!==null)if(this.cancelNextCallback(),o===dt){if(this.props.unmountOnExit||this.props.mountOnEnter){var i=this.props.nodeRef?this.props.nodeRef.current:He.findDOMNode(this);i&&yh(i)}this.performEnter(s)}else this.performExit();else this.props.unmountOnExit&&this.state.status===ft&&this.setState({status:Kt})},t.performEnter=function(s){var o=this,i=this.props.enter,a=this.context?this.context.isMounting:s,c=this.props.nodeRef?[a]:[He.findDOMNode(this),a],d=c[0],h=c[1],p=this.getTimeouts(),v=a?p.appear:p.enter;if(!s&&!i||Po.disabled){this.safeSetState({status:Ct},function(){o.props.onEntered(d)});return}this.props.onEnter(d,h),this.safeSetState({status:dt},function(){o.props.onEntering(d,h),o.onTransitionEnd(v,function(){o.safeSetState({status:Ct},function(){o.props.onEntered(d,h)})})})},t.performExit=function(){var s=this,o=this.props.exit,i=this.getTimeouts(),a=this.props.nodeRef?void 0:He.findDOMNode(this);if(!o||Po.disabled){this.safeSetState({status:ft},function(){s.props.onExited(a)});return}this.props.onExit(a),this.safeSetState({status:kn},function(){s.props.onExiting(a),s.onTransitionEnd(i.exit,function(){s.safeSetState({status:ft},function(){s.props.onExited(a)})})})},t.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},t.safeSetState=function(s,o){o=this.setNextCallback(o),this.setState(s,o)},t.setNextCallback=function(s){var o=this,i=!0;return this.nextCallback=function(a){i&&(i=!1,o.nextCallback=null,s(a))},this.nextCallback.cancel=function(){i=!1},this.nextCallback},t.onTransitionEnd=function(s,o){this.setNextCallback(o);var i=this.props.nodeRef?this.props.nodeRef.current:He.findDOMNode(this),a=s==null&&!this.props.addEndListener;if(!i||a){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var c=this.props.nodeRef?[this.nextCallback]:[i,this.nextCallback],d=c[0],h=c[1];this.props.addEndListener(d,h)}s!=null&&setTimeout(this.nextCallback,s)},t.render=function(){var s=this.state.status;if(s===Kt)return null;var o=this.props,i=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var a=ih(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return f.createElement(To.Provider,{value:null},typeof i=="function"?i(s,a):f.cloneElement(f.Children.only(i),a))},r}(f.Component);Je.contextType=To,Je.propTypes=process.env.NODE_ENV!=="production"?{nodeRef:ne.shape({current:typeof Element>"u"?ne.any:function(e,r,t,n,s,o){var i=e[r];return ne.instanceOf(i&&"ownerDocument"in i?i.ownerDocument.defaultView.Element:Element)(e,r,t,n,s,o)}}),children:ne.oneOfType([ne.func.isRequired,ne.element.isRequired]).isRequired,in:ne.bool,mountOnEnter:ne.bool,unmountOnExit:ne.bool,appear:ne.bool,enter:ne.bool,exit:ne.bool,timeout:function(r){var t=bh;r.addEndListener||(t=t.isRequired);for(var n=arguments.length,s=new Array(n>1?n-1:0),o=1;o<n;o++)s[o-1]=arguments[o];return t.apply(void 0,[r].concat(s))},addEndListener:ne.func,onEnter:ne.func,onEntering:ne.func,onEntered:ne.func,onExit:ne.func,onExiting:ne.func,onExited:ne.func}:{};function kt(){}Je.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:kt,onEntering:kt,onEntered:kt,onExit:kt,onExiting:kt,onExited:kt},Je.UNMOUNTED=Kt,Je.EXITED=ft,Je.ENTERING=dt,Je.ENTERED=Ct,Je.EXITING=kn;const vh=Je,So=({start:e,timeout:r=400,defaultStyle:t,transitionStyles:n,showTransitionOptions:s="cubic-bezier(0, 0, 0.2, 1)",hideTransitionOptions:o="linear",unmountOnExit:i=!1,onEntering:a,onEntered:c,onExit:d,onExited:h,children:p})=>{const v=t||{transition:`opacity ${r}ms ${s}`,opacity:0},y=n||{entering:{opacity:1},entered:{opacity:1},exiting:{transition:`opacity ${r}ms ${o}`,opacity:0},exited:{transition:`opacity ${r}ms ${o}`,opacity:0},unmounted:{}};return l.jsx(vh,{in:e,timeout:r,onEntering:a,onEntered:c,onExit:d,onExited:h,unmountOnExit:i,children:x=>p({state:x,defaultStyle:v,transitionStyles:y})})};function Eo(e){return e.target?e.target:e}const Co=({visible:e,target:r,appendTo:t=document.body,unmountWhenHidden:n=!1,transitionDuration:s=400,showTransitionOptions:o="cubic-bezier(0, 0, 0.2, 1)",hideTransitionOptions:i="linear",approveText:a="DONE",shown:c,hidden:d,isClickedWithin:h,children:p})=>{const[v,y]=f.useState(-1),[x,D]=f.useState(-1),[O,P]=f.useState(e),R=f.useRef(100),z=f.useRef(101),$=f.useRef(),g=f.useRef(),L=f.useRef();f.useEffect(()=>{r&&($.current=Eo(r));const I=Kn("zIndex",F=>F==="auto"||F==="-1"?!1:parseInt(F)>100).map(F=>parseInt(F,10));I.length>0&&(R.current=Math.max(...I)+1,z.current=Math.max(...I)+2),P(e)},[e,r]);const C=I=>{g.current=I},U=()=>{D(R.current),y(z.current)},B=()=>{if(!g.current)return;c==null||c();let I;$.current&&(I=[$.current]);const F=j=>{j?h==null||h():P(!1)};L.current=co(g.current,F,I)},se=()=>{L.current&&uo(L.current)},re=()=>{D(-1),y(-1),d==null||d()},ee={entering:{opacity:.5},entered:{opacity:.5}};return He.createPortal(l.jsx(So,{start:O,timeout:s,showTransitionOptions:o,hideTransitionOptions:i,onEntering:U,onEntered:B,onExit:se,onExited:re,unmountOnExit:n,children:({state:I,defaultStyle:F,transitionStyles:j})=>l.jsxs("div",{ref:k=>k&&C(k),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:x,...j[I],...ee[I]}}),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:v,...F,...j[I]},children:[l.jsx("div",{className:"bsc-w-full",children:p}),l.jsx(l.Fragment,{children:l.jsx(Ve,{buttonType:"primary",fullWidth:!0,onClick:()=>P(!1),className:"bsc-text-xs bsc-font-bold",children:a})})]})]})}),t)};var ko=(e=>(e[e.TopLeft=0]="TopLeft",e[e.TopRight=1]="TopRight",e[e.BottomLeft=2]="BottomLeft",e[e.BottomRight=3]="BottomRight",e))(ko||{}),Do=(e=>(e[e.TopLeft=0]="TopLeft",e[e.TopRight=1]="TopRight",e[e.BottomLeft=2]="BottomLeft",e[e.BottomRight=3]="BottomRight",e))(Do||{});class we{static positionToTarget(r,t=2){const n=r.getBoundingClientRect();let s=0,o=0;const i=window.scrollY;switch(t){case 2:s=n.top+n.height+i,o=n.left;break;case 0:s=n.top+i,o=n.left;break;case 3:s=n.top+n.height+i,o=n.left+n.width;break;case 1:s=n.top+i,o=n.left+n.width}return{top:s,left:o}}static positionElementToTarget(r,t,n=0,s=2){let{left:o,top:i}=we.positionToTarget(t,s);const a=r.getBoundingClientRect();switch(n){case 0:break;case 1:o=o-a.width;break;case 2:i=i-a.height;break;case 3:i=i-a.height,o=o-a.width;break}return{top:i,left:o}}static canPositionElementOnScreenWithTarget(r,t){const n=we.getScreenDimensions(),s=r.getBoundingClientRect(),o=we.positionElementToTarget(r,t,0,2);if(o.left+s.width<n.width&&o.top+s.height<n.height||we.positionElementToTarget(r,t,1,3).left>=0&&o.top+s.height<n.height)return!0;const a=we.positionElementToTarget(r,t,2,0);if(a.left+s.width<n.width&&a.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:o,top:i}=we.positionElementToTarget(r,t,n,s),a=r.getBoundingClientRect(),c=we.determineOffScreenLocation(a);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:i,left:o}}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 Oo=({visible:e,target:r,targetPosition:t=ko.BottomLeft,elementAlignment:n=Do.TopLeft,shouldTargetCloseOverlay:s=!0,shouldMatchTargetWidth:o=!1,shouldScrollCloseOverlay:i=!1,shouldCheckZIndex:a=!1,shouldRemainOnScreen:c=!1,unmountWhenHidden:d=!1,transitionDuration:h=400,showTransitionOptions:p="cubic-bezier(0, 0, 0.2, 1)",hideTransitionOptions:v="linear",shown:y,hidden:x,isClickedWithin:D,markupCreated:O,children:P})=>{const[R,z]=f.useState(-1),[$,g]=f.useState(e),[L,C]=f.useState(!1),U=f.useRef(!1),B=f.useRef(100),se=f.useRef({left:0,top:0,width:0}),re=f.useRef(),ee=f.useRef(),I=f.useRef(),F=f.useRef(),j=f.useRef(),k=f.useRef(),G=Fn();f.useEffect(()=>(c===!0&&(k.current=new ResizeObserver(N)),()=>{var A,Y;c===!0&&(ee.current&&((A=k.current)==null||A.unobserve(ee.current)),(Y=k.current)==null||Y.disconnect())}),[]),f.useEffect(()=>{if(r&&(re.current=Eo(r),i)){const A=G==null?void 0:G.isValidScrollableElement;I.current=Gn(re.current,{overflow:"scroll, auto",overflowX:"scroll, auto",overflowY:"scroll, auto"},!1,A),I.current.tagName.toLowerCase()==="html"&&(I.current=document)}if(a){const A=Kn("zIndex",Y=>parseInt(Y)>=100).map(Y=>parseInt(Y));A.length>0&&(B.current=Math.max(...A)+1)}e!==void 0&&g(e)},[r,e,i,a]);const N=A=>{if(ee.current){const Y=we.getScreenDimensions(),q=A[A.length-1].target,Q=q.getBoundingClientRect(),E=we.determineOffScreenLocation(Q);if(E){if(re.current&&we.canPositionElementOnScreenWithTarget(q,re.current)){const te=we.positionElementToTargetOnScreen(ee.current,re.current,n,t);se.current={...se.current,...te}}else E.right?se.current.left=Y.width-Q.width:E.left&&(se.current.left=0),E.bottom?se.current.top=Y.height-Q.height:E.top&&(se.current.top=0);W()}}},W=Vt(()=>{U.current=!U.current,C(U.current)},20),b=()=>{z(B.current)},T=()=>{if(!ee.current)return;y==null||y();let A;!s&&re.current&&(A=[re.current]);const Y=q=>{q?D==null||D():g(!1)};F.current=co(ee.current,Y,A),i&&(j.current=Ml(q=>ee.current&&ni(q,ee.current)&&g(!1),100,{leading:!0}),I.current&&I.current.addEventListener("scroll",j.current))},V=()=>{I.current&&j.current&&(I.current.removeEventListener("scroll",j.current),j.current=void 0),F.current&&uo(F.current)},S=()=>{z(-1),x==null||x()},H=A=>{var Y,q;if(c===!0&&ee.current&&((Y=k.current)==null||Y.unobserve(ee.current)),ee.current=A,O==null||O(A),re.current){const Q=we.positionElementToTarget(ee.current,re.current,n,t);se.current={...Q,width:re.current.offsetWidth},c===!0&&(we.canPositionElementOnScreenWithTarget(ee.current,re.current)||we.canPositionElementOnScreen(ee.current))&&((q=k.current)==null||q.observe(ee.current))}},K=f.useMemo(()=>{const A={top:`${se.current.top}px`,left:`${se.current.left}px`,zIndex:R};return o&&(A.width=`${se.current.width}px`),A},[L,R,o]);return l.jsx(So,{start:$,timeout:h,showTransitionOptions:p,hideTransitionOptions:v,onEntering:b,onEntered:T,onExit:V,onExited:S,unmountOnExit:d,children:({state:A,defaultStyle:Y,transitionStyles:q})=>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:{...K,...Y,...q[A]},ref:Q=>Q&&H(Q),children:P})})};let yr;const xh=new Uint8Array(16);function wh(){if(!yr&&(yr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!yr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return yr(xh)}const Ne=[];for(let e=0;e<256;++e)Ne.push((e+256).toString(16).slice(1));function Ph(e,r=0){return Ne[e[r+0]]+Ne[e[r+1]]+Ne[e[r+2]]+Ne[e[r+3]]+"-"+Ne[e[r+4]]+Ne[e[r+5]]+"-"+Ne[e[r+6]]+Ne[e[r+7]]+"-"+Ne[e[r+8]]+Ne[e[r+9]]+"-"+Ne[e[r+10]]+Ne[e[r+11]]+Ne[e[r+12]]+Ne[e[r+13]]+Ne[e[r+14]]+Ne[e[r+15]]}const No={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Th(e,r,t){if(No.randomUUID&&!r&&!e)return No.randomUUID();e=e||{};const n=e.random||(e.rng||wh)();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 Ph(n)}class Zt{static create(r){const t=[];let n=0;for(let s=0,o=r.formatParts.length;s<o;s++){const i=r.formatParts[s],a=n,c=a+i.characterCount;t.push({startPosition:a,endPosition:c,...i}),n=c}return t}}class Sh{constructor(r,t){m(this,"instanceCollection");m(this,"formatPartList");m(this,"inputSlotCollection");m(this,"currentPartIndex",0);m(this,"currentPartIndices",[]);m(this,"currentCursorPosition",0);m(this,"highlightCursorPosition",0);m(this,"currentCursorStartPosition",-1);m(this,"currentCursorEndPosition",-1);m(this,"inputElement");m(this,"inputSelection",null);m(this,"inputRange");m(this,"textNode");this.instanceCollection=Dt.getInstance(),this.formatPartList=Zt.create(r),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(t,r)}get isSelection(){return this.inputRange!==void 0&&this.inputRange.startOffset!==this.inputRange.endOffset}get isAllSelected(){var t;const r=this.inputSlotCollection.getLastSlot();return this.isSelection&&((t=this.inputRange)==null?void 0:t.startOffset)===0&&this.inputRange.endOffset===r.endPosition}getCursorPosition(){return this.currentCursorPosition}getCursorStartPosition(){return this.currentCursorStartPosition}getCursorEndPosition(){return this.currentCursorEndPosition}getCurrentPartIndex(){return this.currentPartIndex}getCurrentPartIndices(){return this.currentPartIndices}setInputElement(r){this.inputElement=r}setCursorToCurrentPosition(){this.setCursorSelection(this.currentCursorPosition>-1?this.currentCursorPosition:this.highlightCursorPosition)}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.currentPartIndices=[],t===void 0||r===t?(this.currentCursorPosition=t||r,this.highlightCursorPosition=t||r,this.currentCursorStartPosition=-1,this.currentCursorEndPosition=-1,this.setPartIndexByCursorPosition()):(r<t?(this.currentCursorStartPosition!==r?this.highlightCursorPosition=r:this.currentCursorEndPosition!==t&&(this.highlightCursorPosition=t),this.currentCursorStartPosition=r,this.currentCursorEndPosition=t):(this.currentCursorStartPosition!==t?this.highlightCursorPosition=t:this.currentCursorEndPosition!==r&&(this.highlightCursorPosition=r),this.currentCursorStartPosition=t,this.currentCursorEndPosition=r),this.currentCursorPosition=-1,this.setPartIndexByHighlightPosition(),this.setPartIndicesByCursorPositions()))}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 d=document.createRange();return d.selectNodeContents(c),d.compareBoundaryPoints(Range.END_TO_END,r)<1?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT});let o=0;for(;s.nextNode();)o+=((n=s.currentNode.textContent)==null?void 0:n.length)||0;r.startContainer.nodeType===Node.TEXT_NODE&&(o+=r.startOffset);const i=this.inputSlotCollection.getLastSlotWithData(),a=i.startPosition+i.partText.length;r.startOffset===r.endOffset?this.setCursorSelection(o>a?a:o):this.setCursorSelection(r.startOffset,r.endOffset)}}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.updateCursorPosition(),this.currentCursorPosition>0&&!this.isSelection){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--)if(t=this.formatPartList[n],r>=t.startPosition&&r<=t.endPosition){t.isSeparator?this.setCursorSelection(this.formatPartList[n-1].endPosition):this.setCursorSelection(r);break}}else this.isSelection?this.setCursorSelection(this.currentCursorPosition):this.moveHome()}moveCursorRight(){this.updateCursorPosition(!1);const r=this.inputSlotCollection.getLastSlotWithData(),t=r.startPosition+r.partText.length;if(this.currentCursorPosition<t&&!this.isSelection){const n=this.currentCursorPosition+1;let s=this.formatPartList[this.currentPartIndex];if(n>=s.startPosition&&n<=s.endPosition)this.setCursorSelection(n);else for(let o=this.currentPartIndex+1,i=this.formatPartList.length;o<i;o++)if(s=this.formatPartList[o],n>=s.startPosition&&n<=s.endPosition){s.isSeparator?this.setCursorSelection(this.formatPartList[o+1].startPosition):this.setCursorSelection(n);break}}else this.setCursorSelection(this.currentCursorPosition)}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))}}highlightAll(){const r=this.formatPartList[this.formatPartList.length-1].endPosition;this.setCursorSelection(0,r)}moveHighlightLeft(){this.updateHighlightPositions();const r=this.highlightCursorPosition>this.currentCursorStartPosition;if(this.currentCursorStartPosition>0||r){let t=r?this.currentCursorStartPosition:this.currentCursorStartPosition-1,n=r?this.highlightCursorPosition-1:this.currentCursorEndPosition,s=this.formatPartList[this.currentPartIndex];if(t>=s.startPosition&&t<=s.endPosition||r&&n>=s.startPosition&&n<=s.endPosition)this.setCursorSelection(t,n);else for(let o=this.currentPartIndex-1;o>=0;o--)if(s=this.formatPartList[o],t>=s.startPosition&&t<=s.endPosition||r&&n>=s.startPosition&&n<=s.endPosition){s.isSeparator?(r?n=this.formatPartList[o-1].endPosition-1:t=this.formatPartList[o-1].endPosition-1,this.setCursorSelection(t,n)):this.setCursorSelection(t,n);break}}}moveHighlightRight(){this.updateHighlightPositions();const r=this.inputSlotCollection.getLastSlotWithData(),t=r.startPosition+r.partText.length,n=this.highlightCursorPosition<this.currentCursorEndPosition;if(this.currentCursorEndPosition<t||n){let s=n?this.highlightCursorPosition+1:this.currentCursorStartPosition,o=n?this.currentCursorEndPosition:this.currentCursorEndPosition+1,i=this.formatPartList[this.currentPartIndex];if(o>=i.startPosition&&o<=i.endPosition||n&&s>=i.startPosition&&s<=i.endPosition)this.setCursorSelection(s,o);else for(let a=this.currentPartIndex+1,c=this.formatPartList.length;a<c;a++)if(i=this.formatPartList[a],o>=i.startPosition&&o<=i.endPosition||n&&s>=i.startPosition&&s<=i.endPosition){i.isSeparator?(n?s=this.formatPartList[a+1].startPosition+1:o=this.formatPartList[a+1].startPosition+1,this.setCursorSelection(s,o)):this.setCursorSelection(s,o);break}}}updateHighlightPositions(){this.currentCursorStartPosition===-1&&this.currentCursorEndPosition===-1&&this.currentCursorPosition>-1&&(this.currentCursorStartPosition=this.currentCursorPosition,this.currentCursorEndPosition=this.currentCursorPosition,this.highlightCursorPosition=this.currentCursorPosition)}updateCursorPosition(r=!0){this.currentCursorPosition===-1&&this.currentCursorStartPosition>-1&&this.currentCursorEndPosition>-1&&(r?this.currentCursorPosition=this.currentCursorStartPosition:this.currentCursorPosition=this.currentCursorEndPosition)}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}}}setPartIndexByHighlightPosition(){for(let r=0;r<this.formatPartList.length;r++){const t=this.formatPartList[r];if(this.highlightCursorPosition>=t.startPosition&&this.highlightCursorPosition<=t.endPosition){if(t.isSeparator){this.highlightCursorPosition=this.formatPartList[r+1].startPosition,this.currentPartIndex=r+1;break}this.currentPartIndex=r;break}}}setPartIndicesByCursorPositions(){for(let r=0,t=this.formatPartList.length;r<t;r++){const n=this.formatPartList[r];n.isSeparator||(n.startPosition>=this.currentCursorStartPosition&&n.startPosition<=this.currentCursorEndPosition||n.endPosition>=this.currentCursorStartPosition&&n.endPosition<=this.currentCursorEndPosition||n.startPosition<this.currentCursorStartPosition&&n.endPosition>this.currentCursorEndPosition)&&this.currentPartIndices.push(r)}}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 Eh{static create(r){const t=[];for(let n=0,s=r.length;n<s;n++){const o=r[n];o.isSeparator||t.push({partIndex:n,partText:"",isComplete:!1,...o})}return t}}class Ch{constructor(r){m(this,"inputSlots");this.inputSlots=Eh.create(Zt.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)}getSlots(r){return this.inputSlots.filter(t=>r.includes(t.partIndex))}getSlotsFromCursorPosition(r){let t=-1;for(let n=0,s=this.inputSlots.length;n<s;n++){const o=this.inputSlots[n];if(r>=o.startPosition&&r<=o.endPosition){t=n;break}}return t>-1?this.inputSlots.filter(n=>n.partIndex>=t):void 0}getFirstSlot(){return this.inputSlots[0]}getLastSlot(){return this.inputSlots[this.inputSlots.length-1]}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 Dt{static getInstance(){return this.instance||(this.instance=new kh),this.instance}}m(Dt,"instance");class kh{constructor(){m(this,"navigatorInstances");m(this,"inputSlotInstances");this.navigatorInstances={},this.inputSlotInstances={}}getNavigatorInstance(r,t){return this.navigatorInstances[r]||(this.navigatorInstances[r]=new Sh(t,r)),this.navigatorInstances[r]}getInputSlotInstance(r,t){return this.inputSlotInstances[r]||(this.inputSlotInstances[r]=new Ch(t)),this.inputSlotInstances[r]}removeInstances(r){this.navigatorInstances[r]&&delete this.navigatorInstances[r],this.inputSlotInstances[r]&&delete this.inputSlotInstances[r]}}class Dn{constructor(r,t){m(this,"instanceCollection");m(this,"formatPartList");m(this,"inputSlotCollection");m(this,"inputElement");this.instanceCollection=Dt.getInstance(),this.formatPartList=Zt.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 o=this.formatPartList[n];if(o.isSeparator)r+=o.inputText;else{const i=this.inputSlotCollection.getSlot(n);i&&(r+=i.partText+((t=i.inputText)==null?void 0:t.repeat(i.characterCount-i.partText.length)))}}this.inputElement&&(this.inputElement.innerHTML=r)}}var qe=(e=>(e[e.Text=0]="Text",e[e.Numeric=1]="Numeric",e))(qe||{});class _o{constructor(){m(this,"numberKeys",["0","1","2","3","4","5","6","7","8","9"]);m(this,"movementKeys",["ArrowLeft","ArrowRight","Home","End","a"]);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 Dh{constructor(r){m(this,"_currentIndex",0);m(this,"index",0);m(this,"formatParts");this.formatParts=Zt.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 Oh{constructor(r){m(this,"formatParts");this.formatParts=Zt.create(r)}getUniqueSeparators(){const r=[],t=this.formatParts.filter(n=>n.isSeparator);for(let n=0,s=t.length;n<s;n++){const o=t[n];o.inputText&&!r.includes(o.inputText)&&r.push(o.inputText)}return r}}class Io{constructor(r,t){m(this,"instanceCollection");m(this,"inputSlotCollection");m(this,"formatNavigator");m(this,"keyTypeChecker");m(this,"formatRenderer");m(this,"formatPartList");m(this,"partEntryList");this.format=r,this.instanceCollection=Dt.getInstance(),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(t,r),this.formatNavigator=this.instanceCollection.getNavigatorInstance(t,r),this.keyTypeChecker=new _o,this.formatRenderer=new Dn(r,t),this.formatPartList=new Dh(r),this.partEntryList=new Oh(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 o=this.formatPartList.currentIndex,i=this.formatPartList.next();if(i&&i.inputText){const a=r.indexOf(i.inputText,t),c=this.inputSlotCollection.getSlot(o);if(c&&a>-1){const d=a-t>c.characterCount?t+c.characterCount:a;c.partText=r.substring(t,d),this.processSlotRules(c),t=a+i.characterCount}}}else{const o=this.inputSlotCollection.getSlot(this.formatPartList.currentIndex);o&&(o.partText=r.substring(t,t+o.characterCount),this.processSlotRules(o))}}}processPastedValue(r,t=!1){t&&this.processSelectionEditRules();const n=this.formatNavigator.getCursorPosition(),s=this.inputSlotCollection.getSlotsFromCursorPosition(n);if(s){const o=n-s[0].startPosition,i=s[0].partText.substring(0,o);let a=s[0].partText.substring(o);s[0].partText="";for(let p=1,v=s.length;p<v;p++)a+=s[p].partText,s[p].partText="";const c=this.removeSeparatorsFromValue(r),d=i+c+a;let h=0;for(let p=0,v=s.length;p<v;p++){const y=s[p];y.partText=d.substring(h,y.characterCount+h),h+=y.characterCount,this.processSlotRules(y)}}}removeSeparatorsFromValue(r){let t=r;const n=this.partEntryList.getUniqueSeparators();for(let s=0,o=n.length;s<o;s++){const i=n[s];t=t.replaceAll(i,"")}return t}processEditRules(r){this.formatNavigator.isSelection?this.processSelectionEditRules():this.processNonSelectionEditRules(r)}processNonSelectionEditRules(r){const t=this.inputSlotCollection.getSlot(this.formatNavigator.getCurrentPartIndex());if(!t)return;const n=this.formatNavigator.getCursorPosition(),s=n-t.startPosition,o=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),o&&this.shiftFormatParts(t),this.formatRenderer.render(),this.formatNavigator.moveCursorLeft(),this.processSlotRules(t,!0);else{this.processSlotRules(t,!0);const a=this.inputSlotCollection.getPreviousSlot(t.partIndex);a&&(a.partText=a.partText.substring(0,a.partText.length-1),o&&this.shiftFormatParts(a),this.formatRenderer.render(),this.formatNavigator.setCursorPosition(a.startPosition+a.partText.length),this.processSlotRules(a,!0))}break}case"Delete":t.partText=t.partText.substring(0,s)+t.partText.substring(s+1),o&&this.shiftFormatParts(t),this.formatRenderer.render(),this.formatNavigator.setCursorToCurrentPosition(),this.processSlotRules(t,!0);break}}processSelectionEditRules(){const r=this.inputSlotCollection.getSlots(this.formatNavigator.getCurrentPartIndices());if(r.length<=0)return;const t=this.formatNavigator.getCursorStartPosition(),n=this.formatNavigator.getCursorEndPosition();for(let s=0,o=r.length;s<o;s++){const i=r[s];i.startPosition>=t&&i.endPosition<=n?i.partText="":i.startPosition>=t&&i.endPosition>n?i.partText=i.partText.substring(n-i.startPosition):i.startPosition<t&&i.endPosition<=n?i.partText=i.partText.substring(0,t-i.startPosition):i.startPosition<t&&i.endPosition>n&&(i.partText=i.partText.substring(0,t-i.startPosition)+i.partText.substring(n-i.startPosition))}this.formatRenderer.render(),this.formatNavigator.setCursorPosition(t);for(let s=0,o=r.length;s<o;s++)this.processSlotRules(r[s])}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,o=t.partText;if(t.valueType===qe.Numeric){if(!this.keyTypeChecker.isNumberKey(n))return;const i=t.maximumValue,a=t.exceedingMaximumValueCausesTab||!1,c=t.padWithZeros||!1,d=parseInt(this.createNewValue(t,n));if(i&&d>i)if(a){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 o.length+1===s?(this.addToInputSlot(n),t.isComplete=!0,this.formatRenderer.render(),this.formatNavigator.isAtLastPart()?this.formatNavigator.moveCursorRight():this.formatNavigator.moveToNextInputPart()):o.length+1<s&&(this.addToInputSlot(n),this.formatRenderer.render(),this.formatNavigator.moveCursorRight())}else o.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 o=s-r.startPosition;return n.substring(0,o)+t+n.substring(o)}}processSlotRules(r,t=!1){const n=r.characterCount,s=r.allCharactersRequired||!1;if(r.valueType===qe.Numeric){const o=r.minimumValue,i=r.maximumValue;if(s)r.isComplete=r.partText.length===n;else if(o!==void 0&&i!==void 0){const a=r.padWithZeros||!1,c=parseInt(r.partText);r.isComplete=c>=o&&c<=i,r.isComplete&&a&&!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 Nh{constructor(r,t){m(this,"instanceCollection");m(this,"formatNavigator");m(this,"ruleProcessor");m(this,"keyTypeChecker");m(this,"formatRenderer");this.format=r,this.instanceCollection=Dt.getInstance(),this.formatNavigator=this.instanceCollection.getNavigatorInstance(t,r),this.ruleProcessor=new Io(r,t),this.keyTypeChecker=new _o,this.formatRenderer=new Dn(r,t)}setInputElement(r){this.ruleProcessor.setInputElement(r),this.formatRenderer.setInputElement(r)}processMovementKey(r){const{key:t,metaKey:n,ctrlKey:s,shiftKey:o}=r;switch(t){case"ArrowLeft":o?this.formatNavigator.moveHighlightLeft():n?this.formatNavigator.moveHome():this.formatNavigator.moveCursorLeft();break;case"ArrowRight":o?this.formatNavigator.moveHighlightRight():n?this.formatNavigator.moveEnd():this.formatNavigator.moveCursorRight();break;case"Home":this.formatNavigator.moveHome();break;case"End":this.formatNavigator.moveEnd();break;case"a":(n||s)&&this.formatNavigator.highlightAll();break}}processKeyPress(r){return this.keyTypeChecker.isIgnoreKey(r)?!1:this.keyTypeChecker.isMovementKey(r)?(this.processMovementKey(r),!1):(this.ruleProcessor.processKeyPress(r),!0)}}class _h{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=Th(),this.instanceCollection=Dt.getInstance(),this.keyProcessor=new Nh(r,this.instanceId),this.formatNavigator=this.instanceCollection.getNavigatorInstance(this.instanceId,r),this.formatRenderer=new Dn(r,this.instanceId),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(this.instanceId,r),this.inputRuleProcessor=new Io(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),this.renderFormat())}pastedValue(r){r.length>0&&(this.formatNavigator.isSelection?this.formatNavigator.isAllSelected?this.inputValuePassed(r):this.inputRuleProcessor.processPastedValue(r,!0):this.inputValue.length===0?this.inputValuePassed(r):this.inputRuleProcessor.processPastedValue(r),this.renderFormat(!0))}registerFormatChangeEvent(r){this.onFormatChange=r}mouseUpHandler(){this.formatNavigator.findCursorPosition()}keyDownHandler(r){r.key!=="Tab"&&(!(r.key==="c"&&(r.ctrlKey||r.metaKey))&&!(r.key==="v"&&(r.ctrlKey||r.metaKey))&&(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)}renderFormat(r=!1){setTimeout(()=>{var t,n;this.formatRenderer.render(),this.isInputFocused&&this.formatNavigator.setCursorToCurrentPosition(),this.inputValue.length>0&&(this.previousOutputValue=(t=this.inputElement)==null?void 0:t.innerHTML),r&&((n=this.inputElement)!=null&&n.innerHTML)&&this.onFormatChange&&this.onFormatChange(this.inputElement.innerHTML)})}}const Ih=(e,r)=>{const{value:t="",format:n,readOnly:s=!1,debounceTime:o=800,fillContainer:i=!0,leftElement:a,rightElement:c,className:d,leftElementClassName:h,rightElementClassName:p,isSingleLine:v=!1,allowSingleLineScroll:y=!1,isInputValid:x,onChange:D,onFocus:O,onBlur:P,onElementCreate:R,onLeftElementClick:z,onRightElementClick:$}=e,[g,L]=f.useState(!0),C=f.useRef(),U=f.useRef(),B=f.useRef();f.useEffect(()=>()=>{var W;(W=B.current)==null||W.dispose()},[]),f.useEffect(()=>{var W;(W=B.current)==null||W.inputValuePassed(t)},[t]),f.useEffect(()=>{var W,b,T;(W=B.current)==null||W.dispose(),n&&(B.current=new _h(n,t),U.current&&((b=B.current)==null||b.inputElementCreated(U.current)),(T=B.current)==null||T.registerFormatChangeEvent(se))},[n]);const se=f.useCallback(W=>{x?x(W)?(L(!0),D==null||D(W)):L(!1):D==null||D(W)},[D]),re=f.useCallback(W=>{var b;(b=B.current)==null||b.inputFocused(),O==null||O(W)},[O]),ee=f.useCallback(W=>{var b;(b=B.current)==null||b.inputBlurred(),P==null||P(W)},[P]),I=f.useCallback(()=>{var W;(W=B.current)==null||W.mouseUpHandler()},[]),F=f.useCallback(W=>{var b;(b=B.current)==null||b.keyDownHandler(W)},[]),j=f.useCallback(W=>{var T,V;W.preventDefault(),W.stopPropagation();const b=(T=W.clipboardData)==null?void 0:T.getData("text/plain");b&&((V=B.current)==null||V.pastedValue(b))},[]),k=f.useCallback(W=>{var b,T,V,S,H,K,A,Y,q,Q,E,te,_;(T=(b=C.current)==null?void 0:b.inputElement)==null||T.removeEventListener("keydown",F),(S=(V=C.current)==null?void 0:V.inputElement)==null||S.removeEventListener("mouseup",I),(K=(H=C.current)==null?void 0:H.inputElement)==null||K.removeEventListener("paste",j),C.current=W,(Y=(A=C.current)==null?void 0:A.inputElement)==null||Y.addEventListener("keydown",F),(Q=(q=C.current)==null?void 0:q.inputElement)==null||Q.addEventListener("mouseup",I),(te=(E=C.current)==null?void 0:E.inputElement)==null||te.addEventListener("paste",j),U.current=(_=C.current)==null?void 0:_.inputElement},[]),G=f.useCallback(()=>{var W;(W=C.current)==null||W.focus()},[]);f.useImperativeHandle(r,()=>({focus:G}));const N=le(d,{"!bsc-border-error":!g});return l.jsx(hr,{ref:W=>W&&k(W),readOnly:s,debounceTime:o,fillContainer:i,leftElement:a,rightElement:c,className:N,leftElementClassName:h,rightElementClassName:p,isSingleLine:v,allowSingleLineScroll:y,onFocus:re,onBlur:ee,onElementCreate:R,onLeftElementClick:z,onRightElementClick:$})},jo=f.forwardRef(Ih),On=f.createContext(void 0);function Mo(e,r,t=!0){var v,y;const n=eo(e),s=Gs(e),o=jf(e);let i=ln(s)-(((v=r.options)==null?void 0:v.weekStartsOn)||0);i=i===-1?6:i;const a=ln(o)-(((y=r.options)==null?void 0:y.weekStartsOn)||0),c=Yl({start:s,end:o}),d=n+i>35?6:5,h=Ro(d,7,{dayValue:null,isCurrent:!0});let p=1;for(let x=0,D=d;x<D;x++){for(let O=x>0?0:i;O<7;O++){const P=c[p-1];if(P.setHours(e.getHours(),e.getMinutes(),e.getSeconds()),h[x][O].dayValue=P,++p>n)break}if(p>n)break}if(i>0&&t)for(let x=0;x<i;x++)h[0][x].dayValue=Nd(s,i-x),h[0][x].isCurrent=!1;if(a>-1&&t)for(let x=6;x>a;x--)h[d-1][x].dayValue=St(o,x-a),h[d-1][x].isCurrent=!1;return h}function Ro(e,r,t){const n=[];for(let s=0,o=e;s<o;s++){const i=[];for(let a=0,c=r;a<c;a++){const d=jh(t)?t:{...t};i.push(d)}n.push(i)}return n}function jh(e){const r=typeof e;return r==="string"||r==="number"||r==="boolean"||e instanceof Date}function Mh(e){var n;const r=_d(new Date,((n=e.options)==null?void 0:n.weekStartsOn)||0),t=[];for(let s=0;s<7;s++)t.push(St(r,s).toLocaleDateString(e.code,{weekday:"short"}));return t}function Rh(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 o=0;o<4;o++)t[s][o]={monthNumber:n,monthName:tt(r,n++).toLocaleDateString(e.code,{month:"short"})};return t}function Lh(e,r){const t=new Date(e.getTime()),n=Math.floor(t.getFullYear()/10)*10;t.setFullYear(n);const s=Wl({start:t,end:Ut(t,9)}),o=Ro(3,4,"");let i=0;for(let a=0;a<3;a++)for(let c=0;c<4&&(o[a][c]=s[i++].toLocaleDateString(r.code,{year:"numeric"}),i!==s.length);c++);return o}function Ah(e){const r=new Date;return r.setHours(0,0,0,0),r.toLocaleTimeString(e.code)}function Fh(e,r,t){return e.getTime()>=r.getTime()&&e.getTime()<=t.getTime()}async function Lo(e){return(await import(`/node_modules/date-fns/locale/${$h(e)}`)).default}function $h(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=Id(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 Nn(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 ge=(e=>(e[e.DateTime=0]="DateTime",e[e.DateOnly=1]="DateOnly",e[e.TimeOnly=2]="TimeOnly",e[e.DateRange=3]="DateRange",e))(ge||{}),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||{}),Ot=(e=>(e[e.Day=0]="Day",e[e.Month=1]="Month",e[e.Year=2]="Year",e[e.Range=3]="Range",e))(Ot||{}),Xt=(e=>(e[e.Short=0]="Short",e[e.Medium=1]="Medium",e[e.Long=2]="Long",e))(Xt||{}),Se=(e=>(e[e.TwelveHour=0]="TwelveHour",e[e.TwentyFourHour=1]="TwentyFourHour",e))(Se||{}),nt=(e=>(e[e.Normal=0]="Normal",e[e.Range=1]="Range",e))(nt||{}),vr=(e=>(e[e.Right=0]="Right",e[e.Left=1]="Left",e[e.None=2]="None",e))(vr||{}),oe=(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))(oe||{});const Hh=(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:Yh(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 Yh(e){return e?Array.isArray(e)?e[0]:e:new Date}const _n=(e,r,t)=>{const n=f.useCallback(c=>{t({type:oe.SetViewDate,viewDate:tt(r,c)})},[r]),s=f.useCallback(c=>{t({type:oe.SetViewDate,viewDate:pn(r,c)})},[r]),o=f.useCallback(c=>{t({type:oe.SetViewDate,viewDate:Ut(r,c)})},[r]),i=f.useCallback(c=>{t({type:oe.SetViewDate,viewDate:mn(r,c)})},[r]),a=f.useCallback(c=>{t({type:oe.SetDateSelector,dateSelector:c})},[]);return{...e,incrementViewMonths:n,decrementViewMonths:s,incrementViewYears:o,decrementViewYears:i,setDateSelector:a}},xr=({viewDate:e,selectedDate:r,selectedStartDate:t,selectedEndDate:n,selectionMode:s=nt.Normal,locale:o,onDateSelected:i,selectableDate:a,isValidDate:c,dispatcher:d})=>{var j;const[h,p]=f.useState(!1),[v,y]=f.useState(),[x,D]=f.useState(),[O,P]=f.useState(),[R,z]=f.useState(),$=f.useRef(),g=f.useRef(),L=f.useContext(On),C=f.useMemo(()=>L.calendarTemplate,[L.calendarTemplate]),U=async()=>o||await Lo(qn());f.useEffect(()=>{U().then(k=>{$.current=k,g.current=Mh($.current),p(!0)}).catch(k=>console.error(k))},[]),f.useEffect(()=>{e&&$.current&&P(Mo(e,$.current,s===nt.Normal))},[e,h]),f.useEffect(()=>{z(r?new Date(r.getFullYear(),r.getMonth(),r.getDate()):void 0)},[r]),f.useEffect(()=>{y(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]),f.useEffect(()=>{$.current&&o&&($.current=o,P(Mo(e,$.current,s===nt.Normal)))},[o]);const B=k=>{if(s===nt.Normal)d==null||d({type:oe.SetSelectedDate,selectedDate:k,viewDate:k}),i==null||i(k);else{if(!i)throw new Error("Range selection mode requires onDateSelected to be set");!t||Mf(k,t)?i(k):t&&!n?i(k,{setEndDate:!0}):t&&n&&i(k)}},se=k=>(R==null?void 0:R.toLocaleDateString())===k.toLocaleDateString(),re=k=>{if(v&&x){const G=k.getTime();return G>=v&&G<=x}return!1},ee=_n({viewDate:e,selectedDate:r,selectedStartDate:t,selectedEndDate:n,selectionMode:s,locale:o,weekDays:g.current,monthMatrix:O,selectableDate:a,isValidDate:c,onDateClicked:B,isSelectedDate:se,isInSelectedDateRange:re},e,d),F=C||((k,G)=>l.jsx("div",{className:"bc-dt-calendar bsc-w-full",children:G}));return l.jsx(lt,{props:ee,template:F,children:l.jsxs("div",{className:"bc-dt-day-row bsc-grid bsc-min-w-[329px] bsc-grid-cols-7 bsc-gap-3",children:[(j=g.current)==null?void 0:j.map((k,G)=>l.jsx("div",{className:"bc-dt-day-cell bsc-text-center bsc-font-bold",children:k},G)),O==null?void 0:O.map((k,G)=>k.map((N,W)=>{var V,S;const b=N.dayValue!==null&&(a===void 0||a(N.dayValue)),T=le("bsc-text-center bsc-py-1",{"bsc-text-gray-3":!N.isCurrent,"bsc-bg-primary-3 dark:bsc-bg-mono-light-1 dark:bsc-text-mono-dark-1":N&&N.dayValue&&(R&&se(N.dayValue)||v&&!x&&qs(v,N.dayValue)||v&&x&&re(N.dayValue)),"bsc-cursor-pointer":b,"bsc-text-error bsc-cursor-not-allowed":!b,"bsc-bg-primary-5 dark:bsc-bg-mono-light-3 dark:bsc-text-mono-dark-1":N.dayValue&&Od(N.dayValue)&&!(se(N.dayValue)||re(N.dayValue))},"bc-dt-date-cell");return l.jsx("div",{className:T,onClick:()=>N&&N.dayValue&&b&&(c===void 0||c(N.dayValue))&&B(N.dayValue),children:(S=N.dayValue)==null?void 0:S.getDate().toLocaleString((V=$.current)==null?void 0:V.code)},G.toString()+W.toString())}))]})})},wr=({title:e,scrollerType:r,onTitleClicked:t,onMovePrevious:n,onMoveNext:s,viewDate:o,dispatcher:i})=>{const c=f.useContext(On).dateScrollerTemplate,d=_n({title:e,scrollerType:r,onTitleClicked:t,onMovePrevious:n,onMoveNext:s},o,i),p=c||((v,y)=>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:y}));return l.jsxs(lt,{props:d,template:p,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(Fe,{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(Ve,{className:"bsc-bg-transparent focus:bsc-outline-none",onClick:s,children:l.jsx(Fe,{icon:"chevronRight",size:je.Regular})})})]})},Wh=({selectedDate:e,viewDate:r,locale:t,showTimeSelector:n,selectableDate:s,isValidDate:o,onChange:i,dispatcher:a})=>{const c=()=>{r&&a({type:oe.SetViewDate,viewDate:pn(r,1)})},d=()=>{r&&a({type:oe.SetViewDate,viewDate:tt(r,1)})},h=()=>{a({type:oe.SetDateSelector,dateSelector:Oe.MonthSelector})},p=()=>{a({type:oe.SetDateSelector,dateSelector:Oe.TimeSelector})},v=()=>r?r.toLocaleDateString(t.code,{month:"long",year:"numeric"}):"";return l.jsxs("div",{className:"bc-dt-day-selector bsc-p-2",children:[l.jsx(wr,{title:v(),scrollerType:Ot.Day,onTitleClicked:h,onMovePrevious:c,onMoveNext:d,viewDate:r,dispatcher:a}),l.jsx(xr,{viewDate:r,selectedDate:e,locale:t,selectableDate:s,isValidDate:o,onDateSelected:i,dispatcher:a}),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))||Ah(t)})})]})},Vh=({viewDate:e,locale:r,dateSelection:t=ge.DateTime,dispatcher:n})=>{const s=f.useRef(Rh(r)),o=()=>{const h=mn(e,1);n({type:oe.SetViewDate,viewDate:h})},i=()=>{const h=Ut(e,1);n({type:oe.SetViewDate,viewDate:h})},a=h=>{n({type:oe.SetDateSelector,dateSelector:t!==ge.DateRange?Oe.DaySelector:Oe.DateRangeSelector,viewDate:Gd(e,h)})},c=()=>e.toLocaleDateString(r.code,{year:"numeric"}),d=()=>{n({type:oe.SetDateSelector,dateSelector:Oe.YearSelector})};return l.jsxs("div",{className:"bc-dt-month-selector bsc-p-2",style:{minWidth:"20rem"},children:[l.jsx(wr,{title:c(),scrollerType:Ot.Month,onTitleClicked:d,onMovePrevious:o,onMoveNext:i,viewDate:e,dispatcher:n}),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((v,y)=>l.jsx("div",{className:"bc-dt-month-cell bsc-cursor-pointer bsc-text-center",onClick:()=>a(v.monthNumber),children:v.monthName},p.toString()+y.toString())))})]})},Bh=({viewDate:e,selectedStartDate:r,selectedEndDate:t,locale:n,onChange:s,dispatcher:o})=>{const i=gr("screen and (max-device-width: 40rem)"),a=tt(e,1),c=(y,x)=>{!x||!x.setEndDate?o({type:oe.SetSelectedStartDate,selectedStartDate:y}):(o({type:oe.SetSelectedEndDate,selectedEndDate:y}),r&&(s==null||s([r,y])))},d=()=>{o({type:oe.SetDateSelector,dateSelector:Oe.MonthSelector})},h=()=>i?`${e.toLocaleDateString(n.code,{month:"long"})} ${e.toLocaleDateString(n.code,{year:"numeric"})}`:`${e.toLocaleDateString(n.code,{month:"long"})} ${e.toLocaleDateString(n.code,{year:"numeric"})} - ${a.toLocaleDateString(n.code,{month:"long"})} ${a.toLocaleDateString(n.code,{year:"numeric"})}`,p=()=>{e&&o({type:oe.SetViewDate,viewDate:pn(e,1)})},v=()=>{e&&o({type:oe.SetViewDate,viewDate:tt(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(wr,{title:h(),scrollerType:Ot.Range,onTitleClicked:d,onMovePrevious:p,onMoveNext:v,viewDate:e,dispatcher:o})}),l.jsx("div",{className:"bsc-flex-grow",children:l.jsx(bn,{mobileMarkup:l.jsx("div",{className:"bc-dt-range-calendar bsc-px-2 bsc-py-1",children:l.jsx(xr,{viewDate:e,selectedStartDate:r,selectedEndDate:t,selectionMode:nt.Range,onDateSelected:c,locale:n,dispatcher:o})}),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(xr,{viewDate:e,selectedStartDate:r,selectedEndDate:t,selectionMode:nt.Range,onDateSelected:c,locale:n,dispatcher:o})}),l.jsx("div",{className:"bc-dt-range-calendar-2 bsc-pl-4",children:l.jsx(xr,{viewDate:a,selectedStartDate:r,selectedEndDate:t,selectionMode:nt.Range,onDateSelected:c,locale:n,dispatcher:o})})]})})})]})},Uh=({viewDate:e,showDateSelector:r,locale:t,timeFormat:n=Se.TwelveHour,timeConstraints:s,onChange:o,dispatcher:i})=>{const a=f.useRef(n===Se.TwelveHour?11:23),c=f.useRef(n===Se.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"]),d=f.useRef(ri(0,59,I=>I.toString().padStart(2,"0"))),h=f.useRef(["AM","PM"]),p=f.useRef(Dl(e)),v=I=>I>11?I-12:I,[y,x]=f.useState(v(e.getHours())),[D,O]=f.useState(e.getMinutes()),[P,R]=f.useState(e.getHours()<=12?0:1),z=f.useRef(e.toLocaleDateString(t.code));f.useEffect(()=>{const I=e.getHours(),F=e.getMinutes();if(I!==y&&x(n===Se.TwelveHour?v(I):I),F!==D&&O(F),n===Se.TwelveHour){const j=I<=11?0:1;j!==P&&R(j)}},[e]);const $=()=>{var j;const I=((j=s==null?void 0:s.hours)==null?void 0:j.step)||1,F=y<a.current?y+I:0;x(F),B(F,D,P)},g=()=>{var j;const I=((j=s==null?void 0:s.hours)==null?void 0:j.step)||1,F=y>0?y-I:a.current;x(F),B(F,D,P)},L=()=>{var j,k,G;const I=((j=s==null?void 0:s.minutes)==null?void 0:j.step)||1,F=D+I<(((k=s==null?void 0:s.minutes)==null?void 0:k.max)||59)?D+I:((G=s==null?void 0:s.minutes)==null?void 0:G.min)||0;O(F),B(y,F,P)},C=()=>{var j,k,G;const I=((j=s==null?void 0:s.minutes)==null?void 0:j.step)||1,F=D-I>=(((k=s==null?void 0:s.minutes)==null?void 0:k.min)||0)?D-I:(((G=s==null?void 0:s.minutes)==null?void 0:G.max)||60)-I;O(F),B(y,F,P)},U=()=>{const I=P===0?1:0;R(I),B(y,D,I)},B=(I,F,j)=>{const k=n===Se.TwelveHour&&j===1?I+12:I;p.current.setHours(k,F),i({type:oe.SetSelectedDate,selectedDate:p.current,viewDate:p.current}),o==null||o(p.current)},se=()=>{i({type:oe.SetDateSelector,dateSelector:Oe.DaySelector})},re=le("bsc-w-full bsc-grid bsc-grid-rows-3 bsc-gap-4 bc-dt-time-grid",{"bsc-grid-cols-4":n===Se.TwelveHour,"bsc-grid-cols-3":n===Se.TwentyFourHour}),ee=le("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===Se.TwelveHour,"bsc-col-span-3":n===Se.TwentyFourHour});return l.jsx("div",{className:"bc-dt-time-selector bsc-flex bsc-flex-row bsc-justify-center bsc-p-2",style:{minWidth:n===Se.TwelveHour?"15rem":"11rem"},children:l.jsxs("div",{className:re,children:[r&&l.jsx("div",{className:ee,onClick:se,children:z.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:$,children:l.jsx(Fe,{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(Ve,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:L,children:l.jsx(Fe,{icon:"chevronUp",size:je.Regular})})}),n===Se.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:U,children:l.jsx(Fe,{icon:"chevronUp",size:je.Regular})})}),l.jsx("div",{className:"bc-dt-time-hour-value bsc-text-center",children:c.current[y]}),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:d.current[D]}),n===Se.TwelveHour&&l.jsx("div",{className:"bc-dt-time-meridian-value bsc-text-center",children:h.current[P]}),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:g,children:l.jsx(Fe,{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(Ve,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:C,children:l.jsx(Fe,{icon:"chevronDown",size:je.Regular})})}),n===Se.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:U,children:l.jsx(Fe,{icon:"chevronDown",size:je.Regular})})})]})})},zh=({viewDate:e,locale:r,dispatcher:t})=>{const n=Lh(e,r),s=()=>{const c=mn(e,10);t({type:oe.SetViewDate,viewDate:c})},o=()=>{const c=Ut(e,10);t({type:oe.SetViewDate,viewDate:c})},i=c=>{const d=parseInt(c);t({type:oe.SetDateSelector,dateSelector:Oe.MonthSelector,viewDate:Kd(e,d)})},a=()=>`${n[0][0].toString()} - ${n[2][1].toString()}`;return l.jsxs("div",{className:"bc-dt-year-selector",style:{minWidth:"20rem"},children:[l.jsx(wr,{title:a(),scrollerType:Ot.Year,onMovePrevious:s,onMoveNext:o,viewDate:e,dispatcher:t}),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,d)=>c.map((h,p)=>h.length>0?l.jsx("div",{className:"bc-dt-year-cell bsc-cursor-pointer bsc-text-center",onClick:()=>i(h),children:h},d.toString()+p.toString()):l.jsx("div",{},d.toString()+p.toString())))})})]})};class qh{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,o=20,a=new Date(n,s-1,o).toLocaleDateString(t,{year:"numeric",month:"numeric",day:"numeric"});this.dateFormat=a.replace(`${n}`,"YYYY").replace(`${s}`,"MM").replace(`${o}`,"DD");const c=new Date,d=18,h=24,p=37,v=317;c.setHours(d,h,p,v);const y=c.toLocaleTimeString(t);this.use24HourTime=y.startsWith("18"),this.timeFormat=y.replace(`${this.use24HourTime?d:"6"}`,"HH").replace(`${h}`,"MM").replace(`${p}`,"SS").replace(`${v}`,"LLL"),this.createDateParts()}get is24HourTime(){return this.use24HourTime}createInputFormat(){const r={deleteShiftsFormatPart:!1,formatParts:[]};switch(this.dateSelection){case ge.DateOnly:return this.createDateFormat(r);case ge.TimeOnly:return this.createTimeFormat(r);case ge.DateRange:return this.createDateRangeFormat(r);case ge.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 o={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};return[this.monthPart,s,this.dayPart,o,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 o={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};return[this.dayPart,s,this.monthPart,o,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 o={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};return[this.yearPart,s,this.monthPart,o,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},o={characterCount:1,placeholder:" ",inputText:" ",isSeparator:!0};return[this.twelveHourPart,s,this.minutePart,o,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 Gh=(e,r)=>{var o;const[t,n]=f.useState(),s=f.useRef();return f.useEffect(()=>{r&&!t&&(s.current=new qh(e,r),n(s.current.createInputFormat()))},[r]),[t,(o=s.current)==null?void 0:o.is24HourTime]},Kh=({value:e,readOnly:r=!1,label:t,useDefaultDateValue:n=!1,useFormattedInput:s=!1,allowClear:o=!1,closeSelector:i=!1,locale:a,className:c,dateSelection:d=ge.DateTime,dateFormat:h,timeConstraints:p,icon:v,iconPosition:y=vr.Right,inputElement:x,selectableDate:D,isValidDate:O,onChange:P,calendarTemplate:R,dateScrollerTemplate:z,inputTemplate:$,wrapperTemplate:g})=>{const[L,C]=f.useState(!1),[U,B]=f.useState(),[se,re]=f.useState(),[ee,I,F]=ti(d),j=f.useRef(),k=f.useRef(!1),G=f.useRef(a||qn()),N=f.useRef(),W=f.useRef(),b=f.useRef(),T=f.useRef(null),V=f.useRef(null),[S,H]=Gh(d,U),K=f.useRef({calendarTemplate:R,dateScrollerTemplate:z});f.useEffect(()=>{G.current&&Y(G.current)},[G]),f.useEffect(()=>{a&&Y(a)},[a]),f.useEffect(()=>{if(e){const Z=q();te({type:oe.InitializeDates,initialDate:Z})}else te({type:oe.ClearDates})},[e,N.current]),f.useEffect(()=>{H&&te({type:oe.SetTimeFormat,timeFormat:H?Se.TwentyFourHour:Se.TwelveHour})},[H]),f.useEffect(()=>{x&&(W.current=x)},[x]),f.useEffect(()=>{te({type:oe.SetDateSelector,dateSelector:A()})},[ee]);const A=f.useCallback(()=>F.current===ge.TimeOnly?Oe.TimeSelector:F.current===ge.DateTime||F.current===ge.DateOnly?Oe.DaySelector:Oe.DateRangeSelector,[]),Y=Z=>{Lo(Z).then(ae=>{B(ae.code),N.current=ae;const Re=q();te(e||n?{type:oe.InitializeDates,initialDate:Array.isArray(Re)?Re[0]:Re}:{type:oe.SetViewDate,viewDate:Array.isArray(Re)?Re[0]:Re})}).catch(ae=>console.error(ae))},q=()=>{const Z=new Date;return Z.setHours(0,0,0,0),e?typeof e=="string"?F.current!==ge.DateRange?Qt(e,N.current):Nn(e,N.current):e:Z},Q={currentSelector:A(),currentViewDate:new Date,timeFormat:Se.TwelveHour,dateInitialized:!1},[E,te]=f.useReducer(Hh,Q),_=()=>{Or(),C(!0)},_e=f.useMemo(()=>Vt(()=>{C(!1)},250),[]),st=f.useMemo(()=>Vt(()=>{_e.cancel()},5),[_e]),Ge=Z=>{const ae=Z.target.innerText;er(ae)},pt=Z=>{if(Z){const ae=F.current!==ge.DateRange?Qt(Z,N.current):Nn(Z,N.current);return ae?O?Array.isArray(ae)?ae.every(Re=>O(Re)):O(ae):!0:!1}else return!0},Cr=Z=>{er(Z||"")},er=Z=>{const ae=F.current!==ge.DateRange?Qt(Z,N.current):Nn(Z,N.current);ae?(Array.isArray(ae)?(Fh(ae[0],Gs(E.currentViewDate),Hl(tt(E.currentViewDate,1)))||te({type:oe.SetViewDate,viewDate:ae[0]}),te({type:oe.SetSelectedDateRange,selectedStartDate:ae[0],selectedEndDate:ae[1]})):te({type:oe.SetSelectedDate,selectedDate:ae,viewDate:ae}),P==null||P(ae)):Z===""&&(te({type:oe.ClearDates}),P==null||P())},_t=Z=>{F.current===ge.DateOnly&&i===!0&&C(!1),P==null||P(Z)},kr=()=>{Or(),C(!L),V.current?V.current.focus():T.current&&T.current.focus()},Dr=()=>{te({type:oe.ClearDates}),C(!1),P==null||P()},mt=(Z,ae)=>{(!W.current||j.current!==ae)&&(W.current=Z,j.current=ae,k.current=!0)},Or=()=>{(!b.current||k.current)&&W.current&&(b.current=W.current,re(W.current),k.current=!1)},Nr=()=>{C(!1),te({type:oe.SetDateSelector,dateSelector:A()})},_r=()=>{switch(h){case Xt.Short:return"short";case Xt.Medium:return"medium";case Xt.Long:return"long";default:return}},gt=()=>{var ae,Re,et,It,jt,rr,Ar,nr,Fr,sr,or,$r;const Z=_r();switch(F.current){case ge.DateTime:return E.selectedDate?Z?E.selectedDate.toLocaleString((ae=N.current)==null?void 0:ae.code,{dateStyle:Z,timeStyle:Z}):E.selectedDate.toLocaleString((Re=N.current)==null?void 0:Re.code):"";case ge.DateOnly:return E.selectedDate?Z?E.selectedDate.toLocaleDateString((et=N.current)==null?void 0:et.code,{dateStyle:Z}):E.selectedDate.toLocaleDateString((It=N.current)==null?void 0:It.code):"";case ge.TimeOnly:return E.selectedDate?Z?E.selectedDate.toLocaleTimeString((jt=N.current)==null?void 0:jt.code,{timeStyle:Z,hour12:E.timeFormat===Se.TwelveHour,hourCycle:E.timeFormat===Se.TwentyFourHour?"h23":void 0}):E.selectedDate.toLocaleTimeString((rr=N.current)==null?void 0:rr.code,{hour12:E.timeFormat===Se.TwelveHour,hourCycle:E.timeFormat===Se.TwentyFourHour?"h23":void 0}):"";case ge.DateRange:return E.selectedStartDate&&E.selectedEndDate?Z?`${E.selectedStartDate.toLocaleDateString((Ar=N.current)==null?void 0:Ar.code,{dateStyle:Z})} - ${E.selectedEndDate.toLocaleDateString((nr=N.current)==null?void 0:nr.code,{dateStyle:Z})}`:`${E.selectedStartDate.toLocaleDateString((Fr=N.current)==null?void 0:Fr.code)} - ${E.selectedEndDate.toLocaleDateString((sr=N.current)==null?void 0:sr.code)}`:"";default:return E.selectedDate?Z?E.selectedDate.toLocaleString((or=N.current)==null?void 0:or.code,{dateStyle:Z,timeStyle:Z}):E.selectedDate.toLocaleString(($r=N.current)==null?void 0:$r.code):""}},Ke=ee===ge.DateTime||ee===ge.DateOnly||ee===ge.DateRange,In=ee===ge.DateTime||ee===ge.TimeOnly,ot=y===vr.None?{}:y===vr.Right?{rightElement:l.jsxs("div",{className:"bsc-flex bsc-text-black dark:bsc-text-mono-light-1",children:[o&&!r&&l.jsx("div",{children:l.jsx(Fe,{icon:"close",size:je.Small,className:"bsc-cursor-pointer bsc-text-sm",onClick:Dr})}),l.jsx("div",{className:"bsc-ml-2",onClick:r?void 0:kr,children:v||l.jsx(Fe,{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:v||l.jsx(Fe,{icon:"calendar",size:je.Small,className:r?void 0:"bsc-cursor-pointer"})}),o&&!r&&l.jsx("div",{children:l.jsx(Fe,{icon:"close",size:je.Small,className:"bsc-cursor-pointer bsc-text-sm",onClick:Dr})})]}),leftElementClassName:"bsc-justify-center"},Ir={setDateSelector:Z=>I(Z)},jn=g||((Z,ae)=>l.jsx(l.Fragment,{children:ae})),Mr=()=>l.jsx(lt,{props:Ir,template:jn,children:l.jsxs(l.Fragment,{children:[E.currentSelector===Oe.DaySelector&&Ke&&E.dateInitialized&&N.current&&l.jsx(Wh,{selectedDate:E.selectedDate,viewDate:E.currentViewDate,locale:N.current,showTimeSelector:F.current===ge.DateTime,selectableDate:D,isValidDate:O,dispatcher:te,onChange:_t}),E.currentSelector===Oe.MonthSelector&&Ke&&E.dateInitialized&&N.current&&l.jsx(Vh,{viewDate:E.currentViewDate,locale:N.current,dateSelection:F.current,dispatcher:te}),E.currentSelector===Oe.YearSelector&&Ke&&E.dateInitialized&&N.current&&l.jsx(zh,{viewDate:E.currentViewDate,locale:N.current,dispatcher:te}),E.currentSelector===Oe.TimeSelector&&In&&E.dateInitialized&&N.current&&l.jsx(Uh,{viewDate:E.currentViewDate,showDateSelector:F.current===ge.DateTime,locale:N.current,timeFormat:E.timeFormat,timeConstraints:p,onChange:P,dispatcher:te}),E.currentSelector===Oe.DateRangeSelector&&Ke&&E.dateInitialized&&N.current&&l.jsx(Bh,{viewDate:E.currentViewDate,selectedStartDate:E.selectedStartDate,selectedEndDate:E.selectedEndDate,locale:N.current,onChange:P,dispatcher:te})]})}),Rr=_n({label:t,readOnly:r,allowClear:o,getValue:gt,onFocus:_,onInput:Ge,iconPosition:y,iconElement:ot.rightElement||ot.leftElement},E.currentViewDate,te),Lr=$||((Z,ae)=>l.jsx(l.Fragment,{children:ae})),tr=le("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(On.Provider,{value:K.current,children:l.jsxs("div",{className:"bc-date-time",children:[t&&l.jsx(Ze,{label:t,readOnly:r,className:"bc-dt-label"}),l.jsx(bn,{mobileMarkup:l.jsxs(l.Fragment,{children:[l.jsx(lt,{props:Rr,template:Lr,children:l.jsx(hr,{ref:T,value:gt(),readOnly:r,inputMode:"none",className:tr,onFocus:_,onElementCreate:Z=>mt(Z,!1),...ot})}),l.jsx(Co,{visible:L,target:se,hidden:Nr,unmountWhenHidden:!0,children:Mr()})]}),aboveMobileMarkup:l.jsxs(l.Fragment,{children:[l.jsx(lt,{props:Rr,template:Lr,children:s===!1?l.jsx(hr,{ref:T,value:gt(),readOnly:r,className:tr,onFocus:_,onBlur:_e,onInput:Ge,onElementCreate:Z=>mt(Z,!1),...ot}):l.jsx(jo,{ref:V,value:gt(),readOnly:r,className:tr,format:S,isInputValid:pt,onFocus:_,onBlur:_e,onChange:Cr,onElementCreate:Z=>mt(Z,!0),...ot})}),l.jsx(Oo,{visible:L,target:se,shouldTargetCloseOverlay:!1,shouldScrollCloseOverlay:!0,shouldCheckZIndex:!0,shouldRemainOnScreen:!0,hidden:Nr,isClickedWithin:st,unmountWhenHidden:!0,children:Mr()})]})})]})})};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 Zh(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 Pr(e){return Object.prototype.toString.call(e)==="[object Object]"}function Jt(e){return Object(e)===e}function Tr(e){return Object.keys(e).length===0}var Xh=["__proto__","prototype","constructor"],Jh=function(e){return Xh.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(Jh);if(n.length!==t.length)throw Error("Refusing to update blacklisted property "+e);return t}var Ao=Object.prototype.hasOwnProperty;function ce(e,r,t,n){if(!(this instanceof ce))return new ce(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 Nt=new ce(".",!1,!0,!0);function We(e){return function(){return Nt[e].apply(Nt,arguments)}}ce.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])?[]:{}),!Jt(r[s]))if(this.override)r[s]={};else{if(!(Jt(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&&Jt(r[s])&&!Tr(r[s])){if(!(Jt(t)&&Tr(t)))throw new Error("Trying to redefine non-empty obj['"+s+"']");return}r[s]=ht(t,n)}},ce.prototype.object=function(e,r){var t=this;return Object.keys(e).forEach(function(n){var s=r===void 0?null:r[n],o=Sr(n,t.separator).join(t.separator);o.indexOf(t.separator)!==-1?(t._fill(o.split(t.separator),e,e[n],s),delete e[n]):e[n]=ht(e[n],s)}),e},ce.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},ce.prototype.pick=function(e,r,t,n){var s,o,i,a,c;for(o=Sr(e,this.separator),s=0;s<o.length;s++)if(a=Zh(o[s],r),r&&typeof r=="object"&&a in r){if(s===o.length-1)return t?(i=r[a],n&&Array.isArray(r)?r.splice(a,1):delete r[a],Array.isArray(r)&&(c=o.slice(0,-1).join("."),this.cleanup.indexOf(c)===-1&&this.cleanup.push(c)),i):r[a];r=r[a]}else return;return t&&Array.isArray(r)&&(r=r.filter(function(d){return d!==void 0})),r},ce.prototype.delete=function(e,r){return this.remove(e,r,!0)},ce.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)},ce.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(o){return o!==void 0}),this.set(this.cleanup[t],r,e);this.cleanup=[]}},ce.prototype.del=ce.prototype.remove,ce.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},ce.prototype.transfer=function(e,r,t,n,s,o){return typeof s=="function"||Array.isArray(s)?this.set(r,ht(this.pick(e,t,!0),s),n,o):(o=s,this.set(r,this.pick(e,t,!0),n,o)),n},ce.prototype.copy=function(e,r,t,n,s,o){return typeof s=="function"||Array.isArray(s)?this.set(r,ht(JSON.parse(JSON.stringify(this.pick(e,t,!1))),s),n,o):(o=s,this.set(r,this.pick(e,t,!1),n,o)),n},ce.prototype.set=function(e,r,t,n){var s,o,i,a;if(typeof r>"u")return t;for(i=Sr(e,this.separator),s=0;s<i.length;s++){if(a=i[s],s===i.length-1)if(n&&Pr(r)&&Pr(t[a]))for(o in r)Ao.call(r,o)&&(t[a][o]=r[o]);else if(n&&Array.isArray(t[a])&&Array.isArray(r))for(var c=0;c<r.length;c++)t[i[s]].push(r[c]);else t[a]=r;else(!Ao.call(t,a)||!Pr(t[a])&&!Array.isArray(t[a]))&&(/^\d+$/.test(i[s+1])?t[a]=[]:t[a]={});t=t[a]}return t},ce.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},ce.prototype.dot=function(e,r,t){r=r||{},t=t||[];var n=Array.isArray(e);return Object.keys(e).forEach((function(s){var o=n&&this.useBrackets?"["+s+"]":s;if(Jt(e[s])&&(Pr(e[s])&&!Tr(e[s])||Array.isArray(e[s])&&!this.keepArray&&e[s].length!==0))if(n&&this.useBrackets){var i=t[t.length-1]||"";return this.dot(e[s],r,t.slice(0,-1).concat(i+o))}else return this.dot(e[s],r,t.concat(o));else n&&this.useBrackets?r[t.join(this.separator).concat("["+s+"]")]=e[s]:r[t.concat(o).join(this.separator)]=e[s]}).bind(this)),r},ce.pick=We("pick"),ce.move=We("move"),ce.transfer=We("transfer"),ce.transform=We("transform"),ce.copy=We("copy"),ce.object=We("object"),ce.str=We("str"),ce.set=We("set"),ce.delete=We("delete"),ce.del=ce.remove=We("remove"),ce.dot=We("dot"),["override","overwrite"].forEach(function(e){Object.defineProperty(ce,e,{get:function(){return Nt.override},set:function(r){Nt.override=!!r}})}),["useArray","keepArray","useBrackets"].forEach(function(e){Object.defineProperty(ce,e,{get:function(){return Nt[e]},set:function(r){Nt[e]=r}})}),ce._process=ht;var ep=ce;const Er=Hr(ep),tp=({name:e,label:r,value:t,data:n,textField:s,valueField:o,readOnly:i=!1,orientation:a=Ie.Horizontal,isMultiSelect:c=!1,className:d,onChange:h,itemTemplate:p})=>{const[v,y]=f.useState(),[x,D]=f.useState([]),O=cr(()=>n,[n]),P=f.useId();f.useEffect(()=>{if(c){const j=Array.isArray(t)?t.map(k=>k.toString()):t?[String(t)]:void 0;D(j??[])}else t&&y(t.toString())},[t]);const R=j=>c?x.findIndex(k=>k===j)>-1:v===j,z=j=>{const k=j.toString();if(c){const G=R(k);let N;G?N=x.filter(W=>W!=k):N=[...x,k],D(N),h==null||h({name:e,value:N})}else k!==v&&(y(k),h==null||h({name:e,value:k}))},$=j=>{const{value:k}=j.target;y(k),h==null||h({name:e,value:k})},g=j=>{const{value:k,checked:G}=j.target;let N;G?N=[...x,k]:N=x.filter(W=>W!=k),D(N),h==null||h({name:e,value:N})},L=(j,k,G,N)=>l.jsxs("label",{htmlFor:j,className:N,children:[l.jsx("input",{id:j,name:e,value:G,type:"checkbox",onChange:g,checked:R(G),className:"bsc-appearance-none"}),k]},j),C=(j,k,G,N)=>l.jsxs("label",{htmlFor:j,className:N,children:[l.jsx("input",{id:j,name:e,value:G,type:"radio",onChange:$,checked:R(G),className:"bsc-appearance-none"}),k]},j),U=ir(Ft.FocusWithin),B=f.useCallback((j,k)=>l.jsx(l.Fragment,{children:k}),[]),se=p||B,re=(j,k,G)=>{const N=`element_${P}_${k}`,W=Er.pick(s,j),b=String(Er.pick(o,j)),T=k===0,V=k===G.length-1,S=le("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":!i,"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":i,"bsc-border-t bsc-border-l bsc-border-b bsc-rounded-l-md bsc-pl-2":T&&a===Ie.Horizontal,"bsc-border-t bsc-border-r bsc-border-l bsc-border-b bsc-rounded-r-md bsc-pr-2":V&&a===Ie.Horizontal,"bsc-border-t bsc-border-b":!T&&!V&&a===Ie.Horizontal,"bsc-border-l":!T&&a===Ie.Horizontal,"bsc-border-l bsc-border-r bsc-border-t bsc-rounded-t-md":T&&a===Ie.Vertical,"bsc-border bsc-rounded-b-md":V&&a===Ie.Vertical,"bsc-border-t bsc-border-l bsc-border-r":!T&&!V&&a===Ie.Vertical},U),H={itemId:N,selectedValue:c?x:v,itemText:W,itemValue:b,itemData:j,itemStyles:S,isSelected:R(b),isFirstItem:T,isLastItem:V,onItemChanged:z};return c?l.jsx(lt,{props:H,template:se,children:L(N,W,b,S)}):l.jsx(lt,{props:H,template:se,children:C(N,W,b,S)})},ee=le("bsc-flex bsc-flex-col bsc-gap-2",d),I=le("bsc-flex",{"bsc-flex-col [width:max-content]":a===Ie.Vertical}),F=j=>l.jsx("div",{className:I,children:j.map(re)});return l.jsxs("div",{className:ee,children:[r&&l.jsx(Ze,{label:r,readOnly:i}),O&&F(O)]})},rp=f.memo(tp),np=({id:e,name:r,label:t,value:n,checked:s=!1,labelLocation:o=Ae.Right,readOnly:i=!1,useAnimation:a,onChange:c})=>{const d=Wr(a),h=f.useCallback(y=>{c==null||c(y)},[c]),p=le("bc-radio-item-wrapper bsc-flex bsc-items-center *:bsc-cursor-pointer",{"bc-read-only":i}),v=le("bc-radio-item-outer bsc-relative *:bsc-size-[21px]",{"bsc-pl-1":o===Ae.Left,"bsc-pr-1":o===Ae.Right,"bsc-radio-item-animate":!i&&d,"bsc-radio-item":!i,"bc-read-only bsc-radio-item-read-only":i});return l.jsxs("div",{className:p,children:[o===Ae.Left&&l.jsx(Ze,{label:t,htmlFor:e,readOnly:i}),l.jsxs("label",{className:v,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})]})]}),o===Ae.Right&&l.jsx(Ze,{label:t,htmlFor:e,readOnly:i})]})},sp=f.memo(np),op=({name:e,label:r,value:t,data:n,textField:s,valueField:o,readOnly:i=!1,labelLocation:a=Ae.Right,orientation:c=Ie.Vertical,className:d,useAnimation:h,onChange:p})=>{const[v,y]=f.useState(t),x=cr(()=>n,[n]),D=f.useId(),O=f.useCallback(g=>{const L=g.target.value;y(L),p==null||p({name:e,value:L,originalEvent:g})},[e]),P=(g,L)=>{const C=`${D}_radio_${L}`,U=Er.pick(o,g);return l.jsx(sp,{id:C,name:e,label:Er.pick(s,g),value:U,checked:U==v,labelLocation:a,readOnly:i,useAnimation:h,onChange:O},C)},R=le("bc-radio-container bsc-flex bsc-flex-col bsc-gap-1",d),z=le("bc-radio-wrapper bsc-flex bsc-gap-1",{"bsc-flex-col":c===Ie.Vertical,"[&>*]:bsc-pr-2":c===Ie.Horizontal}),$=g=>l.jsx("div",{className:z,children:g.map(P)});return l.jsxs("div",{className:R,children:[r&&l.jsx(Ze,{label:r,readOnly:i}),x&&$(x)]})},ip=f.memo(op),ap=({name:e,label:r,value:t,checked:n=!1,readOnly:s=!1,useAnimation:o,className:i,onChange:a})=>{const[c,d]=f.useState(!1),h=f.useId(),p=Wr(o);f.useEffect(()=>{d(n)},[n]);const v=P=>{const{checked:R}=P.target;d(R),a==null||a({originalEvent:P,name:e||P.target.name,value:t||P.target.value,checked:R})},y=le("bc-toggle-wrapper bsc-flex bsc-flex-col",i),x=ir(Ft.FocusWithin),D=le("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},x),O=le("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:y,children:[r&&l.jsx(Ze,{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:v,className:"bsc-appearance-none"}),l.jsx("div",{id:"switch",className:O})]})]})},cp=f.memo(ap),Pp="";J.BeeSoftProvider=Bo,J.Button=Ve,J.Checkbox=Zn,J.CheckboxGroup=yi,J.ContentEditableInput=hr,J.DateFormatType=Xt,J.DateScrollerType=Ot,J.DateSelectionType=ge,J.DateTime=Kh,J.FormGroupItemOrientation=Ie,J.FormattedInput=jo,J.GroupButton=rp,J.MediaQuery=bn,J.MobileOverlayPanel=Co,J.OverlayPanel=Oo,J.RadioButton=ip,J.SelectionLabelLocation=Ae,J.Toggle=cp,J.applyBeeSoftTheme=ai,J.createBeeSoftTheme=ci,Object.defineProperty(J,Symbol.toStringTag,{value:"Module"})});
|
|
87
|
+
*/var rs,Oi;function Bp(){if(Oi)return rs;Oi=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function n(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function s(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var i={},a=0;a<10;a++)i["_"+String.fromCharCode(a)]=a;var u=Object.getOwnPropertyNames(i).map(function(h){return i[h]});if(u.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 rs=s()?Object.assign:function(o,i){for(var a,u=n(o),f,h=1;h<arguments.length;h++){a=Object(arguments[h]);for(var g in a)t.call(a,g)&&(u[g]=a[g]);if(e){f=e(a);for(var x=0;x<f.length;x++)r.call(a,f[x])&&(u[f[x]]=a[f[x]])}}return u},rs}var ns,Di;function ss(){if(Di)return ns;Di=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ns=e,ns}var os,Ni;function Ii(){return Ni||(Ni=1,os=Function.call.bind(Object.prototype.hasOwnProperty)),os}var is,ji;function Up(){if(ji)return is;ji=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=ss(),r={},n=Ii();e=function(o){var i="Warning: "+o;typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}}function s(o,i,a,u,f){if(process.env.NODE_ENV!=="production"){for(var h in o)if(n(o,h)){var g;try{if(typeof o[h]!="function"){var x=Error((u||"React class")+": "+a+" type `"+h+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[h]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw x.name="Invariant Violation",x}g=o[h](i,h,u,a,null,t)}catch(T){g=T}if(g&&!(g instanceof Error)&&e((u||"React class")+": type specification of "+a+" `"+h+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof g+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),g instanceof Error&&!(g.message in r)){r[g.message]=!0;var v=f?f():"";e("Failed "+a+" type: "+g.message+(v??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(r={})},is=s,is}var as,Mi;function zp(){if(Mi)return as;Mi=1;var e=ki(),t=Bp(),r=ss(),n=Ii(),s=Up(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(a){var u="Warning: "+a;typeof console<"u"&&console.error(u);try{throw new Error(u)}catch{}});function i(){return null}return as=function(a,u){var f=typeof Symbol=="function"&&Symbol.iterator,h="@@iterator";function g(S){var N=S&&(f&&S[f]||S[h]);if(typeof N=="function")return N}var x="<<anonymous>>",v={array:E("array"),bigint:E("bigint"),bool:E("boolean"),func:E("function"),number:E("number"),object:E("object"),string:E("string"),symbol:E("symbol"),any:D(),arrayOf:Q,element:U(),elementType:y(),instanceOf:F,node:oe(),objectOf:q,oneOf:k,oneOfType:z,shape:ne,exact:M};function T(S,N){return S===N?S!==0||1/S===1/N:S!==S&&N!==N}function I(S,N){this.message=S,this.data=N&&typeof N=="object"?N:{},this.stack=""}I.prototype=Error.prototype;function j(S){if(process.env.NODE_ENV!=="production")var N={},C=0;function P(X,Y,B,K,re,_,ie){if(K=K||x,_=_||B,ie!==r){if(u){var A=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 A.name="Invariant Violation",A}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var De=K+":"+B;!N[De]&&C<3&&(o("You are manually calling a React.PropTypes validation function for the `"+_+"` prop on `"+K+"`. 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."),N[De]=!0,C++)}}return Y[B]==null?X?Y[B]===null?new I("The "+re+" `"+_+"` is marked as required "+("in `"+K+"`, but its value is `null`.")):new I("The "+re+" `"+_+"` is marked as required in "+("`"+K+"`, but its value is `undefined`.")):null:S(Y,B,K,re,_)}var V=P.bind(null,!1);return V.isRequired=P.bind(null,!0),V}function E(S){function N(C,P,V,X,Y,B){var K=C[P],re=O(K);if(re!==S){var _=J(K);return new I("Invalid "+X+" `"+Y+"` of type "+("`"+_+"` supplied to `"+V+"`, expected ")+("`"+S+"`."),{expectedType:S})}return null}return j(N)}function D(){return j(i)}function Q(S){function N(C,P,V,X,Y){if(typeof S!="function")return new I("Property `"+Y+"` of component `"+V+"` has invalid PropType notation inside arrayOf.");var B=C[P];if(!Array.isArray(B)){var K=O(B);return new I("Invalid "+X+" `"+Y+"` of type "+("`"+K+"` supplied to `"+V+"`, expected an array."))}for(var re=0;re<B.length;re++){var _=S(B,re,V,X,Y+"["+re+"]",r);if(_ instanceof Error)return _}return null}return j(N)}function U(){function S(N,C,P,V,X){var Y=N[C];if(!a(Y)){var B=O(Y);return new I("Invalid "+V+" `"+X+"` of type "+("`"+B+"` supplied to `"+P+"`, expected a single ReactElement."))}return null}return j(S)}function y(){function S(N,C,P,V,X){var Y=N[C];if(!e.isValidElementType(Y)){var B=O(Y);return new I("Invalid "+V+" `"+X+"` of type "+("`"+B+"` supplied to `"+P+"`, expected a single ReactElement type."))}return null}return j(S)}function F(S){function N(C,P,V,X,Y){if(!(C[P]instanceof S)){var B=S.name||x,K=ge(C[P]);return new I("Invalid "+X+" `"+Y+"` of type "+("`"+K+"` supplied to `"+V+"`, expected ")+("instance of `"+B+"`."))}return null}return j(N)}function k(S){if(!Array.isArray(S))return process.env.NODE_ENV!=="production"&&(arguments.length>1?o("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])."):o("Invalid argument supplied to oneOf, expected an array.")),i;function N(C,P,V,X,Y){for(var B=C[P],K=0;K<S.length;K++)if(T(B,S[K]))return null;var re=JSON.stringify(S,function(ie,A){var De=J(A);return De==="symbol"?String(A):A});return new I("Invalid "+X+" `"+Y+"` of value `"+String(B)+"` "+("supplied to `"+V+"`, expected one of "+re+"."))}return j(N)}function q(S){function N(C,P,V,X,Y){if(typeof S!="function")return new I("Property `"+Y+"` of component `"+V+"` has invalid PropType notation inside objectOf.");var B=C[P],K=O(B);if(K!=="object")return new I("Invalid "+X+" `"+Y+"` of type "+("`"+K+"` supplied to `"+V+"`, expected an object."));for(var re in B)if(n(B,re)){var _=S(B,re,V,X,Y+"."+re,r);if(_ instanceof Error)return _}return null}return j(N)}function z(S){if(!Array.isArray(S))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var N=0;N<S.length;N++){var C=S[N];if(typeof C!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+R(C)+" at index "+N+"."),i}function P(V,X,Y,B,K){for(var re=[],_=0;_<S.length;_++){var ie=S[_],A=ie(V,X,Y,B,K,r);if(A==null)return null;A.data&&n(A.data,"expectedType")&&re.push(A.data.expectedType)}var De=re.length>0?", expected one of type ["+re.join(", ")+"]":"";return new I("Invalid "+B+" `"+K+"` supplied to "+("`"+Y+"`"+De+"."))}return j(P)}function oe(){function S(N,C,P,V,X){return H(N[C])?null:new I("Invalid "+V+" `"+X+"` supplied to "+("`"+P+"`, expected a ReactNode."))}return j(S)}function ce(S,N,C,P,V){return new I((S||"React class")+": "+N+" type `"+C+"."+P+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+V+"`.")}function ne(S){function N(C,P,V,X,Y){var B=C[P],K=O(B);if(K!=="object")return new I("Invalid "+X+" `"+Y+"` of type `"+K+"` "+("supplied to `"+V+"`, expected `object`."));for(var re in S){var _=S[re];if(typeof _!="function")return ce(V,X,Y,re,J(_));var ie=_(B,re,V,X,Y+"."+re,r);if(ie)return ie}return null}return j(N)}function M(S){function N(C,P,V,X,Y){var B=C[P],K=O(B);if(K!=="object")return new I("Invalid "+X+" `"+Y+"` of type `"+K+"` "+("supplied to `"+V+"`, expected `object`."));var re=t({},C[P],S);for(var _ in re){var ie=S[_];if(n(S,_)&&typeof ie!="function")return ce(V,X,Y,_,J(ie));if(!ie)return new I("Invalid "+X+" `"+Y+"` key `"+_+"` supplied to `"+V+"`.\nBad object: "+JSON.stringify(C[P],null," ")+`
|
|
88
|
+
Valid keys: `+JSON.stringify(Object.keys(S),null," "));var A=ie(B,_,V,X,Y+"."+_,r);if(A)return A}return null}return j(N)}function H(S){switch(typeof S){case"number":case"string":case"undefined":return!0;case"boolean":return!S;case"object":if(Array.isArray(S))return S.every(H);if(S===null||a(S))return!0;var N=g(S);if(N){var C=N.call(S),P;if(N!==S.entries){for(;!(P=C.next()).done;)if(!H(P.value))return!1}else for(;!(P=C.next()).done;){var V=P.value;if(V&&!H(V[1]))return!1}}else return!1;return!0;default:return!1}}function L(S,N){return S==="symbol"?!0:N?N["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&N instanceof Symbol:!1}function O(S){var N=typeof S;return Array.isArray(S)?"array":S instanceof RegExp?"object":L(N,S)?"symbol":N}function J(S){if(typeof S>"u"||S===null)return""+S;var N=O(S);if(N==="object"){if(S instanceof Date)return"date";if(S instanceof RegExp)return"regexp"}return N}function R(S){var N=J(S);switch(N){case"array":case"object":return"an "+N;case"boolean":case"date":case"regexp":return"a "+N;default:return N}}function ge(S){return!S.constructor||!S.constructor.name?x:S.constructor.name}return v.checkPropTypes=s,v.resetWarningCache=s.resetWarningCache,v.PropTypes=v,v},as}var cs,Ri;function qp(){if(Ri)return cs;Ri=1;var e=ss();function t(){}function r(){}return r.resetWarningCache=t,cs=function(){function n(i,a,u,f,h,g){if(g!==e){var x=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 x.name="Invariant Violation",x}}n.isRequired=n;function s(){return n}var o={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:r,resetWarningCache:t};return o.PropTypes=o,o},cs}if(process.env.NODE_ENV!=="production"){var Kp=ki(),Gp=!0;ts.exports=zp()(Kp.isElement,Gp)}else ts.exports=qp()();var Zp=ts.exports;const ue=hn(Zp),Ai={disabled:!1};var Qp=process.env.NODE_ENV!=="production"?ue.oneOfType([ue.number,ue.shape({enter:ue.number,exit:ue.number,appear:ue.number}).isRequired]):null;process.env.NODE_ENV!=="production"&&ue.oneOfType([ue.string,ue.shape({enter:ue.string,exit:ue.string,active:ue.string}),ue.shape({enter:ue.string,enterDone:ue.string,enterActive:ue.string,exit:ue.string,exitDone:ue.string,exitActive:ue.string})]);const Li=d.createContext(null);var Xp=function(t){return t.scrollTop},Or="unmounted",Ot="exited",Dt="entering",Zt="entered",us="exiting",bt=function(e){Yp(t,e);function t(n,s){var o;o=e.call(this,n,s)||this;var i=s,a=i&&!i.isMounting?n.enter:n.appear,u;return o.appearStatus=null,n.in?a?(u=Ot,o.appearStatus=Dt):u=Zt:n.unmountOnExit||n.mountOnEnter?u=Or:u=Ot,o.state={status:u},o.nextCallback=null,o}t.getDerivedStateFromProps=function(s,o){var i=s.in;return i&&o.status===Or?{status:Ot}:null};var r=t.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(s){var o=null;if(s!==this.props){var i=this.state.status;this.props.in?i!==Dt&&i!==Zt&&(o=Dt):(i===Dt||i===Zt)&&(o=us)}this.updateStatus(!1,o)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var s=this.props.timeout,o,i,a;return o=i=a=s,s!=null&&typeof s!="number"&&(o=s.exit,i=s.enter,a=s.appear!==void 0?s.appear:i),{exit:o,enter:i,appear:a}},r.updateStatus=function(s,o){if(s===void 0&&(s=!1),o!==null)if(this.cancelNextCallback(),o===Dt){if(this.props.unmountOnExit||this.props.mountOnEnter){var i=this.props.nodeRef?this.props.nodeRef.current:Je.findDOMNode(this);i&&Xp(i)}this.performEnter(s)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Ot&&this.setState({status:Or})},r.performEnter=function(s){var o=this,i=this.props.enter,a=this.context?this.context.isMounting:s,u=this.props.nodeRef?[a]:[Je.findDOMNode(this),a],f=u[0],h=u[1],g=this.getTimeouts(),x=a?g.appear:g.enter;if(!s&&!i||Ai.disabled){this.safeSetState({status:Zt},function(){o.props.onEntered(f)});return}this.props.onEnter(f,h),this.safeSetState({status:Dt},function(){o.props.onEntering(f,h),o.onTransitionEnd(x,function(){o.safeSetState({status:Zt},function(){o.props.onEntered(f,h)})})})},r.performExit=function(){var s=this,o=this.props.exit,i=this.getTimeouts(),a=this.props.nodeRef?void 0:Je.findDOMNode(this);if(!o||Ai.disabled){this.safeSetState({status:Ot},function(){s.props.onExited(a)});return}this.props.onExit(a),this.safeSetState({status:us},function(){s.props.onExiting(a),s.onTransitionEnd(i.exit,function(){s.safeSetState({status:Ot},function(){s.props.onExited(a)})})})},r.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(s,o){o=this.setNextCallback(o),this.setState(s,o)},r.setNextCallback=function(s){var o=this,i=!0;return this.nextCallback=function(a){i&&(i=!1,o.nextCallback=null,s(a))},this.nextCallback.cancel=function(){i=!1},this.nextCallback},r.onTransitionEnd=function(s,o){this.setNextCallback(o);var i=this.props.nodeRef?this.props.nodeRef.current:Je.findDOMNode(this),a=s==null&&!this.props.addEndListener;if(!i||a){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var u=this.props.nodeRef?[this.nextCallback]:[i,this.nextCallback],f=u[0],h=u[1];this.props.addEndListener(f,h)}s!=null&&setTimeout(this.nextCallback,s)},r.render=function(){var s=this.state.status;if(s===Or)return null;var o=this.props,i=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var a=Hp(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return d.createElement(Li.Provider,{value:null},typeof i=="function"?i(s,a):d.cloneElement(d.Children.only(i),a))},t}(d.Component);bt.contextType=Li,bt.propTypes=process.env.NODE_ENV!=="production"?{nodeRef:ue.shape({current:typeof Element>"u"?ue.any:function(e,t,r,n,s,o){var i=e[t];return ue.instanceOf(i&&"ownerDocument"in i?i.ownerDocument.defaultView.Element:Element)(e,t,r,n,s,o)}}),children:ue.oneOfType([ue.func.isRequired,ue.element.isRequired]).isRequired,in:ue.bool,mountOnEnter:ue.bool,unmountOnExit:ue.bool,appear:ue.bool,enter:ue.bool,exit:ue.bool,timeout:function(t){var r=Qp;t.addEndListener||(r=r.isRequired);for(var n=arguments.length,s=new Array(n>1?n-1:0),o=1;o<n;o++)s[o-1]=arguments[o];return r.apply(void 0,[t].concat(s))},addEndListener:ue.func,onEnter:ue.func,onEntering:ue.func,onEntered:ue.func,onExit:ue.func,onExiting:ue.func,onExited:ue.func}:{};function Qt(){}bt.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Qt,onEntering:Qt,onEntered:Qt,onExit:Qt,onExiting:Qt,onExited:Qt},bt.UNMOUNTED=Or,bt.EXITED=Ot,bt.ENTERING=Dt,bt.ENTERED=Zt,bt.EXITING=us;const Jp=bt,$i=({start:e,timeout:t=400,defaultStyle:r,transitionStyles:n,showTransitionOptions:s="cubic-bezier(0, 0, 0.2, 1)",hideTransitionOptions:o="linear",unmountOnExit:i=!1,onEntering:a,onEntered:u,onExit:f,onExited:h,children:g})=>{const x=r||{transition:`opacity ${t}ms ${s}`,opacity:0},v=n||{entering:{opacity:1},entered:{opacity:1},exiting:{transition:`opacity ${t}ms ${o}`,opacity:0},exited:{transition:`opacity ${t}ms ${o}`,opacity:0},unmounted:{}};return p.jsx(Jp,{in:e,timeout:t,onEntering:a,onEntered:u,onExit:f,onExited:h,unmountOnExit:i,children:T=>g({state:T,defaultStyle:x,transitionStyles:v})})};function Fi(e){return e.target?e.target:e}const Hi=({visible:e,target:t,appendTo:r=document.body,unmountWhenHidden:n=!1,transitionDuration:s=400,showTransitionOptions:o="cubic-bezier(0, 0, 0.2, 1)",hideTransitionOptions:i="linear",approveText:a="DONE",shown:u,hidden:f,isClickedWithin:h,children:g})=>{const[x,v]=d.useState(-1),[T,I]=d.useState(-1),[j,E]=d.useState(e),D=d.useRef(100),Q=d.useRef(101),U=d.useRef(),y=d.useRef(),F=d.useRef();d.useEffect(()=>{t&&(U.current=Fi(t));const M=xi("zIndex",H=>H==="auto"||H==="-1"?!1:parseInt(H)>100).map(H=>parseInt(H,10));M.length>0&&(D.current=Math.max(...M)+1,Q.current=Math.max(...M)+2),E(e)},[e,t]);const k=M=>{y.current=M},q=()=>{I(D.current),v(Q.current)},z=()=>{if(!y.current)return;u==null||u();let M;U.current&&(M=[U.current]);const H=L=>{L?h==null||h():E(!1)};F.current=Si(y.current,H,M)},oe=()=>{F.current&&Ti(F.current)},ce=()=>{I(-1),v(-1),f==null||f()},ne={entering:{opacity:.5},entered:{opacity:.5}};return Je.createPortal(p.jsx($i,{start:j,timeout:s,showTransitionOptions:o,hideTransitionOptions:i,onEntering:q,onEntered:z,onExit:oe,onExited:ce,unmountOnExit:n,children:({state:M,defaultStyle:H,transitionStyles:L})=>p.jsxs("div",{ref:O=>O&&k(O),children:[p.jsx("div",{className:"bsc-fixed bsc-left-0 bsc-top-0 bsc-h-full bsc-w-full bsc-bg-mono-dark-1",style:{zIndex:T,...L[M],...ne[M]}}),p.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:x,...H,...L[M]},children:[p.jsx("div",{className:"bsc-w-full",children:g}),p.jsx(p.Fragment,{children:p.jsx(ot,{buttonType:"primary",fullWidth:!0,onClick:()=>E(!1),className:"bsc-text-xs bsc-font-bold",children:a})})]})]})}),r)};var Yi=(e=>(e[e.TopLeft=0]="TopLeft",e[e.TopRight=1]="TopRight",e[e.BottomLeft=2]="BottomLeft",e[e.BottomRight=3]="BottomRight",e))(Yi||{}),Vi=(e=>(e[e.TopLeft=0]="TopLeft",e[e.TopRight=1]="TopRight",e[e.BottomLeft=2]="BottomLeft",e[e.BottomRight=3]="BottomRight",e))(Vi||{});class _e{static positionToTarget(t,r=2){const n=t.getBoundingClientRect();let s=0,o=0;const i=window.scrollY;switch(r){case 2:s=n.top+n.height+i,o=n.left;break;case 0:s=n.top+i,o=n.left;break;case 3:s=n.top+n.height+i,o=n.left+n.width;break;case 1:s=n.top+i,o=n.left+n.width}return{top:s,left:o}}static positionElementToTarget(t,r,n=0,s=2){let{left:o,top:i}=_e.positionToTarget(r,s);const a=t.getBoundingClientRect();switch(n){case 0:break;case 1:o=o-a.width;break;case 2:i=i-a.height;break;case 3:i=i-a.height,o=o-a.width;break}return{top:i,left:o}}static canPositionElementOnScreenWithTarget(t,r){const n=_e.getScreenDimensions(),s=t.getBoundingClientRect(),o=_e.positionElementToTarget(t,r,0,2);if(o.left+s.width<n.width&&o.top+s.height<n.height||_e.positionElementToTarget(t,r,1,3).left>=0&&o.top+s.height<n.height)return!0;const a=_e.positionElementToTarget(t,r,2,0);if(a.left+s.width<n.width&&a.top>=0)return!0;const u=_e.positionElementToTarget(t,r,3,1);return u.left>=0&&u.top>=0}static canPositionElementOnScreen(t){const r=_e.getScreenDimensions(),n=t.getBoundingClientRect();return n.width<=r.width&&n.height<=r.height}static positionElementToTargetOnScreen(t,r,n=0,s=2){const{left:o,top:i}=_e.positionElementToTarget(t,r,n,s),a=t.getBoundingClientRect(),u=_e.determineOffScreenLocation(a);if(u){if(n===0&&s===2){if(u.right&&!u.bottom)return _e.positionElementToTarget(t,r,1,3);if(u.bottom&&!u.right)return _e.positionElementToTarget(t,r,2,0);if(u.right&&u.bottom)return _e.positionElementToTarget(t,r,3,1)}else if(n===1&&s===3){if(u.left&&!u.bottom)return _e.positionElementToTarget(t,r,0,2);if(u.bottom&&!u.left)return _e.positionElementToTarget(t,r,3,1);if(u.left&&u.bottom)return _e.positionElementToTarget(t,r,2,0)}}return{top:i,left:o}}static determineOffScreenLocation(t){const r=_e.getScreenDimensions(),n={left:t.left<0,top:t.top<0,right:t.left+t.width>r.width,bottom:t.top+t.height>r.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 Wi=({visible:e,target:t,targetPosition:r=Yi.BottomLeft,elementAlignment:n=Vi.TopLeft,shouldTargetCloseOverlay:s=!0,shouldMatchTargetWidth:o=!1,shouldScrollCloseOverlay:i=!1,shouldCheckZIndex:a=!1,shouldRemainOnScreen:u=!1,unmountWhenHidden:f=!1,transitionDuration:h=400,showTransitionOptions:g="cubic-bezier(0, 0, 0.2, 1)",hideTransitionOptions:x="linear",shown:v,hidden:T,isClickedWithin:I,markupCreated:j,children:E})=>{const[D,Q]=d.useState(-1),[U,y]=d.useState(e),[F,k]=d.useState(!1),q=d.useRef(!1),z=d.useRef(100),oe=d.useRef({left:0,top:0,width:0}),ce=d.useRef(),ne=d.useRef(),M=d.useRef(),H=d.useRef(),L=d.useRef(),O=d.useRef(),J=ws();d.useEffect(()=>(u===!0&&(O.current=new ResizeObserver(R)),()=>{var Y,B;u===!0&&(ne.current&&((Y=O.current)==null||Y.unobserve(ne.current)),(B=O.current)==null||B.disconnect())}),[]),d.useEffect(()=>{if(t&&(ce.current=Fi(t),i)){const Y=J==null?void 0:J.isValidScrollableElement;M.current=vi(ce.current,{overflow:"scroll, auto",overflowX:"scroll, auto",overflowY:"scroll, auto"},!1,Y),M.current.tagName.toLowerCase()==="html"&&(M.current=document)}if(a){const Y=xi("zIndex",B=>parseInt(B)>=100).map(B=>parseInt(B));Y.length>0&&(z.current=Math.max(...Y)+1)}e!==void 0&&y(e)},[t,e,i,a]);const R=Y=>{if(ne.current){const B=_e.getScreenDimensions(),K=Y[Y.length-1].target,re=K.getBoundingClientRect(),_=_e.determineOffScreenLocation(re);if(_){if(ce.current&&_e.canPositionElementOnScreenWithTarget(K,ce.current)){const ie=_e.positionElementToTargetOnScreen(ne.current,ce.current,n,r);oe.current={...oe.current,...ie}}else _.right?oe.current.left=B.width-re.width:_.left&&(oe.current.left=0),_.bottom?oe.current.top=B.height-re.height:_.top&&(oe.current.top=0);ge()}}},ge=Sr(()=>{q.current=!q.current,k(q.current)},20),S=()=>{Q(z.current)},N=()=>{if(!ne.current)return;v==null||v();let Y;!s&&ce.current&&(Y=[ce.current]);const B=K=>{K?I==null||I():y(!1)};H.current=Si(ne.current,B,Y),i&&(L.current=cd(K=>ne.current&&Tp(K,ne.current)&&y(!1),100,{leading:!0}),M.current&&M.current.addEventListener("scroll",L.current))},C=()=>{M.current&&L.current&&(M.current.removeEventListener("scroll",L.current),L.current=void 0),H.current&&Ti(H.current)},P=()=>{Q(-1),T==null||T()},V=Y=>{var B,K;if(u===!0&&ne.current&&((B=O.current)==null||B.unobserve(ne.current)),ne.current=Y,j==null||j(Y),ce.current){const re=_e.positionElementToTarget(ne.current,ce.current,n,r);oe.current={...re,width:ce.current.offsetWidth},u===!0&&(_e.canPositionElementOnScreenWithTarget(ne.current,ce.current)||_e.canPositionElementOnScreen(ne.current))&&((K=O.current)==null||K.observe(ne.current))}},X=d.useMemo(()=>{const Y={top:`${oe.current.top}px`,left:`${oe.current.left}px`,zIndex:D};return o&&(Y.width=`${oe.current.width}px`),Y},[F,D,o]);return p.jsx($i,{start:U,timeout:h,showTransitionOptions:g,hideTransitionOptions:x,onEntering:S,onEntered:N,onExit:C,onExited:P,unmountOnExit:f,children:({state:Y,defaultStyle:B,transitionStyles:K})=>p.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:{...X,...B,...K[Y]},ref:re=>re&&V(re),children:E})})};let tn;const em=new Uint8Array(16);function tm(){if(!tn&&(tn=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!tn))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return tn(em)}const Ye=[];for(let e=0;e<256;++e)Ye.push((e+256).toString(16).slice(1));function rm(e,t=0){return Ye[e[t+0]]+Ye[e[t+1]]+Ye[e[t+2]]+Ye[e[t+3]]+"-"+Ye[e[t+4]]+Ye[e[t+5]]+"-"+Ye[e[t+6]]+Ye[e[t+7]]+"-"+Ye[e[t+8]]+Ye[e[t+9]]+"-"+Ye[e[t+10]]+Ye[e[t+11]]+Ye[e[t+12]]+Ye[e[t+13]]+Ye[e[t+14]]+Ye[e[t+15]]}const Bi={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function nm(e,t,r){if(Bi.randomUUID&&!t&&!e)return Bi.randomUUID();e=e||{};const n=e.random||(e.rng||tm)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let s=0;s<16;++s)t[r+s]=n[s];return t}return rm(n)}class Dr{static create(t){const r=[];let n=0;for(let s=0,o=t.formatParts.length;s<o;s++){const i=t.formatParts[s],a=n,u=a+i.characterCount;r.push({startPosition:a,endPosition:u,...i}),n=u}return r}}class sm{constructor(t,r){b(this,"instanceCollection");b(this,"formatPartList");b(this,"inputSlotCollection");b(this,"currentPartIndex",0);b(this,"currentPartIndices",[]);b(this,"currentCursorPosition",0);b(this,"highlightCursorPosition",0);b(this,"currentCursorStartPosition",-1);b(this,"currentCursorEndPosition",-1);b(this,"inputElement");b(this,"inputSelection",null);b(this,"inputRange");b(this,"textNode");this.instanceCollection=Xt.getInstance(),this.formatPartList=Dr.create(t),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(r,t)}get isSelection(){return this.inputRange!==void 0&&this.inputRange.startOffset!==this.inputRange.endOffset}get isAllSelected(){var r;const t=this.inputSlotCollection.getLastSlot();return this.isSelection&&((r=this.inputRange)==null?void 0:r.startOffset)===0&&this.inputRange.endOffset===t.endPosition}getCursorPosition(){return this.currentCursorPosition}getCursorStartPosition(){return this.currentCursorStartPosition}getCursorEndPosition(){return this.currentCursorEndPosition}getCurrentPartIndex(){return this.currentPartIndex}getCurrentPartIndices(){return this.currentPartIndices}setInputElement(t){this.inputElement=t}setCursorToCurrentPosition(){this.setCursorSelection(this.currentCursorPosition>-1?this.currentCursorPosition:this.highlightCursorPosition)}setCursorPosition(t){this.setCursorSelection(t)}setCursorSelection(t,r){if(this.createInputRangeSelection(),this.inputRange&&this.textNode){let n,s,o=!0;r===void 0?(n=t,s=t):t<r?(n=t,s=r):(o=!1,n=r,s=t),this.inputRange.setStart(this.textNode,n),this.inputRange.setEnd(this.textNode,s),this.currentPartIndices=[],n===s?(this.currentCursorPosition=s,this.highlightCursorPosition=s,this.currentCursorStartPosition=-1,this.currentCursorEndPosition=-1,this.setPartIndexByCursorPosition()):(o?this.currentCursorStartPosition===-1&&this.currentCursorEndPosition===-1?this.highlightCursorPosition=s:this.currentCursorStartPosition!==n?this.highlightCursorPosition=n:this.currentCursorEndPosition!==s&&(this.highlightCursorPosition=s):this.currentCursorStartPosition===-1&&this.currentCursorEndPosition===-1?this.highlightCursorPosition=n:this.currentCursorStartPosition!==s?this.highlightCursorPosition=s:this.currentCursorEndPosition!==n&&(this.highlightCursorPosition=n),this.currentCursorStartPosition=n,this.currentCursorEndPosition=s,this.currentCursorPosition=-1,this.setPartIndexByHighlightPosition(),this.setPartIndicesByCursorPositions())}}findCursorPosition(){var n;const t=window.getSelection(),r=t==null?void 0:t.getRangeAt(0);if(this.inputElement&&t&&r){const s=document.createTreeWalker(this.inputElement,NodeFilter.SHOW_TEXT,u=>{const f=document.createRange();return f.selectNodeContents(u),f.compareBoundaryPoints(Range.END_TO_END,r)<1?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT});let o=0;for(;s.nextNode();)o+=((n=s.currentNode.textContent)==null?void 0:n.length)||0;r.startContainer.nodeType===Node.TEXT_NODE&&(o+=r.startOffset);const i=this.inputSlotCollection.getLastSlotWithData(),a=i.startPosition+i.partText.length;t.anchorOffset===t.focusOffset?this.setCursorSelection(o>a?a:o):this.setCursorSelection(t.anchorOffset,t.focusOffset)}}isAtLastPart(){return this.currentPartIndex===this.formatPartList.length-1}moveHome(){const t=this.inputSlotCollection.getFirstSlot();this.setCursorSelection(t.startPosition)}moveEnd(){const t=this.inputSlotCollection.getLastSlotWithData(),r=t.startPosition+t.partText.length;this.setCursorSelection(r)}moveCursorLeft(){if(this.updateCursorPosition(),this.currentCursorPosition>0&&!this.isSelection){const t=this.currentCursorPosition-1;let r=this.formatPartList[this.currentPartIndex];if(t>=r.startPosition&&t<=r.endPosition)this.setCursorSelection(t);else for(let n=this.currentPartIndex-1;n>=0;n--)if(r=this.formatPartList[n],t>=r.startPosition&&t<=r.endPosition){r.isSeparator?this.setCursorSelection(this.formatPartList[n-1].endPosition):this.setCursorSelection(t);break}}else this.isSelection?this.setCursorSelection(this.currentCursorPosition):this.moveHome()}moveCursorRight(){this.updateCursorPosition(!1);const t=this.inputSlotCollection.getLastSlotWithData(),r=t.startPosition+t.partText.length;if(this.currentCursorPosition<r&&!this.isSelection){const n=this.currentCursorPosition+1;let s=this.formatPartList[this.currentPartIndex];if(n>=s.startPosition&&n<=s.endPosition)this.setCursorSelection(n);else for(let o=this.currentPartIndex+1,i=this.formatPartList.length;o<i;o++)if(s=this.formatPartList[o],n>=s.startPosition&&n<=s.endPosition){s.isSeparator?this.setCursorSelection(this.formatPartList[o+1].startPosition):this.setCursorSelection(n);break}}else this.setCursorSelection(this.currentCursorPosition)}moveToNextInputPart(){if(this.currentPartIndex<this.formatPartList.length-1){const t=this.findNextEditablePart();t&&(this.currentPartIndex=t.partIndex,this.setCursorSelection(t.startPosition))}}moveToPreviousInputPart(){if(this.currentPartIndex>0){const t=this.findPreviousEditablePart();t&&(this.currentPartIndex=t.partIndex,this.setCursorSelection(t.endPosition))}}highlightAll(){const t=this.formatPartList[this.formatPartList.length-1].endPosition;this.setCursorSelection(0,t)}moveHighlightLeft(){this.updateHighlightPositions();const t=this.highlightCursorPosition>this.currentCursorStartPosition;if(this.currentCursorStartPosition>0||t){let r=t?this.currentCursorStartPosition:this.currentCursorStartPosition-1,n=t?this.highlightCursorPosition-1:this.currentCursorEndPosition,s=this.formatPartList[this.currentPartIndex];if(r>=s.startPosition&&r<=s.endPosition||t&&n>=s.startPosition&&n<=s.endPosition)this.setCursorSelection(r,n);else for(let o=this.currentPartIndex-1;o>=0;o--)if(s=this.formatPartList[o],r>=s.startPosition&&r<=s.endPosition||t&&n>=s.startPosition&&n<=s.endPosition){s.isSeparator?(t?n=this.formatPartList[o-1].endPosition:r=this.formatPartList[o-1].endPosition,this.setCursorSelection(r,n)):this.setCursorSelection(r,n);break}}}moveHighlightRight(){this.updateHighlightPositions();const t=this.inputSlotCollection.getLastSlotWithData(),r=t.startPosition+t.partText.length,n=this.highlightCursorPosition<this.currentCursorEndPosition;if(this.currentCursorEndPosition<r||n){let s=n?this.highlightCursorPosition+1:this.currentCursorStartPosition,o=n?this.currentCursorEndPosition:this.currentCursorEndPosition+1,i=this.formatPartList[this.currentPartIndex];if(o>=i.startPosition&&o<=i.endPosition||n&&s>=i.startPosition&&s<=i.endPosition)this.setCursorSelection(s,o);else for(let a=this.currentPartIndex+1,u=this.formatPartList.length;a<u;a++)if(i=this.formatPartList[a],o>=i.startPosition&&o<=i.endPosition||n&&s>=i.startPosition&&s<=i.endPosition){i.isSeparator?(n?s=this.formatPartList[a+1].startPosition:o=this.formatPartList[a+1].startPosition,this.setCursorSelection(s,o)):this.setCursorSelection(s,o);break}}}updateHighlightPositions(){this.currentCursorStartPosition===-1&&this.currentCursorEndPosition===-1&&this.currentCursorPosition>-1&&(this.currentCursorStartPosition=this.currentCursorPosition,this.currentCursorEndPosition=this.currentCursorPosition,this.highlightCursorPosition=this.currentCursorPosition)}updateCursorPosition(t=!0){this.currentCursorPosition===-1&&this.currentCursorStartPosition>-1&&this.currentCursorEndPosition>-1&&(t?this.currentCursorPosition=this.currentCursorStartPosition:this.currentCursorPosition=this.currentCursorEndPosition)}findNextEditablePart(){return this.inputSlotCollection.getNextSlot(this.currentPartIndex)}findPreviousEditablePart(){return this.inputSlotCollection.getPreviousSlot(this.currentPartIndex)}setPartIndexByCursorPosition(){for(let t=0;t<this.formatPartList.length;t++){const r=this.formatPartList[t];if(this.currentCursorPosition>=r.startPosition&&this.currentCursorPosition<=r.endPosition){if(r.isSeparator){this.currentCursorPosition=this.formatPartList[t+1].startPosition,this.currentPartIndex=t+1;break}this.currentPartIndex=t;break}}}setPartIndexByHighlightPosition(){for(let t=0;t<this.formatPartList.length;t++){const r=this.formatPartList[t];if(this.highlightCursorPosition>=r.startPosition&&this.highlightCursorPosition<=r.endPosition){if(r.isSeparator){this.highlightCursorPosition=this.formatPartList[t+1].startPosition,this.currentPartIndex=t+1;break}this.currentPartIndex=t;break}}}setPartIndicesByCursorPositions(){for(let t=0,r=this.formatPartList.length;t<r;t++){const n=this.formatPartList[t];n.isSeparator||(n.startPosition>=this.currentCursorStartPosition&&n.startPosition<=this.currentCursorEndPosition||n.endPosition>=this.currentCursorStartPosition&&n.endPosition<=this.currentCursorEndPosition||n.startPosition<this.currentCursorStartPosition&&n.endPosition>this.currentCursorEndPosition)&&this.currentPartIndices.push(t)}}createInputRangeSelection(){var t,r;this.inputElement&&(this.inputSelection=window.getSelection(),this.inputRange=document.createRange(),(t=this.inputSelection)==null||t.removeAllRanges(),this.inputRange.selectNodeContents(this.inputElement),this.inputRange.collapse(!0),(r=this.inputSelection)==null||r.addRange(this.inputRange),this.inputElement.firstChild&&(this.textNode=this.inputElement.firstChild))}}class om{static create(t){const r=[];for(let n=0,s=t.length;n<s;n++){const o=t[n];o.isSeparator||r.push({partIndex:n,partText:"",isComplete:!1,...o})}return r}}class im{constructor(t){b(this,"inputSlots");this.inputSlots=om.create(Dr.create(t))}clearAllSlots(){for(let t=0,r=this.inputSlots.length;t<r;t++)this.inputSlots[t].partText=""}getSlot(t){return this.inputSlots.find(r=>r.partIndex===t)}getSlots(t){return this.inputSlots.filter(r=>t.includes(r.partIndex))}getSlotsFromCursorPosition(t){let r=-1;for(let n=0,s=this.inputSlots.length;n<s;n++){const o=this.inputSlots[n];if(t>=o.startPosition&&t<=o.endPosition){r=o.partIndex;break}}return r>-1?this.inputSlots.filter(n=>n.partIndex>=r):void 0}getFirstSlot(){return this.inputSlots[0]}getLastSlot(){return this.inputSlots[this.inputSlots.length-1]}getNextSlot(t){const r=this.inputSlots.findIndex(n=>n.partIndex===t);if(r>-1&&r+1<this.inputSlots.length)return this.inputSlots[r+1]}getPreviousSlot(t){const r=this.inputSlots.findIndex(n=>n.partIndex===t);if(r>-1&&r-1>=0)return this.inputSlots[r-1]}getLastSlotWithData(){const t=this.inputSlots.findIndex(n=>!n.isComplete);let r=t;for(let n=t+1,s=this.inputSlots.length;n<s;n++)this.inputSlots[n].partText.length>0&&(r=n);return this.inputSlots[r>-1?r:0]}allSlotsCompleted(){return this.inputSlots.every(t=>t.isComplete)}allSlotsEmpty(){return this.inputSlots.every(t=>t.partText.length===0)}}class Xt{static getInstance(){return this.instance||(this.instance=new am),this.instance}}b(Xt,"instance");class am{constructor(){b(this,"navigatorInstances");b(this,"inputSlotInstances");this.navigatorInstances={},this.inputSlotInstances={}}getNavigatorInstance(t,r){return this.navigatorInstances[t]||(this.navigatorInstances[t]=new sm(r,t)),this.navigatorInstances[t]}getInputSlotInstance(t,r){return this.inputSlotInstances[t]||(this.inputSlotInstances[t]=new im(r)),this.inputSlotInstances[t]}removeInstances(t){this.navigatorInstances[t]&&delete this.navigatorInstances[t],this.inputSlotInstances[t]&&delete this.inputSlotInstances[t]}}class ls{constructor(t,r){b(this,"instanceCollection");b(this,"formatPartList");b(this,"inputSlotCollection");b(this,"inputElement");this.instanceCollection=Xt.getInstance(),this.formatPartList=Dr.create(t),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(r,t)}setInputElement(t){this.inputElement=t}render(){var r;let t="";for(let n=0,s=this.formatPartList.length;n<s;n++){const o=this.formatPartList[n];if(o.isSeparator)t+=o.inputText;else{const i=this.inputSlotCollection.getSlot(n);i&&(t+=i.partText+((r=i.inputText)==null?void 0:r.repeat(i.characterCount-i.partText.length)))}}this.inputElement&&(this.inputElement.innerHTML=t)}}var lt=(e=>(e[e.Text=0]="Text",e[e.Numeric=1]="Numeric",e))(lt||{});class Ui{constructor(){b(this,"numberKeys",["0","1","2","3","4","5","6","7","8","9"]);b(this,"movementKeys",["ArrowLeft","ArrowRight","Home","End","a"]);b(this,"editingKeys",["Backspace","Delete"]);b(this,"ignoreKeys",["Shift","Alt","Control","Fn","Meta"])}isNumberKey(t){return this.numberKeys.includes(t)}isMovementKey(t){return this.movementKeys.includes(t.key)}isEditingKey(t){return this.editingKeys.includes(t.key)}isIgnoreKey(t){return this.ignoreKeys.includes(t.key)}}class cm{constructor(t){b(this,"_currentIndex",0);b(this,"index",0);b(this,"formatParts");this.formatParts=Dr.create(t)}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 um{constructor(t){b(this,"formatParts");this.formatParts=Dr.create(t)}getUniqueSeparators(){const t=[],r=this.formatParts.filter(n=>n.isSeparator);for(let n=0,s=r.length;n<s;n++){const o=r[n];o.inputText&&!t.includes(o.inputText)&&t.push(o.inputText)}return t}}class zi{constructor(t,r){b(this,"instanceCollection");b(this,"inputSlotCollection");b(this,"formatNavigator");b(this,"keyTypeChecker");b(this,"formatRenderer");b(this,"formatPartList");b(this,"partEntryList");this.format=t,this.instanceCollection=Xt.getInstance(),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(r,t),this.formatNavigator=this.instanceCollection.getNavigatorInstance(r,t),this.keyTypeChecker=new Ui,this.formatRenderer=new ls(t,r),this.formatPartList=new cm(t),this.partEntryList=new um(t)}setInputElement(t){this.formatRenderer.setInputElement(t)}processKeyPress(t){if(this.keyTypeChecker.isEditingKey(t)){this.processEditRules(t);return}this.formatNavigator.isSelection?(this.processSelectionEditRules(),setTimeout(()=>this.processInputRules(t))):this.processInputRules(t)}processInputValue(t){var n;this.inputSlotCollection.clearAllSlots(),this.formatPartList.reset();let r=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 o=this.formatPartList.currentIndex,i=this.formatPartList.next();if(i&&i.inputText){const a=t.indexOf(i.inputText,r),u=this.inputSlotCollection.getSlot(o);if(u&&a>-1){const f=a-r>u.characterCount?r+u.characterCount:a;u.partText=t.substring(r,f),this.processSlotRules(u),r=a+i.characterCount}}}else{const o=this.inputSlotCollection.getSlot(this.formatPartList.currentIndex);o&&(o.partText=t.substring(r,r+o.characterCount),this.processSlotRules(o))}}}processPastedValue(t,r=!1){r&&this.processSelectionEditRules();const n=this.formatNavigator.getCursorPosition(),s=this.inputSlotCollection.getSlotsFromCursorPosition(n);if(s){const o=n-s[0].startPosition,i=s[0].partText.substring(0,o);let a=s[0].partText.substring(o);s[0].partText="";for(let g=1,x=s.length;g<x;g++)a+=s[g].partText,s[g].partText="";const u=this.removeSeparatorsFromValue(t),f=i+u+a;let h=0;for(let g=0,x=s.length;g<x;g++){const v=s[g];v.partText=f.substring(h,v.characterCount+h),h+=v.characterCount,this.processSlotRules(v)}}}removeSeparatorsFromValue(t){let r=t;const n=this.partEntryList.getUniqueSeparators();for(let s=0,o=n.length;s<o;s++){const i=n[s];r=r.replaceAll(i,"")}return r}processEditRules(t){this.formatNavigator.isSelection?this.processSelectionEditRules():this.processNonSelectionEditRules(t)}processNonSelectionEditRules(t){const r=this.inputSlotCollection.getSlot(this.formatNavigator.getCurrentPartIndex());if(!r)return;const n=this.formatNavigator.getCursorPosition(),s=n-r.startPosition,o=this.format.deleteShiftsFormatPart||!1;switch(t.key){case"Backspace":{if(!(r.startPosition===n))r.partText=r.partText.substring(0,s-1)+r.partText.substring(s),o&&this.shiftFormatParts(r),this.formatRenderer.render(),this.formatNavigator.moveCursorLeft(),this.processSlotRules(r,!0);else{this.processSlotRules(r,!0);const a=this.inputSlotCollection.getPreviousSlot(r.partIndex);a&&(a.partText=a.partText.substring(0,a.partText.length-1),o&&this.shiftFormatParts(a),this.formatRenderer.render(),this.formatNavigator.setCursorPosition(a.startPosition+a.partText.length),this.processSlotRules(a,!0))}break}case"Delete":r.partText=r.partText.substring(0,s)+r.partText.substring(s+1),o&&this.shiftFormatParts(r),this.formatRenderer.render(),this.formatNavigator.setCursorToCurrentPosition(),this.processSlotRules(r,!0);break}}processSelectionEditRules(){const t=this.inputSlotCollection.getSlots(this.formatNavigator.getCurrentPartIndices());if(t.length<=0)return;const r=this.formatNavigator.getCursorStartPosition(),n=this.formatNavigator.getCursorEndPosition();for(let s=0,o=t.length;s<o;s++){const i=t[s];i.startPosition>=r&&i.endPosition<=n?i.partText="":i.startPosition>=r&&i.endPosition>n?i.partText=i.partText.substring(n-i.startPosition):i.startPosition<r&&i.endPosition<=n?i.partText=i.partText.substring(0,r-i.startPosition):i.startPosition<r&&i.endPosition>n&&(i.partText=i.partText.substring(0,r-i.startPosition)+i.partText.substring(n-i.startPosition))}this.formatRenderer.render(),this.formatNavigator.setCursorPosition(r);for(let s=0,o=t.length;s<o;s++)this.processSlotRules(t[s])}shiftFormatParts(t){let r=t,n;for(;(n=this.inputSlotCollection.getNextSlot(r.partIndex))!==void 0;){const s=n.partText.substring(0,1);n.partText=n.partText.substring(1),r.partText=r.partText+s,r=n}}processInputRules(t){const r=this.inputSlotCollection.getSlot(this.formatNavigator.getCurrentPartIndex());if(!r)return;const{key:n}=t,s=r.characterCount,o=r.partText;if(r.valueType===lt.Numeric){if(!this.keyTypeChecker.isNumberKey(n))return;const i=r.maximumValue,a=r.exceedingMaximumValueCausesTab||!1,u=r.padWithZeros||!1,f=parseInt(this.createNewValue(r,n));if(i&&f>i)if(a){u&&(r.partText=r.partText.padStart(s,"0")),r.isComplete=!0;const h=this.inputSlotCollection.getNextSlot(r.partIndex);h&&!h.isComplete&&(h.partText=n),this.formatRenderer.render(),h&&this.formatNavigator.setCursorPosition(h.isComplete?h.startPosition:h.startPosition+1)}else return;else o.length+1===s?(this.addToInputSlot(n),r.isComplete=!0,this.formatRenderer.render(),this.formatNavigator.isAtLastPart()?this.formatNavigator.moveCursorRight():this.formatNavigator.moveToNextInputPart()):o.length+1<s&&(this.addToInputSlot(n),this.formatRenderer.render(),this.formatNavigator.moveCursorRight())}else o.length+1===s?(this.addToInputSlot(n),r.isComplete=!0,this.formatRenderer.render(),this.formatNavigator.isAtLastPart()?this.formatNavigator.moveCursorRight():this.formatNavigator.moveToNextInputPart()):(this.addToInputSlot(n),this.formatRenderer.render(),this.formatNavigator.moveCursorRight())}addToInputSlot(t){const r=this.inputSlotCollection.getSlot(this.formatNavigator.getCurrentPartIndex());r&&(r.partText=this.createNewValue(r,t))}createNewValue(t,r){const n=t.partText,s=this.formatNavigator.getCursorPosition();if(s>=t.startPosition+t.partText.length)return n+r;{const o=s-t.startPosition;return n.substring(0,o)+r+n.substring(o)}}processSlotRules(t,r=!1){const n=t.characterCount,s=t.allCharactersRequired||!1;if(t.valueType===lt.Numeric){const o=t.minimumValue,i=t.maximumValue;if(s)t.isComplete=t.partText.length===n;else if(o!==void 0&&i!==void 0){const a=t.padWithZeros||!1,u=parseInt(t.partText);t.isComplete=u>=o&&u<=i,t.isComplete&&a&&!r&&(t.partText=t.partText.padStart(n,"0"))}else t.isComplete=t.partText.length>0}else s?t.isComplete=t.partText.length===n:t.isComplete=t.partText.length>0}}class lm{constructor(t,r){b(this,"instanceCollection");b(this,"formatNavigator");b(this,"ruleProcessor");b(this,"keyTypeChecker");b(this,"formatRenderer");this.format=t,this.instanceCollection=Xt.getInstance(),this.formatNavigator=this.instanceCollection.getNavigatorInstance(r,t),this.ruleProcessor=new zi(t,r),this.keyTypeChecker=new Ui,this.formatRenderer=new ls(t,r)}setInputElement(t){this.ruleProcessor.setInputElement(t),this.formatRenderer.setInputElement(t)}processMovementKey(t){const{key:r,metaKey:n,ctrlKey:s,shiftKey:o}=t;switch(r){case"ArrowLeft":o?this.formatNavigator.moveHighlightLeft():n?this.formatNavigator.moveHome():this.formatNavigator.moveCursorLeft();break;case"ArrowRight":o?this.formatNavigator.moveHighlightRight():n?this.formatNavigator.moveEnd():this.formatNavigator.moveCursorRight();break;case"Home":this.formatNavigator.moveHome();break;case"End":this.formatNavigator.moveEnd();break;case"a":(n||s)&&this.formatNavigator.highlightAll();break}}processKeyPress(t){return this.keyTypeChecker.isIgnoreKey(t)?!1:this.keyTypeChecker.isMovementKey(t)?(this.processMovementKey(t),!1):(this.ruleProcessor.processKeyPress(t),!0)}}class fm{constructor(t,r=""){b(this,"instanceId");b(this,"instanceCollection");b(this,"keyProcessor");b(this,"formatNavigator");b(this,"formatRenderer");b(this,"inputSlotCollection");b(this,"inputRuleProcessor");b(this,"previousOutputValue","");b(this,"inputElementSet",!1);b(this,"isInputFocused",!1);b(this,"inputElement");b(this,"onFormatChange");this.inputValue=r,this.instanceId=nm(),this.instanceCollection=Xt.getInstance(),this.keyProcessor=new lm(t,this.instanceId),this.formatNavigator=this.instanceCollection.getNavigatorInstance(this.instanceId,t),this.formatRenderer=new ls(t,this.instanceId),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(this.instanceId,t),this.inputRuleProcessor=new zi(t,this.instanceId)}inputElementCreated(t){this.keyProcessor.setInputElement(t),this.formatNavigator.setInputElement(t),this.formatRenderer.setInputElement(t),this.inputElement=t,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(t){this.inputValue=t,this.inputElementSet&&(this.inputValue.length>0?this.inputRuleProcessor.processInputValue(t):(this.inputSlotCollection.clearAllSlots(),this.previousOutputValue=void 0),this.renderFormat())}pastedValue(t){t.length>0&&(this.formatNavigator.isSelection?this.formatNavigator.isAllSelected?this.inputValuePassed(t):this.inputRuleProcessor.processPastedValue(t,!0):this.inputValue.length===0?this.inputValuePassed(t):this.inputRuleProcessor.processPastedValue(t),this.renderFormat(!0))}registerFormatChangeEvent(t){this.onFormatChange=t}mouseUpHandler(){this.formatNavigator.findCursorPosition()}keyDownHandler(t){if(t.key!=="Tab"){if(!(t.key==="c"&&(t.ctrlKey||t.metaKey))&&!(t.key==="x"&&(t.ctrlKey||t.metaKey))&&!(t.key==="v"&&(t.ctrlKey||t.metaKey)))t.preventDefault(),t.stopPropagation();else return;this.keyProcessor.processKeyPress(t)&&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)}renderFormat(t=!1){setTimeout(()=>{var r,n;this.formatRenderer.render(),this.isInputFocused&&this.formatNavigator.setCursorToCurrentPosition(),this.inputValue.length>0&&(this.previousOutputValue=(r=this.inputElement)==null?void 0:r.innerHTML),t&&((n=this.inputElement)!=null&&n.innerHTML)&&this.onFormatChange&&this.onFormatChange(this.inputElement.innerHTML)})}}const dm=(e,t)=>{const{value:r="",format:n,readOnly:s=!1,debounceTime:o=800,fillContainer:i=!0,leftElement:a,rightElement:u,className:f,leftElementClassName:h,rightElementClassName:g,isSingleLine:x=!1,allowSingleLineScroll:v=!1,isInputValid:T,onChange:I,onFocus:j,onBlur:E,onElementCreate:D,onLeftElementClick:Q,onRightElementClick:U}=e,[y,F]=d.useState(!0),k=d.useRef(),q=d.useRef(),z=d.useRef(),oe=d.useRef(!1);d.useEffect(()=>(document.addEventListener("mouseup",O),()=>{var C;(C=z.current)==null||C.dispose(),document.removeEventListener("mouseup",O)}),[]),d.useEffect(()=>{var C;(C=z.current)==null||C.inputValuePassed(r)},[r]),d.useEffect(()=>{var C,P,V;(C=z.current)==null||C.dispose(),n&&(z.current=new fm(n,r),q.current&&((P=z.current)==null||P.inputElementCreated(q.current)),(V=z.current)==null||V.registerFormatChangeEvent(ce))},[n]);const ce=d.useCallback(C=>{T?T(C)?(F(!0),I==null||I(C)):F(!1):I==null||I(C)},[I]),ne=d.useCallback(C=>{var P;(P=z.current)==null||P.inputFocused(),j==null||j(C)},[j]),M=d.useCallback(C=>{var P;(P=z.current)==null||P.inputBlurred(),E==null||E(C)},[E]),H=d.useCallback(()=>{oe.current=!0},[]),L=d.useCallback(()=>{var C;if(oe.current)oe.current=!1,(C=z.current)==null||C.mouseUpHandler();else{const P=new MouseEvent("mouseup");document.dispatchEvent(P)}},[]),O=d.useCallback(()=>{var C;oe.current&&(oe.current=!1,(C=z.current)==null||C.mouseUpHandler())},[]),J=d.useCallback(C=>{var P;(P=z.current)==null||P.keyDownHandler(C)},[]),R=d.useCallback(C=>{var V,X;C.preventDefault(),C.stopPropagation();const P=(V=C.clipboardData)==null?void 0:V.getData("text/plain");P&&((X=z.current)==null||X.pastedValue(P))},[]),ge=d.useCallback(C=>{var P,V,X,Y,B,K,re,_,ie,A,De,Ge,$e,Be,ft,rt,Ue;(V=(P=k.current)==null?void 0:P.inputElement)==null||V.removeEventListener("keydown",J),(Y=(X=k.current)==null?void 0:X.inputElement)==null||Y.removeEventListener("mousedown",H),(K=(B=k.current)==null?void 0:B.inputElement)==null||K.removeEventListener("mouseup",L),(_=(re=k.current)==null?void 0:re.inputElement)==null||_.removeEventListener("paste",R),k.current=C,(A=(ie=k.current)==null?void 0:ie.inputElement)==null||A.addEventListener("keydown",J),(Ge=(De=k.current)==null?void 0:De.inputElement)==null||Ge.addEventListener("mousedown",H),(Be=($e=k.current)==null?void 0:$e.inputElement)==null||Be.addEventListener("mouseup",L),(rt=(ft=k.current)==null?void 0:ft.inputElement)==null||rt.addEventListener("paste",R),q.current=(Ue=k.current)==null?void 0:Ue.inputElement},[]),S=d.useCallback(()=>{var C;(C=k.current)==null||C.focus()},[]);d.useImperativeHandle(t,()=>({focus:S}));const N=pe(f,{"!bsc-border-error":!y});return p.jsx(Zr,{ref:C=>C&&ge(C),readOnly:s,debounceTime:o,fillContainer:i,leftElement:a,rightElement:u,className:N,leftElementClassName:h,rightElementClassName:g,isSingleLine:x,allowSingleLineScroll:v,onFocus:ne,onBlur:M,onElementCreate:D,onLeftElementClick:Q,onRightElementClick:U})},qi=d.forwardRef(dm),fs=d.createContext(void 0);function Ki(e,t,r=!0){var x,v;const n=di(e),s=ii(e),o=ih(e);let i=zn(s)-(((x=t.options)==null?void 0:x.weekStartsOn)||0);i=i===-1?6:i;const a=zn(o)-(((v=t.options)==null?void 0:v.weekStartsOn)||0),u=md({start:s,end:o}),f=n+i>35?6:5,h=Gi(f,7,{dayValue:null,isCurrent:!0});let g=1;for(let T=0,I=f;T<I;T++){for(let j=T>0?0:i;j<7;j++){const E=u[g-1];if(E.setHours(e.getHours(),e.getMinutes(),e.getSeconds()),h[T][j].dayValue=E,++g>n)break}if(g>n)break}if(i>0&&r)for(let T=0;T<i;T++)h[0][T].dayValue=np(s,i-T),h[0][T].isCurrent=!1;if(a>-1&&r)for(let T=6;T>a;T--)h[f-1][T].dayValue=Kt(o,T-a),h[f-1][T].isCurrent=!1;return h}function Gi(e,t,r){const n=[];for(let s=0,o=e;s<o;s++){const i=[];for(let a=0,u=t;a<u;a++){const f=hm(r)?r:{...r};i.push(f)}n.push(i)}return n}function hm(e){const t=typeof e;return t==="string"||t==="number"||t==="boolean"||e instanceof Date}function pm(e){var n;const t=sp(new Date,((n=e.options)==null?void 0:n.weekStartsOn)||0),r=[];for(let s=0;s<7;s++)r.push(Kt(t,s).toLocaleDateString(e.code,{weekday:"short"}));return r}function mm(e){const t=new Date(Date.UTC(2020,0,1)),r=[[{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 o=0;o<4;o++)r[s][o]={monthNumber:n,monthName:xt(t,n++).toLocaleDateString(e.code,{month:"short"})};return r}function gm(e,t){const r=new Date(e.getTime()),n=Math.floor(r.getFullYear()/10)*10;r.setFullYear(n);const s=gd({start:r,end:Er(r,9)}),o=Gi(3,4,"");let i=0;for(let a=0;a<3;a++)for(let u=0;u<4&&(o[a][u]=s[i++].toLocaleDateString(t.code,{year:"numeric"}),i!==s.length);u++);return o}function bm(e){const t=new Date;return t.setHours(0,0,0,0),t.toLocaleTimeString(e.code)}function ym(e,t,r){return e.getTime()>=t.getTime()&&e.getTime()<=r.getTime()}async function Zi(e){return(await import(`/node_modules/date-fns/locale/${vm(e)}`)).default}function vm(e){const[t,r]=e.split("-");switch(t){case"af":return"af";case"ar":switch(r){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(r){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(r){case"AT":return"de-AT";default:return"de"}case"el":return"el";case"en":switch(r){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(r){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(r){case"CH":return"it-CH";default:return"it"}case"ja":switch(r){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(r){case"BE":return"nl-BE";default:return"nl"}case"nn":return"nn";case"oc":return"oc";case"pl":return"pl";case"pt":switch(r){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(r){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(r){case"Cyrl":return"uz-Cyrl";default:return"uz"}case"vi":return"vi";case"zh":switch(r){case"CN":return"zh-CN";case"HK":return"zh-HK";default:return"zh-TW"}default:return"en-AU"}}function Nr(e,t){const r=op(e);if(isNaN(r.valueOf())){let n=ut(e,"P pp",new Date,{locale:t});return!isNaN(n.valueOf())||(n=ut(e,"Pp",new Date,{locale:t}),!isNaN(n.valueOf()))||(n=ut(e,"P HH:mm",new Date,{locale:t}),!isNaN(n.valueOf()))||(n=ut(e,"P hh:mm a..aaa",new Date,{locale:t}),!isNaN(n.valueOf()))||(n=ut(e,"P HH:mm:ss",new Date,{locale:t}),!isNaN(n.valueOf()))||(n=ut(e,"P hh:mm:ss a..aaa",new Date,{locale:t}),!isNaN(n.valueOf()))||(n=ut(e,"P",new Date,{locale:t}),!isNaN(n.valueOf()))||(n=ut(e,"P p",new Date,{locale:t}),!isNaN(n.valueOf()))||(n=ut(e,"pp",new Date,{locale:t}),!isNaN(n.valueOf()))||(n=ut(e,"p",new Date,{locale:t}),!isNaN(n.valueOf()))?n:void 0}return r}function ds(e,t){const r=e.split("-");if(r.length!==2)return;const n=Nr(r[0].trim(),t);if(!n)return;const s=Nr(r[1].trim(),t);if(s)return[n,s]}var Pe=(e=>(e[e.DateTime=0]="DateTime",e[e.DateOnly=1]="DateOnly",e[e.TimeOnly=2]="TimeOnly",e[e.DateRange=3]="DateRange",e))(Pe||{}),Le=(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))(Le||{}),Jt=(e=>(e[e.Day=0]="Day",e[e.Month=1]="Month",e[e.Year=2]="Year",e[e.Range=3]="Range",e))(Jt||{}),Ir=(e=>(e[e.Short=0]="Short",e[e.Medium=1]="Medium",e[e.Long=2]="Long",e))(Ir||{}),Oe=(e=>(e[e.TwelveHour=0]="TwelveHour",e[e.TwentyFourHour=1]="TwentyFourHour",e))(Oe||{}),Pt=(e=>(e[e.Normal=0]="Normal",e[e.Range=1]="Range",e))(Pt||{}),rn=(e=>(e[e.Right=0]="Right",e[e.Left=1]="Left",e[e.None=2]="None",e))(rn||{}),fe=(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))(fe||{});const xm=(e,t)=>{switch(t.type){case 0:return t.dateSelector!==void 0?{...e,currentSelector:t.dateSelector,currentViewDate:t.viewDate||e.currentViewDate}:{...e};case 1:return{...e,currentViewDate:t.viewDate||new Date,dateInitialized:!0};case 2:return{...e,selectedDate:t.selectedDate||e.selectedDate,currentViewDate:t.viewDate||e.currentViewDate};case 3:return{...e,selectedStartDate:t.selectedStartDate||e.selectedStartDate,selectedEndDate:t.selectedEndDate||e.selectedEndDate};case 4:return{...e,selectedStartDate:t.selectedStartDate,selectedEndDate:void 0};case 5:return{...e,selectedEndDate:t.selectedEndDate};case 6:return{...e,timeFormat:t.timeFormat||e.timeFormat};case 7:return{currentSelector:e.currentSelector,currentViewDate:e.currentViewDate,timeFormat:e.timeFormat,dateInitialized:!0};case 8:{const r={...e,currentViewDate:wm(t.initialDate),dateInitialized:!0};return Array.isArray(t.initialDate)?{...r,selectedStartDate:t.initialDate[0],selectedEndDate:t.initialDate[1]}:{...r,selectedDate:t.initialDate}}default:return{...e,currentSelector:Le.DaySelector}}};function wm(e){return e?Array.isArray(e)?e[0]:e:new Date}const hs=(e,t,r)=>{const n=d.useCallback(u=>{r({type:fe.SetViewDate,viewDate:xt(t,u)})},[t]),s=d.useCallback(u=>{r({type:fe.SetViewDate,viewDate:Zn(t,u)})},[t]),o=d.useCallback(u=>{r({type:fe.SetViewDate,viewDate:Er(t,u)})},[t]),i=d.useCallback(u=>{r({type:fe.SetViewDate,viewDate:Qn(t,u)})},[t]),a=d.useCallback(u=>{r({type:fe.SetDateSelector,dateSelector:u})},[]);return{...e,incrementViewMonths:n,decrementViewMonths:s,incrementViewYears:o,decrementViewYears:i,setDateSelector:a}},nn=({viewDate:e,selectedDate:t,selectedStartDate:r,selectedEndDate:n,selectionMode:s=Pt.Normal,locale:o,onDateSelected:i,selectableDate:a,isValidDate:u,dispatcher:f})=>{var L;const[h,g]=d.useState(!1),[x,v]=d.useState(),[T,I]=d.useState(),[j,E]=d.useState(),[D,Q]=d.useState(),U=d.useRef(),y=d.useRef(),F=d.useContext(fs),k=d.useMemo(()=>F.calendarTemplate,[F.calendarTemplate]),q=async()=>o||await Zi(yi());d.useEffect(()=>{q().then(O=>{U.current=O,y.current=pm(U.current),g(!0)}).catch(O=>console.error(O))},[]),d.useEffect(()=>{e&&U.current&&E(Ki(e,U.current,s===Pt.Normal))},[e,h]),d.useEffect(()=>{Q(t?new Date(t.getFullYear(),t.getMonth(),t.getDate()):void 0)},[t]),d.useEffect(()=>{v(r?new Date(r.getFullYear(),r.getMonth(),r.getDate(),0,0,0).getTime():void 0),I(n?new Date(n.getFullYear(),n.getMonth(),n.getDate(),23,59,59).getTime():void 0)},[r,n]),d.useEffect(()=>{U.current&&o&&(U.current=o,E(Ki(e,U.current,s===Pt.Normal)))},[o]);const z=O=>{if(s===Pt.Normal)f==null||f({type:fe.SetSelectedDate,selectedDate:O,viewDate:O}),i==null||i(O);else{if(!i)throw new Error("Range selection mode requires onDateSelected to be set");!r||ah(O,r)?i(O):r&&!n?i(O,{setEndDate:!0}):r&&n&&i(O)}},oe=O=>(D==null?void 0:D.toLocaleDateString())===O.toLocaleDateString(),ce=O=>{if(x&&T){const J=O.getTime();return J>=x&&J<=T}return!1},ne=hs({viewDate:e,selectedDate:t,selectedStartDate:r,selectedEndDate:n,selectionMode:s,locale:o,weekDays:y.current,monthMatrix:j,selectableDate:a,isValidDate:u,onDateClicked:z,isSelectedDate:oe,isInSelectedDateRange:ce},e,f),H=k||((O,J)=>p.jsx("div",{className:"bc-dt-calendar bsc-w-full",children:J}));return p.jsx(kt,{props:ne,template:H,children:p.jsxs("div",{className:"bc-dt-day-row bsc-grid bsc-min-w-[329px] bsc-grid-cols-7 bsc-gap-3",children:[(L=y.current)==null?void 0:L.map((O,J)=>p.jsx("div",{className:"bc-dt-day-cell bsc-text-center bsc-font-bold",children:O},J)),j==null?void 0:j.map((O,J)=>O.map((R,ge)=>{var C,P;const S=R.dayValue!==null&&(a===void 0||a(R.dayValue)),N=pe("bsc-text-center bsc-py-1",{"bsc-text-gray-3":!R.isCurrent,"bsc-bg-primary-3 dark:bsc-bg-mono-light-1 dark:bsc-text-mono-dark-1":R&&R.dayValue&&(D&&oe(R.dayValue)||x&&!T&&oi(x,R.dayValue)||x&&T&&ce(R.dayValue)),"bsc-cursor-pointer":S,"bsc-text-error bsc-cursor-not-allowed":!S,"bsc-bg-primary-5 dark:bsc-bg-mono-light-3 dark:bsc-text-mono-dark-1":R.dayValue&&rp(R.dayValue)&&!(oe(R.dayValue)||ce(R.dayValue))},"bc-dt-date-cell");return p.jsx("div",{className:N,onClick:()=>R&&R.dayValue&&S&&(u===void 0||u(R.dayValue))&&z(R.dayValue),children:(P=R.dayValue)==null?void 0:P.getDate().toLocaleString((C=U.current)==null?void 0:C.code)},J.toString()+ge.toString())}))]})})},sn=({title:e,scrollerType:t,onTitleClicked:r,onMovePrevious:n,onMoveNext:s,viewDate:o,dispatcher:i})=>{const u=d.useContext(fs).dateScrollerTemplate,f=hs({title:e,scrollerType:t,onTitleClicked:r,onMovePrevious:n,onMoveNext:s},o,i),g=u||((x,v)=>p.jsx("div",{className:"bc-dt-scroller bsc-flex bsc-w-full bsc-flex-row bsc-items-center bsc-px-2 bsc-py-1",children:v}));return p.jsxs(kt,{props:f,template:g,children:[p.jsx("div",{className:"bc-dt-scroller-left bsc-flex-shrink bsc-cursor-pointer",children:p.jsx(ot,{className:"bsc-bg-transparent focus:bsc-outline-none",onClick:n,children:p.jsx(Xe,{icon:"chevronLeft",size:We.Regular})})}),p.jsx("div",{className:"bc-dt-scroller-title bsc-flex-grow bsc-cursor-pointer bsc-text-center",onClick:r,children:e}),p.jsx("div",{className:"bc-dt-scroller-right bsc-flex-shrink bsc-cursor-pointer",children:p.jsx(ot,{className:"bsc-bg-transparent focus:bsc-outline-none",onClick:s,children:p.jsx(Xe,{icon:"chevronRight",size:We.Regular})})})]})},Pm=({selectedDate:e,viewDate:t,locale:r,showTimeSelector:n,selectableDate:s,isValidDate:o,onChange:i,dispatcher:a})=>{const u=()=>{t&&a({type:fe.SetViewDate,viewDate:Zn(t,1)})},f=()=>{t&&a({type:fe.SetViewDate,viewDate:xt(t,1)})},h=()=>{a({type:fe.SetDateSelector,dateSelector:Le.MonthSelector})},g=()=>{a({type:fe.SetDateSelector,dateSelector:Le.TimeSelector})},x=()=>t?t.toLocaleDateString(r.code,{month:"long",year:"numeric"}):"";return p.jsxs("div",{className:"bc-dt-day-selector bsc-p-2",children:[p.jsx(sn,{title:x(),scrollerType:Jt.Day,onTitleClicked:h,onMovePrevious:u,onMoveNext:f,viewDate:t,dispatcher:a}),p.jsx(nn,{viewDate:t,selectedDate:e,locale:r,selectableDate:s,isValidDate:o,onDateSelected:i,dispatcher:a}),n&&p.jsx("div",{className:"bc-dt-time-value-wrapper bsc-flex bsc-w-full bsc-flex-row bsc-justify-center bsc-p-2",children:p.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:g,children:(e==null?void 0:e.toLocaleTimeString(r.code))||bm(r)})})]})},Sm=({viewDate:e,locale:t,dateSelection:r=Pe.DateTime,dispatcher:n})=>{const s=d.useRef(mm(t)),o=()=>{const h=Qn(e,1);n({type:fe.SetViewDate,viewDate:h})},i=()=>{const h=Er(e,1);n({type:fe.SetViewDate,viewDate:h})},a=h=>{n({type:fe.SetDateSelector,dateSelector:r!==Pe.DateRange?Le.DaySelector:Le.DateRangeSelector,viewDate:wp(e,h)})},u=()=>e.toLocaleDateString(t.code,{year:"numeric"}),f=()=>{n({type:fe.SetDateSelector,dateSelector:Le.YearSelector})};return p.jsxs("div",{className:"bc-dt-month-selector bsc-p-2",style:{minWidth:"20rem"},children:[p.jsx(sn,{title:u(),scrollerType:Jt.Month,onTitleClicked:f,onMovePrevious:o,onMoveNext:i,viewDate:e,dispatcher:n}),p.jsx("div",{className:"bc-dt-month-grid bsc-grid bsc-w-full bsc-grid-cols-4 bsc-gap-4",children:s.current.map((h,g)=>h.map((x,v)=>p.jsx("div",{className:"bc-dt-month-cell bsc-cursor-pointer bsc-text-center",onClick:()=>a(x.monthNumber),children:x.monthName},g.toString()+v.toString())))})]})},Tm=({viewDate:e,selectedStartDate:t,selectedEndDate:r,locale:n,onChange:s,dispatcher:o})=>{const i=Jr("screen and (max-device-width: 40rem)"),a=xt(e,1),u=(v,T)=>{!T||!T.setEndDate?o({type:fe.SetSelectedStartDate,selectedStartDate:v}):(o({type:fe.SetSelectedEndDate,selectedEndDate:v}),t&&(s==null||s([t,v])))},f=()=>{o({type:fe.SetDateSelector,dateSelector:Le.MonthSelector})},h=()=>i?`${e.toLocaleDateString(n.code,{month:"long"})} ${e.toLocaleDateString(n.code,{year:"numeric"})}`:`${e.toLocaleDateString(n.code,{month:"long"})} ${e.toLocaleDateString(n.code,{year:"numeric"})} - ${a.toLocaleDateString(n.code,{month:"long"})} ${a.toLocaleDateString(n.code,{year:"numeric"})}`,g=()=>{e&&o({type:fe.SetViewDate,viewDate:Zn(e,1)})},x=()=>{e&&o({type:fe.SetViewDate,viewDate:xt(e,1)})};return p.jsxs("div",{className:"bc-dt-range-selector bsc-flex bsc-flex-col",children:[p.jsx("div",{className:"bc-dt-range-scroller-wrapper bsc-flex-shrink",children:p.jsx(sn,{title:h(),scrollerType:Jt.Range,onTitleClicked:f,onMovePrevious:g,onMoveNext:x,viewDate:e,dispatcher:o})}),p.jsx("div",{className:"bsc-flex-grow",children:p.jsx(Jn,{mobileMarkup:p.jsx("div",{className:"bc-dt-range-calendar bsc-px-2 bsc-py-1",children:p.jsx(nn,{viewDate:e,selectedStartDate:t,selectedEndDate:r,selectionMode:Pt.Range,onDateSelected:u,locale:n,dispatcher:o})}),aboveMobileMarkup:p.jsxs("div",{className:"bc-dt-range-wrapper bsc-flex bsc-flex-row bsc-px-2 bsc-py-1",children:[p.jsx("div",{className:"bc-dt-range-calendar-1 bsc-border-r bsc-border-solid bsc-border-gray-3 bsc-pr-4",children:p.jsx(nn,{viewDate:e,selectedStartDate:t,selectedEndDate:r,selectionMode:Pt.Range,onDateSelected:u,locale:n,dispatcher:o})}),p.jsx("div",{className:"bc-dt-range-calendar-2 bsc-pl-4",children:p.jsx(nn,{viewDate:a,selectedStartDate:t,selectedEndDate:r,selectionMode:Pt.Range,onDateSelected:u,locale:n,dispatcher:o})})]})})})]})},Em=({viewDate:e,showDateSelector:t,locale:r,timeFormat:n=Oe.TwelveHour,timeConstraints:s,onChange:o,dispatcher:i})=>{const a=d.useRef(n===Oe.TwelveHour?11:23),u=d.useRef(n===Oe.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(Sp(0,59,M=>M.toString().padStart(2,"0"))),h=d.useRef(["AM","PM"]),g=d.useRef(rd(e)),x=M=>M>11?M-12:M,[v,T]=d.useState(x(e.getHours())),[I,j]=d.useState(e.getMinutes()),[E,D]=d.useState(e.getHours()<=12?0:1),Q=d.useRef(e.toLocaleDateString(r.code));d.useEffect(()=>{const M=e.getHours(),H=e.getMinutes();if(M!==v&&T(n===Oe.TwelveHour?x(M):M),H!==I&&j(H),n===Oe.TwelveHour){const L=M<=11?0:1;L!==E&&D(L)}},[e]);const U=()=>{var L;const M=((L=s==null?void 0:s.hours)==null?void 0:L.step)||1,H=v<a.current?v+M:0;T(H),z(H,I,E)},y=()=>{var L;const M=((L=s==null?void 0:s.hours)==null?void 0:L.step)||1,H=v>0?v-M:a.current;T(H),z(H,I,E)},F=()=>{var L,O,J;const M=((L=s==null?void 0:s.minutes)==null?void 0:L.step)||1,H=I+M<(((O=s==null?void 0:s.minutes)==null?void 0:O.max)||59)?I+M:((J=s==null?void 0:s.minutes)==null?void 0:J.min)||0;j(H),z(v,H,E)},k=()=>{var L,O,J;const M=((L=s==null?void 0:s.minutes)==null?void 0:L.step)||1,H=I-M>=(((O=s==null?void 0:s.minutes)==null?void 0:O.min)||0)?I-M:(((J=s==null?void 0:s.minutes)==null?void 0:J.max)||60)-M;j(H),z(v,H,E)},q=()=>{const M=E===0?1:0;D(M),z(v,I,M)},z=(M,H,L)=>{const O=n===Oe.TwelveHour&&L===1?M+12:M;g.current.setHours(O,H),i({type:fe.SetSelectedDate,selectedDate:g.current,viewDate:g.current}),o==null||o(g.current)},oe=()=>{i({type:fe.SetDateSelector,dateSelector:Le.DaySelector})},ce=pe("bsc-w-full bsc-grid bsc-grid-rows-3 bsc-gap-4 bc-dt-time-grid",{"bsc-grid-cols-4":n===Oe.TwelveHour,"bsc-grid-cols-3":n===Oe.TwentyFourHour}),ne=pe("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===Oe.TwelveHour,"bsc-col-span-3":n===Oe.TwentyFourHour});return p.jsx("div",{className:"bc-dt-time-selector bsc-flex bsc-flex-row bsc-justify-center bsc-p-2",style:{minWidth:n===Oe.TwelveHour?"15rem":"11rem"},children:p.jsxs("div",{className:ce,children:[t&&p.jsx("div",{className:ne,onClick:oe,children:Q.current}),p.jsx("div",{className:"bc-dt-time-hour-increase bsc-cursor-pointer bsc-text-center",children:p.jsx(ot,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:U,children:p.jsx(Xe,{icon:"chevronUp",size:We.Regular})})}),p.jsx("div",{}),p.jsx("div",{className:"bc-dt-time-minute-increase bsc-cursor-pointer bsc-text-center",children:p.jsx(ot,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:F,children:p.jsx(Xe,{icon:"chevronUp",size:We.Regular})})}),n===Oe.TwelveHour&&p.jsx("div",{className:"bc-dt-time-meridian-increase bsc-cursor-pointer bsc-text-center",children:p.jsx(ot,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:q,children:p.jsx(Xe,{icon:"chevronUp",size:We.Regular})})}),p.jsx("div",{className:"bc-dt-time-hour-value bsc-text-center",children:u.current[v]}),p.jsx("div",{className:"bc-dt-time-separator bsc-text-center",children:":"}),p.jsx("div",{className:"bc-dt-time-minute-value bsc-text-center",children:f.current[I]}),n===Oe.TwelveHour&&p.jsx("div",{className:"bc-dt-time-meridian-value bsc-text-center",children:h.current[E]}),p.jsx("div",{className:"bc-dt-time-hour-decrease bsc-cursor-pointer bsc-text-center",children:p.jsx(ot,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:y,children:p.jsx(Xe,{icon:"chevronDown",size:We.Regular})})}),p.jsx("div",{}),p.jsx("div",{className:"bc-dt-time-minute-decrease bsc-cursor-pointer bsc-text-center",children:p.jsx(ot,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:k,children:p.jsx(Xe,{icon:"chevronDown",size:We.Regular})})}),n===Oe.TwelveHour&&p.jsx("div",{className:"bc-dt-time-meridian-decrease bsc-cursor-pointer bsc-text-center",children:p.jsx(ot,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:q,children:p.jsx(Xe,{icon:"chevronDown",size:We.Regular})})})]})})},_m=({viewDate:e,locale:t,dispatcher:r})=>{const n=gm(e,t),s=()=>{const u=Qn(e,10);r({type:fe.SetViewDate,viewDate:u})},o=()=>{const u=Er(e,10);r({type:fe.SetViewDate,viewDate:u})},i=u=>{const f=parseInt(u);r({type:fe.SetDateSelector,dateSelector:Le.MonthSelector,viewDate:Pp(e,f)})},a=()=>`${n[0][0].toString()} - ${n[2][1].toString()}`;return p.jsxs("div",{className:"bc-dt-year-selector",style:{minWidth:"20rem"},children:[p.jsx(sn,{title:a(),scrollerType:Jt.Year,onMovePrevious:s,onMoveNext:o,viewDate:e,dispatcher:r}),p.jsx("div",{className:"bc-dt-year-wrapper bsc-w-full",children:p.jsx("div",{className:"bc-dt-year-grid bsc-grid bsc-grid-cols-4 bsc-gap-4",children:n.map((u,f)=>u.map((h,g)=>h.length>0?p.jsx("div",{className:"bc-dt-year-cell bsc-cursor-pointer bsc-text-center",onClick:()=>i(h),children:h},f.toString()+g.toString()):p.jsx("div",{},f.toString()+g.toString())))})})]})};class Cm{constructor(t,r){b(this,"dateFormat");b(this,"timeFormat");b(this,"use24HourTime");b(this,"monthPart");b(this,"dayPart");b(this,"yearPart");b(this,"twelveHourPart");b(this,"twentyFourHourPart");b(this,"minutePart");b(this,"meridianPart");this.dateSelection=t;const n=2023,s=12,o=20,a=new Date(n,s-1,o).toLocaleDateString(r,{year:"numeric",month:"numeric",day:"numeric"});this.dateFormat=a.replace(`${n}`,"YYYY").replace(`${s}`,"MM").replace(`${o}`,"DD");const u=new Date,f=18,h=24,g=37,x=317;u.setHours(f,h,g,x);const v=u.toLocaleTimeString(r);this.use24HourTime=v.startsWith("18"),this.timeFormat=v.replace(`${this.use24HourTime?f:"6"}`,"HH").replace(`${h}`,"MM").replace(`${g}`,"SS").replace(`${x}`,"LLL"),this.createDateParts()}get is24HourTime(){return this.use24HourTime}createInputFormat(){const t={deleteShiftsFormatPart:!1,formatParts:[]};switch(this.dateSelection){case Pe.DateOnly:return this.createDateFormat(t);case Pe.TimeOnly:return this.createTimeFormat(t);case Pe.DateRange:return this.createDateRangeFormat(t);case Pe.DateTime:return this.createDateTimeFormat(t)}}createDateFormat(t){return this.dateFormat.startsWith("MM")?t.formatParts.push(...this.createMonthDayYearFormatParts()):this.dateFormat.startsWith("DD")?t.formatParts.push(...this.createDayMonthYearFormatParts()):t.formatParts.push(...this.createYearMonthDayFormatParts()),t}createTimeFormat(t){return this.use24HourTime?t.formatParts.push(...this.createTwentyFourHourFormatParts()):t.formatParts.push(...this.createTwelveHourFormatParts()),t}createDateRangeFormat(t){const r=[];this.dateFormat.startsWith("MM")?r.push(...this.createMonthDayYearFormatParts()):this.dateFormat.startsWith("DD")?r.push(...this.createDayMonthYearFormatParts()):r.push(...this.createYearMonthDayFormatParts());const n={characterCount:3,placeholder:" - ",inputText:" - ",isSeparator:!0};return t.formatParts.push(...r,n,...r),t}createDateTimeFormat(t){this.dateFormat.startsWith("MM")?t.formatParts.push(...this.createMonthDayYearFormatParts()):this.dateFormat.startsWith("DD")?t.formatParts.push(...this.createDayMonthYearFormatParts()):t.formatParts.push(...this.createYearMonthDayFormatParts());const r={characterCount:1,placeholder:" ",inputText:" ",isSeparator:!0};return t.formatParts.push(r),this.use24HourTime?t.formatParts.push(...this.createTwentyFourHourFormatParts()):t.formatParts.push(...this.createTwelveHourFormatParts()),t}createMonthDayYearFormatParts(){if(this.monthPart&&this.dayPart&&this.yearPart){let t=this.dateFormat.replace("MM",""),r=t.indexOf("DD"),n=t.substring(0,r);t=t.replace(n,"").replace("DD","");const s={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};r=t.indexOf("YYYY"),n=t.substring(0,r);const o={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};return[this.monthPart,s,this.dayPart,o,this.yearPart]}return[]}createDayMonthYearFormatParts(){if(this.monthPart&&this.dayPart&&this.yearPart){let t=this.dateFormat.replace("DD",""),r=t.indexOf("MM"),n=t.substring(0,r);t=t.replace(n,"").replace("MM","");const s={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};r=t.indexOf("YYYY"),n=t.substring(0,r);const o={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};return[this.dayPart,s,this.monthPart,o,this.yearPart]}return[]}createYearMonthDayFormatParts(){if(this.monthPart&&this.dayPart&&this.yearPart){let t=this.dateFormat.replace("YYYY",""),r=t.indexOf("MM"),n=t.substring(0,r);t=t.replace(n,"").replace("MM","");const s={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};r=t.indexOf("DD"),n=t.substring(0,r);const o={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};return[this.yearPart,s,this.monthPart,o,this.dayPart]}return[]}createTwelveHourFormatParts(){if(this.twelveHourPart&&this.minutePart&&this.meridianPart){const t=this.timeFormat.replace("HH",""),r=t.indexOf("MM"),n=t.substring(0,r),s={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0},o={characterCount:1,placeholder:" ",inputText:" ",isSeparator:!0};return[this.twelveHourPart,s,this.minutePart,o,this.meridianPart]}return[]}createTwentyFourHourFormatParts(){if(this.twentyFourHourPart&&this.minutePart){const t=this.timeFormat.replace("HH",""),r=t.indexOf("MM"),n=t.substring(0,r),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:lt.Numeric,minimumValue:1,maximumValue:12,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.dayPart={characterCount:2,placeholder:"D",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:lt.Numeric,minimumValue:1,maximumValue:31,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.yearPart={characterCount:4,placeholder:"Y",inputText:"_",isSeparator:!1,allCharactersRequired:!0,valueType:lt.Numeric},this.twelveHourPart={characterCount:2,placeholder:"H",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:lt.Numeric,minimumValue:1,maximumValue:12,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.twentyFourHourPart={characterCount:2,placeholder:"H",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:lt.Numeric,minimumValue:0,maximumValue:23,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.minutePart={characterCount:2,placeholder:"M",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:lt.Numeric,minimumValue:0,maximumValue:59,exceedingMaximumValueCausesError:!0,padWithZeros:!0},this.meridianPart={characterCount:2,inputText:"_",isSeparator:!1,valueType:lt.Text,possibleValues:["AM","PM"]}}}const km=(e,t)=>{var o;const[r,n]=d.useState(),s=d.useRef();return d.useEffect(()=>{t&&!r&&(s.current=new Cm(e,t),n(s.current.createInputFormat()))},[t]),[r,(o=s.current)==null?void 0:o.is24HourTime]},Om=({value:e,readOnly:t=!1,label:r,useDefaultDateValue:n=!1,useFormattedInput:s=!1,allowClear:o=!1,closeSelector:i=!1,locale:a,className:u,dateSelection:f=Pe.DateTime,dateFormat:h,timeConstraints:g,icon:x,iconPosition:v=rn.Right,inputElement:T,selectableDate:I,isValidDate:j,onChange:E,calendarTemplate:D,dateScrollerTemplate:Q,inputTemplate:U,wrapperTemplate:y})=>{const[F,k]=d.useState(!1),[q,z]=d.useState(),[oe,ce]=d.useState(),[ne,M,H]=Wa(f),L=d.useRef(),O=d.useRef(!1),J=d.useRef(a||yi()),R=d.useRef(),ge=d.useRef(),S=d.useRef(),N=d.useRef(null),C=d.useRef(null),[P,V]=km(f,q),X=d.useRef({calendarTemplate:D,dateScrollerTemplate:Q});d.useEffect(()=>{J.current&&B(J.current)},[J]),d.useEffect(()=>{a&&B(a)},[a]),d.useEffect(()=>{if(e){const ee=K();ie({type:fe.InitializeDates,initialDate:ee})}else ie({type:fe.ClearDates})},[e,R.current]),d.useEffect(()=>{V&&ie({type:fe.SetTimeFormat,timeFormat:V?Oe.TwentyFourHour:Oe.TwelveHour})},[V]),d.useEffect(()=>{T&&(ge.current=T)},[T]),d.useEffect(()=>{ie({type:fe.SetDateSelector,dateSelector:Y()})},[ne]);const Y=d.useCallback(()=>H.current===Pe.TimeOnly?Le.TimeSelector:H.current===Pe.DateTime||H.current===Pe.DateOnly?Le.DaySelector:Le.DateRangeSelector,[]),B=ee=>{Zi(ee).then(le=>{z(le.code),R.current=le;const Me=K();ie(e||n?{type:fe.InitializeDates,initialDate:Array.isArray(Me)?Me[0]:Me}:{type:fe.SetViewDate,viewDate:Array.isArray(Me)?Me[0]:Me})}).catch(le=>console.error(le))},K=()=>{const ee=new Date;return ee.setHours(0,0,0,0),e?typeof e=="string"?H.current!==Pe.DateRange?Nr(e,R.current):ds(e,R.current):e:ee},re={currentSelector:Y(),currentViewDate:new Date,timeFormat:Oe.TwelveHour,dateInitialized:!1},[_,ie]=d.useReducer(xm,re),A=()=>{nr(),k(!0)},De=d.useMemo(()=>Sr(()=>{k(!1)},250),[]),Ge=d.useMemo(()=>Sr(()=>{De.cancel()},5),[De]),$e=ee=>{const le=ee.target.innerText;rt(le)},Be=ee=>{if(ee){const le=H.current!==Pe.DateRange?Nr(ee,R.current):ds(ee,R.current);return le?j?Array.isArray(le)?le.every(Me=>j(Me)):j(le):!0:!1}else return!0},ft=ee=>{rt(ee||"")},rt=ee=>{const le=H.current!==Pe.DateRange?Nr(ee,R.current):ds(ee,R.current);le?(Array.isArray(le)?(ym(le[0],ii(_.currentViewDate),pd(xt(_.currentViewDate,1)))||ie({type:fe.SetViewDate,viewDate:le[0]}),ie({type:fe.SetSelectedDateRange,selectedStartDate:le[0],selectedEndDate:le[1]})):ie({type:fe.SetSelectedDate,selectedDate:le,viewDate:le}),E==null||E(le)):ee===""&&(ie({type:fe.ClearDates}),E==null||E())},Ue=ee=>{H.current===Pe.DateOnly&&i===!0&&k(!1),E==null||E(ee)},tr=()=>{nr(),k(!F),C.current?C.current.focus():N.current&&N.current.focus()},rr=()=>{ie({type:fe.ClearDates}),k(!1),E==null||E()},nt=(ee,le)=>{(!ge.current||L.current!==le)&&(ge.current=ee,L.current=le,O.current=!0)},nr=()=>{(!S.current||O.current)&&ge.current&&(S.current=ge.current,ce(ge.current),O.current=!1)},sr=()=>{k(!1),ie({type:fe.SetDateSelector,dateSelector:Y()})},It=()=>{switch(h){case Ir.Short:return"short";case Ir.Medium:return"medium";case Ir.Long:return"long";default:return}},dt=()=>{var le,Me,Qe,ht,yt,Rt,At,Lt,$t,St,Ft,ur;const ee=It();switch(H.current){case Pe.DateTime:return _.selectedDate?ee?_.selectedDate.toLocaleString((le=R.current)==null?void 0:le.code,{dateStyle:ee,timeStyle:ee}):_.selectedDate.toLocaleString((Me=R.current)==null?void 0:Me.code):"";case Pe.DateOnly:return _.selectedDate?ee?_.selectedDate.toLocaleDateString((Qe=R.current)==null?void 0:Qe.code,{dateStyle:ee}):_.selectedDate.toLocaleDateString((ht=R.current)==null?void 0:ht.code):"";case Pe.TimeOnly:return _.selectedDate?ee?_.selectedDate.toLocaleTimeString((yt=R.current)==null?void 0:yt.code,{timeStyle:ee,hour12:_.timeFormat===Oe.TwelveHour,hourCycle:_.timeFormat===Oe.TwentyFourHour?"h23":void 0}):_.selectedDate.toLocaleTimeString((Rt=R.current)==null?void 0:Rt.code,{hour12:_.timeFormat===Oe.TwelveHour,hourCycle:_.timeFormat===Oe.TwentyFourHour?"h23":void 0}):"";case Pe.DateRange:return _.selectedStartDate&&_.selectedEndDate?ee?`${_.selectedStartDate.toLocaleDateString((At=R.current)==null?void 0:At.code,{dateStyle:ee})} - ${_.selectedEndDate.toLocaleDateString((Lt=R.current)==null?void 0:Lt.code,{dateStyle:ee})}`:`${_.selectedStartDate.toLocaleDateString(($t=R.current)==null?void 0:$t.code)} - ${_.selectedEndDate.toLocaleDateString((St=R.current)==null?void 0:St.code)}`:"";default:return _.selectedDate?ee?_.selectedDate.toLocaleString((Ft=R.current)==null?void 0:Ft.code,{dateStyle:ee,timeStyle:ee}):_.selectedDate.toLocaleString((ur=R.current)==null?void 0:ur.code):""}},Ze=ne===Pe.DateTime||ne===Pe.DateOnly||ne===Pe.DateRange,Mr=ne===Pe.DateTime||ne===Pe.TimeOnly,st=v===rn.None?{}:v===rn.Right?{rightElement:p.jsxs("div",{className:"bsc-flex bsc-text-black dark:bsc-text-mono-light-1",children:[o&&!t&&p.jsx("div",{children:p.jsx(Xe,{icon:"close",size:We.Small,className:"bsc-cursor-pointer bsc-text-sm",onClick:rr})}),p.jsx("div",{className:"bsc-ml-2",onClick:t?void 0:tr,children:x||p.jsx(Xe,{icon:"calendar",size:We.Small,className:t?void 0:"bsc-cursor-pointer"})})]}),rightElementClassName:"bsc-justify-center"}:{leftElement:p.jsxs("div",{className:"bsc-flex bsc-text-black dark:bsc-text-mono-light-1",children:[p.jsx("div",{className:"bsc-mr-2",onClick:t?void 0:tr,children:x||p.jsx(Xe,{icon:"calendar",size:We.Small,className:t?void 0:"bsc-cursor-pointer"})}),o&&!t&&p.jsx("div",{children:p.jsx(Xe,{icon:"close",size:We.Small,className:"bsc-cursor-pointer bsc-text-sm",onClick:rr})})]}),leftElementClassName:"bsc-justify-center"},jt={setDateSelector:ee=>M(ee)},Rr=y||((ee,le)=>p.jsx(p.Fragment,{children:le})),ir=()=>p.jsx(kt,{props:jt,template:Rr,children:p.jsxs(p.Fragment,{children:[_.currentSelector===Le.DaySelector&&Ze&&_.dateInitialized&&R.current&&p.jsx(Pm,{selectedDate:_.selectedDate,viewDate:_.currentViewDate,locale:R.current,showTimeSelector:H.current===Pe.DateTime,selectableDate:I,isValidDate:j,dispatcher:ie,onChange:Ue}),_.currentSelector===Le.MonthSelector&&Ze&&_.dateInitialized&&R.current&&p.jsx(Sm,{viewDate:_.currentViewDate,locale:R.current,dateSelection:H.current,dispatcher:ie}),_.currentSelector===Le.YearSelector&&Ze&&_.dateInitialized&&R.current&&p.jsx(_m,{viewDate:_.currentViewDate,locale:R.current,dispatcher:ie}),_.currentSelector===Le.TimeSelector&&Mr&&_.dateInitialized&&R.current&&p.jsx(Em,{viewDate:_.currentViewDate,showDateSelector:H.current===Pe.DateTime,locale:R.current,timeFormat:_.timeFormat,timeConstraints:g,onChange:E,dispatcher:ie}),_.currentSelector===Le.DateRangeSelector&&Ze&&_.dateInitialized&&R.current&&p.jsx(Tm,{viewDate:_.currentViewDate,selectedStartDate:_.selectedStartDate,selectedEndDate:_.selectedEndDate,locale:R.current,onChange:E,dispatcher:ie})]})}),ar=hs({label:r,readOnly:t,allowClear:o,getValue:dt,onFocus:A,onInput:$e,iconPosition:v,iconElement:st.rightElement||st.leftElement},_.currentViewDate,ie),cr=U||((ee,le)=>p.jsx(p.Fragment,{children:le})),Mt=pe("bsc-text-left",{"bc-read-only bsc-bg-gray-4 dark:bsc-bg-mono-dark-3":t,"bsc-bg-white dark:bsc-bg-mono-dark-1":!t},"bc-dt-input",u);return p.jsx(fs.Provider,{value:X.current,children:p.jsxs("div",{className:"bc-date-time",children:[r&&p.jsx(pt,{label:r,readOnly:t,className:"bc-dt-label"}),p.jsx(Jn,{mobileMarkup:p.jsxs(p.Fragment,{children:[p.jsx(kt,{props:ar,template:cr,children:p.jsx(Zr,{ref:N,value:dt(),readOnly:t,inputMode:"none",className:Mt,onFocus:A,onElementCreate:ee=>nt(ee,!1),...st})}),p.jsx(Hi,{visible:F,target:oe,hidden:sr,unmountWhenHidden:!0,children:ir()})]}),aboveMobileMarkup:p.jsxs(p.Fragment,{children:[p.jsx(kt,{props:ar,template:cr,children:s===!1?p.jsx(Zr,{ref:N,value:dt(),readOnly:t,className:Mt,onFocus:A,onBlur:De,onInput:$e,onElementCreate:ee=>nt(ee,!1),...st}):p.jsx(qi,{ref:C,value:dt(),readOnly:t,className:Mt,format:P,isInputValid:Be,onFocus:A,onBlur:De,onChange:ft,onElementCreate:ee=>nt(ee,!0),...st})}),p.jsx(Wi,{visible:F,target:oe,shouldTargetCloseOverlay:!1,shouldScrollCloseOverlay:!0,shouldCheckZIndex:!0,shouldRemainOnScreen:!0,hidden:sr,isClickedWithin:Ge,unmountWhenHidden:!0,children:ir()})]})})]})})};function Nt(e,t){var r,n;if(typeof t=="function")n=t(e),n!==void 0&&(e=n);else if(Array.isArray(t))for(r=0;r<t.length;r++)n=t[r](e),n!==void 0&&(e=n);return e}function Dm(e,t){return e[0]==="-"&&Array.isArray(t)&&/^-\d+$/.test(e)?t.length+parseInt(e,10):e}function Nm(e){return/^\d+$/.test(e)}function on(e){return Object.prototype.toString.call(e)==="[object Object]"}function jr(e){return Object(e)===e}function an(e){return Object.keys(e).length===0}var Im=["__proto__","prototype","constructor"],jm=function(e){return Im.indexOf(e)===-1};function cn(e,t){e.indexOf("[")>=0&&(e=e.replace(/\[/g,t).replace(/]/g,""));var r=e.split(t),n=r.filter(jm);if(n.length!==r.length)throw Error("Refusing to update blacklisted property "+e);return r}var Qi=Object.prototype.hasOwnProperty;function he(e,t,r,n){if(!(this instanceof he))return new he(e,t,r,n);typeof t>"u"&&(t=!1),typeof r>"u"&&(r=!0),typeof n>"u"&&(n=!0),this.separator=e||".",this.override=t,this.useArray=r,this.useBrackets=n,this.keepArray=!1,this.cleanup=[]}var er=new he(".",!1,!0,!0);function tt(e){return function(){return er[e].apply(er,arguments)}}he.prototype._fill=function(e,t,r,n){var s=e.shift();if(e.length>0){if(t[s]=t[s]||(this.useArray&&Nm(e[0])?[]:{}),!jr(t[s]))if(this.override)t[s]={};else{if(!(jr(r)&&an(r)))throw new Error("Trying to redefine `"+s+"` which is a "+typeof t[s]);return}this._fill(e,t[s],r,n)}else{if(!this.override&&jr(t[s])&&!an(t[s])){if(!(jr(r)&&an(r)))throw new Error("Trying to redefine non-empty obj['"+s+"']");return}t[s]=Nt(r,n)}},he.prototype.object=function(e,t){var r=this;return Object.keys(e).forEach(function(n){var s=t===void 0?null:t[n],o=cn(n,r.separator).join(r.separator);o.indexOf(r.separator)!==-1?(r._fill(o.split(r.separator),e,e[n],s),delete e[n]):e[n]=Nt(e[n],s)}),e},he.prototype.str=function(e,t,r,n){var s=cn(e,this.separator).join(this.separator);return e.indexOf(this.separator)!==-1?this._fill(s.split(this.separator),r,t,n):r[e]=Nt(t,n),r},he.prototype.pick=function(e,t,r,n){var s,o,i,a,u;for(o=cn(e,this.separator),s=0;s<o.length;s++)if(a=Dm(o[s],t),t&&typeof t=="object"&&a in t){if(s===o.length-1)return r?(i=t[a],n&&Array.isArray(t)?t.splice(a,1):delete t[a],Array.isArray(t)&&(u=o.slice(0,-1).join("."),this.cleanup.indexOf(u)===-1&&this.cleanup.push(u)),i):t[a];t=t[a]}else return;return r&&Array.isArray(t)&&(t=t.filter(function(f){return f!==void 0})),t},he.prototype.delete=function(e,t){return this.remove(e,t,!0)},he.prototype.remove=function(e,t,r){var n;if(this.cleanup=[],Array.isArray(e)){for(n=0;n<e.length;n++)this.pick(e[n],t,!0,r);return r||this._cleanup(t),t}else return this.pick(e,t,!0,r)},he.prototype._cleanup=function(e){var t,r,n,s;if(this.cleanup.length){for(r=0;r<this.cleanup.length;r++)n=this.cleanup[r].split("."),s=n.splice(0,-1).join("."),t=s?this.pick(s,e):e,t=t[n[0]].filter(function(o){return o!==void 0}),this.set(this.cleanup[r],t,e);this.cleanup=[]}},he.prototype.del=he.prototype.remove,he.prototype.move=function(e,t,r,n,s){return typeof n=="function"||Array.isArray(n)?this.set(t,Nt(this.pick(e,r,!0),n),r,s):(s=n,this.set(t,this.pick(e,r,!0),r,s)),r},he.prototype.transfer=function(e,t,r,n,s,o){return typeof s=="function"||Array.isArray(s)?this.set(t,Nt(this.pick(e,r,!0),s),n,o):(o=s,this.set(t,this.pick(e,r,!0),n,o)),n},he.prototype.copy=function(e,t,r,n,s,o){return typeof s=="function"||Array.isArray(s)?this.set(t,Nt(JSON.parse(JSON.stringify(this.pick(e,r,!1))),s),n,o):(o=s,this.set(t,this.pick(e,r,!1),n,o)),n},he.prototype.set=function(e,t,r,n){var s,o,i,a;if(typeof t>"u")return r;for(i=cn(e,this.separator),s=0;s<i.length;s++){if(a=i[s],s===i.length-1)if(n&&on(t)&&on(r[a]))for(o in t)Qi.call(t,o)&&(r[a][o]=t[o]);else if(n&&Array.isArray(r[a])&&Array.isArray(t))for(var u=0;u<t.length;u++)r[i[s]].push(t[u]);else r[a]=t;else(!Qi.call(r,a)||!on(r[a])&&!Array.isArray(r[a]))&&(/^\d+$/.test(i[s+1])?r[a]=[]:r[a]={});r=r[a]}return r},he.prototype.transform=function(e,t,r){return t=t||{},r=r||{},Object.keys(e).forEach((function(n){this.set(e[n],this.pick(n,t),r)}).bind(this)),r},he.prototype.dot=function(e,t,r){t=t||{},r=r||[];var n=Array.isArray(e);return Object.keys(e).forEach((function(s){var o=n&&this.useBrackets?"["+s+"]":s;if(jr(e[s])&&(on(e[s])&&!an(e[s])||Array.isArray(e[s])&&!this.keepArray&&e[s].length!==0))if(n&&this.useBrackets){var i=r[r.length-1]||"";return this.dot(e[s],t,r.slice(0,-1).concat(i+o))}else return this.dot(e[s],t,r.concat(o));else n&&this.useBrackets?t[r.join(this.separator).concat("["+s+"]")]=e[s]:t[r.concat(o).join(this.separator)]=e[s]}).bind(this)),t},he.pick=tt("pick"),he.move=tt("move"),he.transfer=tt("transfer"),he.transform=tt("transform"),he.copy=tt("copy"),he.object=tt("object"),he.str=tt("str"),he.set=tt("set"),he.delete=tt("delete"),he.del=he.remove=tt("remove"),he.dot=tt("dot"),["override","overwrite"].forEach(function(e){Object.defineProperty(he,e,{get:function(){return er.override},set:function(t){er.override=!!t}})}),["useArray","keepArray","useBrackets"].forEach(function(e){Object.defineProperty(he,e,{get:function(){return er[e]},set:function(t){er[e]=t}})}),he._process=Nt;var Mm=he;const un=hn(Mm),Rm=({name:e,label:t,value:r,data:n,textField:s,valueField:o,readOnly:i=!1,orientation:a=Ve.Horizontal,isMultiSelect:u=!1,className:f,onChange:h,itemTemplate:g})=>{const[x,v]=d.useState(),[T,I]=d.useState([]),j=Cn(()=>n,[n]),E=d.useId();d.useEffect(()=>{if(u){const L=Array.isArray(r)?r.map(O=>O.toString()):r?[String(r)]:void 0;I(L??[])}else r&&v(r.toString())},[r]);const D=L=>u?T.findIndex(O=>O===L)>-1:x===L,Q=L=>{const O=L.toString();if(u){const J=D(O);let R;J?R=T.filter(ge=>ge!=O):R=[...T,O],I(R),h==null||h({name:e,value:R})}else O!==x&&(v(O),h==null||h({name:e,value:O}))},U=L=>{const{value:O}=L.target;v(O),h==null||h({name:e,value:O})},y=L=>{const{value:O,checked:J}=L.target;let R;J?R=[...T,O]:R=T.filter(ge=>ge!=O),I(R),h==null||h({name:e,value:R})},F=(L,O,J,R)=>p.jsxs("label",{htmlFor:L,className:R,children:[p.jsx("input",{id:L,name:e,value:J,type:"checkbox",onChange:y,checked:D(J),className:"bsc-appearance-none"}),O]},L),k=(L,O,J,R)=>p.jsxs("label",{htmlFor:L,className:R,children:[p.jsx("input",{id:L,name:e,value:J,type:"radio",onChange:U,checked:D(J),className:"bsc-appearance-none"}),O]},L),q=$r(hr.FocusWithin),z=d.useCallback((L,O)=>p.jsx(p.Fragment,{children:O}),[]),oe=g||z,ce=(L,O,J)=>{const R=`element_${E}_${O}`,ge=un.pick(s,L),S=String(un.pick(o,L)),N=O===0,C=O===J.length-1,P=pe("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":!i,"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":i,"bsc-border-t bsc-border-l bsc-border-b bsc-rounded-l-md bsc-pl-2":N&&a===Ve.Horizontal,"bsc-border-t bsc-border-r bsc-border-l bsc-border-b bsc-rounded-r-md bsc-pr-2":C&&a===Ve.Horizontal,"bsc-border-t bsc-border-b":!N&&!C&&a===Ve.Horizontal,"bsc-border-l":!N&&a===Ve.Horizontal,"bsc-border-l bsc-border-r bsc-border-t bsc-rounded-t-md":N&&a===Ve.Vertical,"bsc-border bsc-rounded-b-md":C&&a===Ve.Vertical,"bsc-border-t bsc-border-l bsc-border-r":!N&&!C&&a===Ve.Vertical},q),V={itemId:R,selectedValue:u?T:x,itemText:ge,itemValue:S,itemData:L,itemStyles:P,isSelected:D(S),isFirstItem:N,isLastItem:C,onItemChanged:Q};return u?p.jsx(kt,{props:V,template:oe,children:F(R,ge,S,P)}):p.jsx(kt,{props:V,template:oe,children:k(R,ge,S,P)})},ne=pe("bsc-flex bsc-flex-col bsc-gap-2",f),M=pe("bsc-flex",{"bsc-flex-col [width:max-content]":a===Ve.Vertical}),H=L=>p.jsx("div",{className:M,children:L.map(ce)});return p.jsxs("div",{className:ne,children:[t&&p.jsx(pt,{label:t,readOnly:i}),j&&H(j)]})},Am=d.memo(Rm),Lm=({id:e,name:t,label:r,value:n,checked:s=!1,labelLocation:o=qe.Right,readOnly:i=!1,useAnimation:a,onChange:u})=>{const f=Tn(a),h=d.useCallback(v=>{u==null||u(v)},[u]),g=pe("bc-radio-item-wrapper bsc-flex bsc-items-center *:bsc-cursor-pointer",{"bc-read-only":i}),x=pe("bc-radio-item-outer bsc-relative *:bsc-size-[21px]",{"bsc-pl-1":o===qe.Left,"bsc-pr-1":o===qe.Right,"bsc-radio-item-animate":!i&&f,"bsc-radio-item":!i,"bc-read-only bsc-radio-item-read-only":i});return p.jsxs("div",{className:g,children:[o===qe.Left&&p.jsx(pt,{label:r,htmlFor:e,readOnly:i}),p.jsxs("label",{className:x,children:[p.jsx("input",{id:e,name:t,value:n,type:"radio",checked:s,onChange:h,className:"bc-radio-item-input-hidden bsc-hidden"}),p.jsxs("svg",{viewBox:"0 0 30 30",preserveAspectRatio:"xMidYMid meet",className:"bc-radio-item-svg",children:[p.jsx("circle",{cx:15,cy:15,r:13}),p.jsx("circle",{cx:"50%",cy:"50%",r:7})]})]}),o===qe.Right&&p.jsx(pt,{label:r,htmlFor:e,readOnly:i})]})},$m=d.memo(Lm),Fm=({name:e,label:t,value:r,data:n,textField:s,valueField:o,readOnly:i=!1,labelLocation:a=qe.Right,orientation:u=Ve.Vertical,className:f,useAnimation:h,onChange:g})=>{const[x,v]=d.useState(r),T=Cn(()=>n,[n]),I=d.useId(),j=d.useCallback(y=>{const F=y.target.value;v(F),g==null||g({name:e,value:F,originalEvent:y})},[e]),E=(y,F)=>{const k=`${I}_radio_${F}`,q=un.pick(o,y);return p.jsx($m,{id:k,name:e,label:un.pick(s,y),value:q,checked:q==x,labelLocation:a,readOnly:i,useAnimation:h,onChange:j},k)},D=pe("bc-radio-container bsc-flex bsc-flex-col bsc-gap-1",f),Q=pe("bc-radio-wrapper bsc-flex bsc-gap-1",{"bsc-flex-col":u===Ve.Vertical,"[&>*]:bsc-pr-2":u===Ve.Horizontal}),U=y=>p.jsx("div",{className:Q,children:y.map(E)});return p.jsxs("div",{className:D,children:[t&&p.jsx(pt,{label:t,readOnly:i}),T&&U(T)]})},Hm=d.memo(Fm),Ym=({name:e,label:t,value:r,checked:n=!1,readOnly:s=!1,useAnimation:o,className:i,onChange:a})=>{const[u,f]=d.useState(!1),h=d.useId(),g=Tn(o);d.useEffect(()=>{f(n)},[n]);const x=E=>{const{checked:D}=E.target;f(D),a==null||a({originalEvent:E,name:e||E.target.name,value:r||E.target.value,checked:D})},v=pe("bc-toggle-wrapper bsc-flex bsc-flex-col",i),T=$r(hr.FocusWithin),I=pe("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},T),j=pe("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&&g});return p.jsxs("div",{className:v,children:[t&&p.jsx(pt,{label:t,htmlFor:h,readOnly:s}),p.jsxs("label",{className:I,children:[p.jsx("input",{id:h,name:e,value:r,type:"checkbox",checked:u,onChange:x,className:"bsc-appearance-none"}),p.jsx("div",{id:"switch",className:j})]})]})},Vm=d.memo(Ym),Zm="";se.BeeSoftProvider=ta,se.Button=ot,se.Checkbox=so,se.CheckboxGroup=Ua,se.ContentEditableInput=Zr,se.DateFormatType=Ir,se.DateScrollerType=Jt,se.DateSelectionType=Pe,se.DateTime=Om,se.FormGroupItemOrientation=Ve,se.FormattedInput=qi,se.GroupButton=Am,se.MediaQuery=Jn,se.MobileOverlayPanel=Hi,se.OverlayPanel=Wi,se.RadioButton=Hm,se.SelectionLabelLocation=qe,se.Toggle=Vm,se.applyBeeSoftTheme=kp,se.createBeeSoftTheme=Op,Object.defineProperty(se,Symbol.toStringTag,{value:"Module"})});
|