beesoft-components 0.9.6-3 → 0.9.6
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 +16 -14
- package/dist/index.es.js.gz +0 -0
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.gz +0 -0
- package/package.json +2 -2
package/dist/index.es.js
CHANGED
|
@@ -6091,7 +6091,9 @@ class Yh {
|
|
|
6091
6091
|
this.inputElement = r;
|
|
6092
6092
|
}
|
|
6093
6093
|
setCursorToCurrentPosition() {
|
|
6094
|
-
this.setCursorSelection(
|
|
6094
|
+
this.setCursorSelection(
|
|
6095
|
+
this.currentCursorPosition > -1 ? this.currentCursorPosition : this.highlightCursorPosition
|
|
6096
|
+
);
|
|
6095
6097
|
}
|
|
6096
6098
|
setCursorPosition(r) {
|
|
6097
6099
|
this.setCursorSelection(r);
|
|
@@ -6596,7 +6598,7 @@ class Bo {
|
|
|
6596
6598
|
const n = this.partEntryList.getUniqueSeparators();
|
|
6597
6599
|
for (let s = 0, o = n.length; s < o; s++) {
|
|
6598
6600
|
const i = n[s];
|
|
6599
|
-
t = t.
|
|
6601
|
+
t = t.replaceAll(i, "");
|
|
6600
6602
|
}
|
|
6601
6603
|
return t;
|
|
6602
6604
|
}
|
|
@@ -6606,7 +6608,7 @@ class Bo {
|
|
|
6606
6608
|
* @private
|
|
6607
6609
|
*/
|
|
6608
6610
|
processEditRules(r) {
|
|
6609
|
-
this.formatNavigator.isSelection ? this.processSelectionEditRules(
|
|
6611
|
+
this.formatNavigator.isSelection ? this.processSelectionEditRules() : this.processNonSelectionEditRules(r);
|
|
6610
6612
|
}
|
|
6611
6613
|
processNonSelectionEditRules(r) {
|
|
6612
6614
|
const t = this.inputSlotCollection.getSlot(this.formatNavigator.getCurrentPartIndex());
|
|
@@ -6629,18 +6631,18 @@ class Bo {
|
|
|
6629
6631
|
break;
|
|
6630
6632
|
}
|
|
6631
6633
|
}
|
|
6632
|
-
processSelectionEditRules(
|
|
6633
|
-
const
|
|
6634
|
-
if (
|
|
6634
|
+
processSelectionEditRules() {
|
|
6635
|
+
const r = this.inputSlotCollection.getSlots(this.formatNavigator.getCurrentPartIndices());
|
|
6636
|
+
if (r.length <= 0)
|
|
6635
6637
|
return;
|
|
6636
|
-
const
|
|
6637
|
-
for (let
|
|
6638
|
-
const
|
|
6639
|
-
|
|
6640
|
-
}
|
|
6641
|
-
this.formatRenderer.render(),
|
|
6642
|
-
for (let
|
|
6643
|
-
this.processSlotRules(
|
|
6638
|
+
const t = this.formatNavigator.getCursorStartPosition(), n = this.formatNavigator.getCursorEndPosition();
|
|
6639
|
+
for (let s = 0, o = r.length; s < o; s++) {
|
|
6640
|
+
const i = r[s];
|
|
6641
|
+
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));
|
|
6642
|
+
}
|
|
6643
|
+
this.formatRenderer.render(), this.formatNavigator.setCursorPosition(t);
|
|
6644
|
+
for (let s = 0, o = r.length; s < o; s++)
|
|
6645
|
+
this.processSlotRules(r[s]);
|
|
6644
6646
|
}
|
|
6645
6647
|
/**
|
|
6646
6648
|
* Used to shift the text of the format parts to the right of where the delete happened. This is only called when the
|
package/dist/index.es.js.gz
CHANGED
|
Binary file
|
package/dist/index.umd.js
CHANGED
|
@@ -52,4 +52,4 @@ object-assign
|
|
|
52
52
|
(c) Sindre Sorhus
|
|
53
53
|
@license MIT
|
|
54
54
|
*/var xn,mo;function lh(){if(mo)return xn;mo=1;var e=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,t=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 c=Object.getOwnPropertyNames(i).map(function(h){return i[h]});if(c.join("")!=="0123456789")return!1;var d={};return"abcdefghijklmnopqrst".split("").forEach(function(h){d[h]=h}),Object.keys(Object.assign({},d)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return xn=s()?Object.assign:function(o,i){for(var a,c=n(o),d,h=1;h<arguments.length;h++){a=Object(arguments[h]);for(var p in a)r.call(a,p)&&(c[p]=a[p]);if(e){d=e(a);for(var v=0;v<d.length;v++)t.call(a,d[v])&&(c[d[v]]=a[d[v]])}}return c},xn}var wn,go;function Pn(){if(go)return wn;go=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return wn=e,wn}var Tn,bo;function yo(){return bo||(bo=1,Tn=Function.call.bind(Object.prototype.hasOwnProperty)),Tn}var Sn,vo;function fh(){if(vo)return Sn;vo=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var r=Pn(),t={},n=yo();e=function(o){var i="Warning: "+o;typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}}function s(o,i,a,c,d){if(process.env.NODE_ENV!=="production"){for(var h in o)if(n(o,h)){var p;try{if(typeof o[h]!="function"){var v=Error((c||"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 v.name="Invariant Violation",v}p=o[h](i,h,c,a,null,r)}catch(x){p=x}if(p&&!(p instanceof Error)&&e((c||"React class")+": type specification of "+a+" `"+h+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof p+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),p instanceof Error&&!(p.message in t)){t[p.message]=!0;var y=d?d():"";e("Failed "+a+" type: "+p.message+(y??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(t={})},Sn=s,Sn}var En,xo;function dh(){if(xo)return En;xo=1;var e=po(),r=lh(),t=Pn(),n=yo(),s=fh(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(a){var c="Warning: "+a;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}});function i(){return null}return En=function(a,c){var d=typeof Symbol=="function"&&Symbol.iterator,h="@@iterator";function p(b){var T=b&&(d&&b[d]||b[h]);if(typeof T=="function")return T}var v="<<anonymous>>",y={array:P("array"),bigint:P("bigint"),bool:P("boolean"),func:P("function"),number:P("number"),object:P("object"),string:P("string"),symbol:P("symbol"),any:R(),arrayOf:z,element:$(),elementType:g(),instanceOf:L,node:se(),objectOf:U,oneOf:C,oneOfType:B,shape:ee,exact:I};function x(b,T){return b===T?b!==0||1/b===1/T:b!==b&&T!==T}function D(b,T){this.message=b,this.data=T&&typeof T=="object"?T:{},this.stack=""}D.prototype=Error.prototype;function O(b){if(process.env.NODE_ENV!=="production")var T={},V=0;function S(K,A,Y,q,Q,E,te){if(q=q||v,E=E||Y,te!==t){if(c){var _=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 _.name="Invariant Violation",_}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var _e=q+":"+Y;!T[_e]&&V<3&&(o("You are manually calling a React.PropTypes validation function for the `"+E+"` prop on `"+q+"`. 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."),T[_e]=!0,V++)}}return A[Y]==null?K?A[Y]===null?new D("The "+Q+" `"+E+"` is marked as required "+("in `"+q+"`, but its value is `null`.")):new D("The "+Q+" `"+E+"` is marked as required in "+("`"+q+"`, but its value is `undefined`.")):null:b(A,Y,q,Q,E)}var H=S.bind(null,!1);return H.isRequired=S.bind(null,!0),H}function P(b){function T(V,S,H,K,A,Y){var q=V[S],Q=k(q);if(Q!==b){var E=G(q);return new D("Invalid "+K+" `"+A+"` of type "+("`"+E+"` supplied to `"+H+"`, expected ")+("`"+b+"`."),{expectedType:b})}return null}return O(T)}function R(){return O(i)}function z(b){function T(V,S,H,K,A){if(typeof b!="function")return new D("Property `"+A+"` of component `"+H+"` has invalid PropType notation inside arrayOf.");var Y=V[S];if(!Array.isArray(Y)){var q=k(Y);return new D("Invalid "+K+" `"+A+"` of type "+("`"+q+"` supplied to `"+H+"`, expected an array."))}for(var Q=0;Q<Y.length;Q++){var E=b(Y,Q,H,K,A+"["+Q+"]",t);if(E instanceof Error)return E}return null}return O(T)}function $(){function b(T,V,S,H,K){var A=T[V];if(!a(A)){var Y=k(A);return new D("Invalid "+H+" `"+K+"` of type "+("`"+Y+"` supplied to `"+S+"`, expected a single ReactElement."))}return null}return O(b)}function g(){function b(T,V,S,H,K){var A=T[V];if(!e.isValidElementType(A)){var Y=k(A);return new D("Invalid "+H+" `"+K+"` of type "+("`"+Y+"` supplied to `"+S+"`, expected a single ReactElement type."))}return null}return O(b)}function L(b){function T(V,S,H,K,A){if(!(V[S]instanceof b)){var Y=b.name||v,q=W(V[S]);return new D("Invalid "+K+" `"+A+"` of type "+("`"+q+"` supplied to `"+H+"`, expected ")+("instance of `"+Y+"`."))}return null}return O(T)}function C(b){if(!Array.isArray(b))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 T(V,S,H,K,A){for(var Y=V[S],q=0;q<b.length;q++)if(x(Y,b[q]))return null;var Q=JSON.stringify(b,function(te,_){var _e=G(_);return _e==="symbol"?String(_):_});return new D("Invalid "+K+" `"+A+"` of value `"+String(Y)+"` "+("supplied to `"+H+"`, expected one of "+Q+"."))}return O(T)}function U(b){function T(V,S,H,K,A){if(typeof b!="function")return new D("Property `"+A+"` of component `"+H+"` has invalid PropType notation inside objectOf.");var Y=V[S],q=k(Y);if(q!=="object")return new D("Invalid "+K+" `"+A+"` of type "+("`"+q+"` supplied to `"+H+"`, expected an object."));for(var Q in Y)if(n(Y,Q)){var E=b(Y,Q,H,K,A+"."+Q,t);if(E instanceof Error)return E}return null}return O(T)}function B(b){if(!Array.isArray(b))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var T=0;T<b.length;T++){var V=b[T];if(typeof V!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+N(V)+" at index "+T+"."),i}function S(H,K,A,Y,q){for(var Q=[],E=0;E<b.length;E++){var te=b[E],_=te(H,K,A,Y,q,t);if(_==null)return null;_.data&&n(_.data,"expectedType")&&Q.push(_.data.expectedType)}var _e=Q.length>0?", expected one of type ["+Q.join(", ")+"]":"";return new D("Invalid "+Y+" `"+q+"` supplied to "+("`"+A+"`"+_e+"."))}return O(S)}function se(){function b(T,V,S,H,K){return F(T[V])?null:new D("Invalid "+H+" `"+K+"` supplied to "+("`"+S+"`, expected a ReactNode."))}return O(b)}function re(b,T,V,S,H){return new D((b||"React class")+": "+T+" type `"+V+"."+S+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+H+"`.")}function ee(b){function T(V,S,H,K,A){var Y=V[S],q=k(Y);if(q!=="object")return new D("Invalid "+K+" `"+A+"` of type `"+q+"` "+("supplied to `"+H+"`, expected `object`."));for(var Q in b){var E=b[Q];if(typeof E!="function")return re(H,K,A,Q,G(E));var te=E(Y,Q,H,K,A+"."+Q,t);if(te)return te}return null}return O(T)}function I(b){function T(V,S,H,K,A){var Y=V[S],q=k(Y);if(q!=="object")return new D("Invalid "+K+" `"+A+"` of type `"+q+"` "+("supplied to `"+H+"`, expected `object`."));var Q=r({},V[S],b);for(var E in Q){var te=b[E];if(n(b,E)&&typeof te!="function")return re(H,K,A,E,G(te));if(!te)return new D("Invalid "+K+" `"+A+"` key `"+E+"` supplied to `"+H+"`.\nBad object: "+JSON.stringify(V[S],null," ")+`
|
|
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)}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.replace(i,"")}return t}processEditRules(r){this.formatNavigator.isSelection?this.processSelectionEditRules(r):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(r){const t=this.inputSlotCollection.getSlots(this.formatNavigator.getCurrentPartIndices());if(t.length<=0)return;const n=this.formatNavigator.getCursorStartPosition(),s=this.formatNavigator.getCursorEndPosition();for(let o=0,i=t.length;o<i;o++){const a=t[o];a.startPosition>=n&&a.endPosition<=s?a.partText="":a.startPosition>=n&&a.endPosition>s?a.partText=a.partText.substring(s-a.startPosition):a.startPosition<n&&a.endPosition<=s?a.partText=a.partText.substring(0,n-a.startPosition):a.startPosition<n&&a.endPosition>s&&(a.partText=a.partText.substring(0,n-a.startPosition)+a.partText.substring(s-a.startPosition))}this.formatRenderer.render(),!r||r.key==="Backspace"?this.formatNavigator.setCursorPosition(s):this.formatNavigator.setCursorPosition(n);for(let o=0,i=t.length;o<i;o++)this.processSlotRules(t[o])}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"})});
|
|
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"})});
|
package/dist/index.umd.js.gz
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "beesoft-components",
|
|
3
|
-
"version": "0.9.6
|
|
3
|
+
"version": "0.9.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
@@ -37,7 +37,6 @@
|
|
|
37
37
|
"@beesoft/common": "^0.1.11",
|
|
38
38
|
"@preact/signals": "^1.2.3",
|
|
39
39
|
"@react-hook/media-query": "^1.1.1",
|
|
40
|
-
"caniuse-lite": "^1.0.30001718",
|
|
41
40
|
"classnames": "^2.3.2",
|
|
42
41
|
"date-fns": "^3.3.1",
|
|
43
42
|
"dot-object": "^2.1.4",
|
|
@@ -72,6 +71,7 @@
|
|
|
72
71
|
"@typescript-eslint/parser": "^6.0.0",
|
|
73
72
|
"@vitejs/plugin-react-swc": "^3.3.2",
|
|
74
73
|
"autoprefixer": "^10.4.16",
|
|
74
|
+
"caniuse-lite": "^1.0.30001718",
|
|
75
75
|
"chromatic": "^11.3.0",
|
|
76
76
|
"eslint": "^8.45.0",
|
|
77
77
|
"eslint-config-prettier": "^9.0.0",
|