semaphor 0.0.90 → 0.0.92
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/chunks/index-DVyKgtY2.js +60308 -0
- package/dist/chunks/index-DtslCSgq.js +384 -0
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +192 -1
- package/dist/index.js +6088 -32
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/dashboard.d.ts +7 -7
- package/dist/types/main.d.ts +35 -11
- package/dist/types/surfboard.d.ts +7 -7
- package/dist/types/types.d.ts +7 -7
- package/package.json +8 -8
- package/dist/chunks/index-9VVNAgAb.js +0 -5861
- package/dist/chunks/index-BazY0ssg.js +0 -245
- package/dist/chunks/index-CqZ8hSTF.js +0 -412
- package/dist/chunks/index-DUkNWR9M.js +0 -61206
- package/dist/chunks/lucide-react-CZLCF1dV.js +0 -27681
- package/dist/chunks/lucide-react-DEyirEfi.js +0 -7336
|
@@ -1,412 +0,0 @@
|
|
|
1
|
-
"use strict";var mY=Object.defineProperty;var WT=e=>{throw TypeError(e)};var bY=(e,t,n)=>t in e?mY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Me=(e,t,n)=>bY(e,typeof t!="symbol"?t+"":t,n),fx=(e,t,n)=>t.has(e)||WT("Cannot "+n);var se=(e,t,n)=>(fx(e,t,"read from private field"),n?n.call(e):t.get(e)),Ze=(e,t,n)=>t.has(e)?WT("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),je=(e,t,n,r)=>(fx(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Nt=(e,t,n)=>(fx(e,t,"access private method"),n);var Bg=(e,t,n,r)=>({set _(i){je(e,t,i,n)},get _(){return se(e,t,r)}});const P=require("react"),Tr=require("react-dom");function UI(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const R=UI(P),hc=UI(Tr);var Ca=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Oc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function z_(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var hw={exports:{}},cf={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var UT;function yY(){if(UT)return cf;UT=1;var e=P,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(a,l,c){var u,d={},p=null,h=null;c!==void 0&&(p=""+c),l.key!==void 0&&(p=""+l.key),l.ref!==void 0&&(h=l.ref);for(u in l)r.call(l,u)&&!o.hasOwnProperty(u)&&(d[u]=l[u]);if(a&&a.defaultProps)for(u in l=a.defaultProps,l)d[u]===void 0&&(d[u]=l[u]);return{$$typeof:t,type:a,key:p,ref:h,props:d,_owner:i.current}}return cf.Fragment=n,cf.jsx=s,cf.jsxs=s,cf}var uf={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.development.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var GT;function vY(){return GT||(GT=1,process.env.NODE_ENV!=="production"&&function(){var e=P,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen"),m=Symbol.iterator,b="@@iterator";function v(te){if(te===null||typeof te!="object")return null;var Ce=m&&te[m]||te[b];return typeof Ce=="function"?Ce:null}var x=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(te){{for(var Ce=arguments.length,Oe=new Array(Ce>1?Ce-1:0),Ve=1;Ve<Ce;Ve++)Oe[Ve-1]=arguments[Ve];_("error",te,Oe)}}function _(te,Ce,Oe){{var Ve=x.ReactDebugCurrentFrame,kt=Ve.getStackAddendum();kt!==""&&(Ce+="%s",Oe=Oe.concat([kt]));var $t=Oe.map(function(xt){return String(xt)});$t.unshift("Warning: "+Ce),Function.prototype.apply.call(console[te],console,$t)}}var E=!1,C=!1,M=!1,O=!1,k=!1,N;N=Symbol.for("react.module.reference");function F(te){return!!(typeof te=="string"||typeof te=="function"||te===r||te===o||k||te===i||te===c||te===u||O||te===h||E||C||M||typeof te=="object"&&te!==null&&(te.$$typeof===p||te.$$typeof===d||te.$$typeof===s||te.$$typeof===a||te.$$typeof===l||te.$$typeof===N||te.getModuleId!==void 0))}function j(te,Ce,Oe){var Ve=te.displayName;if(Ve)return Ve;var kt=Ce.displayName||Ce.name||"";return kt!==""?Oe+"("+kt+")":Oe}function $(te){return te.displayName||"Context"}function X(te){if(te==null)return null;if(typeof te.tag=="number"&&S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof te=="function")return te.displayName||te.name||null;if(typeof te=="string")return te;switch(te){case r:return"Fragment";case n:return"Portal";case o:return"Profiler";case i:return"StrictMode";case c:return"Suspense";case u:return"SuspenseList"}if(typeof te=="object")switch(te.$$typeof){case a:var Ce=te;return $(Ce)+".Consumer";case s:var Oe=te;return $(Oe._context)+".Provider";case l:return j(te,te.render,"ForwardRef");case d:var Ve=te.displayName||null;return Ve!==null?Ve:X(te.type)||"Memo";case p:{var kt=te,$t=kt._payload,xt=kt._init;try{return X(xt($t))}catch{return null}}}return null}var V=Object.assign,L=0,U,B,W,q,A,Y,G;function D(){}D.__reactDisabledLog=!0;function ee(){{if(L===0){U=console.log,B=console.info,W=console.warn,q=console.error,A=console.group,Y=console.groupCollapsed,G=console.groupEnd;var te={configurable:!0,enumerable:!0,value:D,writable:!0};Object.defineProperties(console,{info:te,log:te,warn:te,error:te,group:te,groupCollapsed:te,groupEnd:te})}L++}}function K(){{if(L--,L===0){var te={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:V({},te,{value:U}),info:V({},te,{value:B}),warn:V({},te,{value:W}),error:V({},te,{value:q}),group:V({},te,{value:A}),groupCollapsed:V({},te,{value:Y}),groupEnd:V({},te,{value:G})})}L<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var oe=x.ReactCurrentDispatcher,J;function Z(te,Ce,Oe){{if(J===void 0)try{throw Error()}catch(kt){var Ve=kt.stack.trim().match(/\n( *(at )?)/);J=Ve&&Ve[1]||""}return`
|
|
18
|
-
`+J+te}}var ae=!1,ce;{var pe=typeof WeakMap=="function"?WeakMap:Map;ce=new pe}function ie(te,Ce){if(!te||ae)return"";{var Oe=ce.get(te);if(Oe!==void 0)return Oe}var Ve;ae=!0;var kt=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var $t;$t=oe.current,oe.current=null,ee();try{if(Ce){var xt=function(){throw Error()};if(Object.defineProperty(xt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(xt,[])}catch(Et){Ve=Et}Reflect.construct(te,[],xt)}else{try{xt.call()}catch(Et){Ve=Et}te.call(xt.prototype)}}else{try{throw Error()}catch(Et){Ve=Et}te()}}catch(Et){if(Et&&Ve&&typeof Et.stack=="string"){for(var pt=Et.stack.split(`
|
|
19
|
-
`),Ie=Ve.stack.split(`
|
|
20
|
-
`),ne=pt.length-1,we=Ie.length-1;ne>=1&&we>=0&&pt[ne]!==Ie[we];)we--;for(;ne>=1&&we>=0;ne--,we--)if(pt[ne]!==Ie[we]){if(ne!==1||we!==1)do if(ne--,we--,we<0||pt[ne]!==Ie[we]){var Ae=`
|
|
21
|
-
`+pt[ne].replace(" at new "," at ");return te.displayName&&Ae.includes("<anonymous>")&&(Ae=Ae.replace("<anonymous>",te.displayName)),typeof te=="function"&&ce.set(te,Ae),Ae}while(ne>=1&&we>=0);break}}}finally{ae=!1,oe.current=$t,K(),Error.prepareStackTrace=kt}var Dt=te?te.displayName||te.name:"",dn=Dt?Z(Dt):"";return typeof te=="function"&&ce.set(te,dn),dn}function ge(te,Ce,Oe){return ie(te,!1)}function de(te){var Ce=te.prototype;return!!(Ce&&Ce.isReactComponent)}function Ee(te,Ce,Oe){if(te==null)return"";if(typeof te=="function")return ie(te,de(te));if(typeof te=="string")return Z(te);switch(te){case c:return Z("Suspense");case u:return Z("SuspenseList")}if(typeof te=="object")switch(te.$$typeof){case l:return ge(te.render);case d:return Ee(te.type,Ce,Oe);case p:{var Ve=te,kt=Ve._payload,$t=Ve._init;try{return Ee($t(kt),Ce,Oe)}catch{}}}return""}var De=Object.prototype.hasOwnProperty,$e={},Te=x.ReactDebugCurrentFrame;function ze(te){if(te){var Ce=te._owner,Oe=Ee(te.type,te._source,Ce?Ce.type:null);Te.setExtraStackFrame(Oe)}else Te.setExtraStackFrame(null)}function yt(te,Ce,Oe,Ve,kt){{var $t=Function.call.bind(De);for(var xt in te)if($t(te,xt)){var pt=void 0;try{if(typeof te[xt]!="function"){var Ie=Error((Ve||"React class")+": "+Oe+" type `"+xt+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof te[xt]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Ie.name="Invariant Violation",Ie}pt=te[xt](Ce,xt,Ve,Oe,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(ne){pt=ne}pt&&!(pt instanceof Error)&&(ze(kt),S("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",Ve||"React class",Oe,xt,typeof pt),ze(null)),pt instanceof Error&&!(pt.message in $e)&&($e[pt.message]=!0,ze(kt),S("Failed %s type: %s",Oe,pt.message),ze(null))}}}var Mt=Array.isArray;function mn(te){return Mt(te)}function Ot(te){{var Ce=typeof Symbol=="function"&&Symbol.toStringTag,Oe=Ce&&te[Symbol.toStringTag]||te.constructor.name||"Object";return Oe}}function un(te){try{return Zt(te),!1}catch{return!0}}function Zt(te){return""+te}function fe(te){if(un(te))return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ot(te)),Zt(te)}var _e=x.ReactCurrentOwner,Be={key:!0,ref:!0,__self:!0,__source:!0},Je,st;function On(te){if(De.call(te,"ref")){var Ce=Object.getOwnPropertyDescriptor(te,"ref").get;if(Ce&&Ce.isReactWarning)return!1}return te.ref!==void 0}function Fn(te){if(De.call(te,"key")){var Ce=Object.getOwnPropertyDescriptor(te,"key").get;if(Ce&&Ce.isReactWarning)return!1}return te.key!==void 0}function Rn(te,Ce){typeof te.ref=="string"&&_e.current}function on(te,Ce){{var Oe=function(){Je||(Je=!0,S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Ce))};Oe.isReactWarning=!0,Object.defineProperty(te,"key",{get:Oe,configurable:!0})}}function jn(te,Ce){{var Oe=function(){st||(st=!0,S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Ce))};Oe.isReactWarning=!0,Object.defineProperty(te,"ref",{get:Oe,configurable:!0})}}var en=function(te,Ce,Oe,Ve,kt,$t,xt){var pt={$$typeof:t,type:te,key:Ce,ref:Oe,props:xt,_owner:$t};return pt._store={},Object.defineProperty(pt._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(pt,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Ve}),Object.defineProperty(pt,"_source",{configurable:!1,enumerable:!1,writable:!1,value:kt}),Object.freeze&&(Object.freeze(pt.props),Object.freeze(pt)),pt};function nr(te,Ce,Oe,Ve,kt){{var $t,xt={},pt=null,Ie=null;Oe!==void 0&&(fe(Oe),pt=""+Oe),Fn(Ce)&&(fe(Ce.key),pt=""+Ce.key),On(Ce)&&(Ie=Ce.ref,Rn(Ce,kt));for($t in Ce)De.call(Ce,$t)&&!Be.hasOwnProperty($t)&&(xt[$t]=Ce[$t]);if(te&&te.defaultProps){var ne=te.defaultProps;for($t in ne)xt[$t]===void 0&&(xt[$t]=ne[$t])}if(pt||Ie){var we=typeof te=="function"?te.displayName||te.name||"Unknown":te;pt&&on(xt,we),Ie&&jn(xt,we)}return en(te,pt,Ie,kt,Ve,_e.current,xt)}}var Kn=x.ReactCurrentOwner,Ui=x.ReactDebugCurrentFrame;function yr(te){if(te){var Ce=te._owner,Oe=Ee(te.type,te._source,Ce?Ce.type:null);Ui.setExtraStackFrame(Oe)}else Ui.setExtraStackFrame(null)}var Lo;Lo=!1;function vr(te){return typeof te=="object"&&te!==null&&te.$$typeof===t}function Ir(){{if(Kn.current){var te=X(Kn.current.type);if(te)return`
|
|
22
|
-
|
|
23
|
-
Check the render method of \``+te+"`."}return""}}function ll(te){return""}var Le={};function vt(te){{var Ce=Ir();if(!Ce){var Oe=typeof te=="string"?te:te.displayName||te.name;Oe&&(Ce=`
|
|
24
|
-
|
|
25
|
-
Check the top-level render call using <`+Oe+">.")}return Ce}}function Bt(te,Ce){{if(!te._store||te._store.validated||te.key!=null)return;te._store.validated=!0;var Oe=vt(Ce);if(Le[Oe])return;Le[Oe]=!0;var Ve="";te&&te._owner&&te._owner!==Kn.current&&(Ve=" It was passed a child from "+X(te._owner.type)+"."),yr(te),S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',Oe,Ve),yr(null)}}function Xn(te,Ce){{if(typeof te!="object")return;if(mn(te))for(var Oe=0;Oe<te.length;Oe++){var Ve=te[Oe];vr(Ve)&&Bt(Ve,Ce)}else if(vr(te))te._store&&(te._store.validated=!0);else if(te){var kt=v(te);if(typeof kt=="function"&&kt!==te.entries)for(var $t=kt.call(te),xt;!(xt=$t.next()).done;)vr(xt.value)&&Bt(xt.value,Ce)}}}function Qn(te){{var Ce=te.type;if(Ce==null||typeof Ce=="string")return;var Oe;if(typeof Ce=="function")Oe=Ce.propTypes;else if(typeof Ce=="object"&&(Ce.$$typeof===l||Ce.$$typeof===d))Oe=Ce.propTypes;else return;if(Oe){var Ve=X(Ce);yt(Oe,te.props,"prop",Ve,te)}else if(Ce.PropTypes!==void 0&&!Lo){Lo=!0;var kt=X(Ce);S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",kt||"Unknown")}typeof Ce.getDefaultProps=="function"&&!Ce.getDefaultProps.isReactClassApproved&&S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Nr(te){{for(var Ce=Object.keys(te.props),Oe=0;Oe<Ce.length;Oe++){var Ve=Ce[Oe];if(Ve!=="children"&&Ve!=="key"){yr(te),S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Ve),yr(null);break}}te.ref!==null&&(yr(te),S("Invalid attribute `ref` supplied to `React.Fragment`."),yr(null))}}var ur={};function rr(te,Ce,Oe,Ve,kt,$t){{var xt=F(te);if(!xt){var pt="";(te===void 0||typeof te=="object"&&te!==null&&Object.keys(te).length===0)&&(pt+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Ie=ll();Ie?pt+=Ie:pt+=Ir();var ne;te===null?ne="null":mn(te)?ne="array":te!==void 0&&te.$$typeof===t?(ne="<"+(X(te.type)||"Unknown")+" />",pt=" Did you accidentally export a JSX literal instead of a component?"):ne=typeof te,S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",ne,pt)}var we=nr(te,Ce,Oe,kt,$t);if(we==null)return we;if(xt){var Ae=Ce.children;if(Ae!==void 0)if(Ve)if(mn(Ae)){for(var Dt=0;Dt<Ae.length;Dt++)Xn(Ae[Dt],te);Object.freeze&&Object.freeze(Ae)}else S("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Xn(Ae,te)}if(De.call(Ce,"key")){var dn=X(te),Et=Object.keys(Ce).filter(function(xs){return xs!=="key"}),Vn=Et.length>0?"{key: someKey, "+Et.join(": ..., ")+": ...}":"{key: someKey}";if(!ur[dn+Vn]){var Jr=Et.length>0?"{"+Et.join(": ..., ")+": ...}":"{}";S(`A props object containing a "key" prop is being spread into JSX:
|
|
26
|
-
let props = %s;
|
|
27
|
-
<%s {...props} />
|
|
28
|
-
React keys must be passed directly to JSX without using spread:
|
|
29
|
-
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props} />`,Vn,dn,Jr,dn),ur[dn+Vn]=!0}}return te===r?Nr(we):Qn(we),we}}function bn(te,Ce,Oe){return rr(te,Ce,Oe,!0)}function oa(te,Ce,Oe){return rr(te,Ce,Oe,!1)}var Bc=oa,Hc=bn;uf.Fragment=r,uf.jsx=Bc,uf.jsxs=Hc}()),uf}process.env.NODE_ENV==="production"?hw.exports=yY():hw.exports=vY();var y=hw.exports;function GI(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=GI(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function mb(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=GI(e))&&(r&&(r+=" "),r+=t);return r}const xY=Object.freeze(Object.defineProperty({__proto__:null,clsx:mb,default:mb},Symbol.toStringTag,{value:"Module"})),B_="-",wY=e=>{const t=_Y(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(B_);return a[0]===""&&a.length!==1&&a.shift(),qI(a,t)||SY(s)},getConflictingClassGroupIds:(s,a)=>{const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}}},qI=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?qI(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(B_);return(s=t.validators.find(({validator:a})=>a(o)))==null?void 0:s.classGroupId},qT=/^\[(.+)\]$/,SY=e=>{if(qT.test(e)){const t=qT.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},_Y=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return EY(Object.entries(e.classGroups),n).forEach(([o,s])=>{pw(s,r,o,t)}),r},pw=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:YT(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(CY(i)){pw(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,s])=>{pw(s,YT(t,o),n,r)})})},YT=(e,t)=>{let n=e;return t.split(B_).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},CY=e=>e.isThemeGetter,EY=(e,t)=>t?e.map(([n,r])=>{const i=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([s,a])=>[t+s,a])):o);return[n,i]}):e,RY=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(o,s)=>{n.set(o,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let s=n.get(o);if(s!==void 0)return s;if((s=r.get(o))!==void 0)return i(o,s),s},set(o,s){n.has(o)?n.set(o,s):i(o,s)}}},YI="!",PY=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],o=t.length,s=a=>{const l=[];let c=0,u=0,d;for(let v=0;v<a.length;v++){let x=a[v];if(c===0){if(x===i&&(r||a.slice(v,v+o)===t)){l.push(a.slice(u,v)),u=v+o;continue}if(x==="/"){d=v;continue}}x==="["?c++:x==="]"&&c--}const p=l.length===0?a:a.substring(u),h=p.startsWith(YI),m=h?p.substring(1):p,b=d&&d>u?d-u:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:b}};return n?a=>n({className:a,parseClassName:s}):s},TY=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},MY=e=>({cache:RY(e.cacheSize),parseClassName:PY(e),...wY(e)}),OY=/\s+/,DY=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,o=[],s=e.trim().split(OY);let a="";for(let l=s.length-1;l>=0;l-=1){const c=s[l],{modifiers:u,hasImportantModifier:d,baseClassName:p,maybePostfixModifierPosition:h}=n(c);let m=!!h,b=r(m?p.substring(0,h):p);if(!b){if(!m){a=c+(a.length>0?" "+a:a);continue}if(b=r(p),!b){a=c+(a.length>0?" "+a:a);continue}m=!1}const v=TY(u).join(":"),x=d?v+YI:v,S=x+b;if(o.includes(S))continue;o.push(S);const _=i(b,m);for(let E=0;E<_.length;++E){const C=_[E];o.push(x+C)}a=c+(a.length>0?" "+a:a)}return a};function AY(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=KI(t))&&(r&&(r+=" "),r+=n);return r}const KI=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=KI(e[r]))&&(n&&(n+=" "),n+=t);return n};function kY(e,...t){let n,r,i,o=s;function s(l){const c=t.reduce((u,d)=>d(u),e());return n=MY(c),r=n.cache.get,i=n.cache.set,o=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=DY(l,n);return i(l,u),u}return function(){return o(AY.apply(null,arguments))}}const vn=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},XI=/^\[(?:([a-z-]+):)?(.+)\]$/i,IY=/^\d+\/\d+$/,NY=new Set(["px","full","screen"]),LY=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,FY=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,jY=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,$Y=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,zY=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Os=e=>Ru(e)||NY.has(e)||IY.test(e),ga=e=>Cd(e,"length",YY),Ru=e=>!!e&&!Number.isNaN(Number(e)),hx=e=>Cd(e,"number",Ru),df=e=>!!e&&Number.isInteger(Number(e)),BY=e=>e.endsWith("%")&&Ru(e.slice(0,-1)),dt=e=>XI.test(e),ma=e=>LY.test(e),HY=new Set(["length","size","percentage"]),VY=e=>Cd(e,HY,QI),WY=e=>Cd(e,"position",QI),UY=new Set(["image","url"]),GY=e=>Cd(e,UY,XY),qY=e=>Cd(e,"",KY),ff=()=>!0,Cd=(e,t,n)=>{const r=XI.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},YY=e=>FY.test(e)&&!jY.test(e),QI=()=>!1,KY=e=>$Y.test(e),XY=e=>zY.test(e),QY=()=>{const e=vn("colors"),t=vn("spacing"),n=vn("blur"),r=vn("brightness"),i=vn("borderColor"),o=vn("borderRadius"),s=vn("borderSpacing"),a=vn("borderWidth"),l=vn("contrast"),c=vn("grayscale"),u=vn("hueRotate"),d=vn("invert"),p=vn("gap"),h=vn("gradientColorStops"),m=vn("gradientColorStopPositions"),b=vn("inset"),v=vn("margin"),x=vn("opacity"),S=vn("padding"),_=vn("saturate"),E=vn("scale"),C=vn("sepia"),M=vn("skew"),O=vn("space"),k=vn("translate"),N=()=>["auto","contain","none"],F=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto",dt,t],$=()=>[dt,t],X=()=>["",Os,ga],V=()=>["auto",Ru,dt],L=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],U=()=>["solid","dashed","dotted","double","none"],B=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],W=()=>["start","end","center","between","around","evenly","stretch"],q=()=>["","0",dt],A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Y=()=>[Ru,dt];return{cacheSize:500,separator:":",theme:{colors:[ff],spacing:[Os,ga],blur:["none","",ma,dt],brightness:Y(),borderColor:[e],borderRadius:["none","","full",ma,dt],borderSpacing:$(),borderWidth:X(),contrast:Y(),grayscale:q(),hueRotate:Y(),invert:q(),gap:$(),gradientColorStops:[e],gradientColorStopPositions:[BY,ga],inset:j(),margin:j(),opacity:Y(),padding:$(),saturate:Y(),scale:Y(),sepia:q(),skew:Y(),space:$(),translate:$()},classGroups:{aspect:[{aspect:["auto","square","video",dt]}],container:["container"],columns:[{columns:[ma]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...L(),dt]}],overflow:[{overflow:F()}],"overflow-x":[{"overflow-x":F()}],"overflow-y":[{"overflow-y":F()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",df,dt]}],basis:[{basis:j()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",dt]}],grow:[{grow:q()}],shrink:[{shrink:q()}],order:[{order:["first","last","none",df,dt]}],"grid-cols":[{"grid-cols":[ff]}],"col-start-end":[{col:["auto",{span:["full",df,dt]},dt]}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":[ff]}],"row-start-end":[{row:["auto",{span:[df,dt]},dt]}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",dt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",dt]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...W()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...W(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...W(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[S]}],px:[{px:[S]}],py:[{py:[S]}],ps:[{ps:[S]}],pe:[{pe:[S]}],pt:[{pt:[S]}],pr:[{pr:[S]}],pb:[{pb:[S]}],pl:[{pl:[S]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[O]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[O]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",dt,t]}],"min-w":[{"min-w":[dt,t,"min","max","fit"]}],"max-w":[{"max-w":[dt,t,"none","full","min","max","fit","prose",{screen:[ma]},ma]}],h:[{h:[dt,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[dt,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[dt,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[dt,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ma,ga]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",hx]}],"font-family":[{font:[ff]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",dt]}],"line-clamp":[{"line-clamp":["none",Ru,hx]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Os,dt]}],"list-image":[{"list-image":["none",dt]}],"list-style-type":[{list:["none","disc","decimal",dt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...U(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Os,ga]}],"underline-offset":[{"underline-offset":["auto",Os,dt]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:$()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",dt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",dt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...L(),WY]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",VY]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},GY]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[x]}],"border-style":[{border:[...U(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[x]}],"divide-style":[{divide:U()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...U()]}],"outline-offset":[{"outline-offset":[Os,dt]}],"outline-w":[{outline:[Os,ga]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[Os,ga]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ma,qY]}],"shadow-color":[{shadow:[ff]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...B(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":B()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",ma,dt]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[_]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[_]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",dt]}],duration:[{duration:Y()}],ease:[{ease:["linear","in","out","in-out",dt]}],delay:[{delay:Y()}],animate:[{animate:["none","spin","ping","pulse","bounce",dt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[df,dt]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"skew-x":[{"skew-x":[M]}],"skew-y":[{"skew-y":[M]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",dt]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",dt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":$()}],"scroll-mx":[{"scroll-mx":$()}],"scroll-my":[{"scroll-my":$()}],"scroll-ms":[{"scroll-ms":$()}],"scroll-me":[{"scroll-me":$()}],"scroll-mt":[{"scroll-mt":$()}],"scroll-mr":[{"scroll-mr":$()}],"scroll-mb":[{"scroll-mb":$()}],"scroll-ml":[{"scroll-ml":$()}],"scroll-p":[{"scroll-p":$()}],"scroll-px":[{"scroll-px":$()}],"scroll-py":[{"scroll-py":$()}],"scroll-ps":[{"scroll-ps":$()}],"scroll-pe":[{"scroll-pe":$()}],"scroll-pt":[{"scroll-pt":$()}],"scroll-pr":[{"scroll-pr":$()}],"scroll-pb":[{"scroll-pb":$()}],"scroll-pl":[{"scroll-pl":$()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",dt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Os,ga,hx]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},JY=kY(QY);class Nf extends Error{}Nf.prototype.name="InvalidTokenError";function ZY(e){return decodeURIComponent(atob(e).replace(/(.)/g,(t,n)=>{let r=n.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}function eK(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return ZY(t)}catch{return atob(t)}}function H_(e,t){if(typeof e!="string")throw new Nf("Invalid token specified: must be a string");t||(t={});const n=t.header===!0?0:1,r=e.split(".")[n];if(typeof r!="string")throw new Nf(`Invalid token specified: missing part #${n+1}`);let i;try{i=eK(r)}catch(o){throw new Nf(`Invalid token specified: invalid base64 for part #${n+1} (${o.message})`)}try{return JSON.parse(i)}catch(o){throw new Nf(`Invalid token specified: invalid json for part #${n+1} (${o.message})`)}}const KT=e=>{let t;const n=new Set,r=(u,d)=>{const p=typeof u=="function"?u(t):u;if(!Object.is(p,t)){const h=t;t=d??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(m=>m(t,h))}},i=()=>t,l={setState:r,getState:i,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{n.clear()}},c=t=e(r,i,l);return l},tK=e=>e?KT(e):KT;var gw={exports:{}},px={},Hg={exports:{}},gx={};/**
|
|
31
|
-
* @license React
|
|
32
|
-
* use-sync-external-store-shim.production.js
|
|
33
|
-
*
|
|
34
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
35
|
-
*
|
|
36
|
-
* This source code is licensed under the MIT license found in the
|
|
37
|
-
* LICENSE file in the root directory of this source tree.
|
|
38
|
-
*/var XT;function nK(){if(XT)return gx;XT=1;var e=P;function t(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function a(d,p){var h=p(),m=r({inst:{value:h,getSnapshot:p}}),b=m[0].inst,v=m[1];return o(function(){b.value=h,b.getSnapshot=p,l(b)&&v({inst:b})},[d,h,p]),i(function(){return l(b)&&v({inst:b}),d(function(){l(b)&&v({inst:b})})},[d]),s(h),h}function l(d){var p=d.getSnapshot;d=d.value;try{var h=p();return!n(d,h)}catch{return!0}}function c(d,p){return p()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return gx.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,gx}var mx={};/**
|
|
39
|
-
* @license React
|
|
40
|
-
* use-sync-external-store-shim.development.js
|
|
41
|
-
*
|
|
42
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
43
|
-
*
|
|
44
|
-
* This source code is licensed under the MIT license found in the
|
|
45
|
-
* LICENSE file in the root directory of this source tree.
|
|
46
|
-
*/var QT;function rK(){return QT||(QT=1,process.env.NODE_ENV!=="production"&&function(){function e(h,m){return h===m&&(h!==0||1/h===1/m)||h!==h&&m!==m}function t(h,m){u||i.startTransition===void 0||(u=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var b=m();if(!d){var v=m();o(b,v)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}v=s({inst:{value:b,getSnapshot:m}});var x=v[0].inst,S=v[1];return l(function(){x.value=b,x.getSnapshot=m,n(x)&&S({inst:x})},[h,b,m]),a(function(){return n(x)&&S({inst:x}),h(function(){n(x)&&S({inst:x})})},[h]),c(b),b}function n(h){var m=h.getSnapshot;h=h.value;try{var b=m();return!o(h,b)}catch{return!0}}function r(h,m){return m()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var i=P,o=typeof Object.is=="function"?Object.is:e,s=i.useState,a=i.useEffect,l=i.useLayoutEffect,c=i.useDebugValue,u=!1,d=!1,p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;mx.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:p,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),mx}var JT;function V_(){return JT||(JT=1,process.env.NODE_ENV==="production"?Hg.exports=nK():Hg.exports=rK()),Hg.exports}/**
|
|
47
|
-
* @license React
|
|
48
|
-
* use-sync-external-store-shim/with-selector.production.js
|
|
49
|
-
*
|
|
50
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
51
|
-
*
|
|
52
|
-
* This source code is licensed under the MIT license found in the
|
|
53
|
-
* LICENSE file in the root directory of this source tree.
|
|
54
|
-
*/var ZT;function iK(){if(ZT)return px;ZT=1;var e=P,t=V_();function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return px.useSyncExternalStoreWithSelector=function(c,u,d,p,h){var m=o(null);if(m.current===null){var b={hasValue:!1,value:null};m.current=b}else b=m.current;m=a(function(){function x(M){if(!S){if(S=!0,_=M,M=p(M),h!==void 0&&b.hasValue){var O=b.value;if(h(O,M))return E=O}return E=M}if(O=E,r(_,M))return O;var k=p(M);return h!==void 0&&h(O,k)?(_=M,O):(_=M,E=k)}var S=!1,_,E,C=d===void 0?null:d;return[function(){return x(u())},C===null?void 0:function(){return x(C())}]},[u,d,p,h]);var v=i(c,m[0],m[1]);return s(function(){b.hasValue=!0,b.value=v},[v]),l(v),v},px}var bx={};/**
|
|
55
|
-
* @license React
|
|
56
|
-
* use-sync-external-store-shim/with-selector.development.js
|
|
57
|
-
*
|
|
58
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
59
|
-
*
|
|
60
|
-
* This source code is licensed under the MIT license found in the
|
|
61
|
-
* LICENSE file in the root directory of this source tree.
|
|
62
|
-
*/var eM;function oK(){return eM||(eM=1,process.env.NODE_ENV!=="production"&&function(){function e(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=P,n=V_(),r=typeof Object.is=="function"?Object.is:e,i=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,a=t.useMemo,l=t.useDebugValue;bx.useSyncExternalStoreWithSelector=function(c,u,d,p,h){var m=o(null);if(m.current===null){var b={hasValue:!1,value:null};m.current=b}else b=m.current;m=a(function(){function x(M){if(!S){if(S=!0,_=M,M=p(M),h!==void 0&&b.hasValue){var O=b.value;if(h(O,M))return E=O}return E=M}if(O=E,r(_,M))return O;var k=p(M);return h!==void 0&&h(O,k)?(_=M,O):(_=M,E=k)}var S=!1,_,E,C=d===void 0?null:d;return[function(){return x(u())},C===null?void 0:function(){return x(C())}]},[u,d,p,h]);var v=i(c,m[0],m[1]);return s(function(){b.hasValue=!0,b.value=v},[v]),l(v),v},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),bx}process.env.NODE_ENV==="production"?gw.exports=iK():gw.exports=oK();var sK=gw.exports;const aK=Oc(sK),{useDebugValue:lK}=P,{useSyncExternalStoreWithSelector:cK}=aK,uK=e=>e;function dK(e,t=uK,n){const r=cK(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return lK(r),r}const tM=e=>{const t=typeof e=="function"?tK(e):e,n=(r,i)=>dK(t,r,i);return Object.assign(n,t),n},JI=e=>e?tM(e):tM;var ZI=Symbol.for("immer-nothing"),nM=Symbol.for("immer-draftable"),ji=Symbol.for("immer-state"),fK=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function di(e,...t){if(process.env.NODE_ENV!=="production"){const n=fK[e],r=typeof n=="function"?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ed=Object.getPrototypeOf;function td(e){return!!e&&!!e[ji]}function pc(e){var t;return e?eN(e)||Array.isArray(e)||!!e[nM]||!!((t=e.constructor)!=null&&t[nM])||Ry(e)||Py(e):!1}var hK=Object.prototype.constructor.toString();function eN(e){if(!e||typeof e!="object")return!1;const t=ed(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===hK}function bb(e,t){Ey(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function Ey(e){const t=e[ji];return t?t.type_:Array.isArray(e)?1:Ry(e)?2:Py(e)?3:0}function mw(e,t){return Ey(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function tN(e,t,n){const r=Ey(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function pK(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Ry(e){return e instanceof Map}function Py(e){return e instanceof Set}function Pl(e){return e.copy_||e.base_}function bw(e,t){if(Ry(e))return new Map(e);if(Py(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=eN(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[ji];let i=Reflect.ownKeys(r);for(let o=0;o<i.length;o++){const s=i[o],a=r[s];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(r[s]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[s]})}return Object.create(ed(e),r)}else{const r=ed(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function W_(e,t=!1){return Ty(e)||td(e)||!pc(e)||(Ey(e)>1&&(e.set=e.add=e.clear=e.delete=gK),Object.freeze(e),t&&Object.entries(e).forEach(([n,r])=>W_(r,!0))),e}function gK(){di(2)}function Ty(e){return Object.isFrozen(e)}var mK={};function gc(e){const t=mK[e];return t||di(0,e),t}var wh;function nN(){return wh}function bK(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function rM(e,t){t&&(gc("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function yw(e){vw(e),e.drafts_.forEach(yK),e.drafts_=null}function vw(e){e===wh&&(wh=e.parent_)}function iM(e){return wh=bK(wh,e)}function yK(e){const t=e[ji];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function oM(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[ji].modified_&&(yw(t),di(4)),pc(e)&&(e=yb(t,e),t.parent_||vb(t,e)),t.patches_&&gc("Patches").generateReplacementPatches_(n[ji].base_,e,t.patches_,t.inversePatches_)):e=yb(t,n,[]),yw(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==ZI?e:void 0}function yb(e,t,n){if(Ty(t))return t;const r=t[ji];if(!r)return bb(t,(i,o)=>sM(e,r,t,i,o,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return vb(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const i=r.copy_;let o=i,s=!1;r.type_===3&&(o=new Set(i),i.clear(),s=!0),bb(o,(a,l)=>sM(e,r,i,a,l,n,s)),vb(e,i,!1),n&&e.patches_&&gc("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function sM(e,t,n,r,i,o,s){if(process.env.NODE_ENV!=="production"&&i===n&&di(5),td(i)){const a=o&&t&&t.type_!==3&&!mw(t.assigned_,r)?o.concat(r):void 0,l=yb(e,i,a);if(tN(n,r,l),td(l))e.canAutoFreeze_=!1;else return}else s&&n.add(i);if(pc(i)&&!Ty(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;yb(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,r)&&vb(e,i)}}function vb(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&W_(t,n)}function vK(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:nN(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,o=U_;n&&(i=[r],o=Sh);const{revoke:s,proxy:a}=Proxy.revocable(i,o);return r.draft_=a,r.revoke_=s,a}var U_={get(e,t){if(t===ji)return e;const n=Pl(e);if(!mw(n,t))return xK(e,n,t);const r=n[t];return e.finalized_||!pc(r)?r:r===yx(e.base_,t)?(vx(e),e.copy_[t]=ww(r,e)):r},has(e,t){return t in Pl(e)},ownKeys(e){return Reflect.ownKeys(Pl(e))},set(e,t,n){const r=rN(Pl(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=yx(Pl(e),t),o=i==null?void 0:i[ji];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(pK(n,i)&&(n!==void 0||mw(e.base_,t)))return!0;vx(e),xw(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return yx(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,vx(e),xw(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Pl(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){di(11)},getPrototypeOf(e){return ed(e.base_)},setPrototypeOf(){di(12)}},Sh={};bb(U_,(e,t)=>{Sh[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Sh.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&di(13),Sh.set.call(this,e,t,void 0)};Sh.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&di(14),U_.set.call(this,e[0],t,n,e[0])};function yx(e,t){const n=e[ji];return(n?Pl(n):e)[t]}function xK(e,t,n){var i;const r=rN(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function rN(e,t){if(!(t in e))return;let n=ed(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=ed(n)}}function xw(e){e.modified_||(e.modified_=!0,e.parent_&&xw(e.parent_))}function vx(e){e.copy_||(e.copy_=bw(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var wK=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const o=n;n=t;const s=this;return function(l=o,...c){return s.produce(l,u=>n.call(this,u,...c))}}typeof n!="function"&&di(6),r!==void 0&&typeof r!="function"&&di(7);let i;if(pc(t)){const o=iM(this),s=ww(t,void 0);let a=!0;try{i=n(s),a=!1}finally{a?yw(o):vw(o)}return rM(o,r),oM(i,o)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===ZI&&(i=void 0),this.autoFreeze_&&W_(i,!0),r){const o=[],s=[];gc("Patches").generateReplacementPatches_(t,i,o,s),r(o,s)}return i}else di(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...a)=>this.produceWithPatches(s,l=>t(l,...a));let r,i;return[this.produce(t,n,(s,a)=>{r=s,i=a}),r,i]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){pc(e)||di(8),td(e)&&(e=SK(e));const t=iM(this),n=ww(e,void 0);return n[ji].isManual_=!0,vw(t),n}finishDraft(e,t){const n=e&&e[ji];(!n||!n.isManual_)&&di(9);const{scope_:r}=n;return rM(r,t),oM(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=gc("Patches").applyPatches_;return td(e)?r(e,t):this.produce(e,i=>r(i,t))}};function ww(e,t){const n=Ry(e)?gc("MapSet").proxyMap_(e,t):Py(e)?gc("MapSet").proxySet_(e,t):vK(e,t);return(t?t.scope_:nN()).drafts_.push(n),n}function SK(e){return td(e)||di(10,e),iN(e)}function iN(e){if(!pc(e)||Ty(e))return e;const t=e[ji];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=bw(e,t.scope_.immer_.useStrictShallowCopy_)}else n=bw(e,!0);return bb(n,(r,i)=>{tN(n,r,iN(i))}),t&&(t.finalized_=!1),n}var $i=new wK,_K=$i.produce;$i.produceWithPatches.bind($i);$i.setAutoFreeze.bind($i);$i.setUseStrictShallowCopy.bind($i);$i.applyPatches.bind($i);$i.createDraft.bind($i);$i.finishDraft.bind($i);const CK=e=>(t,n,r)=>(r.setState=(i,o,...s)=>{const a=typeof i=="function"?_K(i):i;return t(a,o,...s)},e(r.setState,n,r)),oN=CK;var Sw,Vg=Tr;if(process.env.NODE_ENV==="production")Sw=Vg.createRoot,Vg.hydrateRoot;else{var aM=Vg.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Sw=function(e,t){aM.usingClientEntryPoint=!0;try{return Vg.createRoot(e,t)}finally{aM.usingClientEntryPoint=!1}}}var sN={},aN={},G_={exports:{}},ft=String,lN=function(){return{isColorSupported:!1,reset:ft,bold:ft,dim:ft,italic:ft,underline:ft,inverse:ft,hidden:ft,strikethrough:ft,black:ft,red:ft,green:ft,yellow:ft,blue:ft,magenta:ft,cyan:ft,white:ft,gray:ft,bgBlack:ft,bgRed:ft,bgGreen:ft,bgYellow:ft,bgBlue:ft,bgMagenta:ft,bgCyan:ft,bgWhite:ft,blackBright:ft,redBright:ft,greenBright:ft,yellowBright:ft,blueBright:ft,magentaBright:ft,cyanBright:ft,whiteBright:ft,bgBlackBright:ft,bgRedBright:ft,bgGreenBright:ft,bgYellowBright:ft,bgBlueBright:ft,bgMagentaBright:ft,bgCyanBright:ft,bgWhiteBright:ft}};G_.exports=lN();G_.exports.createColors=lN;var EK=G_.exports;(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,c){for(var u in c)Object.defineProperty(l,u,{enumerable:!0,get:c[u]})}t(e,{dim:function(){return s},default:function(){return a}});const n=r(EK);function r(l){return l&&l.__esModule?l:{default:l}}let i=new Set;function o(l,c,u){typeof process<"u"&&process.env.JEST_WORKER_ID||u&&i.has(u)||(u&&i.add(u),console.warn(""),c.forEach(d=>console.warn(l,"-",d)))}function s(l){return n.default.dim(l)}const a={info(l,c){o(n.default.bold(n.default.cyan("info")),...Array.isArray(l)?[l]:[c,l])},warn(l,c){o(n.default.bold(n.default.yellow("warn")),...Array.isArray(l)?[l]:[c,l])},risk(l,c){o(n.default.bold(n.default.magenta("risk")),...Array.isArray(l)?[l]:[c,l])}}})(aN);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return i}});const t=n(aN);function n(o){return o.__esModule?o:{default:o}}function r({version:o,from:s,to:a}){t.default.warn(`${s}-color-renamed`,[`As of Tailwind CSS ${o}, \`${s}\` has been renamed to \`${a}\`.`,"Update your configuration file to silence this warning."])}const i={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},get lightBlue(){return r({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return r({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return r({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return r({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return r({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}})(sN);let xx=sN;var RK=(xx.__esModule?xx:{default:xx}).default;const Ft=Oc(RK),q_=`import pandas as pd
|
|
63
|
-
df = pd.DataFrame(data) # 'data' contains the query result
|
|
64
|
-
result = df.to_dict('records') # must return 'result' as [dict] type
|
|
65
|
-
`,cN="dm",_w=[{locale:"en-US",currency:"USD",currencyName:"US Dollar"},{locale:"en-GB",currency:"GBP",currencyName:"British Pound"},{locale:"en-CA",currency:"CAD",currencyName:"Canadian Dollar"},{locale:"en-AU",currency:"AUD",currencyName:"Australian Dollar"},{locale:"en-IN",currency:"INR",currencyName:"Indian Rupee"},{locale:"ja-JP",currency:"JPY",currencyName:"Japanese Yen"},{locale:"de-DE",currency:"EUR",currencyName:"Germany (Eurozone)"},{locale:"fr-FR",currency:"EUR",currencyName:"France (Eurozone)"},{locale:"es-ES",currency:"EUR",currencyName:"Spain (Eurozone)"},{locale:"it-IT",currency:"EUR",currencyName:"Italy (Eurozone)"},{locale:"fi-FI",currency:"EUR",currencyName:"Finland (Eurozone)"},{locale:"nl-NL",currency:"EUR",currencyName:"Netherlands (Eurozone)"},{locale:"zh-CN",currency:"CNY",currencyName:"Chinese Yuan"},{locale:"ru-RU",currency:"RUB",currencyName:"Russian Ruble"},{locale:"pt-BR",currency:"BRL",currencyName:"Brazilian Real"},{locale:"ko-KR",currency:"KRW",currencyName:"South Korean Won"},{locale:"ar-SA",currency:"SAR",currencyName:"Saudi Riyal"},{locale:"sv-SE",currency:"SEK",currencyName:"Swedish Krona"},{locale:"no-NO",currency:"NOK",currencyName:"Norwegian Krone"},{locale:"da-DK",currency:"DKK",currencyName:"Danish Krone"},{locale:"pl-PL",currency:"PLN",currencyName:"Polish Zloty"},{locale:"tr-TR",currency:"TRY",currencyName:"Turkish Lira"},{locale:"he-IL",currency:"ILS",currencyName:"Israeli Shekel"},{locale:"th-TH",currency:"THB",currencyName:"Thai Baht"},{locale:"vi-VN",currency:"VND",currencyName:"Vietnamese Dong"},{locale:"id-ID",currency:"IDR",currencyName:"Indonesian Rupiah"},{locale:"mx-MX",currency:"MXN",currencyName:"Mexican Peso"},{locale:"za-ZA",currency:"ZAR",currencyName:"South African Rand"},{locale:"sg-SG",currency:"SGD",currencyName:"Singapore Dollar"},{locale:"hk-HK",currency:"HKD",currencyName:"Hong Kong Dollar"},{locale:"ch-CH",currency:"CHF",currencyName:"Swiss Franc"},{locale:"my-MY",currency:"MYR",currencyName:"Malaysian Ringgit"},{locale:"ph-PH",currency:"PHP",currencyName:"Philippine Peso"},{locale:"eg-EG",currency:"EGP",currencyName:"Egyptian Pound"},{locale:"nz-NZ",currency:"NZD",currencyName:"New Zealand Dollar"}],PK=[{label:"English",locales:[{code:"en-US",name:"US English"},{code:"en-GB",name:"British English"},{code:"en-AU",name:"Australian English"},{code:"en-CA",name:"Canadian English"}]},{label:"French",locales:[{code:"fr-FR",name:"France French"},{code:"fr-CA",name:"Canadian French"}]},{label:"Spanish",locales:[{code:"es-ES",name:"Spain Spanish"},{code:"es-MX",name:"Mexican Spanish"},{code:"es-419",name:"Latin American Spanish"}]},{label:"German",locales:[{code:"de-DE",name:"Germany German"},{code:"de-CH",name:"Swiss German"}]},{label:"Chinese",locales:[{code:"zh-CN",name:"Simplified Chinese (China)"},{code:"zh-TW",name:"Traditional Chinese (Taiwan)"},{code:"zh-HK",name:"Hong Kong Chinese"}]},{label:"Japanese",locales:[{code:"ja-JP",name:"Japanese"}]},{label:"Arabic",locales:[{code:"ar-EG",name:"Egypt Arabic"},{code:"ar-SA",name:"Saudi Arabia Arabic"}]},{label:"Russian",locales:[{code:"ru-RU",name:"Russian"}]},{label:"Portuguese",locales:[{code:"pt-PT",name:"Portugal Portuguese"},{code:"pt-BR",name:"Brazil Portuguese"}]},{label:"Indian Languages",locales:[{code:"hi-IN",name:"Hindi (India)"},{code:"ta-IN",name:"Tamil (India)"}]},{label:"Korean",locales:[{code:"ko-KR",name:"Korean"}]},{label:"Italian",locales:[{code:"it-IT",name:"Italian (Italy)"}]},{label:"Dutch",locales:[{code:"nl-NL",name:"Dutch (Netherlands)"}]},{label:"Swedish",locales:[{code:"sv-SE",name:"Swedish (Sweden)"}]},{label:"Turkish",locales:[{code:"tr-TR",name:"Turkish (Turkey)"}]},{label:"Hebrew",locales:[{code:"he-IL",name:"Hebrew (Israel)"}]},{label:"Thai",locales:[{code:"th-TH",name:"Thai (Thailand)"}]},{label:"Polish",locales:[{code:"pl-PL",name:"Polish (Poland)"}]},{label:"Greek",locales:[{code:"el-GR",name:"Greek (Greece)"}]},{label:"Norwegian",locales:[{code:"no-NO",name:"Norwegian (Norway)"}]}],Y_=["lg","md","sm","xs","xxs"],xb={default:{dashboardPanel:"",dashboardTabsContainer:"",gridLayout:{className:""},chart:{font:{family:"Open Sans, Arial, sans-serif"},dataset:{backgroundColor:[Ft.blue[500],Ft.teal[500],Ft.amber[500],Ft.red[500],Ft.indigo[500],Ft.green[500]],borderColor:[Ft.blue[500],Ft.teal[500],Ft.amber[500],Ft.red[500],Ft.indigo[500],Ft.green[500]]},options:{interaction:{mode:"index"},plugins:{datalabels:{display:!1,color:Cw},title:{display:!0},tooltip:{backgroundColor:"#fff",bodyColor:"#000",borderWidth:.25,titleColor:"#000",borderColor:"rgb(128,131,139)",cornerRadius:4,usePointStyle:!0,pointStyle:"rectRounded",boxPadding:4},legend:{position:"top",align:"center",maxHeight:0,labels:{useBorderRadius:!0,borderRadius:2}}},scales:{y:{grid:{display:!0},title:{display:!0,text:""},beginAtZero:!0,ticks:{precision:0}},x:{grid:{display:!0},title:{display:!0}}},layout:{padding:{top:-40}},borderRadius:2,responsive:!0,maintainAspectRatio:!1}}},dark:{chart:{dataset:{backgroundColor:[Ft.blue[500],Ft.teal[500],Ft.amber[500],Ft.red[500],Ft.indigo[500],Ft.green[500]],borderColor:[Ft.blue[500],Ft.teal[500],Ft.amber[500],Ft.red[500],Ft.indigo[500],Ft.green[500]],datalables:{color:Cw}},options:{plugins:{tooltip:{backgroundColor:"#000",bodyColor:"#fff",borderWidth:.25,titleColor:"#fff",borderColor:"rgb(128,131,139)",cornerRadius:2,boxPadding:4}},datalabels:{display:!1},scales:{x:{grid:{display:!0,color:Ft.slate[800]}},y:{grid:{display:!0,color:Ft.slate[800]}}}}}}};function Cw(e){var r,i,o,s,a,l;const t=(a=(s=(o=(i=(r=e==null?void 0:e.chart)==null?void 0:r.config)==null?void 0:i._config)==null?void 0:o.options)==null?void 0:s.plugins)==null?void 0:a.datalabels;let n=(l=e==null?void 0:e.dataset)==null?void 0:l.backgroundColor;return(t==null?void 0:t.align)==="end"&&(t==null?void 0:t.anchor)==="end"&&(n=_h()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=_h()),nd(n)}function _h(){return ye.getState().theme==="dark"?"#000000":"#FFFFFF"}function nd(e){let t=0,n=0,r=0,i=0;const o=u=>{if(!u)return Ft.gray[500];const d=u.replace("#",""),p=parseInt(d.substring(0,2),16),h=parseInt(d.substring(2,4),16),m=parseInt(d.substring(4,6),16);t+=p,n+=h,r+=m,i++};Array.isArray(e)?e.forEach(u=>{o(u)}):o(e);const s=t/i,a=n/i,l=r/i;return(s*299+a*587+l*114)/1e3>=180?"black":"white"}const TK=["text","enum","varchar","nvarchar","nvarchar2","char","character","longtext","nchar","char varying","nchar varying","character varying","string"],MK=["number","integer","int","int64","bigint","smallint","tinyint","byteint","numeric","decimal","dec","double","real","double precision","float","float4","float8","float64"],OK=["date","datetime","time","timestamp","timestamp without time zone","timestamp_ns"],DK=["boolean"];function K_(e){return e.match(/[A-Z]/)?`"${e}"`:e}function My(e){return TK.includes(e.toLowerCase())||/varchar/i.test(e)}function yp(e){return MK.includes(e.toLowerCase())||/int|decimal|float|double/i.test(e)}function Ed(e){return OK.includes(e.toLowerCase())||/date|time|timestamp/i.test(e)}function X_(e){return DK.includes(e.toLowerCase())||/boolean/i.test(e)}function AK(e,t,n,r){const{measures:i,dimensions:o}=e,s=i==null?void 0:i.map(u=>`${u.calc}(${u.name}) as ${u.calc}_${u.name.replace(/"/g,"")}`).join(", "),a=(o==null?void 0:o.join(", "))||"";let l="";const c=r?`${cN}.${r}`:uN(t,n);if(s&&a)return l=`SELECT ${a}, COUNT(*) as count, ${s} FROM ${c} GROUP BY ${a} ORDER BY ${a} DESC`,l;if(!s&&a)return l=`SELECT ${a}, COUNT(*) as count FROM ${c} GROUP BY ${a} ORDER BY ${a} DESC`,l;if(s&&!a)return l=`SELECT ${s} FROM ${c}`,l}function kK(e,t,n="AVG"){var o,s,a,l;let r={};const i=K_(e.column_name);return My(e.data_type)&&(((o=t.dimensions)==null?void 0:o.includes(i))?r={...t,dimensions:(s=t.dimensions)==null?void 0:s.filter(u=>u!==i)}:r={...t,dimensions:[...t.dimensions||[],i]}),yp(e.data_type)&&(((a=t.measures)==null?void 0:a.some(u=>u.name===i&&u.calc===n))?r={...t,measures:(l=t.measures)==null?void 0:l.filter(u=>!(u.name===i&&u.calc===n))}:r={...t,measures:[...t.measures||[],{name:i,calc:n||"SUM"}]}),r}function Pu(e){return My(e.dataType)?"string":yp(e.dataType)?"number":Ed(e.dataType)?"date":X_(e.dataType)?"boolean":"string"}function IK(e){let t;const n=e.data_type.toLowerCase();return My(n)?t="T":yp(n)?t="#":Ed(n)?t="D":X_(n)?t="B":t="?",t}function NK(e,t){const{dimensions:n,measures:r}=t,i=n==null?void 0:n.includes(e.column_name),o=r==null?void 0:r.some(s=>s.name===e.column_name);return i||o}function uN(e,t){return t==="api"||e===K_("NA")||e==="public"?t:e?`${e}.${t}`:`${t}`}const LK=e=>{const t=new Date(e);return!isNaN(t.getTime())},FK=e=>!isNaN(Number(e))&&!isNaN(parseFloat(e)),Oy=e=>{let t;return typeof e=="number"?t="number":typeof e=="string"?LK(e)?t="date":FK(e)?t="number":t="string":typeof e=="boolean"?t="boolean":e instanceof Date?t="date":t="unknown",t};function jK({get:e,dataPoint:t,card:n}){var p;const{addOrUpdateFilterValue:r,addFilteringCard:i,removeFilterValues:o,replaceFilterValue:s,removeFilteringCard:a}=e().actions,l=e().filteringCards,{columnName:c,columnValue:u}=t,d={filterId:n.id,connectionId:n==null?void 0:n.connectionId,tableName:n.lastSelectedTable,name:c,expression:(p=n.preferences)==null?void 0:p.filterOnClickField,valueType:Oy(u),operation:"=",values:[u]};if(l!=null&&l.find(h=>h.id===n.id)){const h=n.id;if(u==null){a(n),o(h);return}else s(d)}i(n),r(d)}var wb={exports:{}};/**
|
|
66
|
-
* @license
|
|
67
|
-
* Lodash <https://lodash.com/>
|
|
68
|
-
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
69
|
-
* Released under MIT license <https://lodash.com/license>
|
|
70
|
-
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
71
|
-
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
72
|
-
*/wb.exports;(function(e,t){(function(){var n,r="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",a="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",c=500,u="__lodash_placeholder__",d=1,p=2,h=4,m=1,b=2,v=1,x=2,S=4,_=8,E=16,C=32,M=64,O=128,k=256,N=512,F=30,j="...",$=800,X=16,V=1,L=2,U=3,B=1/0,W=9007199254740991,q=17976931348623157e292,A=NaN,Y=4294967295,G=Y-1,D=Y>>>1,ee=[["ary",O],["bind",v],["bindKey",x],["curry",_],["curryRight",E],["flip",N],["partial",C],["partialRight",M],["rearg",k]],K="[object Arguments]",oe="[object Array]",J="[object AsyncFunction]",Z="[object Boolean]",ae="[object Date]",ce="[object DOMException]",pe="[object Error]",ie="[object Function]",ge="[object GeneratorFunction]",de="[object Map]",Ee="[object Number]",De="[object Null]",$e="[object Object]",Te="[object Promise]",ze="[object Proxy]",yt="[object RegExp]",Mt="[object Set]",mn="[object String]",Ot="[object Symbol]",un="[object Undefined]",Zt="[object WeakMap]",fe="[object WeakSet]",_e="[object ArrayBuffer]",Be="[object DataView]",Je="[object Float32Array]",st="[object Float64Array]",On="[object Int8Array]",Fn="[object Int16Array]",Rn="[object Int32Array]",on="[object Uint8Array]",jn="[object Uint8ClampedArray]",en="[object Uint16Array]",nr="[object Uint32Array]",Kn=/\b__p \+= '';/g,Ui=/\b(__p \+=) '' \+/g,yr=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Lo=/&(?:amp|lt|gt|quot|#39);/g,vr=/[&<>"']/g,Ir=RegExp(Lo.source),ll=RegExp(vr.source),Le=/<%-([\s\S]+?)%>/g,vt=/<%([\s\S]+?)%>/g,Bt=/<%=([\s\S]+?)%>/g,Xn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Qn=/^\w*$/,Nr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ur=/[\\^$.*+?()[\]{}|]/g,rr=RegExp(ur.source),bn=/^\s+/,oa=/\s/,Bc=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Hc=/\{\n\/\* \[wrapped with (.+)\] \*/,te=/,? & /,Ce=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Oe=/[()=,{}\[\]\/\s]/,Ve=/\\(\\)?/g,kt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,$t=/\w*$/,xt=/^[-+]0x[0-9a-f]+$/i,pt=/^0b[01]+$/i,Ie=/^\[object .+?Constructor\]$/,ne=/^0o[0-7]+$/i,we=/^(?:0|[1-9]\d*)$/,Ae=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Dt=/($^)/,dn=/['\n\r\u2028\u2029\\]/g,Et="\\ud800-\\udfff",Vn="\\u0300-\\u036f",Jr="\\ufe20-\\ufe2f",xs="\\u20d0-\\u20ff",ir=Vn+Jr+xs,Ud="\\u2700-\\u27bf",Gd="a-z\\xdf-\\xf6\\xf8-\\xff",fB="\\xac\\xb1\\xd7\\xf7",hB="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",pB="\\u2000-\\u206f",gB=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",S2="A-Z\\xc0-\\xd6\\xd8-\\xde",_2="\\ufe0e\\ufe0f",C2=fB+hB+pB+gB,nv="['’]",mB="["+Et+"]",E2="["+C2+"]",tg="["+ir+"]",R2="\\d+",bB="["+Ud+"]",P2="["+Gd+"]",T2="[^"+Et+C2+R2+Ud+Gd+S2+"]",rv="\\ud83c[\\udffb-\\udfff]",yB="(?:"+tg+"|"+rv+")",M2="[^"+Et+"]",iv="(?:\\ud83c[\\udde6-\\uddff]){2}",ov="[\\ud800-\\udbff][\\udc00-\\udfff]",Vc="["+S2+"]",O2="\\u200d",D2="(?:"+P2+"|"+T2+")",vB="(?:"+Vc+"|"+T2+")",A2="(?:"+nv+"(?:d|ll|m|re|s|t|ve))?",k2="(?:"+nv+"(?:D|LL|M|RE|S|T|VE))?",I2=yB+"?",N2="["+_2+"]?",xB="(?:"+O2+"(?:"+[M2,iv,ov].join("|")+")"+N2+I2+")*",wB="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",SB="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",L2=N2+I2+xB,_B="(?:"+[bB,iv,ov].join("|")+")"+L2,CB="(?:"+[M2+tg+"?",tg,iv,ov,mB].join("|")+")",EB=RegExp(nv,"g"),RB=RegExp(tg,"g"),sv=RegExp(rv+"(?="+rv+")|"+CB+L2,"g"),PB=RegExp([Vc+"?"+P2+"+"+A2+"(?="+[E2,Vc,"$"].join("|")+")",vB+"+"+k2+"(?="+[E2,Vc+D2,"$"].join("|")+")",Vc+"?"+D2+"+"+A2,Vc+"+"+k2,SB,wB,R2,_B].join("|"),"g"),TB=RegExp("["+O2+Et+ir+_2+"]"),MB=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,OB=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],DB=-1,yn={};yn[Je]=yn[st]=yn[On]=yn[Fn]=yn[Rn]=yn[on]=yn[jn]=yn[en]=yn[nr]=!0,yn[K]=yn[oe]=yn[_e]=yn[Z]=yn[Be]=yn[ae]=yn[pe]=yn[ie]=yn[de]=yn[Ee]=yn[$e]=yn[yt]=yn[Mt]=yn[mn]=yn[Zt]=!1;var fn={};fn[K]=fn[oe]=fn[_e]=fn[Be]=fn[Z]=fn[ae]=fn[Je]=fn[st]=fn[On]=fn[Fn]=fn[Rn]=fn[de]=fn[Ee]=fn[$e]=fn[yt]=fn[Mt]=fn[mn]=fn[Ot]=fn[on]=fn[jn]=fn[en]=fn[nr]=!0,fn[pe]=fn[ie]=fn[Zt]=!1;var AB={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},kB={"&":"&","<":"<",">":">",'"':""","'":"'"},IB={"&":"&","<":"<",">":">",""":'"',"'":"'"},NB={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},LB=parseFloat,FB=parseInt,F2=typeof Ca=="object"&&Ca&&Ca.Object===Object&&Ca,jB=typeof self=="object"&&self&&self.Object===Object&&self,dr=F2||jB||Function("return this")(),av=t&&!t.nodeType&&t,cl=av&&!0&&e&&!e.nodeType&&e,j2=cl&&cl.exports===av,lv=j2&&F2.process,Gi=function(){try{var le=cl&&cl.require&&cl.require("util").types;return le||lv&&lv.binding&&lv.binding("util")}catch{}}(),$2=Gi&&Gi.isArrayBuffer,z2=Gi&&Gi.isDate,B2=Gi&&Gi.isMap,H2=Gi&&Gi.isRegExp,V2=Gi&&Gi.isSet,W2=Gi&&Gi.isTypedArray;function wi(le,me,he){switch(he.length){case 0:return le.call(me);case 1:return le.call(me,he[0]);case 2:return le.call(me,he[0],he[1]);case 3:return le.call(me,he[0],he[1],he[2])}return le.apply(me,he)}function $B(le,me,he,Fe){for(var ot=-1,Vt=le==null?0:le.length;++ot<Vt;){var Jn=le[ot];me(Fe,Jn,he(Jn),le)}return Fe}function qi(le,me){for(var he=-1,Fe=le==null?0:le.length;++he<Fe&&me(le[he],he,le)!==!1;);return le}function zB(le,me){for(var he=le==null?0:le.length;he--&&me(le[he],he,le)!==!1;);return le}function U2(le,me){for(var he=-1,Fe=le==null?0:le.length;++he<Fe;)if(!me(le[he],he,le))return!1;return!0}function sa(le,me){for(var he=-1,Fe=le==null?0:le.length,ot=0,Vt=[];++he<Fe;){var Jn=le[he];me(Jn,he,le)&&(Vt[ot++]=Jn)}return Vt}function ng(le,me){var he=le==null?0:le.length;return!!he&&Wc(le,me,0)>-1}function cv(le,me,he){for(var Fe=-1,ot=le==null?0:le.length;++Fe<ot;)if(he(me,le[Fe]))return!0;return!1}function Pn(le,me){for(var he=-1,Fe=le==null?0:le.length,ot=Array(Fe);++he<Fe;)ot[he]=me(le[he],he,le);return ot}function aa(le,me){for(var he=-1,Fe=me.length,ot=le.length;++he<Fe;)le[ot+he]=me[he];return le}function uv(le,me,he,Fe){var ot=-1,Vt=le==null?0:le.length;for(Fe&&Vt&&(he=le[++ot]);++ot<Vt;)he=me(he,le[ot],ot,le);return he}function BB(le,me,he,Fe){var ot=le==null?0:le.length;for(Fe&&ot&&(he=le[--ot]);ot--;)he=me(he,le[ot],ot,le);return he}function dv(le,me){for(var he=-1,Fe=le==null?0:le.length;++he<Fe;)if(me(le[he],he,le))return!0;return!1}var HB=fv("length");function VB(le){return le.split("")}function WB(le){return le.match(Ce)||[]}function G2(le,me,he){var Fe;return he(le,function(ot,Vt,Jn){if(me(ot,Vt,Jn))return Fe=Vt,!1}),Fe}function rg(le,me,he,Fe){for(var ot=le.length,Vt=he+(Fe?1:-1);Fe?Vt--:++Vt<ot;)if(me(le[Vt],Vt,le))return Vt;return-1}function Wc(le,me,he){return me===me?nH(le,me,he):rg(le,q2,he)}function UB(le,me,he,Fe){for(var ot=he-1,Vt=le.length;++ot<Vt;)if(Fe(le[ot],me))return ot;return-1}function q2(le){return le!==le}function Y2(le,me){var he=le==null?0:le.length;return he?pv(le,me)/he:A}function fv(le){return function(me){return me==null?n:me[le]}}function hv(le){return function(me){return le==null?n:le[me]}}function K2(le,me,he,Fe,ot){return ot(le,function(Vt,Jn,ln){he=Fe?(Fe=!1,Vt):me(he,Vt,Jn,ln)}),he}function GB(le,me){var he=le.length;for(le.sort(me);he--;)le[he]=le[he].value;return le}function pv(le,me){for(var he,Fe=-1,ot=le.length;++Fe<ot;){var Vt=me(le[Fe]);Vt!==n&&(he=he===n?Vt:he+Vt)}return he}function gv(le,me){for(var he=-1,Fe=Array(le);++he<le;)Fe[he]=me(he);return Fe}function qB(le,me){return Pn(me,function(he){return[he,le[he]]})}function X2(le){return le&&le.slice(0,eP(le)+1).replace(bn,"")}function Si(le){return function(me){return le(me)}}function mv(le,me){return Pn(me,function(he){return le[he]})}function qd(le,me){return le.has(me)}function Q2(le,me){for(var he=-1,Fe=le.length;++he<Fe&&Wc(me,le[he],0)>-1;);return he}function J2(le,me){for(var he=le.length;he--&&Wc(me,le[he],0)>-1;);return he}function YB(le,me){for(var he=le.length,Fe=0;he--;)le[he]===me&&++Fe;return Fe}var KB=hv(AB),XB=hv(kB);function QB(le){return"\\"+NB[le]}function JB(le,me){return le==null?n:le[me]}function Uc(le){return TB.test(le)}function ZB(le){return MB.test(le)}function eH(le){for(var me,he=[];!(me=le.next()).done;)he.push(me.value);return he}function bv(le){var me=-1,he=Array(le.size);return le.forEach(function(Fe,ot){he[++me]=[ot,Fe]}),he}function Z2(le,me){return function(he){return le(me(he))}}function la(le,me){for(var he=-1,Fe=le.length,ot=0,Vt=[];++he<Fe;){var Jn=le[he];(Jn===me||Jn===u)&&(le[he]=u,Vt[ot++]=he)}return Vt}function ig(le){var me=-1,he=Array(le.size);return le.forEach(function(Fe){he[++me]=Fe}),he}function tH(le){var me=-1,he=Array(le.size);return le.forEach(function(Fe){he[++me]=[Fe,Fe]}),he}function nH(le,me,he){for(var Fe=he-1,ot=le.length;++Fe<ot;)if(le[Fe]===me)return Fe;return-1}function rH(le,me,he){for(var Fe=he+1;Fe--;)if(le[Fe]===me)return Fe;return Fe}function Gc(le){return Uc(le)?oH(le):HB(le)}function po(le){return Uc(le)?sH(le):VB(le)}function eP(le){for(var me=le.length;me--&&oa.test(le.charAt(me)););return me}var iH=hv(IB);function oH(le){for(var me=sv.lastIndex=0;sv.test(le);)++me;return me}function sH(le){return le.match(sv)||[]}function aH(le){return le.match(PB)||[]}var lH=function le(me){me=me==null?dr:qc.defaults(dr.Object(),me,qc.pick(dr,OB));var he=me.Array,Fe=me.Date,ot=me.Error,Vt=me.Function,Jn=me.Math,ln=me.Object,yv=me.RegExp,cH=me.String,Yi=me.TypeError,og=he.prototype,uH=Vt.prototype,Yc=ln.prototype,sg=me["__core-js_shared__"],ag=uH.toString,tn=Yc.hasOwnProperty,dH=0,tP=function(){var f=/[^.]+$/.exec(sg&&sg.keys&&sg.keys.IE_PROTO||"");return f?"Symbol(src)_1."+f:""}(),lg=Yc.toString,fH=ag.call(ln),hH=dr._,pH=yv("^"+ag.call(tn).replace(ur,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),cg=j2?me.Buffer:n,ca=me.Symbol,ug=me.Uint8Array,nP=cg?cg.allocUnsafe:n,dg=Z2(ln.getPrototypeOf,ln),rP=ln.create,iP=Yc.propertyIsEnumerable,fg=og.splice,oP=ca?ca.isConcatSpreadable:n,Yd=ca?ca.iterator:n,ul=ca?ca.toStringTag:n,hg=function(){try{var f=gl(ln,"defineProperty");return f({},"",{}),f}catch{}}(),gH=me.clearTimeout!==dr.clearTimeout&&me.clearTimeout,mH=Fe&&Fe.now!==dr.Date.now&&Fe.now,bH=me.setTimeout!==dr.setTimeout&&me.setTimeout,pg=Jn.ceil,gg=Jn.floor,vv=ln.getOwnPropertySymbols,yH=cg?cg.isBuffer:n,sP=me.isFinite,vH=og.join,xH=Z2(ln.keys,ln),Zn=Jn.max,xr=Jn.min,wH=Fe.now,SH=me.parseInt,aP=Jn.random,_H=og.reverse,xv=gl(me,"DataView"),Kd=gl(me,"Map"),wv=gl(me,"Promise"),Kc=gl(me,"Set"),Xd=gl(me,"WeakMap"),Qd=gl(ln,"create"),mg=Xd&&new Xd,Xc={},CH=ml(xv),EH=ml(Kd),RH=ml(wv),PH=ml(Kc),TH=ml(Xd),bg=ca?ca.prototype:n,Jd=bg?bg.valueOf:n,lP=bg?bg.toString:n;function z(f){if(Dn(f)&&!at(f)&&!(f instanceof At)){if(f instanceof Ki)return f;if(tn.call(f,"__wrapped__"))return cT(f)}return new Ki(f)}var Qc=function(){function f(){}return function(g){if(!Tn(g))return{};if(rP)return rP(g);f.prototype=g;var w=new f;return f.prototype=n,w}}();function yg(){}function Ki(f,g){this.__wrapped__=f,this.__actions__=[],this.__chain__=!!g,this.__index__=0,this.__values__=n}z.templateSettings={escape:Le,evaluate:vt,interpolate:Bt,variable:"",imports:{_:z}},z.prototype=yg.prototype,z.prototype.constructor=z,Ki.prototype=Qc(yg.prototype),Ki.prototype.constructor=Ki;function At(f){this.__wrapped__=f,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Y,this.__views__=[]}function MH(){var f=new At(this.__wrapped__);return f.__actions__=Zr(this.__actions__),f.__dir__=this.__dir__,f.__filtered__=this.__filtered__,f.__iteratees__=Zr(this.__iteratees__),f.__takeCount__=this.__takeCount__,f.__views__=Zr(this.__views__),f}function OH(){if(this.__filtered__){var f=new At(this);f.__dir__=-1,f.__filtered__=!0}else f=this.clone(),f.__dir__*=-1;return f}function DH(){var f=this.__wrapped__.value(),g=this.__dir__,w=at(f),T=g<0,I=w?f.length:0,H=VV(0,I,this.__views__),Q=H.start,re=H.end,ue=re-Q,ve=T?re:Q-1,xe=this.__iteratees__,Se=xe.length,ke=0,He=xr(ue,this.__takeCount__);if(!w||!T&&I==ue&&He==ue)return AP(f,this.__actions__);var Ue=[];e:for(;ue--&&ke<He;){ve+=g;for(var gt=-1,Ge=f[ve];++gt<Se;){var Rt=xe[gt],It=Rt.iteratee,Ei=Rt.type,jr=It(Ge);if(Ei==L)Ge=jr;else if(!jr){if(Ei==V)continue e;break e}}Ue[ke++]=Ge}return Ue}At.prototype=Qc(yg.prototype),At.prototype.constructor=At;function dl(f){var g=-1,w=f==null?0:f.length;for(this.clear();++g<w;){var T=f[g];this.set(T[0],T[1])}}function AH(){this.__data__=Qd?Qd(null):{},this.size=0}function kH(f){var g=this.has(f)&&delete this.__data__[f];return this.size-=g?1:0,g}function IH(f){var g=this.__data__;if(Qd){var w=g[f];return w===l?n:w}return tn.call(g,f)?g[f]:n}function NH(f){var g=this.__data__;return Qd?g[f]!==n:tn.call(g,f)}function LH(f,g){var w=this.__data__;return this.size+=this.has(f)?0:1,w[f]=Qd&&g===n?l:g,this}dl.prototype.clear=AH,dl.prototype.delete=kH,dl.prototype.get=IH,dl.prototype.has=NH,dl.prototype.set=LH;function ws(f){var g=-1,w=f==null?0:f.length;for(this.clear();++g<w;){var T=f[g];this.set(T[0],T[1])}}function FH(){this.__data__=[],this.size=0}function jH(f){var g=this.__data__,w=vg(g,f);if(w<0)return!1;var T=g.length-1;return w==T?g.pop():fg.call(g,w,1),--this.size,!0}function $H(f){var g=this.__data__,w=vg(g,f);return w<0?n:g[w][1]}function zH(f){return vg(this.__data__,f)>-1}function BH(f,g){var w=this.__data__,T=vg(w,f);return T<0?(++this.size,w.push([f,g])):w[T][1]=g,this}ws.prototype.clear=FH,ws.prototype.delete=jH,ws.prototype.get=$H,ws.prototype.has=zH,ws.prototype.set=BH;function Ss(f){var g=-1,w=f==null?0:f.length;for(this.clear();++g<w;){var T=f[g];this.set(T[0],T[1])}}function HH(){this.size=0,this.__data__={hash:new dl,map:new(Kd||ws),string:new dl}}function VH(f){var g=Dg(this,f).delete(f);return this.size-=g?1:0,g}function WH(f){return Dg(this,f).get(f)}function UH(f){return Dg(this,f).has(f)}function GH(f,g){var w=Dg(this,f),T=w.size;return w.set(f,g),this.size+=w.size==T?0:1,this}Ss.prototype.clear=HH,Ss.prototype.delete=VH,Ss.prototype.get=WH,Ss.prototype.has=UH,Ss.prototype.set=GH;function fl(f){var g=-1,w=f==null?0:f.length;for(this.__data__=new Ss;++g<w;)this.add(f[g])}function qH(f){return this.__data__.set(f,l),this}function YH(f){return this.__data__.has(f)}fl.prototype.add=fl.prototype.push=qH,fl.prototype.has=YH;function go(f){var g=this.__data__=new ws(f);this.size=g.size}function KH(){this.__data__=new ws,this.size=0}function XH(f){var g=this.__data__,w=g.delete(f);return this.size=g.size,w}function QH(f){return this.__data__.get(f)}function JH(f){return this.__data__.has(f)}function ZH(f,g){var w=this.__data__;if(w instanceof ws){var T=w.__data__;if(!Kd||T.length<i-1)return T.push([f,g]),this.size=++w.size,this;w=this.__data__=new Ss(T)}return w.set(f,g),this.size=w.size,this}go.prototype.clear=KH,go.prototype.delete=XH,go.prototype.get=QH,go.prototype.has=JH,go.prototype.set=ZH;function cP(f,g){var w=at(f),T=!w&&bl(f),I=!w&&!T&&pa(f),H=!w&&!T&&!I&&tu(f),Q=w||T||I||H,re=Q?gv(f.length,cH):[],ue=re.length;for(var ve in f)(g||tn.call(f,ve))&&!(Q&&(ve=="length"||I&&(ve=="offset"||ve=="parent")||H&&(ve=="buffer"||ve=="byteLength"||ve=="byteOffset")||Rs(ve,ue)))&&re.push(ve);return re}function uP(f){var g=f.length;return g?f[Av(0,g-1)]:n}function eV(f,g){return Ag(Zr(f),hl(g,0,f.length))}function tV(f){return Ag(Zr(f))}function Sv(f,g,w){(w!==n&&!mo(f[g],w)||w===n&&!(g in f))&&_s(f,g,w)}function Zd(f,g,w){var T=f[g];(!(tn.call(f,g)&&mo(T,w))||w===n&&!(g in f))&&_s(f,g,w)}function vg(f,g){for(var w=f.length;w--;)if(mo(f[w][0],g))return w;return-1}function nV(f,g,w,T){return ua(f,function(I,H,Q){g(T,I,w(I),Q)}),T}function dP(f,g){return f&&jo(g,or(g),f)}function rV(f,g){return f&&jo(g,ti(g),f)}function _s(f,g,w){g=="__proto__"&&hg?hg(f,g,{configurable:!0,enumerable:!0,value:w,writable:!0}):f[g]=w}function _v(f,g){for(var w=-1,T=g.length,I=he(T),H=f==null;++w<T;)I[w]=H?n:rx(f,g[w]);return I}function hl(f,g,w){return f===f&&(w!==n&&(f=f<=w?f:w),g!==n&&(f=f>=g?f:g)),f}function Xi(f,g,w,T,I,H){var Q,re=g&d,ue=g&p,ve=g&h;if(w&&(Q=I?w(f,T,I,H):w(f)),Q!==n)return Q;if(!Tn(f))return f;var xe=at(f);if(xe){if(Q=UV(f),!re)return Zr(f,Q)}else{var Se=wr(f),ke=Se==ie||Se==ge;if(pa(f))return NP(f,re);if(Se==$e||Se==K||ke&&!I){if(Q=ue||ke?{}:eT(f),!re)return ue?IV(f,rV(Q,f)):kV(f,dP(Q,f))}else{if(!fn[Se])return I?f:{};Q=GV(f,Se,re)}}H||(H=new go);var He=H.get(f);if(He)return He;H.set(f,Q),MT(f)?f.forEach(function(Ge){Q.add(Xi(Ge,g,w,Ge,f,H))}):PT(f)&&f.forEach(function(Ge,Rt){Q.set(Rt,Xi(Ge,g,w,Rt,f,H))});var Ue=ve?ue?Vv:Hv:ue?ti:or,gt=xe?n:Ue(f);return qi(gt||f,function(Ge,Rt){gt&&(Rt=Ge,Ge=f[Rt]),Zd(Q,Rt,Xi(Ge,g,w,Rt,f,H))}),Q}function iV(f){var g=or(f);return function(w){return fP(w,f,g)}}function fP(f,g,w){var T=w.length;if(f==null)return!T;for(f=ln(f);T--;){var I=w[T],H=g[I],Q=f[I];if(Q===n&&!(I in f)||!H(Q))return!1}return!0}function hP(f,g,w){if(typeof f!="function")throw new Yi(s);return af(function(){f.apply(n,w)},g)}function ef(f,g,w,T){var I=-1,H=ng,Q=!0,re=f.length,ue=[],ve=g.length;if(!re)return ue;w&&(g=Pn(g,Si(w))),T?(H=cv,Q=!1):g.length>=i&&(H=qd,Q=!1,g=new fl(g));e:for(;++I<re;){var xe=f[I],Se=w==null?xe:w(xe);if(xe=T||xe!==0?xe:0,Q&&Se===Se){for(var ke=ve;ke--;)if(g[ke]===Se)continue e;ue.push(xe)}else H(g,Se,T)||ue.push(xe)}return ue}var ua=zP(Fo),pP=zP(Ev,!0);function oV(f,g){var w=!0;return ua(f,function(T,I,H){return w=!!g(T,I,H),w}),w}function xg(f,g,w){for(var T=-1,I=f.length;++T<I;){var H=f[T],Q=g(H);if(Q!=null&&(re===n?Q===Q&&!Ci(Q):w(Q,re)))var re=Q,ue=H}return ue}function sV(f,g,w,T){var I=f.length;for(w=ut(w),w<0&&(w=-w>I?0:I+w),T=T===n||T>I?I:ut(T),T<0&&(T+=I),T=w>T?0:DT(T);w<T;)f[w++]=g;return f}function gP(f,g){var w=[];return ua(f,function(T,I,H){g(T,I,H)&&w.push(T)}),w}function fr(f,g,w,T,I){var H=-1,Q=f.length;for(w||(w=YV),I||(I=[]);++H<Q;){var re=f[H];g>0&&w(re)?g>1?fr(re,g-1,w,T,I):aa(I,re):T||(I[I.length]=re)}return I}var Cv=BP(),mP=BP(!0);function Fo(f,g){return f&&Cv(f,g,or)}function Ev(f,g){return f&&mP(f,g,or)}function wg(f,g){return sa(g,function(w){return Ps(f[w])})}function pl(f,g){g=fa(g,f);for(var w=0,T=g.length;f!=null&&w<T;)f=f[$o(g[w++])];return w&&w==T?f:n}function bP(f,g,w){var T=g(f);return at(f)?T:aa(T,w(f))}function Lr(f){return f==null?f===n?un:De:ul&&ul in ln(f)?HV(f):tW(f)}function Rv(f,g){return f>g}function aV(f,g){return f!=null&&tn.call(f,g)}function lV(f,g){return f!=null&&g in ln(f)}function cV(f,g,w){return f>=xr(g,w)&&f<Zn(g,w)}function Pv(f,g,w){for(var T=w?cv:ng,I=f[0].length,H=f.length,Q=H,re=he(H),ue=1/0,ve=[];Q--;){var xe=f[Q];Q&&g&&(xe=Pn(xe,Si(g))),ue=xr(xe.length,ue),re[Q]=!w&&(g||I>=120&&xe.length>=120)?new fl(Q&&xe):n}xe=f[0];var Se=-1,ke=re[0];e:for(;++Se<I&&ve.length<ue;){var He=xe[Se],Ue=g?g(He):He;if(He=w||He!==0?He:0,!(ke?qd(ke,Ue):T(ve,Ue,w))){for(Q=H;--Q;){var gt=re[Q];if(!(gt?qd(gt,Ue):T(f[Q],Ue,w)))continue e}ke&&ke.push(Ue),ve.push(He)}}return ve}function uV(f,g,w,T){return Fo(f,function(I,H,Q){g(T,w(I),H,Q)}),T}function tf(f,g,w){g=fa(g,f),f=iT(f,g);var T=f==null?f:f[$o(Ji(g))];return T==null?n:wi(T,f,w)}function yP(f){return Dn(f)&&Lr(f)==K}function dV(f){return Dn(f)&&Lr(f)==_e}function fV(f){return Dn(f)&&Lr(f)==ae}function nf(f,g,w,T,I){return f===g?!0:f==null||g==null||!Dn(f)&&!Dn(g)?f!==f&&g!==g:hV(f,g,w,T,nf,I)}function hV(f,g,w,T,I,H){var Q=at(f),re=at(g),ue=Q?oe:wr(f),ve=re?oe:wr(g);ue=ue==K?$e:ue,ve=ve==K?$e:ve;var xe=ue==$e,Se=ve==$e,ke=ue==ve;if(ke&&pa(f)){if(!pa(g))return!1;Q=!0,xe=!1}if(ke&&!xe)return H||(H=new go),Q||tu(f)?QP(f,g,w,T,I,H):zV(f,g,ue,w,T,I,H);if(!(w&m)){var He=xe&&tn.call(f,"__wrapped__"),Ue=Se&&tn.call(g,"__wrapped__");if(He||Ue){var gt=He?f.value():f,Ge=Ue?g.value():g;return H||(H=new go),I(gt,Ge,w,T,H)}}return ke?(H||(H=new go),BV(f,g,w,T,I,H)):!1}function pV(f){return Dn(f)&&wr(f)==de}function Tv(f,g,w,T){var I=w.length,H=I,Q=!T;if(f==null)return!H;for(f=ln(f);I--;){var re=w[I];if(Q&&re[2]?re[1]!==f[re[0]]:!(re[0]in f))return!1}for(;++I<H;){re=w[I];var ue=re[0],ve=f[ue],xe=re[1];if(Q&&re[2]){if(ve===n&&!(ue in f))return!1}else{var Se=new go;if(T)var ke=T(ve,xe,ue,f,g,Se);if(!(ke===n?nf(xe,ve,m|b,T,Se):ke))return!1}}return!0}function vP(f){if(!Tn(f)||XV(f))return!1;var g=Ps(f)?pH:Ie;return g.test(ml(f))}function gV(f){return Dn(f)&&Lr(f)==yt}function mV(f){return Dn(f)&&wr(f)==Mt}function bV(f){return Dn(f)&&jg(f.length)&&!!yn[Lr(f)]}function xP(f){return typeof f=="function"?f:f==null?ni:typeof f=="object"?at(f)?_P(f[0],f[1]):SP(f):HT(f)}function Mv(f){if(!sf(f))return xH(f);var g=[];for(var w in ln(f))tn.call(f,w)&&w!="constructor"&&g.push(w);return g}function yV(f){if(!Tn(f))return eW(f);var g=sf(f),w=[];for(var T in f)T=="constructor"&&(g||!tn.call(f,T))||w.push(T);return w}function Ov(f,g){return f<g}function wP(f,g){var w=-1,T=ei(f)?he(f.length):[];return ua(f,function(I,H,Q){T[++w]=g(I,H,Q)}),T}function SP(f){var g=Uv(f);return g.length==1&&g[0][2]?nT(g[0][0],g[0][1]):function(w){return w===f||Tv(w,f,g)}}function _P(f,g){return qv(f)&&tT(g)?nT($o(f),g):function(w){var T=rx(w,f);return T===n&&T===g?ix(w,f):nf(g,T,m|b)}}function Sg(f,g,w,T,I){f!==g&&Cv(g,function(H,Q){if(I||(I=new go),Tn(H))vV(f,g,Q,w,Sg,T,I);else{var re=T?T(Kv(f,Q),H,Q+"",f,g,I):n;re===n&&(re=H),Sv(f,Q,re)}},ti)}function vV(f,g,w,T,I,H,Q){var re=Kv(f,w),ue=Kv(g,w),ve=Q.get(ue);if(ve){Sv(f,w,ve);return}var xe=H?H(re,ue,w+"",f,g,Q):n,Se=xe===n;if(Se){var ke=at(ue),He=!ke&&pa(ue),Ue=!ke&&!He&&tu(ue);xe=ue,ke||He||Ue?at(re)?xe=re:$n(re)?xe=Zr(re):He?(Se=!1,xe=NP(ue,!0)):Ue?(Se=!1,xe=LP(ue,!0)):xe=[]:lf(ue)||bl(ue)?(xe=re,bl(re)?xe=AT(re):(!Tn(re)||Ps(re))&&(xe=eT(ue))):Se=!1}Se&&(Q.set(ue,xe),I(xe,ue,T,H,Q),Q.delete(ue)),Sv(f,w,xe)}function CP(f,g){var w=f.length;if(w)return g+=g<0?w:0,Rs(g,w)?f[g]:n}function EP(f,g,w){g.length?g=Pn(g,function(H){return at(H)?function(Q){return pl(Q,H.length===1?H[0]:H)}:H}):g=[ni];var T=-1;g=Pn(g,Si(We()));var I=wP(f,function(H,Q,re){var ue=Pn(g,function(ve){return ve(H)});return{criteria:ue,index:++T,value:H}});return GB(I,function(H,Q){return AV(H,Q,w)})}function xV(f,g){return RP(f,g,function(w,T){return ix(f,T)})}function RP(f,g,w){for(var T=-1,I=g.length,H={};++T<I;){var Q=g[T],re=pl(f,Q);w(re,Q)&&rf(H,fa(Q,f),re)}return H}function wV(f){return function(g){return pl(g,f)}}function Dv(f,g,w,T){var I=T?UB:Wc,H=-1,Q=g.length,re=f;for(f===g&&(g=Zr(g)),w&&(re=Pn(f,Si(w)));++H<Q;)for(var ue=0,ve=g[H],xe=w?w(ve):ve;(ue=I(re,xe,ue,T))>-1;)re!==f&&fg.call(re,ue,1),fg.call(f,ue,1);return f}function PP(f,g){for(var w=f?g.length:0,T=w-1;w--;){var I=g[w];if(w==T||I!==H){var H=I;Rs(I)?fg.call(f,I,1):Nv(f,I)}}return f}function Av(f,g){return f+gg(aP()*(g-f+1))}function SV(f,g,w,T){for(var I=-1,H=Zn(pg((g-f)/(w||1)),0),Q=he(H);H--;)Q[T?H:++I]=f,f+=w;return Q}function kv(f,g){var w="";if(!f||g<1||g>W)return w;do g%2&&(w+=f),g=gg(g/2),g&&(f+=f);while(g);return w}function wt(f,g){return Xv(rT(f,g,ni),f+"")}function _V(f){return uP(nu(f))}function CV(f,g){var w=nu(f);return Ag(w,hl(g,0,w.length))}function rf(f,g,w,T){if(!Tn(f))return f;g=fa(g,f);for(var I=-1,H=g.length,Q=H-1,re=f;re!=null&&++I<H;){var ue=$o(g[I]),ve=w;if(ue==="__proto__"||ue==="constructor"||ue==="prototype")return f;if(I!=Q){var xe=re[ue];ve=T?T(xe,ue,re):n,ve===n&&(ve=Tn(xe)?xe:Rs(g[I+1])?[]:{})}Zd(re,ue,ve),re=re[ue]}return f}var TP=mg?function(f,g){return mg.set(f,g),f}:ni,EV=hg?function(f,g){return hg(f,"toString",{configurable:!0,enumerable:!1,value:sx(g),writable:!0})}:ni;function RV(f){return Ag(nu(f))}function Qi(f,g,w){var T=-1,I=f.length;g<0&&(g=-g>I?0:I+g),w=w>I?I:w,w<0&&(w+=I),I=g>w?0:w-g>>>0,g>>>=0;for(var H=he(I);++T<I;)H[T]=f[T+g];return H}function PV(f,g){var w;return ua(f,function(T,I,H){return w=g(T,I,H),!w}),!!w}function _g(f,g,w){var T=0,I=f==null?T:f.length;if(typeof g=="number"&&g===g&&I<=D){for(;T<I;){var H=T+I>>>1,Q=f[H];Q!==null&&!Ci(Q)&&(w?Q<=g:Q<g)?T=H+1:I=H}return I}return Iv(f,g,ni,w)}function Iv(f,g,w,T){var I=0,H=f==null?0:f.length;if(H===0)return 0;g=w(g);for(var Q=g!==g,re=g===null,ue=Ci(g),ve=g===n;I<H;){var xe=gg((I+H)/2),Se=w(f[xe]),ke=Se!==n,He=Se===null,Ue=Se===Se,gt=Ci(Se);if(Q)var Ge=T||Ue;else ve?Ge=Ue&&(T||ke):re?Ge=Ue&&ke&&(T||!He):ue?Ge=Ue&&ke&&!He&&(T||!gt):He||gt?Ge=!1:Ge=T?Se<=g:Se<g;Ge?I=xe+1:H=xe}return xr(H,G)}function MP(f,g){for(var w=-1,T=f.length,I=0,H=[];++w<T;){var Q=f[w],re=g?g(Q):Q;if(!w||!mo(re,ue)){var ue=re;H[I++]=Q===0?0:Q}}return H}function OP(f){return typeof f=="number"?f:Ci(f)?A:+f}function _i(f){if(typeof f=="string")return f;if(at(f))return Pn(f,_i)+"";if(Ci(f))return lP?lP.call(f):"";var g=f+"";return g=="0"&&1/f==-1/0?"-0":g}function da(f,g,w){var T=-1,I=ng,H=f.length,Q=!0,re=[],ue=re;if(w)Q=!1,I=cv;else if(H>=i){var ve=g?null:jV(f);if(ve)return ig(ve);Q=!1,I=qd,ue=new fl}else ue=g?[]:re;e:for(;++T<H;){var xe=f[T],Se=g?g(xe):xe;if(xe=w||xe!==0?xe:0,Q&&Se===Se){for(var ke=ue.length;ke--;)if(ue[ke]===Se)continue e;g&&ue.push(Se),re.push(xe)}else I(ue,Se,w)||(ue!==re&&ue.push(Se),re.push(xe))}return re}function Nv(f,g){return g=fa(g,f),f=iT(f,g),f==null||delete f[$o(Ji(g))]}function DP(f,g,w,T){return rf(f,g,w(pl(f,g)),T)}function Cg(f,g,w,T){for(var I=f.length,H=T?I:-1;(T?H--:++H<I)&&g(f[H],H,f););return w?Qi(f,T?0:H,T?H+1:I):Qi(f,T?H+1:0,T?I:H)}function AP(f,g){var w=f;return w instanceof At&&(w=w.value()),uv(g,function(T,I){return I.func.apply(I.thisArg,aa([T],I.args))},w)}function Lv(f,g,w){var T=f.length;if(T<2)return T?da(f[0]):[];for(var I=-1,H=he(T);++I<T;)for(var Q=f[I],re=-1;++re<T;)re!=I&&(H[I]=ef(H[I]||Q,f[re],g,w));return da(fr(H,1),g,w)}function kP(f,g,w){for(var T=-1,I=f.length,H=g.length,Q={};++T<I;){var re=T<H?g[T]:n;w(Q,f[T],re)}return Q}function Fv(f){return $n(f)?f:[]}function jv(f){return typeof f=="function"?f:ni}function fa(f,g){return at(f)?f:qv(f,g)?[f]:lT(Yt(f))}var TV=wt;function ha(f,g,w){var T=f.length;return w=w===n?T:w,!g&&w>=T?f:Qi(f,g,w)}var IP=gH||function(f){return dr.clearTimeout(f)};function NP(f,g){if(g)return f.slice();var w=f.length,T=nP?nP(w):new f.constructor(w);return f.copy(T),T}function $v(f){var g=new f.constructor(f.byteLength);return new ug(g).set(new ug(f)),g}function MV(f,g){var w=g?$v(f.buffer):f.buffer;return new f.constructor(w,f.byteOffset,f.byteLength)}function OV(f){var g=new f.constructor(f.source,$t.exec(f));return g.lastIndex=f.lastIndex,g}function DV(f){return Jd?ln(Jd.call(f)):{}}function LP(f,g){var w=g?$v(f.buffer):f.buffer;return new f.constructor(w,f.byteOffset,f.length)}function FP(f,g){if(f!==g){var w=f!==n,T=f===null,I=f===f,H=Ci(f),Q=g!==n,re=g===null,ue=g===g,ve=Ci(g);if(!re&&!ve&&!H&&f>g||H&&Q&&ue&&!re&&!ve||T&&Q&&ue||!w&&ue||!I)return 1;if(!T&&!H&&!ve&&f<g||ve&&w&&I&&!T&&!H||re&&w&&I||!Q&&I||!ue)return-1}return 0}function AV(f,g,w){for(var T=-1,I=f.criteria,H=g.criteria,Q=I.length,re=w.length;++T<Q;){var ue=FP(I[T],H[T]);if(ue){if(T>=re)return ue;var ve=w[T];return ue*(ve=="desc"?-1:1)}}return f.index-g.index}function jP(f,g,w,T){for(var I=-1,H=f.length,Q=w.length,re=-1,ue=g.length,ve=Zn(H-Q,0),xe=he(ue+ve),Se=!T;++re<ue;)xe[re]=g[re];for(;++I<Q;)(Se||I<H)&&(xe[w[I]]=f[I]);for(;ve--;)xe[re++]=f[I++];return xe}function $P(f,g,w,T){for(var I=-1,H=f.length,Q=-1,re=w.length,ue=-1,ve=g.length,xe=Zn(H-re,0),Se=he(xe+ve),ke=!T;++I<xe;)Se[I]=f[I];for(var He=I;++ue<ve;)Se[He+ue]=g[ue];for(;++Q<re;)(ke||I<H)&&(Se[He+w[Q]]=f[I++]);return Se}function Zr(f,g){var w=-1,T=f.length;for(g||(g=he(T));++w<T;)g[w]=f[w];return g}function jo(f,g,w,T){var I=!w;w||(w={});for(var H=-1,Q=g.length;++H<Q;){var re=g[H],ue=T?T(w[re],f[re],re,w,f):n;ue===n&&(ue=f[re]),I?_s(w,re,ue):Zd(w,re,ue)}return w}function kV(f,g){return jo(f,Gv(f),g)}function IV(f,g){return jo(f,JP(f),g)}function Eg(f,g){return function(w,T){var I=at(w)?$B:nV,H=g?g():{};return I(w,f,We(T,2),H)}}function Jc(f){return wt(function(g,w){var T=-1,I=w.length,H=I>1?w[I-1]:n,Q=I>2?w[2]:n;for(H=f.length>3&&typeof H=="function"?(I--,H):n,Q&&Fr(w[0],w[1],Q)&&(H=I<3?n:H,I=1),g=ln(g);++T<I;){var re=w[T];re&&f(g,re,T,H)}return g})}function zP(f,g){return function(w,T){if(w==null)return w;if(!ei(w))return f(w,T);for(var I=w.length,H=g?I:-1,Q=ln(w);(g?H--:++H<I)&&T(Q[H],H,Q)!==!1;);return w}}function BP(f){return function(g,w,T){for(var I=-1,H=ln(g),Q=T(g),re=Q.length;re--;){var ue=Q[f?re:++I];if(w(H[ue],ue,H)===!1)break}return g}}function NV(f,g,w){var T=g&v,I=of(f);function H(){var Q=this&&this!==dr&&this instanceof H?I:f;return Q.apply(T?w:this,arguments)}return H}function HP(f){return function(g){g=Yt(g);var w=Uc(g)?po(g):n,T=w?w[0]:g.charAt(0),I=w?ha(w,1).join(""):g.slice(1);return T[f]()+I}}function Zc(f){return function(g){return uv(zT($T(g).replace(EB,"")),f,"")}}function of(f){return function(){var g=arguments;switch(g.length){case 0:return new f;case 1:return new f(g[0]);case 2:return new f(g[0],g[1]);case 3:return new f(g[0],g[1],g[2]);case 4:return new f(g[0],g[1],g[2],g[3]);case 5:return new f(g[0],g[1],g[2],g[3],g[4]);case 6:return new f(g[0],g[1],g[2],g[3],g[4],g[5]);case 7:return new f(g[0],g[1],g[2],g[3],g[4],g[5],g[6])}var w=Qc(f.prototype),T=f.apply(w,g);return Tn(T)?T:w}}function LV(f,g,w){var T=of(f);function I(){for(var H=arguments.length,Q=he(H),re=H,ue=eu(I);re--;)Q[re]=arguments[re];var ve=H<3&&Q[0]!==ue&&Q[H-1]!==ue?[]:la(Q,ue);if(H-=ve.length,H<w)return qP(f,g,Rg,I.placeholder,n,Q,ve,n,n,w-H);var xe=this&&this!==dr&&this instanceof I?T:f;return wi(xe,this,Q)}return I}function VP(f){return function(g,w,T){var I=ln(g);if(!ei(g)){var H=We(w,3);g=or(g),w=function(re){return H(I[re],re,I)}}var Q=f(g,w,T);return Q>-1?I[H?g[Q]:Q]:n}}function WP(f){return Es(function(g){var w=g.length,T=w,I=Ki.prototype.thru;for(f&&g.reverse();T--;){var H=g[T];if(typeof H!="function")throw new Yi(s);if(I&&!Q&&Og(H)=="wrapper")var Q=new Ki([],!0)}for(T=Q?T:w;++T<w;){H=g[T];var re=Og(H),ue=re=="wrapper"?Wv(H):n;ue&&Yv(ue[0])&&ue[1]==(O|_|C|k)&&!ue[4].length&&ue[9]==1?Q=Q[Og(ue[0])].apply(Q,ue[3]):Q=H.length==1&&Yv(H)?Q[re]():Q.thru(H)}return function(){var ve=arguments,xe=ve[0];if(Q&&ve.length==1&&at(xe))return Q.plant(xe).value();for(var Se=0,ke=w?g[Se].apply(this,ve):xe;++Se<w;)ke=g[Se].call(this,ke);return ke}})}function Rg(f,g,w,T,I,H,Q,re,ue,ve){var xe=g&O,Se=g&v,ke=g&x,He=g&(_|E),Ue=g&N,gt=ke?n:of(f);function Ge(){for(var Rt=arguments.length,It=he(Rt),Ei=Rt;Ei--;)It[Ei]=arguments[Ei];if(He)var jr=eu(Ge),Ri=YB(It,jr);if(T&&(It=jP(It,T,I,He)),H&&(It=$P(It,H,Q,He)),Rt-=Ri,He&&Rt<ve){var zn=la(It,jr);return qP(f,g,Rg,Ge.placeholder,w,It,zn,re,ue,ve-Rt)}var bo=Se?w:this,Ms=ke?bo[f]:f;return Rt=It.length,re?It=nW(It,re):Ue&&Rt>1&&It.reverse(),xe&&ue<Rt&&(It.length=ue),this&&this!==dr&&this instanceof Ge&&(Ms=gt||of(Ms)),Ms.apply(bo,It)}return Ge}function UP(f,g){return function(w,T){return uV(w,f,g(T),{})}}function Pg(f,g){return function(w,T){var I;if(w===n&&T===n)return g;if(w!==n&&(I=w),T!==n){if(I===n)return T;typeof w=="string"||typeof T=="string"?(w=_i(w),T=_i(T)):(w=OP(w),T=OP(T)),I=f(w,T)}return I}}function zv(f){return Es(function(g){return g=Pn(g,Si(We())),wt(function(w){var T=this;return f(g,function(I){return wi(I,T,w)})})})}function Tg(f,g){g=g===n?" ":_i(g);var w=g.length;if(w<2)return w?kv(g,f):g;var T=kv(g,pg(f/Gc(g)));return Uc(g)?ha(po(T),0,f).join(""):T.slice(0,f)}function FV(f,g,w,T){var I=g&v,H=of(f);function Q(){for(var re=-1,ue=arguments.length,ve=-1,xe=T.length,Se=he(xe+ue),ke=this&&this!==dr&&this instanceof Q?H:f;++ve<xe;)Se[ve]=T[ve];for(;ue--;)Se[ve++]=arguments[++re];return wi(ke,I?w:this,Se)}return Q}function GP(f){return function(g,w,T){return T&&typeof T!="number"&&Fr(g,w,T)&&(w=T=n),g=Ts(g),w===n?(w=g,g=0):w=Ts(w),T=T===n?g<w?1:-1:Ts(T),SV(g,w,T,f)}}function Mg(f){return function(g,w){return typeof g=="string"&&typeof w=="string"||(g=Zi(g),w=Zi(w)),f(g,w)}}function qP(f,g,w,T,I,H,Q,re,ue,ve){var xe=g&_,Se=xe?Q:n,ke=xe?n:Q,He=xe?H:n,Ue=xe?n:H;g|=xe?C:M,g&=~(xe?M:C),g&S||(g&=-4);var gt=[f,g,I,He,Se,Ue,ke,re,ue,ve],Ge=w.apply(n,gt);return Yv(f)&&oT(Ge,gt),Ge.placeholder=T,sT(Ge,f,g)}function Bv(f){var g=Jn[f];return function(w,T){if(w=Zi(w),T=T==null?0:xr(ut(T),292),T&&sP(w)){var I=(Yt(w)+"e").split("e"),H=g(I[0]+"e"+(+I[1]+T));return I=(Yt(H)+"e").split("e"),+(I[0]+"e"+(+I[1]-T))}return g(w)}}var jV=Kc&&1/ig(new Kc([,-0]))[1]==B?function(f){return new Kc(f)}:cx;function YP(f){return function(g){var w=wr(g);return w==de?bv(g):w==Mt?tH(g):qB(g,f(g))}}function Cs(f,g,w,T,I,H,Q,re){var ue=g&x;if(!ue&&typeof f!="function")throw new Yi(s);var ve=T?T.length:0;if(ve||(g&=-97,T=I=n),Q=Q===n?Q:Zn(ut(Q),0),re=re===n?re:ut(re),ve-=I?I.length:0,g&M){var xe=T,Se=I;T=I=n}var ke=ue?n:Wv(f),He=[f,g,w,T,I,xe,Se,H,Q,re];if(ke&&ZV(He,ke),f=He[0],g=He[1],w=He[2],T=He[3],I=He[4],re=He[9]=He[9]===n?ue?0:f.length:Zn(He[9]-ve,0),!re&&g&(_|E)&&(g&=-25),!g||g==v)var Ue=NV(f,g,w);else g==_||g==E?Ue=LV(f,g,re):(g==C||g==(v|C))&&!I.length?Ue=FV(f,g,w,T):Ue=Rg.apply(n,He);var gt=ke?TP:oT;return sT(gt(Ue,He),f,g)}function KP(f,g,w,T){return f===n||mo(f,Yc[w])&&!tn.call(T,w)?g:f}function XP(f,g,w,T,I,H){return Tn(f)&&Tn(g)&&(H.set(g,f),Sg(f,g,n,XP,H),H.delete(g)),f}function $V(f){return lf(f)?n:f}function QP(f,g,w,T,I,H){var Q=w&m,re=f.length,ue=g.length;if(re!=ue&&!(Q&&ue>re))return!1;var ve=H.get(f),xe=H.get(g);if(ve&&xe)return ve==g&&xe==f;var Se=-1,ke=!0,He=w&b?new fl:n;for(H.set(f,g),H.set(g,f);++Se<re;){var Ue=f[Se],gt=g[Se];if(T)var Ge=Q?T(gt,Ue,Se,g,f,H):T(Ue,gt,Se,f,g,H);if(Ge!==n){if(Ge)continue;ke=!1;break}if(He){if(!dv(g,function(Rt,It){if(!qd(He,It)&&(Ue===Rt||I(Ue,Rt,w,T,H)))return He.push(It)})){ke=!1;break}}else if(!(Ue===gt||I(Ue,gt,w,T,H))){ke=!1;break}}return H.delete(f),H.delete(g),ke}function zV(f,g,w,T,I,H,Q){switch(w){case Be:if(f.byteLength!=g.byteLength||f.byteOffset!=g.byteOffset)return!1;f=f.buffer,g=g.buffer;case _e:return!(f.byteLength!=g.byteLength||!H(new ug(f),new ug(g)));case Z:case ae:case Ee:return mo(+f,+g);case pe:return f.name==g.name&&f.message==g.message;case yt:case mn:return f==g+"";case de:var re=bv;case Mt:var ue=T&m;if(re||(re=ig),f.size!=g.size&&!ue)return!1;var ve=Q.get(f);if(ve)return ve==g;T|=b,Q.set(f,g);var xe=QP(re(f),re(g),T,I,H,Q);return Q.delete(f),xe;case Ot:if(Jd)return Jd.call(f)==Jd.call(g)}return!1}function BV(f,g,w,T,I,H){var Q=w&m,re=Hv(f),ue=re.length,ve=Hv(g),xe=ve.length;if(ue!=xe&&!Q)return!1;for(var Se=ue;Se--;){var ke=re[Se];if(!(Q?ke in g:tn.call(g,ke)))return!1}var He=H.get(f),Ue=H.get(g);if(He&&Ue)return He==g&&Ue==f;var gt=!0;H.set(f,g),H.set(g,f);for(var Ge=Q;++Se<ue;){ke=re[Se];var Rt=f[ke],It=g[ke];if(T)var Ei=Q?T(It,Rt,ke,g,f,H):T(Rt,It,ke,f,g,H);if(!(Ei===n?Rt===It||I(Rt,It,w,T,H):Ei)){gt=!1;break}Ge||(Ge=ke=="constructor")}if(gt&&!Ge){var jr=f.constructor,Ri=g.constructor;jr!=Ri&&"constructor"in f&&"constructor"in g&&!(typeof jr=="function"&&jr instanceof jr&&typeof Ri=="function"&&Ri instanceof Ri)&&(gt=!1)}return H.delete(f),H.delete(g),gt}function Es(f){return Xv(rT(f,n,fT),f+"")}function Hv(f){return bP(f,or,Gv)}function Vv(f){return bP(f,ti,JP)}var Wv=mg?function(f){return mg.get(f)}:cx;function Og(f){for(var g=f.name+"",w=Xc[g],T=tn.call(Xc,g)?w.length:0;T--;){var I=w[T],H=I.func;if(H==null||H==f)return I.name}return g}function eu(f){var g=tn.call(z,"placeholder")?z:f;return g.placeholder}function We(){var f=z.iteratee||ax;return f=f===ax?xP:f,arguments.length?f(arguments[0],arguments[1]):f}function Dg(f,g){var w=f.__data__;return KV(g)?w[typeof g=="string"?"string":"hash"]:w.map}function Uv(f){for(var g=or(f),w=g.length;w--;){var T=g[w],I=f[T];g[w]=[T,I,tT(I)]}return g}function gl(f,g){var w=JB(f,g);return vP(w)?w:n}function HV(f){var g=tn.call(f,ul),w=f[ul];try{f[ul]=n;var T=!0}catch{}var I=lg.call(f);return T&&(g?f[ul]=w:delete f[ul]),I}var Gv=vv?function(f){return f==null?[]:(f=ln(f),sa(vv(f),function(g){return iP.call(f,g)}))}:ux,JP=vv?function(f){for(var g=[];f;)aa(g,Gv(f)),f=dg(f);return g}:ux,wr=Lr;(xv&&wr(new xv(new ArrayBuffer(1)))!=Be||Kd&&wr(new Kd)!=de||wv&&wr(wv.resolve())!=Te||Kc&&wr(new Kc)!=Mt||Xd&&wr(new Xd)!=Zt)&&(wr=function(f){var g=Lr(f),w=g==$e?f.constructor:n,T=w?ml(w):"";if(T)switch(T){case CH:return Be;case EH:return de;case RH:return Te;case PH:return Mt;case TH:return Zt}return g});function VV(f,g,w){for(var T=-1,I=w.length;++T<I;){var H=w[T],Q=H.size;switch(H.type){case"drop":f+=Q;break;case"dropRight":g-=Q;break;case"take":g=xr(g,f+Q);break;case"takeRight":f=Zn(f,g-Q);break}}return{start:f,end:g}}function WV(f){var g=f.match(Hc);return g?g[1].split(te):[]}function ZP(f,g,w){g=fa(g,f);for(var T=-1,I=g.length,H=!1;++T<I;){var Q=$o(g[T]);if(!(H=f!=null&&w(f,Q)))break;f=f[Q]}return H||++T!=I?H:(I=f==null?0:f.length,!!I&&jg(I)&&Rs(Q,I)&&(at(f)||bl(f)))}function UV(f){var g=f.length,w=new f.constructor(g);return g&&typeof f[0]=="string"&&tn.call(f,"index")&&(w.index=f.index,w.input=f.input),w}function eT(f){return typeof f.constructor=="function"&&!sf(f)?Qc(dg(f)):{}}function GV(f,g,w){var T=f.constructor;switch(g){case _e:return $v(f);case Z:case ae:return new T(+f);case Be:return MV(f,w);case Je:case st:case On:case Fn:case Rn:case on:case jn:case en:case nr:return LP(f,w);case de:return new T;case Ee:case mn:return new T(f);case yt:return OV(f);case Mt:return new T;case Ot:return DV(f)}}function qV(f,g){var w=g.length;if(!w)return f;var T=w-1;return g[T]=(w>1?"& ":"")+g[T],g=g.join(w>2?", ":" "),f.replace(Bc,`{
|
|
73
|
-
/* [wrapped with `+g+`] */
|
|
74
|
-
`)}function YV(f){return at(f)||bl(f)||!!(oP&&f&&f[oP])}function Rs(f,g){var w=typeof f;return g=g??W,!!g&&(w=="number"||w!="symbol"&&we.test(f))&&f>-1&&f%1==0&&f<g}function Fr(f,g,w){if(!Tn(w))return!1;var T=typeof g;return(T=="number"?ei(w)&&Rs(g,w.length):T=="string"&&g in w)?mo(w[g],f):!1}function qv(f,g){if(at(f))return!1;var w=typeof f;return w=="number"||w=="symbol"||w=="boolean"||f==null||Ci(f)?!0:Qn.test(f)||!Xn.test(f)||g!=null&&f in ln(g)}function KV(f){var g=typeof f;return g=="string"||g=="number"||g=="symbol"||g=="boolean"?f!=="__proto__":f===null}function Yv(f){var g=Og(f),w=z[g];if(typeof w!="function"||!(g in At.prototype))return!1;if(f===w)return!0;var T=Wv(w);return!!T&&f===T[0]}function XV(f){return!!tP&&tP in f}var QV=sg?Ps:dx;function sf(f){var g=f&&f.constructor,w=typeof g=="function"&&g.prototype||Yc;return f===w}function tT(f){return f===f&&!Tn(f)}function nT(f,g){return function(w){return w==null?!1:w[f]===g&&(g!==n||f in ln(w))}}function JV(f){var g=Lg(f,function(T){return w.size===c&&w.clear(),T}),w=g.cache;return g}function ZV(f,g){var w=f[1],T=g[1],I=w|T,H=I<(v|x|O),Q=T==O&&w==_||T==O&&w==k&&f[7].length<=g[8]||T==(O|k)&&g[7].length<=g[8]&&w==_;if(!(H||Q))return f;T&v&&(f[2]=g[2],I|=w&v?0:S);var re=g[3];if(re){var ue=f[3];f[3]=ue?jP(ue,re,g[4]):re,f[4]=ue?la(f[3],u):g[4]}return re=g[5],re&&(ue=f[5],f[5]=ue?$P(ue,re,g[6]):re,f[6]=ue?la(f[5],u):g[6]),re=g[7],re&&(f[7]=re),T&O&&(f[8]=f[8]==null?g[8]:xr(f[8],g[8])),f[9]==null&&(f[9]=g[9]),f[0]=g[0],f[1]=I,f}function eW(f){var g=[];if(f!=null)for(var w in ln(f))g.push(w);return g}function tW(f){return lg.call(f)}function rT(f,g,w){return g=Zn(g===n?f.length-1:g,0),function(){for(var T=arguments,I=-1,H=Zn(T.length-g,0),Q=he(H);++I<H;)Q[I]=T[g+I];I=-1;for(var re=he(g+1);++I<g;)re[I]=T[I];return re[g]=w(Q),wi(f,this,re)}}function iT(f,g){return g.length<2?f:pl(f,Qi(g,0,-1))}function nW(f,g){for(var w=f.length,T=xr(g.length,w),I=Zr(f);T--;){var H=g[T];f[T]=Rs(H,w)?I[H]:n}return f}function Kv(f,g){if(!(g==="constructor"&&typeof f[g]=="function")&&g!="__proto__")return f[g]}var oT=aT(TP),af=bH||function(f,g){return dr.setTimeout(f,g)},Xv=aT(EV);function sT(f,g,w){var T=g+"";return Xv(f,qV(T,rW(WV(T),w)))}function aT(f){var g=0,w=0;return function(){var T=wH(),I=X-(T-w);if(w=T,I>0){if(++g>=$)return arguments[0]}else g=0;return f.apply(n,arguments)}}function Ag(f,g){var w=-1,T=f.length,I=T-1;for(g=g===n?T:g;++w<g;){var H=Av(w,I),Q=f[H];f[H]=f[w],f[w]=Q}return f.length=g,f}var lT=JV(function(f){var g=[];return f.charCodeAt(0)===46&&g.push(""),f.replace(Nr,function(w,T,I,H){g.push(I?H.replace(Ve,"$1"):T||w)}),g});function $o(f){if(typeof f=="string"||Ci(f))return f;var g=f+"";return g=="0"&&1/f==-1/0?"-0":g}function ml(f){if(f!=null){try{return ag.call(f)}catch{}try{return f+""}catch{}}return""}function rW(f,g){return qi(ee,function(w){var T="_."+w[0];g&w[1]&&!ng(f,T)&&f.push(T)}),f.sort()}function cT(f){if(f instanceof At)return f.clone();var g=new Ki(f.__wrapped__,f.__chain__);return g.__actions__=Zr(f.__actions__),g.__index__=f.__index__,g.__values__=f.__values__,g}function iW(f,g,w){(w?Fr(f,g,w):g===n)?g=1:g=Zn(ut(g),0);var T=f==null?0:f.length;if(!T||g<1)return[];for(var I=0,H=0,Q=he(pg(T/g));I<T;)Q[H++]=Qi(f,I,I+=g);return Q}function oW(f){for(var g=-1,w=f==null?0:f.length,T=0,I=[];++g<w;){var H=f[g];H&&(I[T++]=H)}return I}function sW(){var f=arguments.length;if(!f)return[];for(var g=he(f-1),w=arguments[0],T=f;T--;)g[T-1]=arguments[T];return aa(at(w)?Zr(w):[w],fr(g,1))}var aW=wt(function(f,g){return $n(f)?ef(f,fr(g,1,$n,!0)):[]}),lW=wt(function(f,g){var w=Ji(g);return $n(w)&&(w=n),$n(f)?ef(f,fr(g,1,$n,!0),We(w,2)):[]}),cW=wt(function(f,g){var w=Ji(g);return $n(w)&&(w=n),$n(f)?ef(f,fr(g,1,$n,!0),n,w):[]});function uW(f,g,w){var T=f==null?0:f.length;return T?(g=w||g===n?1:ut(g),Qi(f,g<0?0:g,T)):[]}function dW(f,g,w){var T=f==null?0:f.length;return T?(g=w||g===n?1:ut(g),g=T-g,Qi(f,0,g<0?0:g)):[]}function fW(f,g){return f&&f.length?Cg(f,We(g,3),!0,!0):[]}function hW(f,g){return f&&f.length?Cg(f,We(g,3),!0):[]}function pW(f,g,w,T){var I=f==null?0:f.length;return I?(w&&typeof w!="number"&&Fr(f,g,w)&&(w=0,T=I),sV(f,g,w,T)):[]}function uT(f,g,w){var T=f==null?0:f.length;if(!T)return-1;var I=w==null?0:ut(w);return I<0&&(I=Zn(T+I,0)),rg(f,We(g,3),I)}function dT(f,g,w){var T=f==null?0:f.length;if(!T)return-1;var I=T-1;return w!==n&&(I=ut(w),I=w<0?Zn(T+I,0):xr(I,T-1)),rg(f,We(g,3),I,!0)}function fT(f){var g=f==null?0:f.length;return g?fr(f,1):[]}function gW(f){var g=f==null?0:f.length;return g?fr(f,B):[]}function mW(f,g){var w=f==null?0:f.length;return w?(g=g===n?1:ut(g),fr(f,g)):[]}function bW(f){for(var g=-1,w=f==null?0:f.length,T={};++g<w;){var I=f[g];T[I[0]]=I[1]}return T}function hT(f){return f&&f.length?f[0]:n}function yW(f,g,w){var T=f==null?0:f.length;if(!T)return-1;var I=w==null?0:ut(w);return I<0&&(I=Zn(T+I,0)),Wc(f,g,I)}function vW(f){var g=f==null?0:f.length;return g?Qi(f,0,-1):[]}var xW=wt(function(f){var g=Pn(f,Fv);return g.length&&g[0]===f[0]?Pv(g):[]}),wW=wt(function(f){var g=Ji(f),w=Pn(f,Fv);return g===Ji(w)?g=n:w.pop(),w.length&&w[0]===f[0]?Pv(w,We(g,2)):[]}),SW=wt(function(f){var g=Ji(f),w=Pn(f,Fv);return g=typeof g=="function"?g:n,g&&w.pop(),w.length&&w[0]===f[0]?Pv(w,n,g):[]});function _W(f,g){return f==null?"":vH.call(f,g)}function Ji(f){var g=f==null?0:f.length;return g?f[g-1]:n}function CW(f,g,w){var T=f==null?0:f.length;if(!T)return-1;var I=T;return w!==n&&(I=ut(w),I=I<0?Zn(T+I,0):xr(I,T-1)),g===g?rH(f,g,I):rg(f,q2,I,!0)}function EW(f,g){return f&&f.length?CP(f,ut(g)):n}var RW=wt(pT);function pT(f,g){return f&&f.length&&g&&g.length?Dv(f,g):f}function PW(f,g,w){return f&&f.length&&g&&g.length?Dv(f,g,We(w,2)):f}function TW(f,g,w){return f&&f.length&&g&&g.length?Dv(f,g,n,w):f}var MW=Es(function(f,g){var w=f==null?0:f.length,T=_v(f,g);return PP(f,Pn(g,function(I){return Rs(I,w)?+I:I}).sort(FP)),T});function OW(f,g){var w=[];if(!(f&&f.length))return w;var T=-1,I=[],H=f.length;for(g=We(g,3);++T<H;){var Q=f[T];g(Q,T,f)&&(w.push(Q),I.push(T))}return PP(f,I),w}function Qv(f){return f==null?f:_H.call(f)}function DW(f,g,w){var T=f==null?0:f.length;return T?(w&&typeof w!="number"&&Fr(f,g,w)?(g=0,w=T):(g=g==null?0:ut(g),w=w===n?T:ut(w)),Qi(f,g,w)):[]}function AW(f,g){return _g(f,g)}function kW(f,g,w){return Iv(f,g,We(w,2))}function IW(f,g){var w=f==null?0:f.length;if(w){var T=_g(f,g);if(T<w&&mo(f[T],g))return T}return-1}function NW(f,g){return _g(f,g,!0)}function LW(f,g,w){return Iv(f,g,We(w,2),!0)}function FW(f,g){var w=f==null?0:f.length;if(w){var T=_g(f,g,!0)-1;if(mo(f[T],g))return T}return-1}function jW(f){return f&&f.length?MP(f):[]}function $W(f,g){return f&&f.length?MP(f,We(g,2)):[]}function zW(f){var g=f==null?0:f.length;return g?Qi(f,1,g):[]}function BW(f,g,w){return f&&f.length?(g=w||g===n?1:ut(g),Qi(f,0,g<0?0:g)):[]}function HW(f,g,w){var T=f==null?0:f.length;return T?(g=w||g===n?1:ut(g),g=T-g,Qi(f,g<0?0:g,T)):[]}function VW(f,g){return f&&f.length?Cg(f,We(g,3),!1,!0):[]}function WW(f,g){return f&&f.length?Cg(f,We(g,3)):[]}var UW=wt(function(f){return da(fr(f,1,$n,!0))}),GW=wt(function(f){var g=Ji(f);return $n(g)&&(g=n),da(fr(f,1,$n,!0),We(g,2))}),qW=wt(function(f){var g=Ji(f);return g=typeof g=="function"?g:n,da(fr(f,1,$n,!0),n,g)});function YW(f){return f&&f.length?da(f):[]}function KW(f,g){return f&&f.length?da(f,We(g,2)):[]}function XW(f,g){return g=typeof g=="function"?g:n,f&&f.length?da(f,n,g):[]}function Jv(f){if(!(f&&f.length))return[];var g=0;return f=sa(f,function(w){if($n(w))return g=Zn(w.length,g),!0}),gv(g,function(w){return Pn(f,fv(w))})}function gT(f,g){if(!(f&&f.length))return[];var w=Jv(f);return g==null?w:Pn(w,function(T){return wi(g,n,T)})}var QW=wt(function(f,g){return $n(f)?ef(f,g):[]}),JW=wt(function(f){return Lv(sa(f,$n))}),ZW=wt(function(f){var g=Ji(f);return $n(g)&&(g=n),Lv(sa(f,$n),We(g,2))}),eU=wt(function(f){var g=Ji(f);return g=typeof g=="function"?g:n,Lv(sa(f,$n),n,g)}),tU=wt(Jv);function nU(f,g){return kP(f||[],g||[],Zd)}function rU(f,g){return kP(f||[],g||[],rf)}var iU=wt(function(f){var g=f.length,w=g>1?f[g-1]:n;return w=typeof w=="function"?(f.pop(),w):n,gT(f,w)});function mT(f){var g=z(f);return g.__chain__=!0,g}function oU(f,g){return g(f),f}function kg(f,g){return g(f)}var sU=Es(function(f){var g=f.length,w=g?f[0]:0,T=this.__wrapped__,I=function(H){return _v(H,f)};return g>1||this.__actions__.length||!(T instanceof At)||!Rs(w)?this.thru(I):(T=T.slice(w,+w+(g?1:0)),T.__actions__.push({func:kg,args:[I],thisArg:n}),new Ki(T,this.__chain__).thru(function(H){return g&&!H.length&&H.push(n),H}))});function aU(){return mT(this)}function lU(){return new Ki(this.value(),this.__chain__)}function cU(){this.__values__===n&&(this.__values__=OT(this.value()));var f=this.__index__>=this.__values__.length,g=f?n:this.__values__[this.__index__++];return{done:f,value:g}}function uU(){return this}function dU(f){for(var g,w=this;w instanceof yg;){var T=cT(w);T.__index__=0,T.__values__=n,g?I.__wrapped__=T:g=T;var I=T;w=w.__wrapped__}return I.__wrapped__=f,g}function fU(){var f=this.__wrapped__;if(f instanceof At){var g=f;return this.__actions__.length&&(g=new At(this)),g=g.reverse(),g.__actions__.push({func:kg,args:[Qv],thisArg:n}),new Ki(g,this.__chain__)}return this.thru(Qv)}function hU(){return AP(this.__wrapped__,this.__actions__)}var pU=Eg(function(f,g,w){tn.call(f,w)?++f[w]:_s(f,w,1)});function gU(f,g,w){var T=at(f)?U2:oV;return w&&Fr(f,g,w)&&(g=n),T(f,We(g,3))}function mU(f,g){var w=at(f)?sa:gP;return w(f,We(g,3))}var bU=VP(uT),yU=VP(dT);function vU(f,g){return fr(Ig(f,g),1)}function xU(f,g){return fr(Ig(f,g),B)}function wU(f,g,w){return w=w===n?1:ut(w),fr(Ig(f,g),w)}function bT(f,g){var w=at(f)?qi:ua;return w(f,We(g,3))}function yT(f,g){var w=at(f)?zB:pP;return w(f,We(g,3))}var SU=Eg(function(f,g,w){tn.call(f,w)?f[w].push(g):_s(f,w,[g])});function _U(f,g,w,T){f=ei(f)?f:nu(f),w=w&&!T?ut(w):0;var I=f.length;return w<0&&(w=Zn(I+w,0)),$g(f)?w<=I&&f.indexOf(g,w)>-1:!!I&&Wc(f,g,w)>-1}var CU=wt(function(f,g,w){var T=-1,I=typeof g=="function",H=ei(f)?he(f.length):[];return ua(f,function(Q){H[++T]=I?wi(g,Q,w):tf(Q,g,w)}),H}),EU=Eg(function(f,g,w){_s(f,w,g)});function Ig(f,g){var w=at(f)?Pn:wP;return w(f,We(g,3))}function RU(f,g,w,T){return f==null?[]:(at(g)||(g=g==null?[]:[g]),w=T?n:w,at(w)||(w=w==null?[]:[w]),EP(f,g,w))}var PU=Eg(function(f,g,w){f[w?0:1].push(g)},function(){return[[],[]]});function TU(f,g,w){var T=at(f)?uv:K2,I=arguments.length<3;return T(f,We(g,4),w,I,ua)}function MU(f,g,w){var T=at(f)?BB:K2,I=arguments.length<3;return T(f,We(g,4),w,I,pP)}function OU(f,g){var w=at(f)?sa:gP;return w(f,Fg(We(g,3)))}function DU(f){var g=at(f)?uP:_V;return g(f)}function AU(f,g,w){(w?Fr(f,g,w):g===n)?g=1:g=ut(g);var T=at(f)?eV:CV;return T(f,g)}function kU(f){var g=at(f)?tV:RV;return g(f)}function IU(f){if(f==null)return 0;if(ei(f))return $g(f)?Gc(f):f.length;var g=wr(f);return g==de||g==Mt?f.size:Mv(f).length}function NU(f,g,w){var T=at(f)?dv:PV;return w&&Fr(f,g,w)&&(g=n),T(f,We(g,3))}var LU=wt(function(f,g){if(f==null)return[];var w=g.length;return w>1&&Fr(f,g[0],g[1])?g=[]:w>2&&Fr(g[0],g[1],g[2])&&(g=[g[0]]),EP(f,fr(g,1),[])}),Ng=mH||function(){return dr.Date.now()};function FU(f,g){if(typeof g!="function")throw new Yi(s);return f=ut(f),function(){if(--f<1)return g.apply(this,arguments)}}function vT(f,g,w){return g=w?n:g,g=f&&g==null?f.length:g,Cs(f,O,n,n,n,n,g)}function xT(f,g){var w;if(typeof g!="function")throw new Yi(s);return f=ut(f),function(){return--f>0&&(w=g.apply(this,arguments)),f<=1&&(g=n),w}}var Zv=wt(function(f,g,w){var T=v;if(w.length){var I=la(w,eu(Zv));T|=C}return Cs(f,T,g,w,I)}),wT=wt(function(f,g,w){var T=v|x;if(w.length){var I=la(w,eu(wT));T|=C}return Cs(g,T,f,w,I)});function ST(f,g,w){g=w?n:g;var T=Cs(f,_,n,n,n,n,n,g);return T.placeholder=ST.placeholder,T}function _T(f,g,w){g=w?n:g;var T=Cs(f,E,n,n,n,n,n,g);return T.placeholder=_T.placeholder,T}function CT(f,g,w){var T,I,H,Q,re,ue,ve=0,xe=!1,Se=!1,ke=!0;if(typeof f!="function")throw new Yi(s);g=Zi(g)||0,Tn(w)&&(xe=!!w.leading,Se="maxWait"in w,H=Se?Zn(Zi(w.maxWait)||0,g):H,ke="trailing"in w?!!w.trailing:ke);function He(zn){var bo=T,Ms=I;return T=I=n,ve=zn,Q=f.apply(Ms,bo),Q}function Ue(zn){return ve=zn,re=af(Rt,g),xe?He(zn):Q}function gt(zn){var bo=zn-ue,Ms=zn-ve,VT=g-bo;return Se?xr(VT,H-Ms):VT}function Ge(zn){var bo=zn-ue,Ms=zn-ve;return ue===n||bo>=g||bo<0||Se&&Ms>=H}function Rt(){var zn=Ng();if(Ge(zn))return It(zn);re=af(Rt,gt(zn))}function It(zn){return re=n,ke&&T?He(zn):(T=I=n,Q)}function Ei(){re!==n&&IP(re),ve=0,T=ue=I=re=n}function jr(){return re===n?Q:It(Ng())}function Ri(){var zn=Ng(),bo=Ge(zn);if(T=arguments,I=this,ue=zn,bo){if(re===n)return Ue(ue);if(Se)return IP(re),re=af(Rt,g),He(ue)}return re===n&&(re=af(Rt,g)),Q}return Ri.cancel=Ei,Ri.flush=jr,Ri}var jU=wt(function(f,g){return hP(f,1,g)}),$U=wt(function(f,g,w){return hP(f,Zi(g)||0,w)});function zU(f){return Cs(f,N)}function Lg(f,g){if(typeof f!="function"||g!=null&&typeof g!="function")throw new Yi(s);var w=function(){var T=arguments,I=g?g.apply(this,T):T[0],H=w.cache;if(H.has(I))return H.get(I);var Q=f.apply(this,T);return w.cache=H.set(I,Q)||H,Q};return w.cache=new(Lg.Cache||Ss),w}Lg.Cache=Ss;function Fg(f){if(typeof f!="function")throw new Yi(s);return function(){var g=arguments;switch(g.length){case 0:return!f.call(this);case 1:return!f.call(this,g[0]);case 2:return!f.call(this,g[0],g[1]);case 3:return!f.call(this,g[0],g[1],g[2])}return!f.apply(this,g)}}function BU(f){return xT(2,f)}var HU=TV(function(f,g){g=g.length==1&&at(g[0])?Pn(g[0],Si(We())):Pn(fr(g,1),Si(We()));var w=g.length;return wt(function(T){for(var I=-1,H=xr(T.length,w);++I<H;)T[I]=g[I].call(this,T[I]);return wi(f,this,T)})}),ex=wt(function(f,g){var w=la(g,eu(ex));return Cs(f,C,n,g,w)}),ET=wt(function(f,g){var w=la(g,eu(ET));return Cs(f,M,n,g,w)}),VU=Es(function(f,g){return Cs(f,k,n,n,n,g)});function WU(f,g){if(typeof f!="function")throw new Yi(s);return g=g===n?g:ut(g),wt(f,g)}function UU(f,g){if(typeof f!="function")throw new Yi(s);return g=g==null?0:Zn(ut(g),0),wt(function(w){var T=w[g],I=ha(w,0,g);return T&&aa(I,T),wi(f,this,I)})}function GU(f,g,w){var T=!0,I=!0;if(typeof f!="function")throw new Yi(s);return Tn(w)&&(T="leading"in w?!!w.leading:T,I="trailing"in w?!!w.trailing:I),CT(f,g,{leading:T,maxWait:g,trailing:I})}function qU(f){return vT(f,1)}function YU(f,g){return ex(jv(g),f)}function KU(){if(!arguments.length)return[];var f=arguments[0];return at(f)?f:[f]}function XU(f){return Xi(f,h)}function QU(f,g){return g=typeof g=="function"?g:n,Xi(f,h,g)}function JU(f){return Xi(f,d|h)}function ZU(f,g){return g=typeof g=="function"?g:n,Xi(f,d|h,g)}function eG(f,g){return g==null||fP(f,g,or(g))}function mo(f,g){return f===g||f!==f&&g!==g}var tG=Mg(Rv),nG=Mg(function(f,g){return f>=g}),bl=yP(function(){return arguments}())?yP:function(f){return Dn(f)&&tn.call(f,"callee")&&!iP.call(f,"callee")},at=he.isArray,rG=$2?Si($2):dV;function ei(f){return f!=null&&jg(f.length)&&!Ps(f)}function $n(f){return Dn(f)&&ei(f)}function iG(f){return f===!0||f===!1||Dn(f)&&Lr(f)==Z}var pa=yH||dx,oG=z2?Si(z2):fV;function sG(f){return Dn(f)&&f.nodeType===1&&!lf(f)}function aG(f){if(f==null)return!0;if(ei(f)&&(at(f)||typeof f=="string"||typeof f.splice=="function"||pa(f)||tu(f)||bl(f)))return!f.length;var g=wr(f);if(g==de||g==Mt)return!f.size;if(sf(f))return!Mv(f).length;for(var w in f)if(tn.call(f,w))return!1;return!0}function lG(f,g){return nf(f,g)}function cG(f,g,w){w=typeof w=="function"?w:n;var T=w?w(f,g):n;return T===n?nf(f,g,n,w):!!T}function tx(f){if(!Dn(f))return!1;var g=Lr(f);return g==pe||g==ce||typeof f.message=="string"&&typeof f.name=="string"&&!lf(f)}function uG(f){return typeof f=="number"&&sP(f)}function Ps(f){if(!Tn(f))return!1;var g=Lr(f);return g==ie||g==ge||g==J||g==ze}function RT(f){return typeof f=="number"&&f==ut(f)}function jg(f){return typeof f=="number"&&f>-1&&f%1==0&&f<=W}function Tn(f){var g=typeof f;return f!=null&&(g=="object"||g=="function")}function Dn(f){return f!=null&&typeof f=="object"}var PT=B2?Si(B2):pV;function dG(f,g){return f===g||Tv(f,g,Uv(g))}function fG(f,g,w){return w=typeof w=="function"?w:n,Tv(f,g,Uv(g),w)}function hG(f){return TT(f)&&f!=+f}function pG(f){if(QV(f))throw new ot(o);return vP(f)}function gG(f){return f===null}function mG(f){return f==null}function TT(f){return typeof f=="number"||Dn(f)&&Lr(f)==Ee}function lf(f){if(!Dn(f)||Lr(f)!=$e)return!1;var g=dg(f);if(g===null)return!0;var w=tn.call(g,"constructor")&&g.constructor;return typeof w=="function"&&w instanceof w&&ag.call(w)==fH}var nx=H2?Si(H2):gV;function bG(f){return RT(f)&&f>=-9007199254740991&&f<=W}var MT=V2?Si(V2):mV;function $g(f){return typeof f=="string"||!at(f)&&Dn(f)&&Lr(f)==mn}function Ci(f){return typeof f=="symbol"||Dn(f)&&Lr(f)==Ot}var tu=W2?Si(W2):bV;function yG(f){return f===n}function vG(f){return Dn(f)&&wr(f)==Zt}function xG(f){return Dn(f)&&Lr(f)==fe}var wG=Mg(Ov),SG=Mg(function(f,g){return f<=g});function OT(f){if(!f)return[];if(ei(f))return $g(f)?po(f):Zr(f);if(Yd&&f[Yd])return eH(f[Yd]());var g=wr(f),w=g==de?bv:g==Mt?ig:nu;return w(f)}function Ts(f){if(!f)return f===0?f:0;if(f=Zi(f),f===B||f===-1/0){var g=f<0?-1:1;return g*q}return f===f?f:0}function ut(f){var g=Ts(f),w=g%1;return g===g?w?g-w:g:0}function DT(f){return f?hl(ut(f),0,Y):0}function Zi(f){if(typeof f=="number")return f;if(Ci(f))return A;if(Tn(f)){var g=typeof f.valueOf=="function"?f.valueOf():f;f=Tn(g)?g+"":g}if(typeof f!="string")return f===0?f:+f;f=X2(f);var w=pt.test(f);return w||ne.test(f)?FB(f.slice(2),w?2:8):xt.test(f)?A:+f}function AT(f){return jo(f,ti(f))}function _G(f){return f?hl(ut(f),-9007199254740991,W):f===0?f:0}function Yt(f){return f==null?"":_i(f)}var CG=Jc(function(f,g){if(sf(g)||ei(g)){jo(g,or(g),f);return}for(var w in g)tn.call(g,w)&&Zd(f,w,g[w])}),kT=Jc(function(f,g){jo(g,ti(g),f)}),zg=Jc(function(f,g,w,T){jo(g,ti(g),f,T)}),EG=Jc(function(f,g,w,T){jo(g,or(g),f,T)}),RG=Es(_v);function PG(f,g){var w=Qc(f);return g==null?w:dP(w,g)}var TG=wt(function(f,g){f=ln(f);var w=-1,T=g.length,I=T>2?g[2]:n;for(I&&Fr(g[0],g[1],I)&&(T=1);++w<T;)for(var H=g[w],Q=ti(H),re=-1,ue=Q.length;++re<ue;){var ve=Q[re],xe=f[ve];(xe===n||mo(xe,Yc[ve])&&!tn.call(f,ve))&&(f[ve]=H[ve])}return f}),MG=wt(function(f){return f.push(n,XP),wi(IT,n,f)});function OG(f,g){return G2(f,We(g,3),Fo)}function DG(f,g){return G2(f,We(g,3),Ev)}function AG(f,g){return f==null?f:Cv(f,We(g,3),ti)}function kG(f,g){return f==null?f:mP(f,We(g,3),ti)}function IG(f,g){return f&&Fo(f,We(g,3))}function NG(f,g){return f&&Ev(f,We(g,3))}function LG(f){return f==null?[]:wg(f,or(f))}function FG(f){return f==null?[]:wg(f,ti(f))}function rx(f,g,w){var T=f==null?n:pl(f,g);return T===n?w:T}function jG(f,g){return f!=null&&ZP(f,g,aV)}function ix(f,g){return f!=null&&ZP(f,g,lV)}var $G=UP(function(f,g,w){g!=null&&typeof g.toString!="function"&&(g=lg.call(g)),f[g]=w},sx(ni)),zG=UP(function(f,g,w){g!=null&&typeof g.toString!="function"&&(g=lg.call(g)),tn.call(f,g)?f[g].push(w):f[g]=[w]},We),BG=wt(tf);function or(f){return ei(f)?cP(f):Mv(f)}function ti(f){return ei(f)?cP(f,!0):yV(f)}function HG(f,g){var w={};return g=We(g,3),Fo(f,function(T,I,H){_s(w,g(T,I,H),T)}),w}function VG(f,g){var w={};return g=We(g,3),Fo(f,function(T,I,H){_s(w,I,g(T,I,H))}),w}var WG=Jc(function(f,g,w){Sg(f,g,w)}),IT=Jc(function(f,g,w,T){Sg(f,g,w,T)}),UG=Es(function(f,g){var w={};if(f==null)return w;var T=!1;g=Pn(g,function(H){return H=fa(H,f),T||(T=H.length>1),H}),jo(f,Vv(f),w),T&&(w=Xi(w,d|p|h,$V));for(var I=g.length;I--;)Nv(w,g[I]);return w});function GG(f,g){return NT(f,Fg(We(g)))}var qG=Es(function(f,g){return f==null?{}:xV(f,g)});function NT(f,g){if(f==null)return{};var w=Pn(Vv(f),function(T){return[T]});return g=We(g),RP(f,w,function(T,I){return g(T,I[0])})}function YG(f,g,w){g=fa(g,f);var T=-1,I=g.length;for(I||(I=1,f=n);++T<I;){var H=f==null?n:f[$o(g[T])];H===n&&(T=I,H=w),f=Ps(H)?H.call(f):H}return f}function KG(f,g,w){return f==null?f:rf(f,g,w)}function XG(f,g,w,T){return T=typeof T=="function"?T:n,f==null?f:rf(f,g,w,T)}var LT=YP(or),FT=YP(ti);function QG(f,g,w){var T=at(f),I=T||pa(f)||tu(f);if(g=We(g,4),w==null){var H=f&&f.constructor;I?w=T?new H:[]:Tn(f)?w=Ps(H)?Qc(dg(f)):{}:w={}}return(I?qi:Fo)(f,function(Q,re,ue){return g(w,Q,re,ue)}),w}function JG(f,g){return f==null?!0:Nv(f,g)}function ZG(f,g,w){return f==null?f:DP(f,g,jv(w))}function eq(f,g,w,T){return T=typeof T=="function"?T:n,f==null?f:DP(f,g,jv(w),T)}function nu(f){return f==null?[]:mv(f,or(f))}function tq(f){return f==null?[]:mv(f,ti(f))}function nq(f,g,w){return w===n&&(w=g,g=n),w!==n&&(w=Zi(w),w=w===w?w:0),g!==n&&(g=Zi(g),g=g===g?g:0),hl(Zi(f),g,w)}function rq(f,g,w){return g=Ts(g),w===n?(w=g,g=0):w=Ts(w),f=Zi(f),cV(f,g,w)}function iq(f,g,w){if(w&&typeof w!="boolean"&&Fr(f,g,w)&&(g=w=n),w===n&&(typeof g=="boolean"?(w=g,g=n):typeof f=="boolean"&&(w=f,f=n)),f===n&&g===n?(f=0,g=1):(f=Ts(f),g===n?(g=f,f=0):g=Ts(g)),f>g){var T=f;f=g,g=T}if(w||f%1||g%1){var I=aP();return xr(f+I*(g-f+LB("1e-"+((I+"").length-1))),g)}return Av(f,g)}var oq=Zc(function(f,g,w){return g=g.toLowerCase(),f+(w?jT(g):g)});function jT(f){return ox(Yt(f).toLowerCase())}function $T(f){return f=Yt(f),f&&f.replace(Ae,KB).replace(RB,"")}function sq(f,g,w){f=Yt(f),g=_i(g);var T=f.length;w=w===n?T:hl(ut(w),0,T);var I=w;return w-=g.length,w>=0&&f.slice(w,I)==g}function aq(f){return f=Yt(f),f&&ll.test(f)?f.replace(vr,XB):f}function lq(f){return f=Yt(f),f&&rr.test(f)?f.replace(ur,"\\$&"):f}var cq=Zc(function(f,g,w){return f+(w?"-":"")+g.toLowerCase()}),uq=Zc(function(f,g,w){return f+(w?" ":"")+g.toLowerCase()}),dq=HP("toLowerCase");function fq(f,g,w){f=Yt(f),g=ut(g);var T=g?Gc(f):0;if(!g||T>=g)return f;var I=(g-T)/2;return Tg(gg(I),w)+f+Tg(pg(I),w)}function hq(f,g,w){f=Yt(f),g=ut(g);var T=g?Gc(f):0;return g&&T<g?f+Tg(g-T,w):f}function pq(f,g,w){f=Yt(f),g=ut(g);var T=g?Gc(f):0;return g&&T<g?Tg(g-T,w)+f:f}function gq(f,g,w){return w||g==null?g=0:g&&(g=+g),SH(Yt(f).replace(bn,""),g||0)}function mq(f,g,w){return(w?Fr(f,g,w):g===n)?g=1:g=ut(g),kv(Yt(f),g)}function bq(){var f=arguments,g=Yt(f[0]);return f.length<3?g:g.replace(f[1],f[2])}var yq=Zc(function(f,g,w){return f+(w?"_":"")+g.toLowerCase()});function vq(f,g,w){return w&&typeof w!="number"&&Fr(f,g,w)&&(g=w=n),w=w===n?Y:w>>>0,w?(f=Yt(f),f&&(typeof g=="string"||g!=null&&!nx(g))&&(g=_i(g),!g&&Uc(f))?ha(po(f),0,w):f.split(g,w)):[]}var xq=Zc(function(f,g,w){return f+(w?" ":"")+ox(g)});function wq(f,g,w){return f=Yt(f),w=w==null?0:hl(ut(w),0,f.length),g=_i(g),f.slice(w,w+g.length)==g}function Sq(f,g,w){var T=z.templateSettings;w&&Fr(f,g,w)&&(g=n),f=Yt(f),g=zg({},g,T,KP);var I=zg({},g.imports,T.imports,KP),H=or(I),Q=mv(I,H),re,ue,ve=0,xe=g.interpolate||Dt,Se="__p += '",ke=yv((g.escape||Dt).source+"|"+xe.source+"|"+(xe===Bt?kt:Dt).source+"|"+(g.evaluate||Dt).source+"|$","g"),He="//# sourceURL="+(tn.call(g,"sourceURL")?(g.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++DB+"]")+`
|
|
75
|
-
`;f.replace(ke,function(Ge,Rt,It,Ei,jr,Ri){return It||(It=Ei),Se+=f.slice(ve,Ri).replace(dn,QB),Rt&&(re=!0,Se+=`' +
|
|
76
|
-
__e(`+Rt+`) +
|
|
77
|
-
'`),jr&&(ue=!0,Se+=`';
|
|
78
|
-
`+jr+`;
|
|
79
|
-
__p += '`),It&&(Se+=`' +
|
|
80
|
-
((__t = (`+It+`)) == null ? '' : __t) +
|
|
81
|
-
'`),ve=Ri+Ge.length,Ge}),Se+=`';
|
|
82
|
-
`;var Ue=tn.call(g,"variable")&&g.variable;if(!Ue)Se=`with (obj) {
|
|
83
|
-
`+Se+`
|
|
84
|
-
}
|
|
85
|
-
`;else if(Oe.test(Ue))throw new ot(a);Se=(ue?Se.replace(Kn,""):Se).replace(Ui,"$1").replace(yr,"$1;"),Se="function("+(Ue||"obj")+`) {
|
|
86
|
-
`+(Ue?"":`obj || (obj = {});
|
|
87
|
-
`)+"var __t, __p = ''"+(re?", __e = _.escape":"")+(ue?`, __j = Array.prototype.join;
|
|
88
|
-
function print() { __p += __j.call(arguments, '') }
|
|
89
|
-
`:`;
|
|
90
|
-
`)+Se+`return __p
|
|
91
|
-
}`;var gt=BT(function(){return Vt(H,He+"return "+Se).apply(n,Q)});if(gt.source=Se,tx(gt))throw gt;return gt}function _q(f){return Yt(f).toLowerCase()}function Cq(f){return Yt(f).toUpperCase()}function Eq(f,g,w){if(f=Yt(f),f&&(w||g===n))return X2(f);if(!f||!(g=_i(g)))return f;var T=po(f),I=po(g),H=Q2(T,I),Q=J2(T,I)+1;return ha(T,H,Q).join("")}function Rq(f,g,w){if(f=Yt(f),f&&(w||g===n))return f.slice(0,eP(f)+1);if(!f||!(g=_i(g)))return f;var T=po(f),I=J2(T,po(g))+1;return ha(T,0,I).join("")}function Pq(f,g,w){if(f=Yt(f),f&&(w||g===n))return f.replace(bn,"");if(!f||!(g=_i(g)))return f;var T=po(f),I=Q2(T,po(g));return ha(T,I).join("")}function Tq(f,g){var w=F,T=j;if(Tn(g)){var I="separator"in g?g.separator:I;w="length"in g?ut(g.length):w,T="omission"in g?_i(g.omission):T}f=Yt(f);var H=f.length;if(Uc(f)){var Q=po(f);H=Q.length}if(w>=H)return f;var re=w-Gc(T);if(re<1)return T;var ue=Q?ha(Q,0,re).join(""):f.slice(0,re);if(I===n)return ue+T;if(Q&&(re+=ue.length-re),nx(I)){if(f.slice(re).search(I)){var ve,xe=ue;for(I.global||(I=yv(I.source,Yt($t.exec(I))+"g")),I.lastIndex=0;ve=I.exec(xe);)var Se=ve.index;ue=ue.slice(0,Se===n?re:Se)}}else if(f.indexOf(_i(I),re)!=re){var ke=ue.lastIndexOf(I);ke>-1&&(ue=ue.slice(0,ke))}return ue+T}function Mq(f){return f=Yt(f),f&&Ir.test(f)?f.replace(Lo,iH):f}var Oq=Zc(function(f,g,w){return f+(w?" ":"")+g.toUpperCase()}),ox=HP("toUpperCase");function zT(f,g,w){return f=Yt(f),g=w?n:g,g===n?ZB(f)?aH(f):WB(f):f.match(g)||[]}var BT=wt(function(f,g){try{return wi(f,n,g)}catch(w){return tx(w)?w:new ot(w)}}),Dq=Es(function(f,g){return qi(g,function(w){w=$o(w),_s(f,w,Zv(f[w],f))}),f});function Aq(f){var g=f==null?0:f.length,w=We();return f=g?Pn(f,function(T){if(typeof T[1]!="function")throw new Yi(s);return[w(T[0]),T[1]]}):[],wt(function(T){for(var I=-1;++I<g;){var H=f[I];if(wi(H[0],this,T))return wi(H[1],this,T)}})}function kq(f){return iV(Xi(f,d))}function sx(f){return function(){return f}}function Iq(f,g){return f==null||f!==f?g:f}var Nq=WP(),Lq=WP(!0);function ni(f){return f}function ax(f){return xP(typeof f=="function"?f:Xi(f,d))}function Fq(f){return SP(Xi(f,d))}function jq(f,g){return _P(f,Xi(g,d))}var $q=wt(function(f,g){return function(w){return tf(w,f,g)}}),zq=wt(function(f,g){return function(w){return tf(f,w,g)}});function lx(f,g,w){var T=or(g),I=wg(g,T);w==null&&!(Tn(g)&&(I.length||!T.length))&&(w=g,g=f,f=this,I=wg(g,or(g)));var H=!(Tn(w)&&"chain"in w)||!!w.chain,Q=Ps(f);return qi(I,function(re){var ue=g[re];f[re]=ue,Q&&(f.prototype[re]=function(){var ve=this.__chain__;if(H||ve){var xe=f(this.__wrapped__),Se=xe.__actions__=Zr(this.__actions__);return Se.push({func:ue,args:arguments,thisArg:f}),xe.__chain__=ve,xe}return ue.apply(f,aa([this.value()],arguments))})}),f}function Bq(){return dr._===this&&(dr._=hH),this}function cx(){}function Hq(f){return f=ut(f),wt(function(g){return CP(g,f)})}var Vq=zv(Pn),Wq=zv(U2),Uq=zv(dv);function HT(f){return qv(f)?fv($o(f)):wV(f)}function Gq(f){return function(g){return f==null?n:pl(f,g)}}var qq=GP(),Yq=GP(!0);function ux(){return[]}function dx(){return!1}function Kq(){return{}}function Xq(){return""}function Qq(){return!0}function Jq(f,g){if(f=ut(f),f<1||f>W)return[];var w=Y,T=xr(f,Y);g=We(g),f-=Y;for(var I=gv(T,g);++w<f;)g(w);return I}function Zq(f){return at(f)?Pn(f,$o):Ci(f)?[f]:Zr(lT(Yt(f)))}function eY(f){var g=++dH;return Yt(f)+g}var tY=Pg(function(f,g){return f+g},0),nY=Bv("ceil"),rY=Pg(function(f,g){return f/g},1),iY=Bv("floor");function oY(f){return f&&f.length?xg(f,ni,Rv):n}function sY(f,g){return f&&f.length?xg(f,We(g,2),Rv):n}function aY(f){return Y2(f,ni)}function lY(f,g){return Y2(f,We(g,2))}function cY(f){return f&&f.length?xg(f,ni,Ov):n}function uY(f,g){return f&&f.length?xg(f,We(g,2),Ov):n}var dY=Pg(function(f,g){return f*g},1),fY=Bv("round"),hY=Pg(function(f,g){return f-g},0);function pY(f){return f&&f.length?pv(f,ni):0}function gY(f,g){return f&&f.length?pv(f,We(g,2)):0}return z.after=FU,z.ary=vT,z.assign=CG,z.assignIn=kT,z.assignInWith=zg,z.assignWith=EG,z.at=RG,z.before=xT,z.bind=Zv,z.bindAll=Dq,z.bindKey=wT,z.castArray=KU,z.chain=mT,z.chunk=iW,z.compact=oW,z.concat=sW,z.cond=Aq,z.conforms=kq,z.constant=sx,z.countBy=pU,z.create=PG,z.curry=ST,z.curryRight=_T,z.debounce=CT,z.defaults=TG,z.defaultsDeep=MG,z.defer=jU,z.delay=$U,z.difference=aW,z.differenceBy=lW,z.differenceWith=cW,z.drop=uW,z.dropRight=dW,z.dropRightWhile=fW,z.dropWhile=hW,z.fill=pW,z.filter=mU,z.flatMap=vU,z.flatMapDeep=xU,z.flatMapDepth=wU,z.flatten=fT,z.flattenDeep=gW,z.flattenDepth=mW,z.flip=zU,z.flow=Nq,z.flowRight=Lq,z.fromPairs=bW,z.functions=LG,z.functionsIn=FG,z.groupBy=SU,z.initial=vW,z.intersection=xW,z.intersectionBy=wW,z.intersectionWith=SW,z.invert=$G,z.invertBy=zG,z.invokeMap=CU,z.iteratee=ax,z.keyBy=EU,z.keys=or,z.keysIn=ti,z.map=Ig,z.mapKeys=HG,z.mapValues=VG,z.matches=Fq,z.matchesProperty=jq,z.memoize=Lg,z.merge=WG,z.mergeWith=IT,z.method=$q,z.methodOf=zq,z.mixin=lx,z.negate=Fg,z.nthArg=Hq,z.omit=UG,z.omitBy=GG,z.once=BU,z.orderBy=RU,z.over=Vq,z.overArgs=HU,z.overEvery=Wq,z.overSome=Uq,z.partial=ex,z.partialRight=ET,z.partition=PU,z.pick=qG,z.pickBy=NT,z.property=HT,z.propertyOf=Gq,z.pull=RW,z.pullAll=pT,z.pullAllBy=PW,z.pullAllWith=TW,z.pullAt=MW,z.range=qq,z.rangeRight=Yq,z.rearg=VU,z.reject=OU,z.remove=OW,z.rest=WU,z.reverse=Qv,z.sampleSize=AU,z.set=KG,z.setWith=XG,z.shuffle=kU,z.slice=DW,z.sortBy=LU,z.sortedUniq=jW,z.sortedUniqBy=$W,z.split=vq,z.spread=UU,z.tail=zW,z.take=BW,z.takeRight=HW,z.takeRightWhile=VW,z.takeWhile=WW,z.tap=oU,z.throttle=GU,z.thru=kg,z.toArray=OT,z.toPairs=LT,z.toPairsIn=FT,z.toPath=Zq,z.toPlainObject=AT,z.transform=QG,z.unary=qU,z.union=UW,z.unionBy=GW,z.unionWith=qW,z.uniq=YW,z.uniqBy=KW,z.uniqWith=XW,z.unset=JG,z.unzip=Jv,z.unzipWith=gT,z.update=ZG,z.updateWith=eq,z.values=nu,z.valuesIn=tq,z.without=QW,z.words=zT,z.wrap=YU,z.xor=JW,z.xorBy=ZW,z.xorWith=eU,z.zip=tU,z.zipObject=nU,z.zipObjectDeep=rU,z.zipWith=iU,z.entries=LT,z.entriesIn=FT,z.extend=kT,z.extendWith=zg,lx(z,z),z.add=tY,z.attempt=BT,z.camelCase=oq,z.capitalize=jT,z.ceil=nY,z.clamp=nq,z.clone=XU,z.cloneDeep=JU,z.cloneDeepWith=ZU,z.cloneWith=QU,z.conformsTo=eG,z.deburr=$T,z.defaultTo=Iq,z.divide=rY,z.endsWith=sq,z.eq=mo,z.escape=aq,z.escapeRegExp=lq,z.every=gU,z.find=bU,z.findIndex=uT,z.findKey=OG,z.findLast=yU,z.findLastIndex=dT,z.findLastKey=DG,z.floor=iY,z.forEach=bT,z.forEachRight=yT,z.forIn=AG,z.forInRight=kG,z.forOwn=IG,z.forOwnRight=NG,z.get=rx,z.gt=tG,z.gte=nG,z.has=jG,z.hasIn=ix,z.head=hT,z.identity=ni,z.includes=_U,z.indexOf=yW,z.inRange=rq,z.invoke=BG,z.isArguments=bl,z.isArray=at,z.isArrayBuffer=rG,z.isArrayLike=ei,z.isArrayLikeObject=$n,z.isBoolean=iG,z.isBuffer=pa,z.isDate=oG,z.isElement=sG,z.isEmpty=aG,z.isEqual=lG,z.isEqualWith=cG,z.isError=tx,z.isFinite=uG,z.isFunction=Ps,z.isInteger=RT,z.isLength=jg,z.isMap=PT,z.isMatch=dG,z.isMatchWith=fG,z.isNaN=hG,z.isNative=pG,z.isNil=mG,z.isNull=gG,z.isNumber=TT,z.isObject=Tn,z.isObjectLike=Dn,z.isPlainObject=lf,z.isRegExp=nx,z.isSafeInteger=bG,z.isSet=MT,z.isString=$g,z.isSymbol=Ci,z.isTypedArray=tu,z.isUndefined=yG,z.isWeakMap=vG,z.isWeakSet=xG,z.join=_W,z.kebabCase=cq,z.last=Ji,z.lastIndexOf=CW,z.lowerCase=uq,z.lowerFirst=dq,z.lt=wG,z.lte=SG,z.max=oY,z.maxBy=sY,z.mean=aY,z.meanBy=lY,z.min=cY,z.minBy=uY,z.stubArray=ux,z.stubFalse=dx,z.stubObject=Kq,z.stubString=Xq,z.stubTrue=Qq,z.multiply=dY,z.nth=EW,z.noConflict=Bq,z.noop=cx,z.now=Ng,z.pad=fq,z.padEnd=hq,z.padStart=pq,z.parseInt=gq,z.random=iq,z.reduce=TU,z.reduceRight=MU,z.repeat=mq,z.replace=bq,z.result=YG,z.round=fY,z.runInContext=le,z.sample=DU,z.size=IU,z.snakeCase=yq,z.some=NU,z.sortedIndex=AW,z.sortedIndexBy=kW,z.sortedIndexOf=IW,z.sortedLastIndex=NW,z.sortedLastIndexBy=LW,z.sortedLastIndexOf=FW,z.startCase=xq,z.startsWith=wq,z.subtract=hY,z.sum=pY,z.sumBy=gY,z.template=Sq,z.times=Jq,z.toFinite=Ts,z.toInteger=ut,z.toLength=DT,z.toLower=_q,z.toNumber=Zi,z.toSafeInteger=_G,z.toString=Yt,z.toUpper=Cq,z.trim=Eq,z.trimEnd=Rq,z.trimStart=Pq,z.truncate=Tq,z.unescape=Mq,z.uniqueId=eY,z.upperCase=Oq,z.upperFirst=ox,z.each=bT,z.eachRight=yT,z.first=hT,lx(z,function(){var f={};return Fo(z,function(g,w){tn.call(z.prototype,w)||(f[w]=g)}),f}(),{chain:!1}),z.VERSION=r,qi(["bind","bindKey","curry","curryRight","partial","partialRight"],function(f){z[f].placeholder=z}),qi(["drop","take"],function(f,g){At.prototype[f]=function(w){w=w===n?1:Zn(ut(w),0);var T=this.__filtered__&&!g?new At(this):this.clone();return T.__filtered__?T.__takeCount__=xr(w,T.__takeCount__):T.__views__.push({size:xr(w,Y),type:f+(T.__dir__<0?"Right":"")}),T},At.prototype[f+"Right"]=function(w){return this.reverse()[f](w).reverse()}}),qi(["filter","map","takeWhile"],function(f,g){var w=g+1,T=w==V||w==U;At.prototype[f]=function(I){var H=this.clone();return H.__iteratees__.push({iteratee:We(I,3),type:w}),H.__filtered__=H.__filtered__||T,H}}),qi(["head","last"],function(f,g){var w="take"+(g?"Right":"");At.prototype[f]=function(){return this[w](1).value()[0]}}),qi(["initial","tail"],function(f,g){var w="drop"+(g?"":"Right");At.prototype[f]=function(){return this.__filtered__?new At(this):this[w](1)}}),At.prototype.compact=function(){return this.filter(ni)},At.prototype.find=function(f){return this.filter(f).head()},At.prototype.findLast=function(f){return this.reverse().find(f)},At.prototype.invokeMap=wt(function(f,g){return typeof f=="function"?new At(this):this.map(function(w){return tf(w,f,g)})}),At.prototype.reject=function(f){return this.filter(Fg(We(f)))},At.prototype.slice=function(f,g){f=ut(f);var w=this;return w.__filtered__&&(f>0||g<0)?new At(w):(f<0?w=w.takeRight(-f):f&&(w=w.drop(f)),g!==n&&(g=ut(g),w=g<0?w.dropRight(-g):w.take(g-f)),w)},At.prototype.takeRightWhile=function(f){return this.reverse().takeWhile(f).reverse()},At.prototype.toArray=function(){return this.take(Y)},Fo(At.prototype,function(f,g){var w=/^(?:filter|find|map|reject)|While$/.test(g),T=/^(?:head|last)$/.test(g),I=z[T?"take"+(g=="last"?"Right":""):g],H=T||/^find/.test(g);I&&(z.prototype[g]=function(){var Q=this.__wrapped__,re=T?[1]:arguments,ue=Q instanceof At,ve=re[0],xe=ue||at(Q),Se=function(Rt){var It=I.apply(z,aa([Rt],re));return T&&ke?It[0]:It};xe&&w&&typeof ve=="function"&&ve.length!=1&&(ue=xe=!1);var ke=this.__chain__,He=!!this.__actions__.length,Ue=H&&!ke,gt=ue&&!He;if(!H&&xe){Q=gt?Q:new At(this);var Ge=f.apply(Q,re);return Ge.__actions__.push({func:kg,args:[Se],thisArg:n}),new Ki(Ge,ke)}return Ue&>?f.apply(this,re):(Ge=this.thru(Se),Ue?T?Ge.value()[0]:Ge.value():Ge)})}),qi(["pop","push","shift","sort","splice","unshift"],function(f){var g=og[f],w=/^(?:push|sort|unshift)$/.test(f)?"tap":"thru",T=/^(?:pop|shift)$/.test(f);z.prototype[f]=function(){var I=arguments;if(T&&!this.__chain__){var H=this.value();return g.apply(at(H)?H:[],I)}return this[w](function(Q){return g.apply(at(Q)?Q:[],I)})}}),Fo(At.prototype,function(f,g){var w=z[g];if(w){var T=w.name+"";tn.call(Xc,T)||(Xc[T]=[]),Xc[T].push({name:g,func:w})}}),Xc[Rg(n,x).name]=[{name:"wrapper",func:n}],At.prototype.clone=MH,At.prototype.reverse=OH,At.prototype.value=DH,z.prototype.at=sU,z.prototype.chain=aU,z.prototype.commit=lU,z.prototype.next=cU,z.prototype.plant=dU,z.prototype.reverse=fU,z.prototype.toJSON=z.prototype.valueOf=z.prototype.value=hU,z.prototype.first=z.prototype.head,Yd&&(z.prototype[Yd]=uU),z},qc=lH();cl?((cl.exports=qc)._=qc,av._=qc):dr._=qc}).call(Ca)})(wb,wb.exports);var Lf=wb.exports;const Jl=Oc(Lf);function lM({id:e,layouts:t,initialHeight:n,y:r,x:i,w:o,minH:s}){const a={i:e,x:i??0,y:r??1/0,w:o||20,h:n||35,minW:6,minH:s||10},l=t?{...t}:{};return Y_.forEach(c=>{l[c]||(l[c]=[]);const u=l[c].reduce((d,p)=>Math.max(d,p.y+p.h),0);a.y=a.y===1/0?u:a.y,l[c].push({...a})}),l}function cM(e,t){if(!t)return;const n={...t};return Y_.forEach(r=>{n[r]&&(n[r]=n[r].filter(i=>i.i!==e))}),n}function Q_(e){return ye.getState().dashboard.globalCacheConfig}const ye=JI()(oN((e,t)=>({isSessionExpired:!1,currentBreakpoint:"lg",dashboard:{id:"",style:xb},showContext:!1,selectedSheetId:null,selectedCardId:null,selectedFrameId:null,selectedCard:null,showFilters:!1,isDashboardEditing:!1,isVisualEditing:!1,showDashboardJSON:!1,filteringCards:[],actions:{setInitStore:()=>{e(n=>{n.isSessionExpired=!1,n.currentBreakpoint="lg",n.dashboard={id:"",style:xb},n.showContext=!1,n.selectedSheetId=null,n.selectedCardId=null,n.selectedFrameId=null,n.selectedCard=null,n.showFilters=!1,n.isDashboardEditing=!1,n.isVisualEditing=!1,n.showDashboardJSON=!1,n.filteringCards=[],n.selectedLensId=void 0,n.filterValues=void 0})},setGlobalCacheConfig:n=>{e(r=>{r.dashboard.globalCacheConfig=n})},setLenses:n=>{e(r=>{r.lenses=n})},setSelectedLensId:n=>{e(r=>{r.selectedLensId=n})},deleteSheet:n=>{e(r=>{var o,s,a,l,c,u,d,p;const i=(o=r.dashboard.sheets)==null?void 0:o.findIndex(h=>h.id===n);if(i!==void 0&&i>-1){(s=r.dashboard.sheets)==null||s.splice(i,1);const h=(a=r.dashboard.filters)==null?void 0:a.filter(b=>b.sheetId===n),m=(l=r.filterValues)==null?void 0:l.filter(b=>h==null?void 0:h.some(v=>v.id===b.filterId));r.filterValues=(c=r.filterValues)==null?void 0:c.filter(b=>!(m!=null&&m.some(v=>v.filterId===b.filterId))),r.dashboard.filters=(u=r.dashboard.filters)==null?void 0:u.filter(b=>b.sheetId!==n),r.selectedSheetId=(p=(d=r.dashboard.sheets)==null?void 0:d[0])==null?void 0:p.id}})},addSheet:n=>{e(r=>{r.dashboard.sheets||(r.dashboard.sheets=[]);const i=r.dashboard.filters;let o={};i==null||i.forEach(a=>{Y_.forEach(l=>{o!=null&&o[l]||(o={...o,[l]:[]});const c={i:a.id,x:0,y:0,w:10,h:8};o[l].push(c)})});const s={...n,layouts:o};r.dashboard.sheets.push(s)})},setGlobalStyle:n=>{e(r=>{r.dashboard.globalStyle=n})},setAIScopeTables:n=>{e(r=>{r.dashboard.aiScopeTables=n})},setIsSessionExpired:n=>{e(()=>({isSessionExpired:n}))},setCardPython:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===i.selectedSheetId);o&&Lf.forEach(o.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(d=>d.id===n);c&&(c.python=r)})})},addBaseQuery:n=>{e(r=>{var i;r.dashboard.baseQueries||(r.dashboard.baseQueries=[]),(i=r.dashboard.baseQueries)==null||i.push(n)})},removeBaseQuery:n=>{e(r=>{var o,s;const i=(o=r.dashboard.baseQueries)==null?void 0:o.findIndex(a=>a.id===n);i!=null&&i>-1&&((s=r.dashboard.baseQueries)==null||s.splice(i,1))})},setBaseQueries:n=>{e(r=>{r.dashboard.baseQueries=n})},setCurrentBreakpoint:n=>{e(()=>({currentBreakpoint:n}))},setFilteringCards:n=>{e(()=>({filteringCards:n}))},addFilteringCard:n=>{e(r=>{var i;(i=r.filteringCards)==null||i.push(n)})},removeFilteringCard:n=>{e(r=>{var o,s;const i=(o=r.filteringCards)==null?void 0:o.findIndex(a=>a.id===n.id);i!==void 0&&i>-1&&((s=r.filteringCards)==null||s.splice(i,1))})},setCustomCards:n=>{e(r=>{r.dashboard.customCards=n})},setAuthToken:n=>{e(()=>({authToken:n}))},setThemeStyle:n=>{e(()=>({themeStyle:n}))},setDashboard:n=>e({dashboard:n}),setDashboardWithFilterValues:(n,r)=>{e(i=>{i.dashboard=n,i.filterValues=r})},setDashboardTheme:n=>{e(r=>{r.theme=n})},setSheets:n=>{e(r=>{r.dashboard&&(r.dashboard.sheets=n)})},setSheetTitle:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);o&&(o.title=r)})},setCardTitle:(n,r,i)=>{e(o=>{var a,l;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&Lf.forEach(s.frames,c=>{var d;const u=(d=c.cards)==null?void 0:d.find(p=>p.id===r);u&&(u.title=i)})})},setCardInfo:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===i.selectedSheetId);o&&Lf.forEach(o.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(d=>d.id===n);c&&(c.info=r)})})},setCardDescription:(n,r,i)=>{e(o=>{var a,l;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&Lf.forEach(s.frames,c=>{var d;const u=(d=c.cards)==null?void 0:d.find(p=>p.id===r);u&&(u.description=i)})})},setCardSql:(n,r,i)=>{e(o=>{var a,l,c,u;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(d=>d.id===n);if(s){const d=(c=s.cards)==null?void 0:c.find(p=>p.id===r);d&&(d.sql=i,(u=o.onUpdateCard)==null||u.call(o,d,n))}})},setSheetLayout:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);o&&(o.layout=r)})},setSheetLayouts:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);o&&(o.layouts=r)})},setShowContext:n=>{e(()=>({showContext:n}))},setShowFilters:n=>{e(()=>({showFilters:n}))},setFilterValues:n=>{e(()=>({filterValues:n}))},addOrUpdateFilterValue:n=>{e(r=>{if(r.filterValues){const i=r.filterValues.findIndex(o=>o.filterId===n.filterId);i>-1?r.filterValues.splice(i,1,n):r.filterValues.push(n)}else r.filterValues=[n]})},addOrUpdateFilterValues:n=>{e(r=>{r.filterValues?n.forEach(i=>{var s,a,l;const o=(s=r==null?void 0:r.filterValues)==null?void 0:s.findIndex(c=>c.filterId===i.filterId);o!==void 0&&o>-1?(a=r.filterValues)==null||a.splice(o,1,i):(l=r.filterValues)==null||l.push(i)}):r.filterValues=n})},removeFilterValues:n=>{e(r=>{if(r.filterValues){const i=r.filterValues.filter(o=>o.filterId!==n&&!o.filterId.startsWith(n));r.filterValues=i}})},replaceFilterValue:n=>{e(r=>{if(r.filterValues){const i=r.filterValues.findIndex(o=>o.filterId===n.filterId);i>-1&&r.filterValues.splice(i,1,n)}})},addFilter:n=>{e(r=>{var o,s;r.dashboard.filters?(o=r.dashboard.filters)==null||o.push(n):r.dashboard.filters=[n],(s=r.dashboard.sheets)==null||s.find(a=>a.id===r.selectedSheetId);const i=r.dashboard.sheets;i==null||i.forEach(a=>{lM({id:n.id,layouts:a.layouts,y:0,initialHeight:8,minH:7,w:10})})})},removeFilter:n=>{e(r=>{var i,o,s;if(r.dashboard.filters){const a=(i=r.dashboard.filters)==null?void 0:i.findIndex(l=>l.id===n);if(a>-1){(o=r.dashboard.filters)==null||o.splice(a,1),(s=r.dashboard.sheets)==null||s.find(c=>c.id===r.selectedSheetId);const l=r.dashboard.sheets;l==null||l.forEach(c=>{const u=cM(n,c.layouts);c.layouts=u})}}})},updateFrameCard:(n,r,i)=>{e(o=>{var l,c,u,d,p;const s=(c=(l=o.dashboard)==null?void 0:l.sheets)==null?void 0:c.find(h=>h.id===n);if(!s)return;const a=(u=s==null?void 0:s.frames)==null?void 0:u.find(h=>h.id===r);if(a){const h=(d=a.cards)==null?void 0:d.findIndex(m=>m.id===i.id);h>-1&&((p=a.cards)==null||p.splice(h,1,i))}})},updateFilter:n=>{e(r=>{var i,o;if(r.dashboard.filters){const s=(i=r.dashboard.filters)==null?void 0:i.findIndex(a=>a.id===n.id);s>-1&&((o=r.dashboard.filters)==null||o.splice(s,1,n))}})},updateFilterId:(n,r)=>{e(i=>{var a,l;const o=(a=i.dashboard.filters)==null?void 0:a.find(c=>c.id===n),s=(l=i.dashboard.filters)==null?void 0:l.some(c=>c.id===r);o&&!s&&(o.id=r)})},setIsDashboardEditing:n=>{e(()=>({isDashboardEditing:n}))},setShowDashboardJSON:n=>{e(()=>({showDashboardJSON:n}))},setIsVisualEditing:n=>{e(()=>({isVisualEditing:n}))},addFrame:(n,r,i)=>{e(o=>{var a,l,c,u;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(d=>d.id===n);if(s){s.frames||(s.frames=[]),(c=s.frames)==null||c.push(r);let d=1/0;const p=0;i==="start"&&(d=0);const h=lM({id:r.id,layouts:s.layouts,minH:10,x:p,y:d});s.layouts=h,(u=o.onAddFrame)==null||u.call(o,r,n)}})},removeFrame:(n,r)=>{e(i=>{var s,a,l,c,u;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(d=>d.id===n);if(o){const d=(l=o.frames)==null?void 0:l.findIndex(p=>p.id===r);console.log(d),typeof d=="number"&&d>-1&&((c=o.frames)==null||c.splice(d,1),(u=o.layout)==null||u.splice(d,1),cM(r,o.layouts))}})},updateFrame:(n,r)=>{e(i=>{var a,l,c,u,d;const o=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(p=>p.id===n),s=(c=o==null?void 0:o.frames)==null?void 0:c.findIndex(p=>p.id===r.id);o&&((u=o.frames)==null||u.splice(s,1,r)),(d=i.onAcceptChanges)==null||d.call(i,r,i.dashboard)})},updateCard:(n,r)=>{e(i=>{var a,l,c,u,d;const o=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(p=>p.id===n),s=(c=o==null?void 0:o.cards)==null?void 0:c.findIndex(p=>p.id===r.id);o&&((u=o.cards)==null||u.splice(s,1,r),(d=i.onUpdateCard)==null||d.call(i,r,n))})},removeCard:(n,r)=>{e(i=>{var a,l,c,u,d,p;const o=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(h=>h.id===n),s=(c=o==null?void 0:o.cards)==null?void 0:c.findIndex(h=>h.id===r.id);o&&((u=o.cards)==null||u.splice(s,1),(d=o.layout)==null||d.splice(s,1),(p=i.onRemoveCard)==null||p.call(i,r,n))})},setStyle:n=>{e(r=>{r.dashboard&&(r.dashboard.style=n)})},setSelectedCardId:(n,r)=>{e(i=>{var s,a,l;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===n);o&&(((l=o.cards)==null?void 0:l.find(u=>u.id===r))?i.selectedCardId=r:i.selectedCardId=null)})},setSelectedFrameId:n=>{e(r=>{var o,s;((s=(o=r.dashboard)==null?void 0:o.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId))&&(r.selectedFrameId=n)})},setSelectedSheetId:n=>{e(r=>{var o,s;((s=(o=r.dashboard)==null?void 0:o.sheets)==null?void 0:s.find(a=>a.id===n))&&(r.selectedSheetId=n)})},setOnSaveFunction:n=>{e(()=>({onSaveFunction:n}))},setOnAddCard:n=>{e(()=>({onAddCard:n}))},setOnAcceptChanges:n=>{e(()=>({onAcceptChanges:n}))},setOnUpdateCard:n=>{e(()=>({onUpdateCard:n}))},setOnRemoveCard:n=>{e(()=>({onRemoveCard:n}))},setOnEvent:n=>{e(()=>({onEvent:n}))},getDashboard:()=>t().dashboard,getSelectedSheet:()=>{var n,r;return(r=(n=t().dashboard)==null?void 0:n.sheets)==null?void 0:r.find(i=>i.id===t().selectedSheetId)},getCardFrame:n=>{var i,o;const r=(i=t().dashboard)==null?void 0:i.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a){for(let l=0;l<a.length;l++)if((o=a[l].cards)==null?void 0:o.find(u=>u.id===n))return a[l]}}},getSelectedFrame:()=>{var r,i,o;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(s=>s.id===t().selectedSheetId);return(o=n==null?void 0:n.frames)==null?void 0:o.find(s=>s.id===t().selectedFrameId)},getCard:n=>{var i,o;const r=(i=t().dashboard)==null?void 0:i.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a)for(let l=0;l<a.length;l++){const c=(o=a[l].cards)==null?void 0:o.find(u=>u.id===n);if(c)return c}}},getSelectedSheetLayout:()=>{var r,i;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(o=>o.id===t().selectedSheetId);return n==null?void 0:n.layout},getSelectedSheetLayouts:()=>{var r,i;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(o=>o.id===t().selectedSheetId);return n==null?void 0:n.layouts},getStyle:()=>{var n;return(n=t().dashboard)==null?void 0:n.style},getCardSheet(n){var i,o;const r=(i=t().dashboard)==null?void 0:i.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a){for(let l=0;l<a.length;l++)if((o=a[l].cards)==null?void 0:o.find(u=>u.id===n))return r[s]}}},handleDataPointClickAction:(n,r)=>{jK({card:n,dataPoint:r,set:e,get:t})}}}))),Hn=()=>ye(e=>e.actions);async function $K(e,t){const n=t.slice(0,16),r=new TextEncoder,i=await window.crypto.subtle.importKey("raw",r.encode(n),{name:"PBKDF2"},!1,["deriveKey"]),o=await window.crypto.subtle.deriveKey({name:"PBKDF2",salt:r.encode(n),iterations:1e5,hash:"SHA-256"},i,{name:"AES-GCM",length:256},!1,["encrypt"]),s=window.crypto.getRandomValues(new Uint8Array(12)),a=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:s},o,r.encode(e)),l=new Uint8Array(s.length+a.byteLength);return l.set(s,0),l.set(new Uint8Array(a),s.length),{payload:btoa(String.fromCharCode(...l))}}async function dN(e,t){const n=t.slice(0,16),r=new TextEncoder,i=new TextDecoder,o=await window.crypto.subtle.importKey("raw",r.encode(n),{name:"PBKDF2"},!1,["deriveKey"]),s=await window.crypto.subtle.deriveKey({name:"PBKDF2",salt:r.encode(n),iterations:1e5,hash:"SHA-256"},o,{name:"AES-GCM",length:256},!1,["decrypt"]),a=Uint8Array.from(atob(e),p=>p.charCodeAt(0)),l=a.slice(0,12),c=a.slice(a.length-16),u=a.slice(12,a.length-16),d=new Uint8Array(u.length+c.length);d.set(u),d.set(c,u.length);try{const p=await window.crypto.subtle.decrypt({name:"AES-GCM",iv:l},s,d);return{decryptedData:i.decode(p)}}catch(p){throw new Error(`Decryption failed: ${p}`)}}function be(...e){return JY(mb(e))}const zK=e=>Object.keys(e).length===0;async function BK(e,t,n={}){try{const r=new URLSearchParams(n).toString(),i=`${e}?${r}`,o=await fetch(i,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(!o.ok){const a=await o.json();throw new Error((a==null?void 0:a.error)||`HTTP error! status: ${o.status}`)}return await o.json()}catch(r){throw console.error("Error during fetch:",r),r}}async function Dy(e,t,n={}){try{const r=JSON.stringify(n),i=await $K(r,t),o=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(i)});if(!o.ok)return o.json().then(a=>{throw console.log(a.detail||"Unknown error occurred"),new Error((a==null?void 0:a.error)||`HTTP error! status: ${o.status}`)});const s=await o.json();if(s.payload){const a=await dN(s.payload,t);return JSON.parse(a.decryptedData)}return s}catch(r){throw console.error("Error during fetch:",r),r}}function HK(e){if(!e)return{tenantId:"",endUserId:""};const t=H_(e);return{tenantId:t==null?void 0:t.tenantId,endUserId:t==null?void 0:t.endUserId}}function VK(e){if(!e)return;const t=H_(e);if(t.params&&t.params.currencyFormat)return t.params.currencyFormat}function fN(e){return e?H_(e).params:void 0}function WK(e){return e.charAt(0).toUpperCase()+e.slice(1)}const eh="focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";async function UK(){var i,o;const e=(o=(i=ye.getState())==null?void 0:i.authToken)==null?void 0:o.accessToken;if(!e)return;const n=await fetch("https://semaphor.cloud/api/v1/invalidate-token",{method:"POST",headers:{Authorization:`Bearer ${e}`}});if(!n.ok)throw new Error("Failed to invalidate token");const r=await n.json();return console.log("invalidateToken",r),r}async function GK(e,t={}){if(!e)return null;let n="https://semaphor.cloud/api/v1/dashboard";const r=Object.fromEntries(Object.entries(t).filter(([a,l])=>l!==void 0)),i=new URLSearchParams(r).toString();i&&(n+=`?${i}`);let s=await(await fetch(n,{headers:{Authorization:`Bearer ${e}`}})).json();if("payload"in s){const a=await dN(atob(s.payload),e);s=JSON.parse(a.decryptedData)}return s}async function qK(e){return e?await(await fetch("https://semaphor.cloud/api/v1/plugins",{headers:{Authorization:`Bearer ${e}`}})).json():null}const YK={theme:"system",setTheme:()=>null},hN=P.createContext(YK);function KK({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[i,o]=P.useState(()=>localStorage.getItem(n)||t);P.useEffect(()=>{const a=window.document.documentElement;if(a.classList.remove("light","dark"),i==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a.classList.add(l);return}a.classList.add(i)},[i]);const s={theme:i,setTheme:a=>{localStorage.setItem(n,a),o(a)}};return y.jsx(hN.Provider,{...r,value:s,children:e})}const pN=()=>{const e=P.useContext(hN);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};var vp=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},mc=typeof window>"u"||"Deno"in globalThis;function no(){}function XK(e,t){return typeof e=="function"?e(t):e}function Ew(e){return typeof e=="number"&&e>=0&&e!==1/0}function gN(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Tu(e,t){return typeof e=="function"?e(t):e}function Co(e,t){return typeof e=="function"?e(t):e}function uM(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==J_(s,t.options))return!1}else if(!Eh(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||i&&i!==t.state.fetchStatus||o&&!o(t))}function dM(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Ch(t.options.mutationKey)!==Ch(o))return!1}else if(!Eh(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function J_(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ch)(e)}function Ch(e){return JSON.stringify(e,(t,n)=>Tw(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Eh(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Eh(e[n],t[n])):!1}function Rw(e,t){if(e===t)return e;const n=fM(e)&&fM(t);if(n||Tw(e)&&Tw(t)){const r=n?e:Object.keys(e),i=r.length,o=n?t:Object.keys(t),s=o.length,a=n?[]:{};let l=0;for(let c=0;c<s;c++){const u=n?c:o[c];(!n&&r.includes(u)||n)&&e[u]===void 0&&t[u]===void 0?(a[u]=void 0,l++):(a[u]=Rw(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return i===s&&l===i?e:a}return t}function Pw(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function fM(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Tw(e){if(!hM(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!hM(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function hM(e){return Object.prototype.toString.call(e)==="[object Object]"}function QK(e){return new Promise(t=>{setTimeout(t,e)})}function Mw(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return Rw(e,t)}catch(r){console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`)}return Rw(e,t)}return t}function JK(e){return e}function ZK(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function eX(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Sb=Symbol();function mN(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===Sb&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Sb?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Ul,Ra,Bu,LI,tX=(LI=class extends vp{constructor(){super();Ze(this,Ul);Ze(this,Ra);Ze(this,Bu);je(this,Bu,t=>{if(!mc&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){se(this,Ra)||this.setEventListener(se(this,Bu))}onUnsubscribe(){var t;this.hasListeners()||((t=se(this,Ra))==null||t.call(this),je(this,Ra,void 0))}setEventListener(t){var n;je(this,Bu,t),(n=se(this,Ra))==null||n.call(this),je(this,Ra,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){se(this,Ul)!==t&&(je(this,Ul,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof se(this,Ul)=="boolean"?se(this,Ul):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ul=new WeakMap,Ra=new WeakMap,Bu=new WeakMap,LI),Z_=new tX,Hu,Pa,Vu,FI,nX=(FI=class extends vp{constructor(){super();Ze(this,Hu,!0);Ze(this,Pa);Ze(this,Vu);je(this,Vu,t=>{if(!mc&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){se(this,Pa)||this.setEventListener(se(this,Vu))}onUnsubscribe(){var t;this.hasListeners()||((t=se(this,Pa))==null||t.call(this),je(this,Pa,void 0))}setEventListener(t){var n;je(this,Vu,t),(n=se(this,Pa))==null||n.call(this),je(this,Pa,t(this.setOnline.bind(this)))}setOnline(t){se(this,Hu)!==t&&(je(this,Hu,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return se(this,Hu)}},Hu=new WeakMap,Pa=new WeakMap,Vu=new WeakMap,FI),_b=new nX;function Ow(){let e,t;const n=new Promise((i,o)=>{e=i,t=o});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}function rX(e){return Math.min(1e3*2**e,3e4)}function bN(e){return(e??"online")==="online"?_b.isOnline():!0}var yN=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function wx(e){return e instanceof yN}function vN(e){let t=!1,n=0,r=!1,i;const o=Ow(),s=b=>{var v;r||(p(new yN(b)),(v=e.abort)==null||v.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>Z_.isFocused()&&(e.networkMode==="always"||_b.isOnline())&&e.canRun(),u=()=>bN(e.networkMode)&&e.canRun(),d=b=>{var v;r||(r=!0,(v=e.onSuccess)==null||v.call(e,b),i==null||i(),o.resolve(b))},p=b=>{var v;r||(r=!0,(v=e.onError)==null||v.call(e,b),i==null||i(),o.reject(b))},h=()=>new Promise(b=>{var v;i=x=>{(r||c())&&b(x)},(v=e.onPause)==null||v.call(e)}).then(()=>{var b;i=void 0,r||(b=e.onContinue)==null||b.call(e)}),m=()=>{if(r)return;let b;const v=n===0?e.initialPromise:void 0;try{b=v??e.fn()}catch(x){b=Promise.reject(x)}Promise.resolve(b).then(d).catch(x=>{var M;if(r)return;const S=e.retry??(mc?0:3),_=e.retryDelay??rX,E=typeof _=="function"?_(n,x):_,C=S===!0||typeof S=="number"&&n<S||typeof S=="function"&&S(n,x);if(t||!C){p(x);return}n++,(M=e.onFail)==null||M.call(e,n,x),QK(E).then(()=>c()?void 0:h()).then(()=>{t?p(x):m()})})};return{promise:o,cancel:s,continue:()=>(i==null||i(),o),cancelRetry:a,continueRetry:l,canStart:u,start:()=>(u()?m():h().then(m),o)}}function iX(){let e=[],t=0,n=a=>{a()},r=a=>{a()},i=a=>setTimeout(a,0);const o=a=>{t?e.push(a):i(()=>{n(a)})},s=()=>{const a=e;e=[],a.length&&i(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||s()}return l},batchCalls:a=>(...l)=>{o(()=>{a(...l)})},schedule:o,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{i=a}}}var gr=iX(),Gl,jI,xN=(jI=class{constructor(){Ze(this,Gl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ew(this.gcTime)&&je(this,Gl,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(mc?1/0:5*60*1e3))}clearGcTimeout(){se(this,Gl)&&(clearTimeout(se(this,Gl)),je(this,Gl,void 0))}},Gl=new WeakMap,jI),Wu,Uu,to,Er,pp,ql,So,Is,$I,oX=($I=class extends xN{constructor(t){super();Ze(this,So);Ze(this,Wu);Ze(this,Uu);Ze(this,to);Ze(this,Er);Ze(this,pp);Ze(this,ql);je(this,ql,!1),je(this,pp,t.defaultOptions),this.setOptions(t.options),this.observers=[],je(this,to,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,je(this,Wu,sX(this.options)),this.state=t.state??se(this,Wu),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=se(this,Er))==null?void 0:t.promise}setOptions(t){this.options={...se(this,pp),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&se(this,to).remove(this)}setData(t,n){const r=Mw(this.state.data,t,this.options);return Nt(this,So,Is).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Nt(this,So,Is).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=se(this,Er))==null?void 0:r.promise;return(i=se(this,Er))==null||i.cancel(t),n?n.then(no).catch(no):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(se(this,Wu))}isActive(){return this.observers.some(t=>Co(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Sb||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!gN(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=se(this,Er))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=se(this,Er))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),se(this,to).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(se(this,Er)&&(se(this,ql)?se(this,Er).cancel({revert:!0}):se(this,Er).cancelRetry()),this.scheduleGc()),se(this,to).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Nt(this,So,Is).call(this,{type:"invalidate"})}fetch(t,n){var l,c,u;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(se(this,Er))return se(this,Er).continueRetry(),se(this,Er).promise}if(t&&this.setOptions(t),!this.options.queryFn){const d=this.observers.find(p=>p.options.queryFn);d&&this.setOptions(d.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,i=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(je(this,ql,!0),r.signal)})},o=()=>{const d=mN(this.options,n),p={queryKey:this.queryKey,meta:this.meta};return i(p),je(this,ql,!1),this.options.persister?this.options.persister(d,p,this):d(p)},s={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:o};i(s),(l=this.options.behavior)==null||l.onFetch(s,this),je(this,Uu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=s.fetchOptions)==null?void 0:c.meta))&&Nt(this,So,Is).call(this,{type:"fetch",meta:(u=s.fetchOptions)==null?void 0:u.meta});const a=d=>{var p,h,m,b;wx(d)&&d.silent||Nt(this,So,Is).call(this,{type:"error",error:d}),wx(d)||((h=(p=se(this,to).config).onError)==null||h.call(p,d,this),(b=(m=se(this,to).config).onSettled)==null||b.call(m,this.state.data,d,this)),this.scheduleGc()};return je(this,Er,vN({initialPromise:n==null?void 0:n.initialPromise,fn:s.fetchFn,abort:r.abort.bind(r),onSuccess:d=>{var p,h,m,b;if(d===void 0){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(d)}catch(v){a(v);return}(h=(p=se(this,to).config).onSuccess)==null||h.call(p,d,this),(b=(m=se(this,to).config).onSettled)==null||b.call(m,d,this.state.error,this),this.scheduleGc()},onError:a,onFail:(d,p)=>{Nt(this,So,Is).call(this,{type:"failed",failureCount:d,error:p})},onPause:()=>{Nt(this,So,Is).call(this,{type:"pause"})},onContinue:()=>{Nt(this,So,Is).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0})),se(this,Er).start()}},Wu=new WeakMap,Uu=new WeakMap,to=new WeakMap,Er=new WeakMap,pp=new WeakMap,ql=new WeakMap,So=new WeakSet,Is=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...wN(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return wx(i)&&i.revert&&se(this,Uu)?{...se(this,Uu),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),gr.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),se(this,to).notify({query:this,type:"updated",action:t})})},$I);function wN(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:bN(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function sX(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Uo,zI,SN=(zI=class extends vp{constructor(t={}){super();Ze(this,Uo);this.config=t,je(this,Uo,new Map)}build(t,n,r){const i=n.queryKey,o=n.queryHash??J_(i,n);let s=this.get(o);return s||(s=new oX({cache:this,queryKey:i,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(s)),s}add(t){se(this,Uo).has(t.queryHash)||(se(this,Uo).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=se(this,Uo).get(t.queryHash);n&&(t.destroy(),n===t&&se(this,Uo).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){gr.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return se(this,Uo).get(t)}getAll(){return[...se(this,Uo).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>uM(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>uM(t,r)):n}notify(t){gr.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){gr.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){gr.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Uo=new WeakMap,zI),Go,Br,Yl,qo,wa,BI,aX=(BI=class extends xN{constructor(t){super();Ze(this,qo);Ze(this,Go);Ze(this,Br);Ze(this,Yl);this.mutationId=t.mutationId,je(this,Br,t.mutationCache),je(this,Go,[]),this.state=t.state||lX(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){se(this,Go).includes(t)||(se(this,Go).push(t),this.clearGcTimeout(),se(this,Br).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){je(this,Go,se(this,Go).filter(n=>n!==t)),this.scheduleGc(),se(this,Br).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){se(this,Go).length||(this.state.status==="pending"?this.scheduleGc():se(this,Br).remove(this))}continue(){var t;return((t=se(this,Yl))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,s,a,l,c,u,d,p,h,m,b,v,x,S,_,E,C,M,O;je(this,Yl,vN({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(k,N)=>{Nt(this,qo,wa).call(this,{type:"failed",failureCount:k,error:N})},onPause:()=>{Nt(this,qo,wa).call(this,{type:"pause"})},onContinue:()=>{Nt(this,qo,wa).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>se(this,Br).canRun(this)}));const n=this.state.status==="pending",r=!se(this,Yl).canStart();try{if(!n){Nt(this,qo,wa).call(this,{type:"pending",variables:t,isPaused:r}),await((o=(i=se(this,Br).config).onMutate)==null?void 0:o.call(i,t,this));const N=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));N!==this.state.context&&Nt(this,qo,wa).call(this,{type:"pending",context:N,variables:t,isPaused:r})}const k=await se(this,Yl).start();return await((c=(l=se(this,Br).config).onSuccess)==null?void 0:c.call(l,k,t,this.state.context,this)),await((d=(u=this.options).onSuccess)==null?void 0:d.call(u,k,t,this.state.context)),await((h=(p=se(this,Br).config).onSettled)==null?void 0:h.call(p,k,null,this.state.variables,this.state.context,this)),await((b=(m=this.options).onSettled)==null?void 0:b.call(m,k,null,t,this.state.context)),Nt(this,qo,wa).call(this,{type:"success",data:k}),k}catch(k){try{throw await((x=(v=se(this,Br).config).onError)==null?void 0:x.call(v,k,t,this.state.context,this)),await((_=(S=this.options).onError)==null?void 0:_.call(S,k,t,this.state.context)),await((C=(E=se(this,Br).config).onSettled)==null?void 0:C.call(E,void 0,k,this.state.variables,this.state.context,this)),await((O=(M=this.options).onSettled)==null?void 0:O.call(M,void 0,k,t,this.state.context)),k}finally{Nt(this,qo,wa).call(this,{type:"error",error:k})}}finally{se(this,Br).runNext(this)}}},Go=new WeakMap,Br=new WeakMap,Yl=new WeakMap,qo=new WeakSet,wa=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),gr.batch(()=>{se(this,Go).forEach(r=>{r.onMutationUpdate(t)}),se(this,Br).notify({mutation:this,type:"updated",action:t})})},BI);function lX(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Bs,_o,gp,HI,cX=(HI=class extends vp{constructor(t={}){super();Ze(this,Bs);Ze(this,_o);Ze(this,gp);this.config=t,je(this,Bs,new Set),je(this,_o,new Map),je(this,gp,0)}build(t,n,r){const i=new aX({mutationCache:this,mutationId:++Bg(this,gp)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){se(this,Bs).add(t);const n=Wg(t);if(typeof n=="string"){const r=se(this,_o).get(n);r?r.push(t):se(this,_o).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(se(this,Bs).delete(t)){const n=Wg(t);if(typeof n=="string"){const r=se(this,_o).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&se(this,_o).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Wg(t);if(typeof n=="string"){const r=se(this,_o).get(n),i=r==null?void 0:r.find(o=>o.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r;const n=Wg(t);if(typeof n=="string"){const i=(r=se(this,_o).get(n))==null?void 0:r.find(o=>o!==t&&o.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){gr.batch(()=>{se(this,Bs).forEach(t=>{this.notify({type:"removed",mutation:t})}),se(this,Bs).clear(),se(this,_o).clear()})}getAll(){return Array.from(se(this,Bs))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>dM(n,r))}findAll(t={}){return this.getAll().filter(n=>dM(t,n))}notify(t){gr.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return gr.batch(()=>Promise.all(t.map(n=>n.continue().catch(no))))}},Bs=new WeakMap,_o=new WeakMap,gp=new WeakMap,HI);function Wg(e){var t;return(t=e.options.scope)==null?void 0:t.id}function pM(e){return{onFetch:(t,n)=>{var u,d,p,h,m;const r=t.options,i=(p=(d=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:p.direction,o=((h=t.state.data)==null?void 0:h.pages)||[],s=((m=t.state.data)==null?void 0:m.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let b=!1;const v=_=>{Object.defineProperty(_,"signal",{enumerable:!0,get:()=>(t.signal.aborted?b=!0:t.signal.addEventListener("abort",()=>{b=!0}),t.signal)})},x=mN(t.options,t.fetchOptions),S=async(_,E,C)=>{if(b)return Promise.reject();if(E==null&&_.pages.length)return Promise.resolve(_);const M={queryKey:t.queryKey,pageParam:E,direction:C?"backward":"forward",meta:t.options.meta};v(M);const O=await x(M),{maxPages:k}=t.options,N=C?eX:ZK;return{pages:N(_.pages,O,k),pageParams:N(_.pageParams,E,k)}};if(i&&o.length){const _=i==="backward",E=_?uX:gM,C={pages:o,pageParams:s},M=E(r,C);a=await S(C,M,_)}else{const _=e??o.length;do{const E=l===0?s[0]??r.initialPageParam:gM(r,a);if(l>0&&E==null)break;a=await S(a,E),l++}while(l<_)}return a};t.options.persister?t.fetchFn=()=>{var b,v;return(v=(b=t.options).persister)==null?void 0:v.call(b,c,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function gM(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function uX(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var An,Ta,Ma,Gu,qu,Oa,Yu,Ku,VI,dX=(VI=class{constructor(e={}){Ze(this,An);Ze(this,Ta);Ze(this,Ma);Ze(this,Gu);Ze(this,qu);Ze(this,Oa);Ze(this,Yu);Ze(this,Ku);je(this,An,e.queryCache||new SN),je(this,Ta,e.mutationCache||new cX),je(this,Ma,e.defaultOptions||{}),je(this,Gu,new Map),je(this,qu,new Map),je(this,Oa,0)}mount(){Bg(this,Oa)._++,se(this,Oa)===1&&(je(this,Yu,Z_.subscribe(async e=>{e&&(await this.resumePausedMutations(),se(this,An).onFocus())})),je(this,Ku,_b.subscribe(async e=>{e&&(await this.resumePausedMutations(),se(this,An).onOnline())})))}unmount(){var e,t;Bg(this,Oa)._--,se(this,Oa)===0&&((e=se(this,Yu))==null||e.call(this),je(this,Yu,void 0),(t=se(this,Ku))==null||t.call(this),je(this,Ku,void 0))}isFetching(e){return se(this,An).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return se(this,Ta).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=se(this,An).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=se(this,An).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Tu(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return se(this,An).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=se(this,An).get(r.queryHash),o=i==null?void 0:i.state.data,s=XK(t,o);if(s!==void 0)return se(this,An).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return gr.batch(()=>se(this,An).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=se(this,An).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=se(this,An);gr.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=se(this,An),r={type:"active",...e};return gr.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=gr.batch(()=>se(this,An).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(no).catch(no)}invalidateQueries(e,t={}){return gr.batch(()=>{if(se(this,An).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none")return Promise.resolve();const n={...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"};return this.refetchQueries(n,t)})}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=gr.batch(()=>se(this,An).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(no)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(no)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=se(this,An).build(this,t);return n.isStaleByTime(Tu(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(no).catch(no)}fetchInfiniteQuery(e){return e.behavior=pM(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(no).catch(no)}ensureInfiniteQueryData(e){return e.behavior=pM(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return _b.isOnline()?se(this,Ta).resumePausedMutations():Promise.resolve()}getQueryCache(){return se(this,An)}getMutationCache(){return se(this,Ta)}getDefaultOptions(){return se(this,Ma)}setDefaultOptions(e){je(this,Ma,e)}setQueryDefaults(e,t){se(this,Gu).set(Ch(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...se(this,Gu).values()],n={};return t.forEach(r=>{Eh(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){se(this,qu).set(Ch(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...se(this,qu).values()];let n={};return t.forEach(r=>{Eh(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...se(this,Ma).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=J_(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Sb&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...se(this,Ma).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){se(this,An).clear(),se(this,Ta).clear()}},An=new WeakMap,Ta=new WeakMap,Ma=new WeakMap,Gu=new WeakMap,qu=new WeakMap,Oa=new WeakMap,Yu=new WeakMap,Ku=new WeakMap,VI),ci,Lt,mp,Hr,Kl,Xu,Da,Yo,bp,Qu,Ju,Xl,Ql,Aa,Zu,Jt,Ff,Dw,Aw,kw,Iw,Nw,Lw,Fw,_N,WI,fX=(WI=class extends vp{constructor(t,n){super();Ze(this,Jt);Ze(this,ci);Ze(this,Lt);Ze(this,mp);Ze(this,Hr);Ze(this,Kl);Ze(this,Xu);Ze(this,Da);Ze(this,Yo);Ze(this,bp);Ze(this,Qu);Ze(this,Ju);Ze(this,Xl);Ze(this,Ql);Ze(this,Aa);Ze(this,Zu,new Set);this.options=n,je(this,ci,t),je(this,Yo,null),je(this,Da,Ow()),this.options.experimental_prefetchInRender||se(this,Da).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(se(this,Lt).addObserver(this),mM(se(this,Lt),this.options)?Nt(this,Jt,Ff).call(this):this.updateResult(),Nt(this,Jt,Iw).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return jw(se(this,Lt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return jw(se(this,Lt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Nt(this,Jt,Nw).call(this),Nt(this,Jt,Lw).call(this),se(this,Lt).removeObserver(this)}setOptions(t,n){const r=this.options,i=se(this,Lt);if(this.options=se(this,ci).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Co(this.options.enabled,se(this,Lt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Nt(this,Jt,Fw).call(this),se(this,Lt).setOptions(this.options),r._defaulted&&!Pw(this.options,r)&&se(this,ci).getQueryCache().notify({type:"observerOptionsUpdated",query:se(this,Lt),observer:this});const o=this.hasListeners();o&&bM(se(this,Lt),i,this.options,r)&&Nt(this,Jt,Ff).call(this),this.updateResult(n),o&&(se(this,Lt)!==i||Co(this.options.enabled,se(this,Lt))!==Co(r.enabled,se(this,Lt))||Tu(this.options.staleTime,se(this,Lt))!==Tu(r.staleTime,se(this,Lt)))&&Nt(this,Jt,Dw).call(this);const s=Nt(this,Jt,Aw).call(this);o&&(se(this,Lt)!==i||Co(this.options.enabled,se(this,Lt))!==Co(r.enabled,se(this,Lt))||s!==se(this,Aa))&&Nt(this,Jt,kw).call(this,s)}getOptimisticResult(t){const n=se(this,ci).getQueryCache().build(se(this,ci),t),r=this.createResult(n,t);return pX(this,r)&&(je(this,Hr,r),je(this,Xu,this.options),je(this,Kl,se(this,Lt).state)),r}getCurrentResult(){return se(this,Hr)}trackResult(t,n){const r={};return Object.keys(t).forEach(i=>{Object.defineProperty(r,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),n==null||n(i),t[i])})}),r}trackProp(t){se(this,Zu).add(t)}getCurrentQuery(){return se(this,Lt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=se(this,ci).defaultQueryOptions(t),r=se(this,ci).getQueryCache().build(se(this,ci),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Nt(this,Jt,Ff).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),se(this,Hr)))}createResult(t,n){var k;const r=se(this,Lt),i=this.options,o=se(this,Hr),s=se(this,Kl),a=se(this,Xu),c=t!==r?t.state:se(this,mp),{state:u}=t;let d={...u},p=!1,h;if(n._optimisticResults){const N=this.hasListeners(),F=!N&&mM(t,n),j=N&&bM(t,r,n,i);(F||j)&&(d={...d,...wN(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:m,errorUpdatedAt:b,status:v}=d;if(n.select&&d.data!==void 0)if(o&&d.data===(s==null?void 0:s.data)&&n.select===se(this,bp))h=se(this,Qu);else try{je(this,bp,n.select),h=n.select(d.data),h=Mw(o==null?void 0:o.data,h,n),je(this,Qu,h),je(this,Yo,null)}catch(N){je(this,Yo,N)}else h=d.data;if(n.placeholderData!==void 0&&h===void 0&&v==="pending"){let N;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))N=o.data;else if(N=typeof n.placeholderData=="function"?n.placeholderData((k=se(this,Ju))==null?void 0:k.state.data,se(this,Ju)):n.placeholderData,n.select&&N!==void 0)try{N=n.select(N),je(this,Yo,null)}catch(F){je(this,Yo,F)}N!==void 0&&(v="success",h=Mw(o==null?void 0:o.data,N,n),p=!0)}se(this,Yo)&&(m=se(this,Yo),h=se(this,Qu),b=Date.now(),v="error");const x=d.fetchStatus==="fetching",S=v==="pending",_=v==="error",E=S&&x,C=h!==void 0,O={status:v,fetchStatus:d.fetchStatus,isPending:S,isSuccess:v==="success",isError:_,isInitialLoading:E,isLoading:E,data:h,dataUpdatedAt:d.dataUpdatedAt,error:m,errorUpdatedAt:b,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:x,isRefetching:x&&!S,isLoadingError:_&&!C,isPaused:d.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:_&&C,isStale:eC(t,n),refetch:this.refetch,promise:se(this,Da)};if(this.options.experimental_prefetchInRender){const N=$=>{O.status==="error"?$.reject(O.error):O.data!==void 0&&$.resolve(O.data)},F=()=>{const $=je(this,Da,O.promise=Ow());N($)},j=se(this,Da);switch(j.status){case"pending":t.queryHash===r.queryHash&&N(j);break;case"fulfilled":(O.status==="error"||O.data!==j.value)&&F();break;case"rejected":(O.status!=="error"||O.error!==j.reason)&&F();break}}return O}updateResult(t){const n=se(this,Hr),r=this.createResult(se(this,Lt),this.options);if(je(this,Kl,se(this,Lt).state),je(this,Xu,this.options),se(this,Kl).data!==void 0&&je(this,Ju,se(this,Lt)),Pw(r,n))return;je(this,Hr,r);const i={},o=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!se(this,Zu).size)return!0;const l=new Set(a??se(this,Zu));return this.options.throwOnError&&l.add("error"),Object.keys(se(this,Hr)).some(c=>{const u=c;return se(this,Hr)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&o()&&(i.listeners=!0),Nt(this,Jt,_N).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Nt(this,Jt,Iw).call(this)}},ci=new WeakMap,Lt=new WeakMap,mp=new WeakMap,Hr=new WeakMap,Kl=new WeakMap,Xu=new WeakMap,Da=new WeakMap,Yo=new WeakMap,bp=new WeakMap,Qu=new WeakMap,Ju=new WeakMap,Xl=new WeakMap,Ql=new WeakMap,Aa=new WeakMap,Zu=new WeakMap,Jt=new WeakSet,Ff=function(t){Nt(this,Jt,Fw).call(this);let n=se(this,Lt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(no)),n},Dw=function(){Nt(this,Jt,Nw).call(this);const t=Tu(this.options.staleTime,se(this,Lt));if(mc||se(this,Hr).isStale||!Ew(t))return;const r=gN(se(this,Hr).dataUpdatedAt,t)+1;je(this,Xl,setTimeout(()=>{se(this,Hr).isStale||this.updateResult()},r))},Aw=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(se(this,Lt)):this.options.refetchInterval)??!1},kw=function(t){Nt(this,Jt,Lw).call(this),je(this,Aa,t),!(mc||Co(this.options.enabled,se(this,Lt))===!1||!Ew(se(this,Aa))||se(this,Aa)===0)&&je(this,Ql,setInterval(()=>{(this.options.refetchIntervalInBackground||Z_.isFocused())&&Nt(this,Jt,Ff).call(this)},se(this,Aa)))},Iw=function(){Nt(this,Jt,Dw).call(this),Nt(this,Jt,kw).call(this,Nt(this,Jt,Aw).call(this))},Nw=function(){se(this,Xl)&&(clearTimeout(se(this,Xl)),je(this,Xl,void 0))},Lw=function(){se(this,Ql)&&(clearInterval(se(this,Ql)),je(this,Ql,void 0))},Fw=function(){const t=se(this,ci).getQueryCache().build(se(this,ci),this.options);if(t===se(this,Lt))return;const n=se(this,Lt);je(this,Lt,t),je(this,mp,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},_N=function(t){gr.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(se(this,Hr))}),se(this,ci).getQueryCache().notify({query:se(this,Lt),type:"observerResultsUpdated"})})},WI);function hX(e,t){return Co(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function mM(e,t){return hX(e,t)||e.state.data!==void 0&&jw(e,t,t.refetchOnMount)}function jw(e,t,n){if(Co(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&eC(e,t)}return!1}function bM(e,t,n,r){return(e!==t||Co(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&eC(e,n)}function eC(e,t){return Co(t.enabled,e)!==!1&&e.isStaleByTime(Tu(t.staleTime,e))}function pX(e,t){return!Pw(e.getCurrentResult(),t)}var tC=R.createContext(void 0),nC=e=>{const t=R.useContext(tC);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},gX=({client:e,children:t})=>(R.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),y.jsx(tC.Provider,{value:e,children:t})),CN=R.createContext(!1),mX=()=>R.useContext(CN);CN.Provider;function bX(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var yX=R.createContext(bX()),vX=()=>R.useContext(yX);function xX(e,t){return typeof e=="function"?e(...t):!!e}function yM(){}var wX=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},SX=e=>{R.useEffect(()=>{e.clearReset()},[e])},_X=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&xX(n,[e.error,r]),CX=e=>{const t=e.staleTime;e.suspense&&(e.staleTime=typeof t=="function"?(...n)=>Math.max(t(...n),1e3):Math.max(t??1e3,1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},EX=(e,t)=>e.isLoading&&e.isFetching&&!t,RX=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,vM=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function PX(e,t,n){var d,p,h,m,b;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=nC(),i=mX(),o=vX(),s=r.defaultQueryOptions(e);(p=(d=r.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||p.call(d,s),s._optimisticResults=i?"isRestoring":"optimistic",CX(s),wX(s,o),SX(o);const a=!r.getQueryCache().get(s.queryHash),[l]=R.useState(()=>new t(r,s)),c=l.getOptimisticResult(s),u=!i&&e.subscribed!==!1;if(R.useSyncExternalStore(R.useCallback(v=>{const x=u?l.subscribe(gr.batchCalls(v)):yM;return l.updateResult(),x},[l,u]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),R.useEffect(()=>{l.setOptions(s,{listeners:!1})},[s,l]),RX(s,c))throw vM(s,l,o);if(_X({result:c,errorResetBoundary:o,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw c.error;if((m=(h=r.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||m.call(h,s,c),s.experimental_prefetchInRender&&!mc&&EX(c,i)){const v=a?vM(s,l,o):(b=r.getQueryCache().get(s.queryHash))==null?void 0:b.promise;v==null||v.catch(yM).finally(()=>{l.updateResult()})}return s.notifyOnChangeProps?c:l.trackResult(c)}function xp(e,t){return PX(e,fX)}function TX(){const e=P.useContext(tC);if(e&&e.isSemaphorClient)return e}function EN({children:e}){const{setIsSessionExpired:t}=Hn(),n=TX(),[r]=P.useState(()=>{const i=new dX({queryCache:new SN({onError:o=>{o instanceof Error?(console.error(`Something went wrong: ${o.message}`),o.message==="invalid token"&&t(!0)):console.error("Something went wrong:",o)}}),defaultOptions:{queries:{gcTime:36e5,staleTime:3e5,refetchOnWindowFocus:!1,retry:1}}});return i.isSemaphorClient=!0,i});return n?y.jsx(y.Fragment,{children:e}):y.jsx(gX,{client:r,children:e})}const Dc=P.forwardRef(({children:e,className:t,...n},r)=>y.jsx("div",{className:be("semaphor-scope",t),ref:r,...n,children:e})),MX={id:"",authToken:void 0},RN=P.createContext(MX),PN=({children:e,dashboardProps:t})=>y.jsx(EN,{children:y.jsx(RN.Provider,{value:t,children:y.jsx(Dc,{style:{height:"100%"},children:e})})});function Vi(){const e=P.useContext(RN);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function OX(){const{authToken:e,version:t}=Vi(),n=ye(a=>a.selectedLensId),{data:r,isLoading:i,isFetching:o,isError:s}=xp({queryKey:["dashboard",n,e==null?void 0:e.accessToken],queryFn:()=>GK(e==null?void 0:e.accessToken,{lensId:n,version:t}),enabled:!!(e!=null&&e.accessToken)});return{data:r,isLoading:i,isFetching:o,isError:s}}function DX(){const{authToken:e}=Vi(),t=ye(r=>r.authToken),{setAuthToken:n}=Hn();return P.useEffect(()=>{e&&(e==null?void 0:e.toString())!==(t==null?void 0:t.toString())&&n(e)},[e,t,n]),e}function TN(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function xM(e,t){const n=TN(e);return n==="dark"?Jl.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function AX({customStyle:e,currentTheme:t,onSave:n,onEvent:r,defaultFilterValues:i,onFilterValuesChange:o}){const{authToken:s}=Vi();DX();const a=ye(L=>L.selectedLensId),{data:l,isLoading:c,isFetching:u,isError:d}=OX(),[p,h]=P.useState(i||[]),{theme:m,setTheme:b}=pN(),v=ye(L=>L.dashboard.globalStyle),{setDashboard:x,setDashboardWithFilterValues:S,setSelectedSheetId:_,setStyle:E,setOnSaveFunction:C,setLenses:M,setSelectedLensId:O,setInitStore:k}=Hn();ye(L=>L.actions.setCustomCards);const N=ye(L=>L.actions.setFilterValues),F=ye(L=>L.filterValues),j=ye(L=>L.actions.setThemeStyle),$=ye(L=>L.actions.setDashboardTheme),X=ye(L=>L.actions.setOnEvent);P.useEffect(()=>{s&&k()},[s,k]),P.useEffect(()=>{if(m){const L=TN(m);$(L)}},[m,$]),P.useEffect(()=>{t&&b(t)},[t,b]);const V=P.useCallback(()=>{const L=Jl.cloneDeep(xb),U=Jl.merge(L,v);if(e){const B=Jl.merge(U,e),W=xM(m,B);j(W),E(B)}else{const B=xM(m,U);j(B),E(xb)}},[m,e,v,j,E]);return P.useEffect(()=>{l&&l.dashboard&&V()},[m,e,v,V,l]),P.useEffect(()=>{var Y,G;function L(D,ee){const K=D.filters||[],oe=[];for(const J of ee){const Z=K.find(ae=>ae.id===J.filterId);Z&&oe.push({filterId:J.filterId,connectionType:Z.database==="NA"?"api":"database",name:Z.column,operation:Z.operation,valueType:Pu(Z),values:J.values})}return oe}if(!l||!l.dashboard)return;const{dashboard:U,filterValues:B,defaultLensId:W,lenses:q}=l,A=L(U,p||[]);S(U,(!B||(B==null?void 0:B.length)===0?A:B)||[]),W&&O(W),q&&M(q),_(((G=(Y=U==null?void 0:U.sheets)==null?void 0:Y[0])==null?void 0:G.id)||null)},[l,x,_,N,a,M,S,O,p]),P.useEffect(()=>{o&&F&&o(F)},[F,o]),P.useEffect(()=>{n&&C(n),r&&X(r)},[n,C,r,X]),{isFetching:u,isLoading:c,isError:d}}function Mu({className:e,...t}){return y.jsx("div",{className:be("animate-pulse rounded-md bg-muted",e),...t})}const MN=R.forwardRef(({className:e,...t},n)=>y.jsx("div",{ref:n,className:be("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));MN.displayName="Card";const Ay=R.forwardRef(({className:e,...t},n)=>y.jsx("div",{ref:n,className:be("flex flex-col space-y-1.5 p-6",e),...t}));Ay.displayName="CardHeader";const Rd=R.forwardRef(({className:e,...t},n)=>y.jsx("h3",{ref:n,className:be("text-2xl font-semibold leading-none tracking-tight",e),...t}));Rd.displayName="CardTitle";const rC=R.forwardRef(({className:e,...t},n)=>y.jsx("p",{ref:n,className:be("text-sm text-muted-foreground",e),...t}));rC.displayName="CardDescription";const ky=R.forwardRef(({className:e,...t},n)=>y.jsx("div",{ref:n,className:be("px-6 pt-0",e),...t}));ky.displayName="CardContent";const ON=R.forwardRef(({className:e,...t},n)=>y.jsx("div",{ref:n,className:be("flex items-center p-6 pt-0",e),...t}));ON.displayName="CardFooter";function DN({className:e,customStyle:t,onSave:n,onEvent:r,LoadingComponent:i,ErrorComponent:o,onChartElementClicked:s,id:a,authToken:l,currentTheme:c,version:u,customCards:d,showAssistant:p,defaultFilterValues:h,onFilterValuesChange:m,...b}){const{placeholders:v}=Vi(),x=ye(C=>C.themeStyle),S=ye(C=>C.isSessionExpired),{isLoading:_,isError:E}=AX({authToken:l,customStyle:t,currentTheme:c,onSave:n,onEvent:r,defaultFilterValues:h,onFilterValuesChange:m});return _||!l?(r==null||r({type:"info",message:"Loading dashboard"}),i?y.jsx(i,{message:"loading"}):y.jsx("div",{className:"flex items-center gap-3",children:y.jsx(Mu,{className:"h-1 w-full dark:h-[2px]"})})):E?(r==null||r({type:"error",message:"Error fetching dashboard"}),o?(console.log("Error fetching dashboard"),y.jsx(o,{})):y.jsx("div",{children:"Error"})):S?(r==null||r({type:"error",message:"Session Expired"}),v!=null&&v.SessionExpired?y.jsx("div",{className:"flex h-full items-center justify-center",children:y.jsx("div",{children:v.SessionExpired})}):y.jsx("div",{className:"flex h-full items-center justify-center",children:y.jsxs("div",{className:"space-y-4 rounded-md border border-muted p-10",children:[y.jsx(Rd,{children:"Session Expired"}),y.jsx("p",{className:"text-muted-foreground",children:"Please refresh your page to continue."})]})})):y.jsx("div",{className:be("flex h-full flex-col justify-between",x==null?void 0:x.dashboardPanel,e),style:{},role:"dashboard-panel",...b})}function Re(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function kX(e,t){const n=R.createContext(t),r=o=>{const{children:s,...a}=o,l=R.useMemo(()=>a,Object.values(a));return y.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function i(o){const s=R.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function tr(e,t=[]){let n=[];function r(o,s){const a=R.createContext(s),l=n.length;n=[...n,s];const c=d=>{var x;const{scope:p,children:h,...m}=d,b=((x=p==null?void 0:p[e])==null?void 0:x[l])||a,v=R.useMemo(()=>m,Object.values(m));return y.jsx(b.Provider,{value:v,children:h})};c.displayName=o+"Provider";function u(d,p){var b;const h=((b=p==null?void 0:p[e])==null?void 0:b[l])||a,m=R.useContext(h);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${o}\``)}return[c,u]}const i=()=>{const o=n.map(s=>R.createContext(s));return function(a){const l=(a==null?void 0:a[e])||o;return R.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,IX(i,...t)]}function IX(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(o)[`__scope${c}`];return{...a,...d}},{});return R.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function wM(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Iy(...e){return t=>{let n=!1;const r=e.map(i=>{const o=wM(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():wM(e[i],null)}}}}function rt(...e){return R.useCallback(Iy(...e),e)}var Js=R.forwardRef((e,t)=>{const{children:n,...r}=e,i=R.Children.toArray(n),o=i.find(NX);if(o){const s=o.props.children,a=i.map(l=>l===o?R.Children.count(s)>1?R.Children.only(null):R.isValidElement(s)?s.props.children:null:l);return y.jsx($w,{...r,ref:t,children:R.isValidElement(s)?R.cloneElement(s,void 0,a):null})}return y.jsx($w,{...r,ref:t,children:n})});Js.displayName="Slot";var $w=R.forwardRef((e,t)=>{const{children:n,...r}=e;if(R.isValidElement(n)){const i=FX(n);return R.cloneElement(n,{...LX(r,n.props),ref:t?Iy(t,i):i})}return R.Children.count(n)>1?R.Children.only(null):null});$w.displayName="SlotClone";var iC=({children:e})=>y.jsx(y.Fragment,{children:e});function NX(e){return R.isValidElement(e)&&e.type===iC}function LX(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{o(...a),i(...a)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function FX(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Ny(e){const t=e+"CollectionProvider",[n,r]=tr(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=h=>{const{scope:m,children:b}=h,v=P.useRef(null),x=P.useRef(new Map).current;return y.jsx(i,{scope:m,itemMap:x,collectionRef:v,children:b})};s.displayName=t;const a=e+"CollectionSlot",l=P.forwardRef((h,m)=>{const{scope:b,children:v}=h,x=o(a,b),S=rt(m,x.collectionRef);return y.jsx(Js,{ref:S,children:v})});l.displayName=a;const c=e+"CollectionItemSlot",u="data-radix-collection-item",d=P.forwardRef((h,m)=>{const{scope:b,children:v,...x}=h,S=P.useRef(null),_=rt(m,S),E=o(c,b);return P.useEffect(()=>(E.itemMap.set(S,{ref:S,...x}),()=>void E.itemMap.delete(S))),y.jsx(Js,{[u]:"",ref:_,children:v})});d.displayName=c;function p(h){const m=o(e+"CollectionConsumer",h);return P.useCallback(()=>{const v=m.collectionRef.current;if(!v)return[];const x=Array.from(v.querySelectorAll(`[${u}]`));return Array.from(m.itemMap.values()).sort((E,C)=>x.indexOf(E.ref.current)-x.indexOf(C.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:s,Slot:l,ItemSlot:d},p,r]}var mr=globalThis!=null&&globalThis.document?R.useLayoutEffect:()=>{},jX=R.useId||(()=>{}),$X=0;function qn(e){const[t,n]=R.useState(jX());return mr(()=>{e||n(r=>r??String($X++))},[e]),e||(t?`radix-${t}`:"")}var zX=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ne=zX.reduce((e,t)=>{const n=R.forwardRef((r,i)=>{const{asChild:o,...s}=r,a=o?Js:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),y.jsx(a,{...s,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function AN(e,t){e&&hc.flushSync(()=>e.dispatchEvent(t))}function er(e){const t=R.useRef(e);return R.useEffect(()=>{t.current=e}),R.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Ar({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=BX({defaultProp:t,onChange:n}),o=e!==void 0,s=o?e:r,a=er(n),l=R.useCallback(c=>{if(o){const d=typeof c=="function"?c(e):c;d!==e&&a(d)}else i(c)},[o,e,i,a]);return[s,l]}function BX({defaultProp:e,onChange:t}){const n=R.useState(e),[r]=n,i=R.useRef(r),o=er(t);return R.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}var HX=R.createContext(void 0);function Ac(e){const t=R.useContext(HX);return e||t||"ltr"}var Sx="rovingFocusGroup.onEntryFocus",VX={bubbles:!1,cancelable:!0},Ly="RovingFocusGroup",[zw,kN,WX]=Ny(Ly),[UX,Pd]=tr(Ly,[WX]),[GX,qX]=UX(Ly),IN=R.forwardRef((e,t)=>y.jsx(zw.Provider,{scope:e.__scopeRovingFocusGroup,children:y.jsx(zw.Slot,{scope:e.__scopeRovingFocusGroup,children:y.jsx(YX,{...e,ref:t})})}));IN.displayName=Ly;var YX=R.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,p=R.useRef(null),h=rt(t,p),m=Ac(o),[b=null,v]=Ar({prop:s,defaultProp:a,onChange:l}),[x,S]=R.useState(!1),_=er(c),E=kN(n),C=R.useRef(!1),[M,O]=R.useState(0);return R.useEffect(()=>{const k=p.current;if(k)return k.addEventListener(Sx,_),()=>k.removeEventListener(Sx,_)},[_]),y.jsx(GX,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:b,onItemFocus:R.useCallback(k=>v(k),[v]),onItemShiftTab:R.useCallback(()=>S(!0),[]),onFocusableItemAdd:R.useCallback(()=>O(k=>k+1),[]),onFocusableItemRemove:R.useCallback(()=>O(k=>k-1),[]),children:y.jsx(Ne.div,{tabIndex:x||M===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:"none",...e.style},onMouseDown:Re(e.onMouseDown,()=>{C.current=!0}),onFocus:Re(e.onFocus,k=>{const N=!C.current;if(k.target===k.currentTarget&&N&&!x){const F=new CustomEvent(Sx,VX);if(k.currentTarget.dispatchEvent(F),!F.defaultPrevented){const j=E().filter(U=>U.focusable),$=j.find(U=>U.active),X=j.find(U=>U.id===b),L=[$,X,...j].filter(Boolean).map(U=>U.ref.current);FN(L,u)}}C.current=!1}),onBlur:Re(e.onBlur,()=>S(!1))})})}),NN="RovingFocusGroupItem",LN=R.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,...s}=e,a=qn(),l=o||a,c=qX(NN,n),u=c.currentTabStopId===l,d=kN(n),{onFocusableItemAdd:p,onFocusableItemRemove:h}=c;return R.useEffect(()=>{if(r)return p(),()=>h()},[r,p,h]),y.jsx(zw.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:y.jsx(Ne.span,{tabIndex:u?0:-1,"data-orientation":c.orientation,...s,ref:t,onMouseDown:Re(e.onMouseDown,m=>{r?c.onItemFocus(l):m.preventDefault()}),onFocus:Re(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:Re(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){c.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const b=QX(m,c.orientation,c.dir);if(b!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let x=d().filter(S=>S.focusable).map(S=>S.ref.current);if(b==="last")x.reverse();else if(b==="prev"||b==="next"){b==="prev"&&x.reverse();const S=x.indexOf(m.currentTarget);x=c.loop?JX(x,S+1):x.slice(S+1)}setTimeout(()=>FN(x))}})})})});LN.displayName=NN;var KX={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function XX(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function QX(e,t,n){const r=XX(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return KX[r]}function FN(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function JX(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var oC=IN,sC=LN;function ZX(e,t){return R.useReducer((n,r)=>t[n][r]??n,e)}var Yn=e=>{const{present:t,children:n}=e,r=eQ(t),i=typeof n=="function"?n({present:r.isPresent}):R.Children.only(n),o=rt(r.ref,tQ(i));return typeof n=="function"||r.isPresent?R.cloneElement(i,{ref:o}):null};Yn.displayName="Presence";function eQ(e){const[t,n]=R.useState(),r=R.useRef({}),i=R.useRef(e),o=R.useRef("none"),s=e?"mounted":"unmounted",[a,l]=ZX(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return R.useEffect(()=>{const c=Ug(r.current);o.current=a==="mounted"?c:"none"},[a]),mr(()=>{const c=r.current,u=i.current;if(u!==e){const p=o.current,h=Ug(c);e?l("MOUNT"):h==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&p!==h?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),mr(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,d=h=>{const b=Ug(r.current).includes(h.animationName);if(h.target===t&&b&&(l("ANIMATION_END"),!i.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},p=h=>{h.target===t&&(o.current=Ug(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:R.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Ug(e){return(e==null?void 0:e.animationName)||"none"}function tQ(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var aC="Tabs",[nQ,XTe]=tr(aC,[Pd]),jN=Pd(),[rQ,lC]=nQ(aC),$N=R.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=Ac(a),[d,p]=Ar({prop:r,onChange:i,defaultProp:o});return y.jsx(rQ,{scope:n,baseId:qn(),value:d,onValueChange:p,orientation:s,dir:u,activationMode:l,children:y.jsx(Ne.div,{dir:u,"data-orientation":s,...c,ref:t})})});$N.displayName=aC;var zN="TabsList",BN=R.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=lC(zN,n),s=jN(n);return y.jsx(oC,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:r,children:y.jsx(Ne.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});BN.displayName=zN;var HN="TabsTrigger",VN=R.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,s=lC(HN,n),a=jN(n),l=GN(s.baseId,r),c=qN(s.baseId,r),u=r===s.value;return y.jsx(sC,{asChild:!0,...a,focusable:!i,active:u,children:y.jsx(Ne.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:l,...o,ref:t,onMouseDown:Re(e.onMouseDown,d=>{!i&&d.button===0&&d.ctrlKey===!1?s.onValueChange(r):d.preventDefault()}),onKeyDown:Re(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&s.onValueChange(r)}),onFocus:Re(e.onFocus,()=>{const d=s.activationMode!=="manual";!u&&!i&&d&&s.onValueChange(r)})})})});VN.displayName=HN;var WN="TabsContent",UN=R.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...s}=e,a=lC(WN,n),l=GN(a.baseId,r),c=qN(a.baseId,r),u=r===a.value,d=R.useRef(u);return R.useEffect(()=>{const p=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(p)},[]),y.jsx(Yn,{present:i||u,children:({present:p})=>y.jsx(Ne.div,{"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:c,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:p&&o})})});UN.displayName=WN;function GN(e,t){return`${e}-trigger-${t}`}function qN(e,t){return`${e}-content-${t}`}var iQ=$N,YN=BN,KN=VN,XN=UN;const cC=iQ,Fy=R.forwardRef(({className:e,...t},n)=>y.jsx(YN,{ref:n,className:be("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Fy.displayName=YN.displayName;const jy=R.forwardRef(({className:e,...t},n)=>y.jsx(KN,{ref:n,className:be("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));jy.displayName=KN.displayName;const uC=R.forwardRef(({className:e,...t},n)=>y.jsx(XN,{ref:n,className:be("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));uC.displayName=XN.displayName;var QN={exports:{}},wp={},Bw={exports:{}};(function(e,t){(function(n,r){r(t)})(Ca,function(n){function r(Z){return function(ce,pe,ie,ge,de,Ee,De){return Z(ce,pe,De)}}function i(Z){return function(ce,pe,ie,ge){if(!ce||!pe||typeof ce!="object"||typeof pe!="object")return Z(ce,pe,ie,ge);var de=ge.get(ce),Ee=ge.get(pe);if(de&&Ee)return de===pe&&Ee===ce;ge.set(ce,pe),ge.set(pe,ce);var De=Z(ce,pe,ie,ge);return ge.delete(ce),ge.delete(pe),De}}function o(Z,ae){var ce={};for(var pe in Z)ce[pe]=Z[pe];for(var pe in ae)ce[pe]=ae[pe];return ce}function s(Z){return Z.constructor===Object||Z.constructor==null}function a(Z){return typeof Z.then=="function"}function l(Z,ae){return Z===ae||Z!==Z&&ae!==ae}var c="[object Arguments]",u="[object Boolean]",d="[object Date]",p="[object RegExp]",h="[object Map]",m="[object Number]",b="[object Object]",v="[object Set]",x="[object String]",S=Object.prototype.toString;function _(Z){var ae=Z.areArraysEqual,ce=Z.areDatesEqual,pe=Z.areMapsEqual,ie=Z.areObjectsEqual,ge=Z.areRegExpsEqual,de=Z.areSetsEqual,Ee=Z.createIsNestedEqual,De=Ee($e);function $e(Te,ze,yt){if(Te===ze)return!0;if(!Te||!ze||typeof Te!="object"||typeof ze!="object")return Te!==Te&&ze!==ze;if(s(Te)&&s(ze))return ie(Te,ze,De,yt);var Mt=Array.isArray(Te),mn=Array.isArray(ze);if(Mt||mn)return Mt===mn&&ae(Te,ze,De,yt);var Ot=S.call(Te);return Ot!==S.call(ze)?!1:Ot===d?ce(Te,ze,De,yt):Ot===p?ge(Te,ze,De,yt):Ot===h?pe(Te,ze,De,yt):Ot===v?de(Te,ze,De,yt):Ot===b||Ot===c?a(Te)||a(ze)?!1:ie(Te,ze,De,yt):Ot===u||Ot===m||Ot===x?l(Te.valueOf(),ze.valueOf()):!1}return $e}function E(Z,ae,ce,pe){var ie=Z.length;if(ae.length!==ie)return!1;for(;ie-- >0;)if(!ce(Z[ie],ae[ie],ie,ie,Z,ae,pe))return!1;return!0}var C=i(E);function M(Z,ae){return l(Z.valueOf(),ae.valueOf())}function O(Z,ae,ce,pe){var ie=Z.size===ae.size;if(!ie)return!1;if(!Z.size)return!0;var ge={},de=0;return Z.forEach(function(Ee,De){if(ie){var $e=!1,Te=0;ae.forEach(function(ze,yt){!$e&&!ge[Te]&&($e=ce(De,yt,de,Te,Z,ae,pe)&&ce(Ee,ze,De,yt,Z,ae,pe))&&(ge[Te]=!0),Te++}),de++,ie=$e}}),ie}var k=i(O),N="_owner",F=Object.prototype.hasOwnProperty;function j(Z,ae,ce,pe){var ie=Object.keys(Z),ge=ie.length;if(Object.keys(ae).length!==ge)return!1;for(var de;ge-- >0;){if(de=ie[ge],de===N){var Ee=!!Z.$$typeof,De=!!ae.$$typeof;if((Ee||De)&&Ee!==De)return!1}if(!F.call(ae,de)||!ce(Z[de],ae[de],de,de,Z,ae,pe))return!1}return!0}var $=i(j);function X(Z,ae){return Z.source===ae.source&&Z.flags===ae.flags}function V(Z,ae,ce,pe){var ie=Z.size===ae.size;if(!ie)return!1;if(!Z.size)return!0;var ge={};return Z.forEach(function(de,Ee){if(ie){var De=!1,$e=0;ae.forEach(function(Te,ze){!De&&!ge[$e]&&(De=ce(de,Te,Ee,ze,Z,ae,pe))&&(ge[$e]=!0),$e++}),ie=De}}),ie}var L=i(V),U=Object.freeze({areArraysEqual:E,areDatesEqual:M,areMapsEqual:O,areObjectsEqual:j,areRegExpsEqual:X,areSetsEqual:V,createIsNestedEqual:r}),B=Object.freeze({areArraysEqual:C,areDatesEqual:M,areMapsEqual:k,areObjectsEqual:$,areRegExpsEqual:X,areSetsEqual:L,createIsNestedEqual:r}),W=_(U);function q(Z,ae){return W(Z,ae,void 0)}var A=_(o(U,{createIsNestedEqual:function(){return l}}));function Y(Z,ae){return A(Z,ae,void 0)}var G=_(B);function D(Z,ae){return G(Z,ae,new WeakMap)}var ee=_(o(B,{createIsNestedEqual:function(){return l}}));function K(Z,ae){return ee(Z,ae,new WeakMap)}function oe(Z){return _(o(U,Z(U)))}function J(Z){var ae=_(o(B,Z(B)));return function(ce,pe,ie){return ie===void 0&&(ie=new WeakMap),ae(ce,pe,ie)}}n.circularDeepEqual=D,n.circularShallowEqual=K,n.createCustomCircularEqual=J,n.createCustomEqual=oe,n.deepEqual=q,n.sameValueZeroEqual=l,n.shallowEqual=Y,Object.defineProperty(n,"__esModule",{value:!0})})})(Bw,Bw.exports);var dC=Bw.exports;const fC=z_(xY);var Ct={},oQ=function(t,n,r){return t===n?!0:t.className===n.className&&r(t.style,n.style)&&t.width===n.width&&t.autoSize===n.autoSize&&t.cols===n.cols&&t.draggableCancel===n.draggableCancel&&t.draggableHandle===n.draggableHandle&&r(t.verticalCompact,n.verticalCompact)&&r(t.compactType,n.compactType)&&r(t.layout,n.layout)&&r(t.margin,n.margin)&&r(t.containerPadding,n.containerPadding)&&t.rowHeight===n.rowHeight&&t.maxRows===n.maxRows&&t.isBounded===n.isBounded&&t.isDraggable===n.isDraggable&&t.isResizable===n.isResizable&&t.allowOverlap===n.allowOverlap&&t.preventCollision===n.preventCollision&&t.useCSSTransforms===n.useCSSTransforms&&t.transformScale===n.transformScale&&t.isDroppable===n.isDroppable&&r(t.resizeHandles,n.resizeHandles)&&r(t.resizeHandle,n.resizeHandle)&&t.onLayoutChange===n.onLayoutChange&&t.onDragStart===n.onDragStart&&t.onDrag===n.onDrag&&t.onDragStop===n.onDragStop&&t.onResizeStart===n.onResizeStart&&t.onResize===n.onResize&&t.onResizeStop===n.onResizeStop&&t.onDrop===n.onDrop&&r(t.droppingItem,n.droppingItem)&&r(t.innerRef,n.innerRef)};Object.defineProperty(Ct,"__esModule",{value:!0});Ct.bottom=hC;Ct.childrenEqual=cQ;Ct.cloneLayout=JN;Ct.cloneLayoutItem=Zl;Ct.collides=$y;Ct.compact=e5;Ct.compactItem=t5;Ct.compactType=SQ;Ct.correctBounds=n5;Ct.fastPositionEqual=uQ;Ct.fastRGLPropsEqual=void 0;Ct.getAllCollisions=r5;Ct.getFirstCollision=Fl;Ct.getLayoutItem=pC;Ct.getStatics=gC;Ct.modifyLayout=ZN;Ct.moveElement=$f;Ct.moveElementAwayFromCollision=Vw;Ct.noop=void 0;Ct.perc=fQ;Ct.resizeItemInDirection=yQ;Ct.setTopLeft=xQ;Ct.setTransform=vQ;Ct.sortLayoutItems=wC;Ct.sortLayoutItemsByColRow=l5;Ct.sortLayoutItemsByRowCol=a5;Ct.synchronizeLayoutWithChildren=wQ;Ct.validateLayout=c5;Ct.withLayoutItem=lQ;var SM=dC,jf=sQ(P);function sQ(e){return e&&e.__esModule?e:{default:e}}const aQ=process.env.NODE_ENV==="production";function hC(e){let t=0,n;for(let r=0,i=e.length;r<i;r++)n=e[r].y+e[r].h,n>t&&(t=n);return t}function JN(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=Zl(e[n]);return t}function ZN(e,t){const n=Array(e.length);for(let r=0,i=e.length;r<i;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function lQ(e,t,n){let r=pC(e,t);return r?(r=n(Zl(r)),e=ZN(e,r),[e,r]):[e,null]}function Zl(e){return{w:e.w,h:e.h,x:e.x,y:e.y,i:e.i,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,isBounded:e.isBounded}}function cQ(e,t){return(0,SM.deepEqual)(jf.default.Children.map(e,n=>n==null?void 0:n.key),jf.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,SM.deepEqual)(jf.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),jf.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}Ct.fastRGLPropsEqual=oQ;function uQ(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function $y(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function e5(e,t,n,r){const i=gC(e),o=wC(e,t),s=Array(e.length);for(let a=0,l=o.length;a<l;a++){let c=Zl(o[a]);c.static||(c=t5(i,c,t,n,o,r),i.push(c)),s[e.indexOf(o[a])]=c,c.moved=!1}return s}const dQ={x:"w",y:"h"};function Hw(e,t,n,r){const i=dQ[r];t[r]+=1;const o=e.map(s=>s.i).indexOf(t.i);for(let s=o+1;s<e.length;s++){const a=e[s];if(!a.static){if(a.y>t.y+t.h)break;$y(t,a)&&Hw(e,a,n+t[i],r)}}t[r]=n}function t5(e,t,n,r,i,o){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(hC(e),t.y);t.y>0&&!Fl(e,t);)t.y--;else if(a)for(;t.x>0&&!Fl(e,t);)t.x--;let l;for(;(l=Fl(e,t))&&!(n===null&&o);)if(a?Hw(i,t,l.x+l.w,"x"):Hw(i,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!Fl(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function n5(e,t){const n=gC(e);for(let r=0,i=e.length;r<i;r++){const o=e[r];if(o.x+o.w>t.cols&&(o.x=t.cols-o.w),o.x<0&&(o.x=0,o.w=t.cols),!o.static)n.push(o);else for(;Fl(n,o);)o.y++}return e}function pC(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function Fl(e,t){for(let n=0,r=e.length;n<r;n++)if($y(e[n],t))return e[n]}function r5(e,t){return e.filter(n=>$y(n,t))}function gC(e){return e.filter(t=>t.static)}function $f(e,t,n,r,i,o,s,a,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;`${t.i}${String(n)}${String(r)}${t.x}${t.y}`;const c=t.x,u=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let d=wC(e,s);(s==="vertical"&&typeof r=="number"?u>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(d=d.reverse());const h=r5(d,t),m=h.length>0;if(m&&l)return JN(e);if(m&&o)return`${t.i}`,t.x=c,t.y=u,t.moved=!1,e;for(let b=0,v=h.length;b<v;b++){const x=h[b];`${t.i}${t.x}${t.y}${x.i}${x.x}${x.y}`,!x.moved&&(x.static?e=Vw(e,x,t,i,s):e=Vw(e,t,x,i,s))}return e}function Vw(e,t,n,r,i,o){const s=i==="horizontal",a=i==="vertical",l=t.static;if(r){r=!1;const d={x:s?Math.max(t.x-n.w,0):n.x,y:a?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},p=Fl(e,d),h=p&&p.y+p.h>t.y,m=p&&t.x+t.w>p.x;if(p){if(h&&a)return $f(e,n,void 0,t.y+1,r,l,i);if(h&&i==null)return t.y=n.y,n.y=n.y+n.h,e;if(m&&s)return $f(e,t,n.x,void 0,r,l,i)}else return`${n.i}${d.x}${d.y}`,$f(e,n,s?d.x:void 0,a?d.y:void 0,r,l,i)}const c=s?n.x+1:void 0,u=a?n.y+1:void 0;return c==null&&u==null?e:$f(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,i)}function fQ(e){return e*100+"%"}const i5=(e,t,n,r)=>e+n>r?t:n,o5=(e,t,n)=>e<0?t:n,s5=e=>Math.max(0,e),mC=e=>Math.max(0,e),bC=(e,t,n)=>{let{left:r,height:i,width:o}=t;const s=e.top-(i-e.height);return{left:r,width:o,height:o5(s,e.height,i),top:mC(s)}},yC=(e,t,n)=>{let{top:r,left:i,height:o,width:s}=t;return{top:r,height:o,width:i5(e.left,e.width,s,n),left:s5(i)}},vC=(e,t,n)=>{let{top:r,height:i,width:o}=t;const s=e.left-(o-e.width);return{height:i,width:s<0?e.width:i5(e.left,e.width,o,n),top:mC(r),left:s5(s)}},xC=(e,t,n)=>{let{top:r,left:i,height:o,width:s}=t;return{width:s,left:i,height:o5(r,e.height,o),top:mC(r)}},hQ=function(){return bC(arguments.length<=0?void 0:arguments[0],yC(...arguments))},pQ=function(){return bC(arguments.length<=0?void 0:arguments[0],vC(...arguments))},gQ=function(){return xC(arguments.length<=0?void 0:arguments[0],yC(...arguments))},mQ=function(){return xC(arguments.length<=0?void 0:arguments[0],vC(...arguments))},bQ={n:bC,ne:hQ,e:yC,se:gQ,s:xC,sw:mQ,w:vC,nw:pQ};function yQ(e,t,n,r){const i=bQ[e];return i?i(t,{...t,...n},r):n}function vQ(e){let{top:t,left:n,width:r,height:i}=e;const o=`translate(${n}px,${t}px)`;return{transform:o,WebkitTransform:o,MozTransform:o,msTransform:o,OTransform:o,width:`${r}px`,height:`${i}px`,position:"absolute"}}function xQ(e){let{top:t,left:n,width:r,height:i}=e;return{top:`${t}px`,left:`${n}px`,width:`${r}px`,height:`${i}px`,position:"absolute"}}function wC(e,t){return t==="horizontal"?l5(e):t==="vertical"?a5(e):e}function a5(e){return e.slice(0).sort(function(t,n){return t.y>n.y||t.y===n.y&&t.x>n.x?1:t.y===n.y&&t.x===n.x?0:-1})}function l5(e){return e.slice(0).sort(function(t,n){return t.x>n.x||t.x===n.x&&t.y>n.y?1:-1})}function wQ(e,t,n,r,i){e=e||[];const o=[];jf.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=pC(e,String(a.key)),c=a.props["data-grid"];l&&c==null?o.push(Zl(l)):c?(aQ||c5([c],"ReactGridLayout.children"),o.push(Zl({...c,i:a.key}))):o.push(Zl({w:1,h:1,x:0,y:hC(o),i:String(a.key)}))});const s=n5(o,{cols:n});return i?s:e5(s,r,n)}function c5(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const n=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(let r=0,i=e.length;r<i;r++){const o=e[r];for(let s=0;s<n.length;s++){const a=n[s],l=o[a];if(typeof l!="number"||Number.isNaN(l))throw new Error(`ReactGridLayout: ${t}[${r}].${a} must be a number! Received: ${l} (${typeof l})`)}if(typeof o.i<"u"&&typeof o.i!="string")throw new Error(`ReactGridLayout: ${t}[${r}].i must be a string! Received: ${o.i} (${typeof o.i})`)}}function SQ(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const _Q=()=>{};Ct.noop=_Q;var hs={};Object.defineProperty(hs,"__esModule",{value:!0});hs.calcGridColWidth=zy;hs.calcGridItemPosition=CQ;hs.calcGridItemWHPx=Ww;hs.calcWH=RQ;hs.calcXY=EQ;hs.clamp=jl;function zy(e){const{margin:t,containerPadding:n,containerWidth:r,cols:i}=e;return(r-t[0]*(i-1)-n[0]*2)/i}function Ww(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function CQ(e,t,n,r,i,o){const{margin:s,containerPadding:a,rowHeight:l}=e,c=zy(e),u={};return o&&o.resizing?(u.width=Math.round(o.resizing.width),u.height=Math.round(o.resizing.height)):(u.width=Ww(r,c,s[0]),u.height=Ww(i,l,s[1])),o&&o.dragging?(u.top=Math.round(o.dragging.top),u.left=Math.round(o.dragging.left)):o&&o.resizing&&typeof o.resizing.top=="number"&&typeof o.resizing.left=="number"?(u.top=Math.round(o.resizing.top),u.left=Math.round(o.resizing.left)):(u.top=Math.round((l+s[1])*n+a[1]),u.left=Math.round((c+s[0])*t+a[0])),u}function EQ(e,t,n,r,i){const{margin:o,containerPadding:s,cols:a,rowHeight:l,maxRows:c}=e,u=zy(e);let d=Math.round((n-s[0])/(u+o[0])),p=Math.round((t-s[1])/(l+o[1]));return d=jl(d,0,a-r),p=jl(p,0,c-i),{x:d,y:p}}function RQ(e,t,n,r,i,o){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,u=zy(e);let d=Math.round((t+s[0])/(u+s[0])),p=Math.round((n+s[1])/(c+s[1])),h=jl(d,0,l-r),m=jl(p,0,a-i);return["sw","w","nw"].indexOf(o)!==-1&&(h=jl(d,0,l)),["nw","n","ne"].indexOf(o)!==-1&&(m=jl(p,0,a)),{w:h,h:m}}function jl(e,t,n){return Math.max(Math.min(e,n),t)}var By={},Uw={exports:{}},Gg={exports:{}},Kt={};/** @license React v16.13.1
|
|
92
|
-
* react-is.production.min.js
|
|
93
|
-
*
|
|
94
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
95
|
-
*
|
|
96
|
-
* This source code is licensed under the MIT license found in the
|
|
97
|
-
* LICENSE file in the root directory of this source tree.
|
|
98
|
-
*/var _M;function PQ(){if(_M)return Kt;_M=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,b=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,x=e?Symbol.for("react.responder"):60118,S=e?Symbol.for("react.scope"):60119;function _(C){if(typeof C=="object"&&C!==null){var M=C.$$typeof;switch(M){case t:switch(C=C.type,C){case l:case c:case r:case o:case i:case d:return C;default:switch(C=C&&C.$$typeof,C){case a:case u:case m:case h:case s:return C;default:return M}}case n:return M}}}function E(C){return _(C)===c}return Kt.AsyncMode=l,Kt.ConcurrentMode=c,Kt.ContextConsumer=a,Kt.ContextProvider=s,Kt.Element=t,Kt.ForwardRef=u,Kt.Fragment=r,Kt.Lazy=m,Kt.Memo=h,Kt.Portal=n,Kt.Profiler=o,Kt.StrictMode=i,Kt.Suspense=d,Kt.isAsyncMode=function(C){return E(C)||_(C)===l},Kt.isConcurrentMode=E,Kt.isContextConsumer=function(C){return _(C)===a},Kt.isContextProvider=function(C){return _(C)===s},Kt.isElement=function(C){return typeof C=="object"&&C!==null&&C.$$typeof===t},Kt.isForwardRef=function(C){return _(C)===u},Kt.isFragment=function(C){return _(C)===r},Kt.isLazy=function(C){return _(C)===m},Kt.isMemo=function(C){return _(C)===h},Kt.isPortal=function(C){return _(C)===n},Kt.isProfiler=function(C){return _(C)===o},Kt.isStrictMode=function(C){return _(C)===i},Kt.isSuspense=function(C){return _(C)===d},Kt.isValidElementType=function(C){return typeof C=="string"||typeof C=="function"||C===r||C===c||C===o||C===i||C===d||C===p||typeof C=="object"&&C!==null&&(C.$$typeof===m||C.$$typeof===h||C.$$typeof===s||C.$$typeof===a||C.$$typeof===u||C.$$typeof===v||C.$$typeof===x||C.$$typeof===S||C.$$typeof===b)},Kt.typeOf=_,Kt}var Xt={};/** @license React v16.13.1
|
|
99
|
-
* react-is.development.js
|
|
100
|
-
*
|
|
101
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
102
|
-
*
|
|
103
|
-
* This source code is licensed under the MIT license found in the
|
|
104
|
-
* LICENSE file in the root directory of this source tree.
|
|
105
|
-
*/var CM;function TQ(){return CM||(CM=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,b=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,x=e?Symbol.for("react.responder"):60118,S=e?Symbol.for("react.scope"):60119;function _(ie){return typeof ie=="string"||typeof ie=="function"||ie===r||ie===c||ie===o||ie===i||ie===d||ie===p||typeof ie=="object"&&ie!==null&&(ie.$$typeof===m||ie.$$typeof===h||ie.$$typeof===s||ie.$$typeof===a||ie.$$typeof===u||ie.$$typeof===v||ie.$$typeof===x||ie.$$typeof===S||ie.$$typeof===b)}function E(ie){if(typeof ie=="object"&&ie!==null){var ge=ie.$$typeof;switch(ge){case t:var de=ie.type;switch(de){case l:case c:case r:case o:case i:case d:return de;default:var Ee=de&&de.$$typeof;switch(Ee){case a:case u:case m:case h:case s:return Ee;default:return ge}}case n:return ge}}}var C=l,M=c,O=a,k=s,N=t,F=u,j=r,$=m,X=h,V=n,L=o,U=i,B=d,W=!1;function q(ie){return W||(W=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),A(ie)||E(ie)===l}function A(ie){return E(ie)===c}function Y(ie){return E(ie)===a}function G(ie){return E(ie)===s}function D(ie){return typeof ie=="object"&&ie!==null&&ie.$$typeof===t}function ee(ie){return E(ie)===u}function K(ie){return E(ie)===r}function oe(ie){return E(ie)===m}function J(ie){return E(ie)===h}function Z(ie){return E(ie)===n}function ae(ie){return E(ie)===o}function ce(ie){return E(ie)===i}function pe(ie){return E(ie)===d}Xt.AsyncMode=C,Xt.ConcurrentMode=M,Xt.ContextConsumer=O,Xt.ContextProvider=k,Xt.Element=N,Xt.ForwardRef=F,Xt.Fragment=j,Xt.Lazy=$,Xt.Memo=X,Xt.Portal=V,Xt.Profiler=L,Xt.StrictMode=U,Xt.Suspense=B,Xt.isAsyncMode=q,Xt.isConcurrentMode=A,Xt.isContextConsumer=Y,Xt.isContextProvider=G,Xt.isElement=D,Xt.isForwardRef=ee,Xt.isFragment=K,Xt.isLazy=oe,Xt.isMemo=J,Xt.isPortal=Z,Xt.isProfiler=ae,Xt.isStrictMode=ce,Xt.isSuspense=pe,Xt.isValidElementType=_,Xt.typeOf=E}()),Xt}var EM;function u5(){return EM||(EM=1,process.env.NODE_ENV==="production"?Gg.exports=PQ():Gg.exports=TQ()),Gg.exports}/*
|
|
106
|
-
object-assign
|
|
107
|
-
(c) Sindre Sorhus
|
|
108
|
-
@license MIT
|
|
109
|
-
*/var _x,RM;function MQ(){if(RM)return _x;RM=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function i(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var s={},a=0;a<10;a++)s["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(s).map(function(u){return s[u]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return _x=i()?Object.assign:function(o,s){for(var a,l=r(o),c,u=1;u<arguments.length;u++){a=Object(arguments[u]);for(var d in a)t.call(a,d)&&(l[d]=a[d]);if(e){c=e(a);for(var p=0;p<c.length;p++)n.call(a,c[p])&&(l[c[p]]=a[c[p]])}}return l},_x}var Cx,PM;function SC(){if(PM)return Cx;PM=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Cx=e,Cx}var Ex,TM;function d5(){return TM||(TM=1,Ex=Function.call.bind(Object.prototype.hasOwnProperty)),Ex}var Rx,MM;function OQ(){if(MM)return Rx;MM=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=SC(),n={},r=d5();e=function(o){var s="Warning: "+o;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function i(o,s,a,l,c){if(process.env.NODE_ENV!=="production"){for(var u in o)if(r(o,u)){var d;try{if(typeof o[u]!="function"){var p=Error((l||"React class")+": "+a+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw p.name="Invariant Violation",p}d=o[u](s,u,l,a,null,t)}catch(m){d=m}if(d&&!(d instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in n)){n[d.message]=!0;var h=c?c():"";e("Failed "+a+" type: "+d.message+(h??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Rx=i,Rx}var Px,OM;function DQ(){if(OM)return Px;OM=1;var e=u5(),t=MQ(),n=SC(),r=d5(),i=OQ(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function s(){return null}return Px=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function d(A){var Y=A&&(c&&A[c]||A[u]);if(typeof Y=="function")return Y}var p="<<anonymous>>",h={array:x("array"),bigint:x("bigint"),bool:x("boolean"),func:x("function"),number:x("number"),object:x("object"),string:x("string"),symbol:x("symbol"),any:S(),arrayOf:_,element:E(),elementType:C(),instanceOf:M,node:F(),objectOf:k,oneOf:O,oneOfType:N,shape:$,exact:X};function m(A,Y){return A===Y?A!==0||1/A===1/Y:A!==A&&Y!==Y}function b(A,Y){this.message=A,this.data=Y&&typeof Y=="object"?Y:{},this.stack=""}b.prototype=Error.prototype;function v(A){if(process.env.NODE_ENV!=="production")var Y={},G=0;function D(K,oe,J,Z,ae,ce,pe){if(Z=Z||p,ce=ce||J,pe!==n){if(l){var ie=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 ie.name="Invariant Violation",ie}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ge=Z+":"+J;!Y[ge]&&G<3&&(o("You are manually calling a React.PropTypes validation function for the `"+ce+"` prop on `"+Z+"`. 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."),Y[ge]=!0,G++)}}return oe[J]==null?K?oe[J]===null?new b("The "+ae+" `"+ce+"` is marked as required "+("in `"+Z+"`, but its value is `null`.")):new b("The "+ae+" `"+ce+"` is marked as required in "+("`"+Z+"`, but its value is `undefined`.")):null:A(oe,J,Z,ae,ce)}var ee=D.bind(null,!1);return ee.isRequired=D.bind(null,!0),ee}function x(A){function Y(G,D,ee,K,oe,J){var Z=G[D],ae=U(Z);if(ae!==A){var ce=B(Z);return new b("Invalid "+K+" `"+oe+"` of type "+("`"+ce+"` supplied to `"+ee+"`, expected ")+("`"+A+"`."),{expectedType:A})}return null}return v(Y)}function S(){return v(s)}function _(A){function Y(G,D,ee,K,oe){if(typeof A!="function")return new b("Property `"+oe+"` of component `"+ee+"` has invalid PropType notation inside arrayOf.");var J=G[D];if(!Array.isArray(J)){var Z=U(J);return new b("Invalid "+K+" `"+oe+"` of type "+("`"+Z+"` supplied to `"+ee+"`, expected an array."))}for(var ae=0;ae<J.length;ae++){var ce=A(J,ae,ee,K,oe+"["+ae+"]",n);if(ce instanceof Error)return ce}return null}return v(Y)}function E(){function A(Y,G,D,ee,K){var oe=Y[G];if(!a(oe)){var J=U(oe);return new b("Invalid "+ee+" `"+K+"` of type "+("`"+J+"` supplied to `"+D+"`, expected a single ReactElement."))}return null}return v(A)}function C(){function A(Y,G,D,ee,K){var oe=Y[G];if(!e.isValidElementType(oe)){var J=U(oe);return new b("Invalid "+ee+" `"+K+"` of type "+("`"+J+"` supplied to `"+D+"`, expected a single ReactElement type."))}return null}return v(A)}function M(A){function Y(G,D,ee,K,oe){if(!(G[D]instanceof A)){var J=A.name||p,Z=q(G[D]);return new b("Invalid "+K+" `"+oe+"` of type "+("`"+Z+"` supplied to `"+ee+"`, expected ")+("instance of `"+J+"`."))}return null}return v(Y)}function O(A){if(!Array.isArray(A))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.")),s;function Y(G,D,ee,K,oe){for(var J=G[D],Z=0;Z<A.length;Z++)if(m(J,A[Z]))return null;var ae=JSON.stringify(A,function(pe,ie){var ge=B(ie);return ge==="symbol"?String(ie):ie});return new b("Invalid "+K+" `"+oe+"` of value `"+String(J)+"` "+("supplied to `"+ee+"`, expected one of "+ae+"."))}return v(Y)}function k(A){function Y(G,D,ee,K,oe){if(typeof A!="function")return new b("Property `"+oe+"` of component `"+ee+"` has invalid PropType notation inside objectOf.");var J=G[D],Z=U(J);if(Z!=="object")return new b("Invalid "+K+" `"+oe+"` of type "+("`"+Z+"` supplied to `"+ee+"`, expected an object."));for(var ae in J)if(r(J,ae)){var ce=A(J,ae,ee,K,oe+"."+ae,n);if(ce instanceof Error)return ce}return null}return v(Y)}function N(A){if(!Array.isArray(A))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var Y=0;Y<A.length;Y++){var G=A[Y];if(typeof G!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+W(G)+" at index "+Y+"."),s}function D(ee,K,oe,J,Z){for(var ae=[],ce=0;ce<A.length;ce++){var pe=A[ce],ie=pe(ee,K,oe,J,Z,n);if(ie==null)return null;ie.data&&r(ie.data,"expectedType")&&ae.push(ie.data.expectedType)}var ge=ae.length>0?", expected one of type ["+ae.join(", ")+"]":"";return new b("Invalid "+J+" `"+Z+"` supplied to "+("`"+oe+"`"+ge+"."))}return v(D)}function F(){function A(Y,G,D,ee,K){return V(Y[G])?null:new b("Invalid "+ee+" `"+K+"` supplied to "+("`"+D+"`, expected a ReactNode."))}return v(A)}function j(A,Y,G,D,ee){return new b((A||"React class")+": "+Y+" type `"+G+"."+D+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+ee+"`.")}function $(A){function Y(G,D,ee,K,oe){var J=G[D],Z=U(J);if(Z!=="object")return new b("Invalid "+K+" `"+oe+"` of type `"+Z+"` "+("supplied to `"+ee+"`, expected `object`."));for(var ae in A){var ce=A[ae];if(typeof ce!="function")return j(ee,K,oe,ae,B(ce));var pe=ce(J,ae,ee,K,oe+"."+ae,n);if(pe)return pe}return null}return v(Y)}function X(A){function Y(G,D,ee,K,oe){var J=G[D],Z=U(J);if(Z!=="object")return new b("Invalid "+K+" `"+oe+"` of type `"+Z+"` "+("supplied to `"+ee+"`, expected `object`."));var ae=t({},G[D],A);for(var ce in ae){var pe=A[ce];if(r(A,ce)&&typeof pe!="function")return j(ee,K,oe,ce,B(pe));if(!pe)return new b("Invalid "+K+" `"+oe+"` key `"+ce+"` supplied to `"+ee+"`.\nBad object: "+JSON.stringify(G[D],null," ")+`
|
|
110
|
-
Valid keys: `+JSON.stringify(Object.keys(A),null," "));var ie=pe(J,ce,ee,K,oe+"."+ce,n);if(ie)return ie}return null}return v(Y)}function V(A){switch(typeof A){case"number":case"string":case"undefined":return!0;case"boolean":return!A;case"object":if(Array.isArray(A))return A.every(V);if(A===null||a(A))return!0;var Y=d(A);if(Y){var G=Y.call(A),D;if(Y!==A.entries){for(;!(D=G.next()).done;)if(!V(D.value))return!1}else for(;!(D=G.next()).done;){var ee=D.value;if(ee&&!V(ee[1]))return!1}}else return!1;return!0;default:return!1}}function L(A,Y){return A==="symbol"?!0:Y?Y["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&Y instanceof Symbol:!1}function U(A){var Y=typeof A;return Array.isArray(A)?"array":A instanceof RegExp?"object":L(Y,A)?"symbol":Y}function B(A){if(typeof A>"u"||A===null)return""+A;var Y=U(A);if(Y==="object"){if(A instanceof Date)return"date";if(A instanceof RegExp)return"regexp"}return Y}function W(A){var Y=B(A);switch(Y){case"array":case"object":return"an "+Y;case"boolean":case"date":case"regexp":return"a "+Y;default:return Y}}function q(A){return!A.constructor||!A.constructor.name?p:A.constructor.name}return h.checkPropTypes=i,h.resetWarningCache=i.resetWarningCache,h.PropTypes=h,h},Px}var Tx,DM;function AQ(){if(DM)return Tx;DM=1;var e=SC();function t(){}function n(){}return n.resetWarningCache=t,Tx=function(){function r(s,a,l,c,u,d){if(d!==e){var p=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 p.name="Invariant Violation",p}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Tx}if(process.env.NODE_ENV!=="production"){var kQ=u5(),IQ=!0;Uw.exports=DQ()(kQ.isElement,IQ)}else Uw.exports=AQ()();var el=Uw.exports,Hy={exports:{}},f5={};function h5(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=h5(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function AM(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=h5(e))&&(r&&(r+=" "),r+=t);return r}const NQ=Object.freeze(Object.defineProperty({__proto__:null,clsx:AM,default:AM},Symbol.toStringTag,{value:"Module"})),LQ=z_(NQ);var Ln={},ps={};Object.defineProperty(ps,"__esModule",{value:!0});ps.dontSetMe=BQ;ps.findInArray=FQ;ps.int=zQ;ps.isFunction=jQ;ps.isNum=$Q;function FQ(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function jQ(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function $Q(e){return typeof e=="number"&&!isNaN(e)}function zQ(e){return parseInt(e,10)}function BQ(e,t,n){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(n," - do not set this, set it on the child."))}var kc={};Object.defineProperty(kc,"__esModule",{value:!0});kc.browserPrefixToKey=g5;kc.browserPrefixToStyle=HQ;kc.default=void 0;kc.getPrefix=p5;const Mx=["Moz","Webkit","O","ms"];function p5(){var e;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const n=(e=window.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.style;if(!n||t in n)return"";for(let r=0;r<Mx.length;r++)if(g5(t,Mx[r])in n)return Mx[r];return""}function g5(e,t){return t?"".concat(t).concat(VQ(e)):e}function HQ(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function VQ(e){let t="",n=!0;for(let r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):e[r]==="-"?n=!0:t+=e[r];return t}kc.default=p5();Object.defineProperty(Ln,"__esModule",{value:!0});Ln.addClassName=y5;Ln.addEvent=GQ;Ln.addUserSelectStyles=rJ;Ln.createCSSTransform=ZQ;Ln.createSVGTransform=eJ;Ln.getTouch=tJ;Ln.getTouchIdentifier=nJ;Ln.getTranslation=_C;Ln.innerHeight=XQ;Ln.innerWidth=QQ;Ln.matchesSelector=b5;Ln.matchesSelectorAndParentsTo=UQ;Ln.offsetXYFromParent=JQ;Ln.outerHeight=YQ;Ln.outerWidth=KQ;Ln.removeClassName=v5;Ln.removeEvent=qQ;Ln.removeUserSelectStyles=iJ;var Li=ps,kM=WQ(kc);function m5(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(m5=function(r){return r?n:t})(e)}function WQ(e,t){if(e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=m5(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}let qg="";function b5(e,t){return qg||(qg=(0,Li.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,Li.isFunction)(e[n])})),(0,Li.isFunction)(e[qg])?e[qg](t):!1}function UQ(e,t,n){let r=e;do{if(b5(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function GQ(e,t,n,r){if(!e)return;const i={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,i):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n}function qQ(e,t,n,r){if(!e)return;const i={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,i):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null}function YQ(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Li.int)(n.borderTopWidth),t+=(0,Li.int)(n.borderBottomWidth),t}function KQ(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Li.int)(n.borderLeftWidth),t+=(0,Li.int)(n.borderRightWidth),t}function XQ(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Li.int)(n.paddingTop),t-=(0,Li.int)(n.paddingBottom),t}function QQ(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Li.int)(n.paddingLeft),t-=(0,Li.int)(n.paddingRight),t}function JQ(e,t,n){const i=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),o=(e.clientX+t.scrollLeft-i.left)/n,s=(e.clientY+t.scrollTop-i.top)/n;return{x:o,y:s}}function ZQ(e,t){const n=_C(e,t,"px");return{[(0,kM.browserPrefixToKey)("transform",kM.default)]:n}}function eJ(e,t){return _C(e,t,"")}function _C(e,t,n){let{x:r,y:i}=e,o="translate(".concat(r).concat(n,",").concat(i).concat(n,")");if(t){const s="".concat(typeof t.x=="string"?t.x:t.x+n),a="".concat(typeof t.y=="string"?t.y:t.y+n);o="translate(".concat(s,", ").concat(a,")")+o}return o}function tJ(e,t){return e.targetTouches&&(0,Li.findInArray)(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&(0,Li.findInArray)(e.changedTouches,n=>t===n.identifier)}function nJ(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function rJ(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
111
|
-
`,t.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
112
|
-
`,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&y5(e.body,"react-draggable-transparent-selection")}function iJ(e){if(e)try{if(e.body&&v5(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&t.type!=="Caret"&&t.removeAllRanges()}}catch{}}function y5(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function v5(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var gs={};Object.defineProperty(gs,"__esModule",{value:!0});gs.canDragX=aJ;gs.canDragY=lJ;gs.createCoreData=uJ;gs.createDraggableData=dJ;gs.getBoundPosition=oJ;gs.getControlPosition=cJ;gs.snapToGrid=sJ;var Pi=ps,vu=Ln;function oJ(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:fJ(r);const i=CC(e);if(typeof r=="string"){const{ownerDocument:o}=i,s=o.defaultView;let a;if(r==="parent"?a=i.parentNode:a=o.querySelector(r),!(a instanceof s.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=a,c=s.getComputedStyle(i),u=s.getComputedStyle(l);r={left:-i.offsetLeft+(0,Pi.int)(u.paddingLeft)+(0,Pi.int)(c.marginLeft),top:-i.offsetTop+(0,Pi.int)(u.paddingTop)+(0,Pi.int)(c.marginTop),right:(0,vu.innerWidth)(l)-(0,vu.outerWidth)(i)-i.offsetLeft+(0,Pi.int)(u.paddingRight)-(0,Pi.int)(c.marginRight),bottom:(0,vu.innerHeight)(l)-(0,vu.outerHeight)(i)-i.offsetTop+(0,Pi.int)(u.paddingBottom)-(0,Pi.int)(c.marginBottom)}}return(0,Pi.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,Pi.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,Pi.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,Pi.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function sJ(e,t,n){const r=Math.round(t/e[0])*e[0],i=Math.round(n/e[1])*e[1];return[r,i]}function aJ(e){return e.props.axis==="both"||e.props.axis==="x"}function lJ(e){return e.props.axis==="both"||e.props.axis==="y"}function cJ(e,t,n){const r=typeof t=="number"?(0,vu.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const i=CC(n),o=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return(0,vu.offsetXYFromParent)(r||e,o,n.props.scale)}function uJ(e,t,n){const r=!(0,Pi.isNum)(e.lastX),i=CC(e);return r?{node:i,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:i,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function dJ(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function fJ(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function CC(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var Vy={},Wy={};Object.defineProperty(Wy,"__esModule",{value:!0});Wy.default=hJ;function hJ(){}Object.defineProperty(Vy,"__esModule",{value:!0});Vy.default=void 0;var Ox=gJ(P),ri=EC(el),pJ=EC(Tr),Sr=Ln,ba=gs,Dx=ps,hf=EC(Wy);function EC(e){return e&&e.__esModule?e:{default:e}}function x5(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(x5=function(r){return r?n:t})(e)}function gJ(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=x5(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function zr(e,t,n){return t=mJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mJ(e){var t=bJ(e,"string");return typeof t=="symbol"?t:String(t)}function bJ(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const vo={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let ya=vo.mouse,Uy=class extends Ox.Component{constructor(){super(...arguments),zr(this,"dragging",!1),zr(this,"lastX",NaN),zr(this,"lastY",NaN),zr(this,"touchIdentifier",null),zr(this,"mounted",!1),zr(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&typeof t.button=="number"&&t.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:r}=n;if(this.props.disabled||!(t.target instanceof r.defaultView.Node)||this.props.handle&&!(0,Sr.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,Sr.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const i=(0,Sr.getTouchIdentifier)(t);this.touchIdentifier=i;const o=(0,ba.getControlPosition)(t,i,this);if(o==null)return;const{x:s,y:a}=o,l=(0,ba.createCoreData)(this,s,a);(0,hf.default)("DraggableCore: handleDragStart: %j",l),(0,hf.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,Sr.addUserSelectStyles)(r),this.dragging=!0,this.lastX=s,this.lastY=a,(0,Sr.addEvent)(r,ya.move,this.handleDrag),(0,Sr.addEvent)(r,ya.stop,this.handleDragStop))}),zr(this,"handleDrag",t=>{const n=(0,ba.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:i}=n;if(Array.isArray(this.props.grid)){let a=r-this.lastX,l=i-this.lastY;if([a,l]=(0,ba.snapToGrid)(this.props.grid,a,l),!a&&!l)return;r=this.lastX+a,i=this.lastY+l}const o=(0,ba.createCoreData)(this,r,i);if((0,hf.default)("DraggableCore: handleDrag: %j",o),this.props.onDrag(t,o)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const l=document.createEvent("MouseEvents");l.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(l)}return}this.lastX=r,this.lastY=i}),zr(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,ba.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:i}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX||0,c=i-this.lastY||0;[l,c]=(0,ba.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,i=this.lastY+c}const o=(0,ba.createCoreData)(this,r,i);if(this.props.onStop(t,o)===!1||this.mounted===!1)return!1;const a=this.findDOMNode();a&&this.props.enableUserSelectHack&&(0,Sr.removeUserSelectStyles)(a.ownerDocument),(0,hf.default)("DraggableCore: handleDragStop: %j",o),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,hf.default)("DraggableCore: Removing handlers"),(0,Sr.removeEvent)(a.ownerDocument,ya.move,this.handleDrag),(0,Sr.removeEvent)(a.ownerDocument,ya.stop,this.handleDragStop))}),zr(this,"onMouseDown",t=>(ya=vo.mouse,this.handleDragStart(t))),zr(this,"onMouseUp",t=>(ya=vo.mouse,this.handleDragStop(t))),zr(this,"onTouchStart",t=>(ya=vo.touch,this.handleDragStart(t))),zr(this,"onTouchEnd",t=>(ya=vo.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,Sr.addEvent)(t,vo.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,Sr.removeEvent)(n,vo.mouse.move,this.handleDrag),(0,Sr.removeEvent)(n,vo.touch.move,this.handleDrag),(0,Sr.removeEvent)(n,vo.mouse.stop,this.handleDragStop),(0,Sr.removeEvent)(n,vo.touch.stop,this.handleDragStop),(0,Sr.removeEvent)(t,vo.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,Sr.removeUserSelectStyles)(n)}}findDOMNode(){var t,n;return(t=this.props)!==null&&t!==void 0&&t.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:pJ.default.findDOMNode(this)}render(){return Ox.cloneElement(Ox.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Vy.default=Uy;zr(Uy,"displayName","DraggableCore");zr(Uy,"propTypes",{allowAnyClick:ri.default.bool,children:ri.default.node.isRequired,disabled:ri.default.bool,enableUserSelectHack:ri.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:ri.default.arrayOf(ri.default.number),handle:ri.default.string,cancel:ri.default.string,nodeRef:ri.default.object,onStart:ri.default.func,onDrag:ri.default.func,onStop:ri.default.func,onMouseDown:ri.default.func,scale:ri.default.number,className:Dx.dontSetMe,style:Dx.dontSetMe,transform:Dx.dontSetMe});zr(Uy,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1});(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),e.default=void 0;var t=p(P),n=u(el),r=u(Tr),i=u(LQ),o=Ln,s=gs,a=ps,l=u(Vy),c=u(Wy);function u(S){return S&&S.__esModule?S:{default:S}}function d(S){if(typeof WeakMap!="function")return null;var _=new WeakMap,E=new WeakMap;return(d=function(C){return C?E:_})(S)}function p(S,_){if(S&&S.__esModule)return S;if(S===null||typeof S!="object"&&typeof S!="function")return{default:S};var E=d(_);if(E&&E.has(S))return E.get(S);var C={},M=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var O in S)if(O!=="default"&&Object.prototype.hasOwnProperty.call(S,O)){var k=M?Object.getOwnPropertyDescriptor(S,O):null;k&&(k.get||k.set)?Object.defineProperty(C,O,k):C[O]=S[O]}return C.default=S,E&&E.set(S,C),C}function h(){return h=Object.assign?Object.assign.bind():function(S){for(var _=1;_<arguments.length;_++){var E=arguments[_];for(var C in E)Object.prototype.hasOwnProperty.call(E,C)&&(S[C]=E[C])}return S},h.apply(this,arguments)}function m(S,_,E){return _=b(_),_ in S?Object.defineProperty(S,_,{value:E,enumerable:!0,configurable:!0,writable:!0}):S[_]=E,S}function b(S){var _=v(S,"string");return typeof _=="symbol"?_:String(_)}function v(S,_){if(typeof S!="object"||S===null)return S;var E=S[Symbol.toPrimitive];if(E!==void 0){var C=E.call(S,_||"default");if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(_==="string"?String:Number)(S)}class x extends t.Component{static getDerivedStateFromProps(_,E){let{position:C}=_,{prevPropsPosition:M}=E;return C&&(!M||C.x!==M.x||C.y!==M.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:C,prevPropsPosition:M}),{x:C.x,y:C.y,prevPropsPosition:{...C}}):null}constructor(_){super(_),m(this,"onDragStart",(E,C)=>{if((0,c.default)("Draggable: onDragStart: %j",C),this.props.onStart(E,(0,s.createDraggableData)(this,C))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),m(this,"onDrag",(E,C)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",C);const M=(0,s.createDraggableData)(this,C),O={x:M.x,y:M.y,slackX:0,slackY:0};if(this.props.bounds){const{x:N,y:F}=O;O.x+=this.state.slackX,O.y+=this.state.slackY;const[j,$]=(0,s.getBoundPosition)(this,O.x,O.y);O.x=j,O.y=$,O.slackX=this.state.slackX+(N-O.x),O.slackY=this.state.slackY+(F-O.y),M.x=O.x,M.y=O.y,M.deltaX=O.x-this.state.x,M.deltaY=O.y-this.state.y}if(this.props.onDrag(E,M)===!1)return!1;this.setState(O)}),m(this,"onDragStop",(E,C)=>{if(!this.state.dragging||this.props.onStop(E,(0,s.createDraggableData)(this,C))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",C);const O={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:N,y:F}=this.props.position;O.x=N,O.y=F}this.setState(O)}),this.state={dragging:!1,dragged:!1,x:_.position?_.position.x:_.defaultPosition.x,y:_.position?_.position.y:_.defaultPosition.y,prevPropsPosition:{..._.position},slackX:0,slackY:0,isElementSVG:!1},_.position&&!(_.onDrag||_.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var _,E;return(_=(E=this.props)===null||E===void 0||(E=E.nodeRef)===null||E===void 0?void 0:E.current)!==null&&_!==void 0?_:r.default.findDOMNode(this)}render(){const{axis:_,bounds:E,children:C,defaultPosition:M,defaultClassName:O,defaultClassNameDragging:k,defaultClassNameDragged:N,position:F,positionOffset:j,scale:$,...X}=this.props;let V={},L=null;const B=!!!F||this.state.dragging,W=F||M,q={x:(0,s.canDragX)(this)&&B?this.state.x:W.x,y:(0,s.canDragY)(this)&&B?this.state.y:W.y};this.state.isElementSVG?L=(0,o.createSVGTransform)(q,j):V=(0,o.createCSSTransform)(q,j);const A=(0,i.default)(C.props.className||"",O,{[k]:this.state.dragging,[N]:this.state.dragged});return t.createElement(l.default,h({},X,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(C),{className:A,style:{...C.props.style,...V},transform:L}))}}e.default=x,m(x,"displayName","Draggable"),m(x,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:a.dontSetMe,style:a.dontSetMe,transform:a.dontSetMe}),m(x,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(f5);const{default:w5,DraggableCore:yJ}=f5;Hy.exports=w5;Hy.exports.default=w5;Hy.exports.DraggableCore=yJ;var S5=Hy.exports,Gy={exports:{}},Sp={},RC={};RC.__esModule=!0;RC.cloneElement=CJ;var vJ=xJ(P);function xJ(e){return e&&e.__esModule?e:{default:e}}function IM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function NM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?IM(Object(n),!0).forEach(function(r){wJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wJ(e,t,n){return t=SJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SJ(e){var t=_J(e,"string");return typeof t=="symbol"?t:String(t)}function _J(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function CJ(e,t){return t.style&&e.props.style&&(t.style=NM(NM({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),vJ.default.cloneElement(e,t)}var _p={};_p.__esModule=!0;_p.resizableProps=void 0;var ht=EJ(el);function EJ(e){return e&&e.__esModule?e:{default:e}}var RJ={axis:ht.default.oneOf(["both","x","y","none"]),className:ht.default.string,children:ht.default.element.isRequired,draggableOpts:ht.default.shape({allowAnyClick:ht.default.bool,cancel:ht.default.string,children:ht.default.node,disabled:ht.default.bool,enableUserSelectHack:ht.default.bool,offsetParent:ht.default.node,grid:ht.default.arrayOf(ht.default.number),handle:ht.default.string,nodeRef:ht.default.object,onStart:ht.default.func,onDrag:ht.default.func,onStop:ht.default.func,onMouseDown:ht.default.func,scale:ht.default.number}),height:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0];if(i.axis==="both"||i.axis==="y"){var o;return(o=ht.default.number).isRequired.apply(o,n)}return ht.default.number.apply(ht.default,n)},handle:ht.default.oneOfType([ht.default.node,ht.default.func]),handleSize:ht.default.arrayOf(ht.default.number),lockAspectRatio:ht.default.bool,maxConstraints:ht.default.arrayOf(ht.default.number),minConstraints:ht.default.arrayOf(ht.default.number),onResizeStop:ht.default.func,onResizeStart:ht.default.func,onResize:ht.default.func,resizeHandles:ht.default.arrayOf(ht.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:ht.default.number,width:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0];if(i.axis==="both"||i.axis==="x"){var o;return(o=ht.default.number).isRequired.apply(o,n)}return ht.default.number.apply(ht.default,n)}};_p.resizableProps=RJ;Sp.__esModule=!0;Sp.default=void 0;var pf=DJ(P),PJ=S5,TJ=RC,MJ=_p,OJ=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function _5(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(_5=function(i){return i?n:t})(e)}function DJ(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=_5(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function Gw(){return Gw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Gw.apply(this,arguments)}function AJ(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function LM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ax(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LM(Object(n),!0).forEach(function(r){kJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kJ(e,t,n){return t=IJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function IJ(e){var t=NJ(e,"string");return typeof t=="symbol"?t:String(t)}function NJ(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function LJ(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,qw(e,t)}function qw(e,t){return qw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},qw(e,t)}var PC=function(e){LJ(t,e);function t(){for(var r,i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r=e.call.apply(e,[this].concat(o))||this,r.handleRefs={},r.lastHandleRect=null,r.slack=null,r}var n=t.prototype;return n.componentWillUnmount=function(){this.resetData()},n.resetData=function(){this.lastHandleRect=this.slack=null},n.runConstraints=function(i,o){var s=this.props,a=s.minConstraints,l=s.maxConstraints,c=s.lockAspectRatio;if(!a&&!l&&!c)return[i,o];if(c){var u=this.props.width/this.props.height,d=i-this.props.width,p=o-this.props.height;Math.abs(d)>Math.abs(p*u)?o=i/u:i=o*u}var h=i,m=o,b=this.slack||[0,0],v=b[0],x=b[1];return i+=v,o+=x,a&&(i=Math.max(a[0],i),o=Math.max(a[1],o)),l&&(i=Math.min(l[0],i),o=Math.min(l[1],o)),this.slack=[v+(h-i),x+(m-o)],[i,o]},n.resizeHandler=function(i,o){var s=this;return function(a,l){var c=l.node,u=l.deltaX,d=l.deltaY;i==="onResizeStart"&&s.resetData();var p=(s.props.axis==="both"||s.props.axis==="x")&&o!=="n"&&o!=="s",h=(s.props.axis==="both"||s.props.axis==="y")&&o!=="e"&&o!=="w";if(!(!p&&!h)){var m=o[0],b=o[o.length-1],v=c.getBoundingClientRect();if(s.lastHandleRect!=null){if(b==="w"){var x=v.left-s.lastHandleRect.left;u+=x}if(m==="n"){var S=v.top-s.lastHandleRect.top;d+=S}}s.lastHandleRect=v,b==="w"&&(u=-u),m==="n"&&(d=-d);var _=s.props.width+(p?u/s.props.transformScale:0),E=s.props.height+(h?d/s.props.transformScale:0),C=s.runConstraints(_,E);_=C[0],E=C[1];var M=_!==s.props.width||E!==s.props.height,O=typeof s.props[i]=="function"?s.props[i]:null,k=i==="onResize"&&!M;O&&!k&&(a.persist==null||a.persist(),O(a,{node:c,size:{width:_,height:E},handle:o})),i==="onResizeStop"&&s.resetData()}}},n.renderResizeHandle=function(i,o){var s=this.props.handle;if(!s)return pf.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+i,ref:o});if(typeof s=="function")return s(i,o);var a=typeof s.type=="string",l=Ax({ref:o},a?{}:{handleAxis:i});return pf.cloneElement(s,l)},n.render=function(){var i=this,o=this.props,s=o.children,a=o.className,l=o.draggableOpts;o.width,o.height,o.handle,o.handleSize,o.lockAspectRatio,o.axis,o.minConstraints,o.maxConstraints,o.onResize,o.onResizeStop,o.onResizeStart;var c=o.resizeHandles;o.transformScale;var u=AJ(o,OJ);return(0,TJ.cloneElement)(s,Ax(Ax({},u),{},{className:(a?a+" ":"")+"react-resizable",children:[].concat(s.props.children,c.map(function(d){var p,h=(p=i.handleRefs[d])!=null?p:i.handleRefs[d]=pf.createRef();return pf.createElement(PJ.DraggableCore,Gw({},l,{nodeRef:h,key:"resizableHandle-"+d,onStop:i.resizeHandler("onResizeStop",d),onStart:i.resizeHandler("onResizeStart",d),onDrag:i.resizeHandler("onResize",d)}),i.renderResizeHandle(d,h))}))}))},t}(pf.Component);Sp.default=PC;PC.propTypes=MJ.resizableProps;PC.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var qy={};qy.__esModule=!0;qy.default=void 0;var kx=BJ(P),FJ=C5(el),jJ=C5(Sp),$J=_p,zJ=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function C5(e){return e&&e.__esModule?e:{default:e}}function E5(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(E5=function(i){return i?n:t})(e)}function BJ(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=E5(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function Yw(){return Yw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yw.apply(this,arguments)}function FM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Cb(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FM(Object(n),!0).forEach(function(r){HJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function HJ(e,t,n){return t=VJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VJ(e){var t=WJ(e,"string");return typeof t=="symbol"?t:String(t)}function WJ(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function UJ(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function GJ(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Kw(e,t)}function Kw(e,t){return Kw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Kw(e,t)}var R5=function(e){GJ(t,e);function t(){for(var r,i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r=e.call.apply(e,[this].concat(o))||this,r.state={width:r.props.width,height:r.props.height,propsWidth:r.props.width,propsHeight:r.props.height},r.onResize=function(a,l){var c=l.size;r.props.onResize?(a.persist==null||a.persist(),r.setState(c,function(){return r.props.onResize&&r.props.onResize(a,l)})):r.setState(c)},r}t.getDerivedStateFromProps=function(i,o){return o.propsWidth!==i.width||o.propsHeight!==i.height?{width:i.width,height:i.height,propsWidth:i.width,propsHeight:i.height}:null};var n=t.prototype;return n.render=function(){var i=this.props,o=i.handle,s=i.handleSize;i.onResize;var a=i.onResizeStart,l=i.onResizeStop,c=i.draggableOpts,u=i.minConstraints,d=i.maxConstraints,p=i.lockAspectRatio,h=i.axis;i.width,i.height;var m=i.resizeHandles,b=i.style,v=i.transformScale,x=UJ(i,zJ);return kx.createElement(jJ.default,{axis:h,draggableOpts:c,handle:o,handleSize:s,height:this.state.height,lockAspectRatio:p,maxConstraints:d,minConstraints:u,onResizeStart:a,onResize:this.onResize,onResizeStop:l,resizeHandles:m,transformScale:v,width:this.state.width},kx.createElement("div",Yw({},x,{style:Cb(Cb({},b),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(kx.Component);qy.default=R5;R5.propTypes=Cb(Cb({},$J.resizableProps),{},{children:FJ.default.element});Gy.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};Gy.exports.Resizable=Sp.default;Gy.exports.ResizableBox=qy.default;var qJ=Gy.exports,Xs={};Object.defineProperty(Xs,"__esModule",{value:!0});Xs.resizeHandleType=Xs.resizeHandleAxesType=Xs.default=void 0;var mt=P5(el),YJ=P5(P);function P5(e){return e&&e.__esModule?e:{default:e}}const KJ=Xs.resizeHandleAxesType=mt.default.arrayOf(mt.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),XJ=Xs.resizeHandleType=mt.default.oneOfType([mt.default.node,mt.default.func]);Xs.default={className:mt.default.string,style:mt.default.object,width:mt.default.number,autoSize:mt.default.bool,cols:mt.default.number,draggableCancel:mt.default.string,draggableHandle:mt.default.string,verticalCompact:function(e){e.verticalCompact===!1&&process.env.NODE_ENV!=="production"&&console.warn('`verticalCompact` on <ReactGridLayout> is deprecated and will be removed soon. Use `compactType`: "horizontal" | "vertical" | null.')},compactType:mt.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&Ct.validateLayout(t,"layout")},margin:mt.default.arrayOf(mt.default.number),containerPadding:mt.default.arrayOf(mt.default.number),rowHeight:mt.default.number,maxRows:mt.default.number,isBounded:mt.default.bool,isDraggable:mt.default.bool,isResizable:mt.default.bool,allowOverlap:mt.default.bool,preventCollision:mt.default.bool,useCSSTransforms:mt.default.bool,transformScale:mt.default.number,isDroppable:mt.default.bool,resizeHandles:KJ,resizeHandle:XJ,onLayoutChange:mt.default.func,onDragStart:mt.default.func,onDrag:mt.default.func,onDragStop:mt.default.func,onResizeStart:mt.default.func,onResize:mt.default.func,onResizeStop:mt.default.func,onDrop:mt.default.func,droppingItem:mt.default.shape({i:mt.default.string.isRequired,w:mt.default.number.isRequired,h:mt.default.number.isRequired}),children:function(e,t){const n=e[t],r={};YJ.default.Children.forEach(n,function(i){if((i==null?void 0:i.key)!=null){if(r[i.key])throw new Error('Duplicate child key "'+i.key+'" found! This will cause problems in ReactGridLayout.');r[i.key]=!0}})},innerRef:mt.default.any};Object.defineProperty(By,"__esModule",{value:!0});By.default=void 0;var ru=TC(P),Wt=TC(el),QJ=S5,JJ=qJ,iu=Ct,hr=hs,jM=Xs,ZJ=TC(fC);function TC(e){return e&&e.__esModule?e:{default:e}}function Bo(e,t,n){return t=eZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eZ(e){var t=tZ(e,"string");return typeof t=="symbol"?t:String(t)}function tZ(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class MC extends ru.default.Component{constructor(){super(...arguments),Bo(this,"state",{resizing:null,dragging:null,className:""}),Bo(this,"elementRef",ru.default.createRef()),Bo(this,"onDragStart",(t,n)=>{let{node:r}=n;const{onDragStart:i,transformScale:o}=this.props;if(!i)return;const s={top:0,left:0},{offsetParent:a}=r;if(!a)return;const l=a.getBoundingClientRect(),c=r.getBoundingClientRect(),u=c.left/o,d=l.left/o,p=c.top/o,h=l.top/o;s.left=u-d+a.scrollLeft,s.top=p-h+a.scrollTop,this.setState({dragging:s});const{x:m,y:b}=(0,hr.calcXY)(this.getPositionParams(),s.top,s.left,this.props.w,this.props.h);return i.call(this,this.props.i,m,b,{e:t,node:r,newPosition:s})}),Bo(this,"onDrag",(t,n)=>{let{node:r,deltaX:i,deltaY:o}=n;const{onDrag:s}=this.props;if(!s)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let a=this.state.dragging.top+o,l=this.state.dragging.left+i;const{isBounded:c,i:u,w:d,h:p,containerWidth:h}=this.props,m=this.getPositionParams();if(c){const{offsetParent:S}=r;if(S){const{margin:_,rowHeight:E,containerPadding:C}=this.props,M=S.clientHeight-(0,hr.calcGridItemWHPx)(p,E,_[1]);a=(0,hr.clamp)(a-C[1],0,M);const O=(0,hr.calcGridColWidth)(m),k=h-(0,hr.calcGridItemWHPx)(d,O,_[0]);l=(0,hr.clamp)(l-C[0],0,k)}}const b={top:a,left:l};this.setState({dragging:b});const{x:v,y:x}=(0,hr.calcXY)(m,a,l,d,p);return s.call(this,u,v,x,{e:t,node:r,newPosition:b})}),Bo(this,"onDragStop",(t,n)=>{let{node:r}=n;const{onDragStop:i}=this.props;if(!i)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:o,h:s,i:a}=this.props,{left:l,top:c}=this.state.dragging,u={top:c,left:l};this.setState({dragging:null});const{x:d,y:p}=(0,hr.calcXY)(this.getPositionParams(),c,l,o,s);return i.call(this,a,d,p,{e:t,node:r,newPosition:u})}),Bo(this,"onResizeStop",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStop")),Bo(this,"onResizeStart",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStart")),Bo(this,"onResize",(t,n,r)=>this.onResizeHandler(t,n,r,"onResize"))}shouldComponentUpdate(t,n){if(this.props.children!==t.children||this.props.droppingPosition!==t.droppingPosition)return!0;const r=(0,hr.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),i=(0,hr.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,iu.fastPositionEqual)(r,i)||this.props.useCSSTransforms!==t.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(t){this.moveDroppingItem(t)}moveDroppingItem(t){const{droppingPosition:n}=this.props;if(!n)return;const r=this.elementRef.current;if(!r)return;const i=t.droppingPosition||{left:0,top:0},{dragging:o}=this.state,s=o&&n.left!==i.left||n.top!==i.top;if(!o)this.onDragStart(n.e,{node:r,deltaX:n.left,deltaY:n.top});else if(s){const a=n.left-o.left,l=n.top-o.top;this.onDrag(n.e,{node:r,deltaX:a,deltaY:l})}}getPositionParams(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:t.cols,containerPadding:t.containerPadding,containerWidth:t.containerWidth,margin:t.margin,maxRows:t.maxRows,rowHeight:t.rowHeight}}createStyle(t){const{usePercentages:n,containerWidth:r,useCSSTransforms:i}=this.props;let o;return i?o=(0,iu.setTransform)(t):(o=(0,iu.setTopLeft)(t),n&&(o.left=(0,iu.perc)(t.left/r),o.width=(0,iu.perc)(t.width/r))),o}mixinDraggable(t,n){return ru.default.createElement(QJ.DraggableCore,{disabled:!n,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},t)}curryResizeHandler(t,n){return(r,i)=>n(r,i,t)}mixinResizable(t,n,r){const{cols:i,minW:o,minH:s,maxW:a,maxH:l,transformScale:c,resizeHandles:u,resizeHandle:d}=this.props,p=this.getPositionParams(),h=(0,hr.calcGridItemPosition)(p,0,0,i,0).width,m=(0,hr.calcGridItemPosition)(p,0,0,o,s),b=(0,hr.calcGridItemPosition)(p,0,0,a,l),v=[m.width,m.height],x=[Math.min(b.width,h),Math.min(b.height,1/0)];return ru.default.createElement(JJ.Resizable,{draggableOpts:{disabled:!r},className:r?void 0:"react-resizable-hide",width:n.width,height:n.height,minConstraints:v,maxConstraints:x,onResizeStop:this.curryResizeHandler(n,this.onResizeStop),onResizeStart:this.curryResizeHandler(n,this.onResizeStart),onResize:this.curryResizeHandler(n,this.onResize),transformScale:c,resizeHandles:u,handle:d},t)}onResizeHandler(t,n,r,i){let{node:o,size:s,handle:a}=n;const l=this.props[i];if(!l)return;const{x:c,y:u,i:d,maxH:p,minH:h,containerWidth:m}=this.props,{minW:b,maxW:v}=this.props;let x=s;o&&(x=(0,iu.resizeItemInDirection)(a,r,s,m),this.setState({resizing:i==="onResizeStop"?null:x}));let{w:S,h:_}=(0,hr.calcWH)(this.getPositionParams(),x.width,x.height,c,u,a);S=(0,hr.clamp)(S,Math.max(b,1),v),_=(0,hr.clamp)(_,h,p),l.call(this,d,S,_,{e:t,node:o,size:x,handle:a})}render(){const{x:t,y:n,w:r,h:i,isDraggable:o,isResizable:s,droppingPosition:a,useCSSTransforms:l}=this.props,c=(0,hr.calcGridItemPosition)(this.getPositionParams(),t,n,r,i,this.state),u=ru.default.Children.only(this.props.children);let d=ru.default.cloneElement(u,{ref:this.elementRef,className:(0,ZJ.default)("react-grid-item",u.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":o,"react-draggable-dragging":!!this.state.dragging,dropping:!!a,cssTransforms:l}),style:{...this.props.style,...u.props.style,...this.createStyle(c)}});return d=this.mixinResizable(d,c,s),d=this.mixinDraggable(d,o),d}}By.default=MC;Bo(MC,"propTypes",{children:Wt.default.element,cols:Wt.default.number.isRequired,containerWidth:Wt.default.number.isRequired,rowHeight:Wt.default.number.isRequired,margin:Wt.default.array.isRequired,maxRows:Wt.default.number.isRequired,containerPadding:Wt.default.array.isRequired,x:Wt.default.number.isRequired,y:Wt.default.number.isRequired,w:Wt.default.number.isRequired,h:Wt.default.number.isRequired,minW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minWidth not Number");if(n>e.w||n>e.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxWidth not Number");if(n<e.w||n<e.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minHeight not Number");if(n>e.h||n>e.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxHeight not Number");if(n<e.h||n<e.minH)return new Error("maxHeight smaller than item height/minHeight")},i:Wt.default.string.isRequired,resizeHandles:jM.resizeHandleAxesType,resizeHandle:jM.resizeHandleType,onDragStop:Wt.default.func,onDragStart:Wt.default.func,onDrag:Wt.default.func,onResizeStop:Wt.default.func,onResizeStart:Wt.default.func,onResize:Wt.default.func,isDraggable:Wt.default.bool.isRequired,isResizable:Wt.default.bool.isRequired,isBounded:Wt.default.bool.isRequired,static:Wt.default.bool,useCSSTransforms:Wt.default.bool.isRequired,transformScale:Wt.default.number,className:Wt.default.string,handle:Wt.default.string,cancel:Wt.default.string,droppingPosition:Wt.default.shape({e:Wt.default.object.isRequired,left:Wt.default.number.isRequired,top:Wt.default.number.isRequired})});Bo(MC,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1});Object.defineProperty(wp,"__esModule",{value:!0});wp.default=void 0;var yl=oZ(P),Ix=dC,nZ=OC(fC),tt=Ct,rZ=hs,$M=OC(By),iZ=OC(Xs);function OC(e){return e&&e.__esModule?e:{default:e}}function T5(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(T5=function(r){return r?n:t})(e)}function oZ(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=T5(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function Cr(e,t,n){return t=sZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sZ(e){var t=aZ(e,"string");return typeof t=="symbol"?t:String(t)}function aZ(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const zM="react-grid-layout";let M5=!1;try{M5=/firefox/i.test(navigator.userAgent)}catch{}class Yy extends yl.Component{constructor(){super(...arguments),Cr(this,"state",{activeDrag:null,layout:(0,tt.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,tt.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),Cr(this,"dragEnterCounter",0),Cr(this,"onDragStart",(t,n,r,i)=>{let{e:o,node:s}=i;const{layout:a}=this.state,l=(0,tt.getLayoutItem)(a,t);if(!l)return;const c={w:l.w,h:l.h,x:l.x,y:l.y,placeholder:!0,i:t};return this.setState({oldDragItem:(0,tt.cloneLayoutItem)(l),oldLayout:a,activeDrag:c}),this.props.onDragStart(a,l,l,null,o,s)}),Cr(this,"onDrag",(t,n,r,i)=>{let{e:o,node:s}=i;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:c,allowOverlap:u,preventCollision:d}=this.props,p=(0,tt.getLayoutItem)(l,t);if(!p)return;const h={w:p.w,h:p.h,x:p.x,y:p.y,placeholder:!0,i:t};l=(0,tt.moveElement)(l,p,n,r,!0,d,(0,tt.compactType)(this.props),c,u),this.props.onDrag(l,a,p,h,o,s),this.setState({layout:u?l:(0,tt.compact)(l,(0,tt.compactType)(this.props),c),activeDrag:h})}),Cr(this,"onDragStop",(t,n,r,i)=>{let{e:o,node:s}=i;if(!this.state.activeDrag)return;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:c,preventCollision:u,allowOverlap:d}=this.props,p=(0,tt.getLayoutItem)(l,t);if(!p)return;l=(0,tt.moveElement)(l,p,n,r,!0,u,(0,tt.compactType)(this.props),c,d);const m=d?l:(0,tt.compact)(l,(0,tt.compactType)(this.props),c);this.props.onDragStop(m,a,p,null,o,s);const{oldLayout:b}=this.state;this.setState({activeDrag:null,layout:m,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(m,b)}),Cr(this,"onResizeStart",(t,n,r,i)=>{let{e:o,node:s}=i;const{layout:a}=this.state,l=(0,tt.getLayoutItem)(a,t);l&&(this.setState({oldResizeItem:(0,tt.cloneLayoutItem)(l),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(a,l,l,null,o,s))}),Cr(this,"onResize",(t,n,r,i)=>{let{e:o,node:s,size:a,handle:l}=i;const{oldResizeItem:c}=this.state,{layout:u}=this.state,{cols:d,preventCollision:p,allowOverlap:h}=this.props;let m=!1,b,v,x;const[S,_]=(0,tt.withLayoutItem)(u,t,C=>{let M;return v=C.x,x=C.y,["sw","w","nw","n","ne"].indexOf(l)!==-1&&(["sw","nw","w"].indexOf(l)!==-1&&(v=C.x+(C.w-n),n=C.x!==v&&v<0?C.w:n,v=v<0?0:v),["ne","n","nw"].indexOf(l)!==-1&&(x=C.y+(C.h-r),r=C.y!==x&&x<0?C.h:r,x=x<0?0:x),m=!0),p&&!h&&(M=(0,tt.getAllCollisions)(u,{...C,w:n,h:r,x:v,y:x}).filter(k=>k.i!==C.i).length>0,M&&(x=C.y,r=C.h,v=C.x,n=C.w,m=!1)),C.w=n,C.h=r,C});if(!_)return;b=S,m&&(b=(0,tt.moveElement)(S,_,v,x,!0,this.props.preventCollision,(0,tt.compactType)(this.props),d,h));const E={w:_.w,h:_.h,x:_.x,y:_.y,static:!0,i:t};this.props.onResize(b,c,_,E,o,s),this.setState({layout:h?b:(0,tt.compact)(b,(0,tt.compactType)(this.props),d),activeDrag:E})}),Cr(this,"onResizeStop",(t,n,r,i)=>{let{e:o,node:s}=i;const{layout:a,oldResizeItem:l}=this.state,{cols:c,allowOverlap:u}=this.props,d=(0,tt.getLayoutItem)(a,t),p=u?a:(0,tt.compact)(a,(0,tt.compactType)(this.props),c);this.props.onResizeStop(p,l,d,null,o,s);const{oldLayout:h}=this.state;this.setState({activeDrag:null,layout:p,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(p,h)}),Cr(this,"onDragOver",t=>{var S;if(t.preventDefault(),t.stopPropagation(),M5&&!((S=t.nativeEvent.target)!=null&&S.classList.contains(zM)))return!1;const{droppingItem:n,onDropDragOver:r,margin:i,cols:o,rowHeight:s,maxRows:a,width:l,containerPadding:c,transformScale:u}=this.props,d=r==null?void 0:r(t);if(d===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const p={...n,...d},{layout:h}=this.state,m=t.currentTarget.getBoundingClientRect(),b=t.clientX-m.left,v=t.clientY-m.top,x={left:b/u,top:v/u,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:_,top:E}=this.state.droppingPosition;(_!=b||E!=v)&&this.setState({droppingPosition:x})}}else{const _={cols:o,margin:i,maxRows:a,rowHeight:s,containerWidth:l,containerPadding:c||i},E=(0,rZ.calcXY)(_,v,b,p.w,p.h);this.setState({droppingDOMNode:yl.createElement("div",{key:p.i}),droppingPosition:x,layout:[...h,{...p,x:E.x,y:E.y,static:!1,isDraggable:!0}]})}}),Cr(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:n}=this.props,{layout:r}=this.state,i=(0,tt.compact)(r.filter(o=>o.i!==t.i),(0,tt.compactType)(this.props),n,this.props.allowOverlap);this.setState({layout:i,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),Cr(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),Cr(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),Cr(this,"onDrop",t=>{t.preventDefault(),t.stopPropagation();const{droppingItem:n}=this.props,{layout:r}=this.state,i=r.find(o=>o.i===n.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(r,i,t)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(t,n){let r;return n.activeDrag?null:(!(0,Ix.deepEqual)(t.layout,n.propsLayout)||t.compactType!==n.compactType?r=t.layout:(0,tt.childrenEqual)(t.children,n.children)||(r=n.layout),r?{layout:(0,tt.synchronizeLayoutWithChildren)(r,t.children,t.cols,(0,tt.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,n){return this.props.children!==t.children||!(0,tt.fastRGLPropsEqual)(this.props,t,Ix.deepEqual)||this.state.activeDrag!==n.activeDrag||this.state.mounted!==n.mounted||this.state.droppingPosition!==n.droppingPosition}componentDidUpdate(t,n){if(!this.state.activeDrag){const r=this.state.layout,i=n.layout;this.onLayoutMaybeChanged(r,i)}}containerHeight(){if(!this.props.autoSize)return;const t=(0,tt.bottom)(this.state.layout),n=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return t*this.props.rowHeight+(t-1)*this.props.margin[1]+n*2+"px"}onLayoutMaybeChanged(t,n){n||(n=this.state.layout),(0,Ix.deepEqual)(n,t)||this.props.onLayoutChange(t)}placeholder(){const{activeDrag:t}=this.state;if(!t)return null;const{width:n,cols:r,margin:i,containerPadding:o,rowHeight:s,maxRows:a,useCSSTransforms:l,transformScale:c}=this.props;return yl.createElement($M.default,{w:t.w,h:t.h,x:t.x,y:t.y,i:t.i,className:`react-grid-placeholder ${this.state.resizing?"placeholder-resizing":""}`,containerWidth:n,cols:r,margin:i,containerPadding:o||i,maxRows:a,rowHeight:s,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:l,transformScale:c},yl.createElement("div",null))}processGridItem(t,n){if(!t||!t.key)return;const r=(0,tt.getLayoutItem)(this.state.layout,String(t.key));if(!r)return null;const{width:i,cols:o,margin:s,containerPadding:a,rowHeight:l,maxRows:c,isDraggable:u,isResizable:d,isBounded:p,useCSSTransforms:h,transformScale:m,draggableCancel:b,draggableHandle:v,resizeHandles:x,resizeHandle:S}=this.props,{mounted:_,droppingPosition:E}=this.state,C=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&u,M=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&d,O=r.resizeHandles||x,k=C&&p&&r.isBounded!==!1;return yl.createElement($M.default,{containerWidth:i,cols:o,margin:s,containerPadding:a||s,maxRows:c,rowHeight:l,cancel:b,handle:v,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:C,isResizable:M,isBounded:k,useCSSTransforms:h&&_,usePercentages:!_,transformScale:m,w:r.w,h:r.h,x:r.x,y:r.y,i:r.i,minH:r.minH,minW:r.minW,maxH:r.maxH,maxW:r.maxW,static:r.static,droppingPosition:n?E:void 0,resizeHandles:O,resizeHandle:S},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:i}=this.props,o=(0,nZ.default)(zM,t),s={height:this.containerHeight(),...n};return yl.createElement("div",{ref:i,className:o,style:s,onDrop:r?this.onDrop:tt.noop,onDragLeave:r?this.onDragLeave:tt.noop,onDragEnter:r?this.onDragEnter:tt.noop,onDragOver:r?this.onDragOver:tt.noop},yl.Children.map(this.props.children,a=>this.processGridItem(a)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}wp.default=Yy;Cr(Yy,"displayName","ReactGridLayout");Cr(Yy,"propTypes",iZ.default);Cr(Yy,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,allowOverlap:!1,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},resizeHandles:["se"],onLayoutChange:tt.noop,onDragStart:tt.noop,onDrag:tt.noop,onDragStop:tt.noop,onResizeStart:tt.noop,onResize:tt.noop,onResizeStop:tt.noop,onDrop:tt.noop,onDropDragOver:tt.noop});var Ky={},Ic={};Object.defineProperty(Ic,"__esModule",{value:!0});Ic.findOrGenerateResponsiveLayout=uZ;Ic.getBreakpointFromWidth=lZ;Ic.getColsFromBreakpoint=cZ;Ic.sortBreakpoints=DC;var Yg=Ct;function lZ(e,t){const n=DC(e);let r=n[0];for(let i=1,o=n.length;i<o;i++){const s=n[i];t>e[s]&&(r=s)}return r}function cZ(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function uZ(e,t,n,r,i,o){if(e[n])return(0,Yg.cloneLayout)(e[n]);let s=e[r];const a=DC(t),l=a.slice(a.indexOf(n));for(let c=0,u=l.length;c<u;c++){const d=l[c];if(e[d]){s=e[d];break}}return s=(0,Yg.cloneLayout)(s||[]),(0,Yg.compact)((0,Yg.correctBounds)(s,{cols:i}),o,i)}function DC(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(Ky,"__esModule",{value:!0});Ky.default=void 0;var BM=fZ(P),ii=O5(el),Nx=dC,Ou=Ct,vl=Ic,dZ=O5(wp);function O5(e){return e&&e.__esModule?e:{default:e}}function D5(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(D5=function(r){return r?n:t})(e)}function fZ(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=D5(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function Xw(){return Xw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xw.apply(this,arguments)}function Eb(e,t,n){return t=hZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hZ(e){var t=pZ(e,"string");return typeof t=="symbol"?t:String(t)}function pZ(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const HM=e=>Object.prototype.toString.call(e);function Kg(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class AC extends BM.Component{constructor(){super(...arguments),Eb(this,"state",this.generateInitialState()),Eb(this,"onLayoutChange",t=>{this.props.onLayoutChange(t,{...this.props.layouts,[this.state.breakpoint]:t})})}generateInitialState(){const{width:t,breakpoints:n,layouts:r,cols:i}=this.props,o=(0,vl.getBreakpointFromWidth)(n,t),s=(0,vl.getColsFromBreakpoint)(o,i),a=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,vl.findOrGenerateResponsiveLayout)(r,n,o,o,s,a),breakpoint:o,cols:s}}static getDerivedStateFromProps(t,n){if(!(0,Nx.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:i}=n;return{layout:(0,vl.findOrGenerateResponsiveLayout)(t.layouts,t.breakpoints,r,r,i,t.compactType),layouts:t.layouts}}return null}componentDidUpdate(t){(this.props.width!=t.width||this.props.breakpoint!==t.breakpoint||!(0,Nx.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,Nx.deepEqual)(this.props.cols,t.cols))&&this.onWidthChange(t)}onWidthChange(t){const{breakpoints:n,cols:r,layouts:i,compactType:o}=this.props,s=this.props.breakpoint||(0,vl.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),a=this.state.breakpoint,l=(0,vl.getColsFromBreakpoint)(s,r),c={...i};if(a!==s||t.breakpoints!==n||t.cols!==r){a in c||(c[a]=(0,Ou.cloneLayout)(this.state.layout));let p=(0,vl.findOrGenerateResponsiveLayout)(c,n,s,a,l,o);p=(0,Ou.synchronizeLayoutWithChildren)(p,this.props.children,l,o,this.props.allowOverlap),c[s]=p,this.props.onBreakpointChange(s,l),this.props.onLayoutChange(p,c),this.setState({breakpoint:s,layout:p,cols:l})}const u=Kg(this.props.margin,s),d=Kg(this.props.containerPadding,s);this.props.onWidthChange(this.props.width,u,l,d)}render(){const{breakpoint:t,breakpoints:n,cols:r,layouts:i,margin:o,containerPadding:s,onBreakpointChange:a,onLayoutChange:l,onWidthChange:c,...u}=this.props;return BM.createElement(dZ.default,Xw({},u,{margin:Kg(o,this.state.breakpoint),containerPadding:Kg(s,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}Ky.default=AC;Eb(AC,"propTypes",{breakpoint:ii.default.string,breakpoints:ii.default.object,allowOverlap:ii.default.bool,cols:ii.default.object,margin:ii.default.oneOfType([ii.default.array,ii.default.object]),containerPadding:ii.default.oneOfType([ii.default.array,ii.default.object]),layouts(e,t){if(HM(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+HM(e[t]));Object.keys(e[t]).forEach(n=>{if(!(n in e.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,Ou.validateLayout)(e.layouts[n],"layouts."+n)})},width:ii.default.number.isRequired,onBreakpointChange:ii.default.func,onLayoutChange:ii.default.func,onWidthChange:ii.default.func});Eb(AC,"defaultProps",{breakpoints:{lg:1200,md:996,sm:768,xs:480,xxs:0},cols:{lg:12,md:10,sm:6,xs:4,xxs:2},containerPadding:{lg:null,md:null,sm:null,xs:null,xxs:null},layouts:{},margin:[10,10],allowOverlap:!1,onBreakpointChange:Ou.noop,onLayoutChange:Ou.noop,onWidthChange:Ou.noop});var kC={},A5=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(i,o){return i[0]===n?(r=o,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),i=this.__entries__[r];return i&&i[1]},t.prototype.set=function(n,r){var i=e(this.__entries__,n);~i?this.__entries__[i][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,i=e(r,n);~i&&r.splice(i,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var i=0,o=this.__entries__;i<o.length;i++){var s=o[i];n.call(r,s[1],s[0])}},t}()}(),Qw=typeof window<"u"&&typeof document<"u"&&window.document===document,Rb=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),gZ=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Rb):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),mZ=2;function bZ(e,t){var n=!1,r=!1,i=0;function o(){n&&(n=!1,e()),r&&a()}function s(){gZ(o)}function a(){var l=Date.now();if(n){if(l-i<mZ)return;r=!0}else n=!0,r=!1,setTimeout(s,t);i=l}return a}var yZ=20,vZ=["top","right","bottom","left","width","height","size","weight"],xZ=typeof MutationObserver<"u",wZ=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=bZ(this.refresh.bind(this),yZ)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,r=n.indexOf(t);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!Qw||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),xZ?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!Qw||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,i=vZ.some(function(o){return!!~r.indexOf(o)});i&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),k5=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e},rd=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||Rb},I5=Xy(0,0,0,0);function Pb(e){return parseFloat(e)||0}function VM(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,i){var o=e["border-"+i+"-width"];return r+Pb(o)},0)}function SZ(e){for(var t=["top","right","bottom","left"],n={},r=0,i=t;r<i.length;r++){var o=i[r],s=e["padding-"+o];n[o]=Pb(s)}return n}function _Z(e){var t=e.getBBox();return Xy(0,0,t.width,t.height)}function CZ(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return I5;var r=rd(e).getComputedStyle(e),i=SZ(r),o=i.left+i.right,s=i.top+i.bottom,a=Pb(r.width),l=Pb(r.height);if(r.boxSizing==="border-box"&&(Math.round(a+o)!==t&&(a-=VM(r,"left","right")+o),Math.round(l+s)!==n&&(l-=VM(r,"top","bottom")+s)),!RZ(e)){var c=Math.round(a+o)-t,u=Math.round(l+s)-n;Math.abs(c)!==1&&(a-=c),Math.abs(u)!==1&&(l-=u)}return Xy(i.left,i.top,a,l)}var EZ=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof rd(e).SVGGraphicsElement}:function(e){return e instanceof rd(e).SVGElement&&typeof e.getBBox=="function"}}();function RZ(e){return e===rd(e).document.documentElement}function PZ(e){return Qw?EZ(e)?_Z(e):CZ(e):I5}function TZ(e){var t=e.x,n=e.y,r=e.width,i=e.height,o=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,s=Object.create(o.prototype);return k5(s,{x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:i+n,left:t}),s}function Xy(e,t,n,r){return{x:e,y:t,width:n,height:r}}var MZ=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Xy(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=PZ(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),OZ=function(){function e(t,n){var r=TZ(n);k5(this,{target:t,contentRect:r})}return e}(),DZ=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new A5,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=r}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof rd(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new MZ(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof rd(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new OZ(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),N5=typeof WeakMap<"u"?new WeakMap:new A5,L5=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=wZ.getInstance(),r=new DZ(t,n,this);N5.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){L5.prototype[e]=function(){var t;return(t=N5.get(this))[e].apply(t,arguments)}});var AZ=function(){return typeof Rb.ResizeObserver<"u"?Rb.ResizeObserver:L5}();const kZ=Object.freeze(Object.defineProperty({__proto__:null,default:AZ},Symbol.toStringTag,{value:"Module"})),IZ=z_(kZ);Object.defineProperty(kC,"__esModule",{value:!0});kC.default=HZ;var Xg=jZ(P),NZ=IC(el),LZ=IC(IZ),FZ=IC(fC);function IC(e){return e&&e.__esModule?e:{default:e}}function F5(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(F5=function(r){return r?n:t})(e)}function jZ(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=F5(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function Jw(){return Jw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jw.apply(this,arguments)}function ou(e,t,n){return t=$Z(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $Z(e){var t=zZ(e,"string");return typeof t=="symbol"?t:String(t)}function zZ(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const BZ="react-grid-layout";function HZ(e){var t;return t=class extends Xg.Component{constructor(){super(...arguments),ou(this,"state",{width:1280}),ou(this,"elementRef",Xg.createRef()),ou(this,"mounted",!1),ou(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new LZ.default(i=>{if(this.elementRef.current instanceof HTMLElement){const s=i[0].contentRect.width;this.setState({width:s})}});const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.observe(r)}componentWillUnmount(){this.mounted=!1;const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.unobserve(r),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:r,...i}=this.props;return r&&!this.mounted?Xg.createElement("div",{className:(0,FZ.default)(this.props.className,BZ),style:this.props.style,ref:this.elementRef}):Xg.createElement(e,Jw({innerRef:this.elementRef},i,this.state))}},ou(t,"defaultProps",{measureBeforeMount:!1}),ou(t,"propTypes",{measureBeforeMount:NZ.default.bool}),t}(function(e){e.exports=wp.default,e.exports.utils=Ct,e.exports.calculateUtils=hs,e.exports.Responsive=Ky.default,e.exports.Responsive.utils=Ic,e.exports.WidthProvider=kC.default})(QN);var WM=QN.exports;function yi(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var VZ=["color"],WZ=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=yi(e,VZ);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),P.createElement("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),UZ=["color"],j5=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=yi(e,UZ);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),P.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),GZ=["color"],qZ=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=yi(e,GZ);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),P.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),YZ=["color"],KZ=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=yi(e,YZ);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),P.createElement("path",{d:"M5 2V1H10V2H5ZM4.75 0C4.33579 0 4 0.335786 4 0.75V1H3.5C2.67157 1 2 1.67157 2 2.5V12.5C2 13.3284 2.67157 14 3.5 14H7V13H3.5C3.22386 13 3 12.7761 3 12.5V2.5C3 2.22386 3.22386 2 3.5 2H4V2.25C4 2.66421 4.33579 3 4.75 3H10.25C10.6642 3 11 2.66421 11 2.25V2H11.5C11.7761 2 12 2.22386 12 2.5V7H13V2.5C13 1.67157 12.3284 1 11.5 1H11V0.75C11 0.335786 10.6642 0 10.25 0H4.75ZM9 8.5C9 8.77614 8.77614 9 8.5 9C8.22386 9 8 8.77614 8 8.5C8 8.22386 8.22386 8 8.5 8C8.77614 8 9 8.22386 9 8.5ZM10.5 9C10.7761 9 11 8.77614 11 8.5C11 8.22386 10.7761 8 10.5 8C10.2239 8 10 8.22386 10 8.5C10 8.77614 10.2239 9 10.5 9ZM13 8.5C13 8.77614 12.7761 9 12.5 9C12.2239 9 12 8.77614 12 8.5C12 8.22386 12.2239 8 12.5 8C12.7761 8 13 8.22386 13 8.5ZM14.5 9C14.7761 9 15 8.77614 15 8.5C15 8.22386 14.7761 8 14.5 8C14.2239 8 14 8.22386 14 8.5C14 8.77614 14.2239 9 14.5 9ZM15 10.5C15 10.7761 14.7761 11 14.5 11C14.2239 11 14 10.7761 14 10.5C14 10.2239 14.2239 10 14.5 10C14.7761 10 15 10.2239 15 10.5ZM14.5 13C14.7761 13 15 12.7761 15 12.5C15 12.2239 14.7761 12 14.5 12C14.2239 12 14 12.2239 14 12.5C14 12.7761 14.2239 13 14.5 13ZM14.5 15C14.7761 15 15 14.7761 15 14.5C15 14.2239 14.7761 14 14.5 14C14.2239 14 14 14.2239 14 14.5C14 14.7761 14.2239 15 14.5 15ZM8.5 11C8.77614 11 9 10.7761 9 10.5C9 10.2239 8.77614 10 8.5 10C8.22386 10 8 10.2239 8 10.5C8 10.7761 8.22386 11 8.5 11ZM9 12.5C9 12.7761 8.77614 13 8.5 13C8.22386 13 8 12.7761 8 12.5C8 12.2239 8.22386 12 8.5 12C8.77614 12 9 12.2239 9 12.5ZM8.5 15C8.77614 15 9 14.7761 9 14.5C9 14.2239 8.77614 14 8.5 14C8.22386 14 8 14.2239 8 14.5C8 14.7761 8.22386 15 8.5 15ZM11 14.5C11 14.7761 10.7761 15 10.5 15C10.2239 15 10 14.7761 10 14.5C10 14.2239 10.2239 14 10.5 14C10.7761 14 11 14.2239 11 14.5ZM12.5 15C12.7761 15 13 14.7761 13 14.5C13 14.2239 12.7761 14 12.5 14C12.2239 14 12 14.2239 12 14.5C12 14.7761 12.2239 15 12.5 15Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),XZ=["color"],$5=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=yi(e,XZ);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),P.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),QZ=["color"],JZ=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=yi(e,QZ);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),P.createElement("path",{d:"M9.875 7.5C9.875 8.81168 8.81168 9.875 7.5 9.875C6.18832 9.875 5.125 8.81168 5.125 7.5C5.125 6.18832 6.18832 5.125 7.5 5.125C8.81168 5.125 9.875 6.18832 9.875 7.5Z",fill:r}))}),ZZ=["color"],eee=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=yi(e,ZZ);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),P.createElement("path",{d:"M14.7649 6.07596C14.9991 6.22231 15.0703 6.53079 14.9239 6.76495C14.4849 7.46743 13.9632 8.10645 13.3702 8.66305L14.5712 9.86406C14.7664 10.0593 14.7664 10.3759 14.5712 10.5712C14.3759 10.7664 14.0593 10.7664 13.8641 10.5712L12.6011 9.30817C11.805 9.90283 10.9089 10.3621 9.93375 10.651L10.383 12.3277C10.4544 12.5944 10.2961 12.8685 10.0294 12.94C9.76267 13.0115 9.4885 12.8532 9.41704 12.5865L8.95917 10.8775C8.48743 10.958 8.00036 10.9999 7.50001 10.9999C6.99965 10.9999 6.51257 10.958 6.04082 10.8775L5.58299 12.5864C5.51153 12.8532 5.23737 13.0115 4.97064 12.94C4.7039 12.8686 4.5456 12.5944 4.61706 12.3277L5.06625 10.651C4.09111 10.3621 3.19503 9.90282 2.3989 9.30815L1.1359 10.5712C0.940638 10.7664 0.624058 10.7664 0.428798 10.5712C0.233537 10.3759 0.233537 10.0593 0.428798 9.86405L1.62982 8.66303C1.03682 8.10643 0.515113 7.46742 0.0760677 6.76495C-0.0702867 6.53079 0.000898544 6.22231 0.235065 6.07596C0.469231 5.9296 0.777703 6.00079 0.924058 6.23496C1.40354 7.00213 1.989 7.68057 2.66233 8.2427C2.67315 8.25096 2.6837 8.25972 2.69397 8.26898C4.00897 9.35527 5.65537 9.99991 7.50001 9.99991C10.3078 9.99991 12.6564 8.5063 14.076 6.23495C14.2223 6.00079 14.5308 5.9296 14.7649 6.07596Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),tee=["color"],nee=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=yi(e,tee);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),P.createElement("path",{d:"M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),ree=["color"],z5=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=yi(e,ree);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),P.createElement("path",{d:"M1.20308 1.04312C1.00481 0.954998 0.772341 1.0048 0.627577 1.16641C0.482813 1.32802 0.458794 1.56455 0.568117 1.75196L3.92115 7.50002L0.568117 13.2481C0.458794 13.4355 0.482813 13.672 0.627577 13.8336C0.772341 13.9952 1.00481 14.045 1.20308 13.9569L14.7031 7.95693C14.8836 7.87668 15 7.69762 15 7.50002C15 7.30243 14.8836 7.12337 14.7031 7.04312L1.20308 1.04312ZM4.84553 7.10002L2.21234 2.586L13.2689 7.50002L2.21234 12.414L4.84552 7.90002H9C9.22092 7.90002 9.4 7.72094 9.4 7.50002C9.4 7.27911 9.22092 7.10002 9 7.10002H4.84553Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),iee=["color"],oee=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=yi(e,iee);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),P.createElement("path",{d:"M3.24182 2.32181C3.3919 2.23132 3.5784 2.22601 3.73338 2.30781L12.7334 7.05781C12.8974 7.14436 13 7.31457 13 7.5C13 7.68543 12.8974 7.85564 12.7334 7.94219L3.73338 12.6922C3.5784 12.774 3.3919 12.7687 3.24182 12.6782C3.09175 12.5877 3 12.4252 3 12.25V2.75C3 2.57476 3.09175 2.4123 3.24182 2.32181ZM4 3.57925V11.4207L11.4288 7.5L4 3.57925Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),see=["color"],aee=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=yi(e,see);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),P.createElement("path",{d:"M10.3004 7.49991C10.3004 8.4943 9.49426 9.30041 8.49988 9.30041C7.50549 9.30041 6.69938 8.4943 6.69938 7.49991C6.69938 6.50553 7.50549 5.69942 8.49988 5.69942C9.49426 5.69942 10.3004 6.50553 10.3004 7.49991ZM11.205 8C10.9699 9.28029 9.84816 10.2504 8.49988 10.2504C7.1516 10.2504 6.0299 9.28029 5.79473 8H0.5C0.223858 8 0 7.77614 0 7.5C0 7.22386 0.223858 7 0.5 7H5.7947C6.0298 5.71962 7.15154 4.74942 8.49988 4.74942C9.84822 4.74942 10.97 5.71962 11.2051 7H14.5C14.7761 7 15 7.22386 15 7.5C15 7.77614 14.7761 8 14.5 8H11.205Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),lee=["color"],cee=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=yi(e,lee);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),P.createElement("path",{d:"M2 3C2 2.44772 2.44772 2 3 2H12C12.5523 2 13 2.44772 13 3V12C13 12.5523 12.5523 13 12 13H3C2.44772 13 2 12.5523 2 12V3ZM12 3H3V12H12V3Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),uee=["color"],B5=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=yi(e,uee);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),P.createElement("path",{d:"M4 6H11L7.5 10.5L4 6Z",fill:r}))}),dee=["color"],H5=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=yi(e,dee);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),P.createElement("path",{d:"M4 9H11L7.5 4.5L4 9Z",fill:r}))});let Qg;const fee=new Uint8Array(16);function hee(){if(!Qg&&(Qg=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Qg))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Qg(fee)}const pr=[];for(let e=0;e<256;++e)pr.push((e+256).toString(16).slice(1));function pee(e,t=0){return pr[e[t+0]]+pr[e[t+1]]+pr[e[t+2]]+pr[e[t+3]]+"-"+pr[e[t+4]]+pr[e[t+5]]+"-"+pr[e[t+6]]+pr[e[t+7]]+"-"+pr[e[t+8]]+pr[e[t+9]]+"-"+pr[e[t+10]]+pr[e[t+11]]+pr[e[t+12]]+pr[e[t+13]]+pr[e[t+14]]+pr[e[t+15]]}const gee=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),UM={randomUUID:gee};function Va(e,t,n){if(UM.randomUUID&&!e)return UM.randomUUID();e=e||{};const r=e.random||(e.rng||hee)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,pee(r)}const Ur=JI()(oN((e,t)=>({isShowingVisual:!0,runSql:!1,sqlGen:{},sql:"",isSqlRunning:!1,queryResultColumns:[],showFilters:!1,applyFilters:!1,filterValues:[{filterId:"sample-filter-id",valueType:"string",name:"",operation:"in",values:[""]}],card:{id:Va(),title:"Editor Card",description:"Description",type:"bar",data:[]},frame:{id:Va(),cards:[],activeCardId:""},actions:{updateCardTab:(n,r)=>{e(i=>{const o=i.frame,s={...o,cards:o.cards.map(l=>l.id===r.id?r:l),activeCardId:n};i.frame=s;const a=s.cards.find(l=>l.id===n);i.card=a})},setActiveTabCardId:n=>{e(r=>{r.activeTabCardId=n})},setCustomCardPreferences:n=>{e(r=>{r.card.customCardPreferences=n})},setChartOrientation:n=>{e(r=>{var s,a,l,c,u,d;const i=r.card.preferences;let o={};((s=i==null?void 0:i.chartOptions)==null?void 0:s.indexAxis)!==n&&(o={x:(l=(a=i==null?void 0:i.chartOptions)==null?void 0:a.scales)==null?void 0:l.y,y:(u=(c=i==null?void 0:i.chartOptions)==null?void 0:c.scales)==null?void 0:u.x}),r.card.preferences={...i,chartOptions:{...i==null?void 0:i.chartOptions,scales:{...(d=i==null?void 0:i.chartOptions)==null?void 0:d.scales,...o},indexAxis:n}}})},setSortChart:n=>{e(r=>{r.card.preferences={...r.card.preferences,sortChart:n}})},setCustomVisualCode:n=>{e(r=>{r.card.preferences={...r.card.preferences,customVisualCode:n}})},setNumberFormat:(n,r,i,o)=>{e(s=>{var a,l,c;s.card.preferences={...(a=s.card)==null?void 0:a.preferences,formatNumber:{...(c=(l=s.card)==null?void 0:l.preferences)==null?void 0:c.formatNumber,decimalPlaces:n,currency:r,locale:i,suffix:o,enabled:!0}}})},setColorRanges:n=>{e(r=>{var i,o;r.card.preferences={...r.card.preferences,formatNumber:{...(o=(i=r.card)==null?void 0:i.preferences)==null?void 0:o.formatNumber,colorRanges:n}}})},setQueryError:n=>{e(r=>{r.queryError=n})},setQueryResultColumns:n=>{e(r=>{r.queryResultColumns=n})},setCardPreferences:n=>{e(r=>{r.card.preferences=n})},setFilterOnClickColumnIndex:n=>{e(r=>{r.card.preferences={...r.card.preferences,filterOnClickColumnIndex:n}})},setFilterOnClickField:n=>{e(r=>{r.card.preferences={...r.card.preferences,filterOnClick:!0,filterOnClickField:n}})},setCardRefreshInterval:n=>{e(r=>{r.card.refreshInterval=n})},setIsShowingVisual:n=>{e({isShowingVisual:n})},setRunSql:n=>{e({runSql:n})},setIsSqlRunning:n=>{e({isSqlRunning:n})},updateCardInFrame:n=>{e(r=>{r.frame.cards=r.frame.cards.map(i=>i.id===n.id?n:i)})},setFrame:n=>{e({frame:n})},setCard:n=>{e({card:n})},setCardType:n=>{e(r=>{var i;r.card.type=n,n==="range"&&(r.card.preferences={...r.card.preferences,chartOptions:{...(i=r.card.preferences)==null?void 0:i.chartOptions,indexAxis:"y"}})})},setCardSql:n=>{e(r=>{r.card.sql=n})},setCardPython:n=>{e(r=>{r.card.python=n})},setPythonStdOut:n=>{e(r=>{r.pythonStdOut=n})},setCardCustomCfg:n=>{e(r=>{r.card.customCfg=n})},setCardCfg:n=>{e(r=>{r.card.cfg=n})},setShowFilters:n=>{e(r=>{r.showFilters=n})},setApplyFilters:n=>{e(r=>{r.applyFilters=n})},setFilterValues:n=>{e(r=>{r.filterValues=n})},setSqlGen:n=>{e(r=>{r.sqlGen=n})},setSqlGenMeasure:(n,r)=>{e(i=>{i.sqlGen.measures=[...i.sqlGen.measures||[],{name:n,calc:r}]})},setSqlGenDimension:n=>{e(r=>{r.sqlGen.dimensions=[...r.sqlGen.dimensions||[],n]})},setSelectedDatamodelId:n=>{var r,i;e(o=>{o.selectedDatamodelId=n,o.card.datamodelId=n}),(i=(r=t()).onDatamodelChange)==null||i.call(r,n)},setSelectedConnectionId:n=>{var r,i;e(o=>{o.selectedConnectionId=n,o.card.connectionId=n}),(i=(r=t()).onConnectionChange)==null||i.call(r,n)},setSelectedDatabaseName:n=>{var r,i;e(o=>{o.selectedDatabaseName=n,o.card.lastSelectedDatabase=n}),(i=(r=t()).onDatabaseChange)==null||i.call(r,n)},setSelectedSchemaName:n=>{var r,i;e(o=>{o.selectedSchemaName=n,o.card.lastSelectedSchema=n}),(i=(r=t()).onSchemaChange)==null||i.call(r,n)},setSelectedTableName:n=>{var r,i;e(o=>{o.selectedTableName=n,o.card.lastSelectedTable=n}),(i=(r=t()).onTableChange)==null||i.call(r,n)},setCurrentColumns:n=>{e(r=>{r.currentColumns=n})},setOnConnectionChange:n=>{e({onConnectionChange:n})},setOnDatabaseChange:n=>{e({onDatabaseChange:n})},setOnSchemaChange:n=>{e({onSchemaChange:n})},setOnTableChange:n=>{e({onTableChange:n})},setOnSave:n=>{e({onSave:n})},setOnClose:n=>{e({onClose:n})}}}))),Qy=()=>Ur(e=>e.actions);function mee(e){return/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/.test(e)}function bee(e,t=1){if(!mee(e)||t===1)return e;e=e.replace(/^#/,"");const n=parseInt(e.substring(0,2),16),r=parseInt(e.substring(2,4),16),i=parseInt(e.substring(4,6),16);return t=Math.min(Math.max(t,0),1),`rgba(${n}, ${r}, ${i}, ${t})`}function yee(e,t,n,r=1){var c,u,d,p;const i=n==null?void 0:n.datasetOptions,o=ye.getState().themeStyle,s=(u=(c=o==null?void 0:o.chart)==null?void 0:c.dataset)==null?void 0:u.backgroundColor,a=(p=(d=o==null?void 0:o.chart)==null?void 0:d.dataset)==null?void 0:p.borderColor;return e.map((h,m)=>{var E;const b=i==null?void 0:i.find(C=>C.idx===m),v=bee(s==null?void 0:s[m%s.length],r),x=a==null?void 0:a[m%a.length],S=a==null?void 0:a[m%a.length];return{label:h.charAt(0).toUpperCase()+h.slice(1),data:t.map(C=>C[h]),...b,datalabels:{...b==null?void 0:b.datalabels,color:vee((E=b==null?void 0:b.datalabels)==null?void 0:E.align,v)},backgroundColor:v,pointBackgroundColor:x,borderColor:S}})}function vee(e,t){return nd(e==="end"||e==="start"?_h():t)}function xee(e){var a,l,c,u;const{metricKeys:t,dimensionKeys:n}=sr(e);let r=[];const i=ye.getState().themeStyle,o=(l=(a=i==null?void 0:i.chart)==null?void 0:a.dataset)==null?void 0:l.backgroundColor,s=(u=(c=i==null?void 0:i.chart)==null?void 0:c.dataset)==null?void 0:u.borderColor;if((n==null?void 0:n.length)===1){const d=e.map(p=>({x:p[t[0]],y:p[t[1]],r:p[t[2]],label:p[n==null?void 0:n[0]]}));r=[{label:n==null?void 0:n[0],data:d}]}return(n==null?void 0:n.length)>1&&(r=[...new Set(e.map(p=>p[n==null?void 0:n[1]]))].map((p,h)=>{const m=e.filter(b=>b[n==null?void 0:n[1]]===p);return{label:p,data:m.map(b=>({x:b[t[0]],y:b[t[1]],r:b[t[2]],label:b[n==null?void 0:n[0]]})),backgroundColor:o==null?void 0:o[h%o.length],borderColor:s==null?void 0:s[h%s.length]}})),r}function wee(e){var c,u,d,p;const{dimensionKeys:t,metricKeys:n}=sr(e),r=ye.getState().themeStyle,i=(u=(c=r==null?void 0:r.chart)==null?void 0:c.dataset)==null?void 0:u.backgroundColor,o=(p=(d=r==null?void 0:r.chart)==null?void 0:d.dataset)==null?void 0:p.borderColor,s=t==null?void 0:t[1];return[...new Set(e.map(h=>h==null?void 0:h[s]))].map((h,m)=>({label:h,data:e.filter(b=>(b==null?void 0:b[s])===h).map(b=>[b==null?void 0:b[n[0]],b==null?void 0:b[n[1]],b==null?void 0:b[n[2]]]),backgroundColor:i==null?void 0:i[m%i.length],borderColor:o==null?void 0:o[m%o.length],borderSkipped:!1}))}function See(e,t){var s,a,l,c;const n=ye.getState().themeStyle,r=(a=(s=n==null?void 0:n.chart)==null?void 0:s.dataset)==null?void 0:a.backgroundColor,i=(c=(l=n==null?void 0:n.chart)==null?void 0:l.dataset)==null?void 0:c.borderColor;return e.map(u=>({label:u.charAt(0).toUpperCase()+u.slice(1),data:t.map(d=>d[u]),backgroundColor:t.map((d,p)=>(d==null?void 0:d._color)||(r==null?void 0:r[p%r.length])),borderColor:t.map((d,p)=>(d==null?void 0:d._color)||(i==null?void 0:i[p%i.length]))}))}function _ee(e){let t=-1,n=0;return e.forEach((r,i)=>{const o=Object.keys(r).length;o>n&&(t=i,n=o)}),t}function sr(e){if(!e||e.length===0)return{keys:[],dimensionKeys:[],metricKeys:[]};const t=_ee(e),n=Object.keys(e[t]),r=n.filter(o=>{var s,a,l,c,u,d,p,h;return!!(typeof((s=e==null?void 0:e[t])==null?void 0:s[o])&&typeof((a=e==null?void 0:e[t])==null?void 0:a[o])=="string"||typeof((l=e==null?void 0:e[0])==null?void 0:l[o])&&typeof((c=e==null?void 0:e[0])==null?void 0:c[o])=="string"||typeof((u=e==null?void 0:e[1])==null?void 0:u[o])&&typeof((d=e==null?void 0:e[1])==null?void 0:d[o])=="string"||typeof((p=e==null?void 0:e[2])==null?void 0:p[o])&&typeof((h=e==null?void 0:e[2])==null?void 0:h[o])=="string")});r.length===0&&r.push(n[0]);const i=n.filter(o=>{var s,a;return((s=e==null?void 0:e[t])==null?void 0:s[o])===+((a=e==null?void 0:e[t])==null?void 0:a[o])});return{keys:n,dimensionKeys:r,metricKeys:i}}function zf(e,t){var r;const n=(r=t==null?void 0:t.data)==null?void 0:r.datasets;return n&&n.length>0?e.map((o,s)=>({...o,...n[s],data:o.data,label:o.label})):e}function Cee(e,t="asc"){function n(r){return Object.entries(r).slice(1).reduce((s,[a,l])=>{const c=typeof l=="number"?l:parseFloat(l);return s+(isNaN(c)?0:c)},0)}return e.sort((r,i)=>{const o=n(r),s=n(i);return t==="asc"?o-s:s-o})}function Tb({dataArray:e,groupKey:t,pivotKey:n,valueKey:r,sortChart:i}){const o=e.reduce((a,l)=>{const c=l[t],u=l[n],d=l[r];return a[c]||(a[c]={[t]:c}),a[c][u]=d,a},{});let s=Object.values(o);return i!=="none"&&i!==void 0&&(s=Cee(s,i)),s}function Oi(e,t){var s;const n=ye.getState().themeStyle,r=(s=n==null?void 0:n.chart)==null?void 0:s.options,i=Jl.cloneDeep(r);return Jl.merge(i,e,t)}function Zw(e,t){return e.map(n=>n[t]?n[t]:"BLANK")}/**
|
|
113
|
-
* @license lucide-react v0.453.0 - ISC
|
|
114
|
-
*
|
|
115
|
-
* This source code is licensed under the ISC license.
|
|
116
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
117
|
-
*/const Eee=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),V5=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/**
|
|
118
|
-
* @license lucide-react v0.453.0 - ISC
|
|
119
|
-
*
|
|
120
|
-
* This source code is licensed under the ISC license.
|
|
121
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
122
|
-
*/var Ree={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
123
|
-
* @license lucide-react v0.453.0 - ISC
|
|
124
|
-
*
|
|
125
|
-
* This source code is licensed under the ISC license.
|
|
126
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
127
|
-
*/const W5=P.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:s,...a},l)=>P.createElement("svg",{ref:l,...Ree,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:V5("lucide",i),...a},[...s.map(([c,u])=>P.createElement(c,u)),...Array.isArray(o)?o:[o]]));/**
|
|
128
|
-
* @license lucide-react v0.453.0 - ISC
|
|
129
|
-
*
|
|
130
|
-
* This source code is licensed under the ISC license.
|
|
131
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
132
|
-
*/const Gt=(e,t)=>{const n=P.forwardRef(({className:r,...i},o)=>P.createElement(W5,{ref:o,iconNode:t,className:V5(`lucide-${Eee(e)}`,r),...i}));return n.displayName=`${e}`,n};/**
|
|
133
|
-
* @license lucide-react v0.453.0 - ISC
|
|
134
|
-
*
|
|
135
|
-
* This source code is licensed under the ISC license.
|
|
136
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
137
|
-
*/const eS=Gt("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
|
|
138
|
-
* @license lucide-react v0.453.0 - ISC
|
|
139
|
-
*
|
|
140
|
-
* This source code is licensed under the ISC license.
|
|
141
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
142
|
-
*/const U5=Gt("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
|
|
143
|
-
* @license lucide-react v0.453.0 - ISC
|
|
144
|
-
*
|
|
145
|
-
* This source code is licensed under the ISC license.
|
|
146
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
147
|
-
*/const Td=Gt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
148
|
-
* @license lucide-react v0.453.0 - ISC
|
|
149
|
-
*
|
|
150
|
-
* This source code is licensed under the ISC license.
|
|
151
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
152
|
-
*/const Jy=Gt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
153
|
-
* @license lucide-react v0.453.0 - ISC
|
|
154
|
-
*
|
|
155
|
-
* This source code is licensed under the ISC license.
|
|
156
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
157
|
-
*/const NC=Gt("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
158
|
-
* @license lucide-react v0.453.0 - ISC
|
|
159
|
-
*
|
|
160
|
-
* This source code is licensed under the ISC license.
|
|
161
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
162
|
-
*/const Zy=Gt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
163
|
-
* @license lucide-react v0.453.0 - ISC
|
|
164
|
-
*
|
|
165
|
-
* This source code is licensed under the ISC license.
|
|
166
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
167
|
-
*/const G5=Gt("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
168
|
-
* @license lucide-react v0.453.0 - ISC
|
|
169
|
-
*
|
|
170
|
-
* This source code is licensed under the ISC license.
|
|
171
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
172
|
-
*/const LC=Gt("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
173
|
-
* @license lucide-react v0.453.0 - ISC
|
|
174
|
-
*
|
|
175
|
-
* This source code is licensed under the ISC license.
|
|
176
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
177
|
-
*/const q5=Gt("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
178
|
-
* @license lucide-react v0.453.0 - ISC
|
|
179
|
-
*
|
|
180
|
-
* This source code is licensed under the ISC license.
|
|
181
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
182
|
-
*/const Y5=Gt("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
183
|
-
* @license lucide-react v0.453.0 - ISC
|
|
184
|
-
*
|
|
185
|
-
* This source code is licensed under the ISC license.
|
|
186
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
187
|
-
*/const K5=Gt("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
|
188
|
-
* @license lucide-react v0.453.0 - ISC
|
|
189
|
-
*
|
|
190
|
-
* This source code is licensed under the ISC license.
|
|
191
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
192
|
-
*/const X5=Gt("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
193
|
-
* @license lucide-react v0.453.0 - ISC
|
|
194
|
-
*
|
|
195
|
-
* This source code is licensed under the ISC license.
|
|
196
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
197
|
-
*/const FC=Gt("FilterX",[["path",{d:"M13.013 3H2l8 9.46V19l4 2v-8.54l.9-1.055",key:"1fi1da"}],["path",{d:"m22 3-5 5",key:"12jva0"}],["path",{d:"m17 3 5 5",key:"k36vhe"}]]);/**
|
|
198
|
-
* @license lucide-react v0.453.0 - ISC
|
|
199
|
-
*
|
|
200
|
-
* This source code is licensed under the ISC license.
|
|
201
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
202
|
-
*/const Q5=Gt("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
|
|
203
|
-
* @license lucide-react v0.453.0 - ISC
|
|
204
|
-
*
|
|
205
|
-
* This source code is licensed under the ISC license.
|
|
206
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
207
|
-
*/const J5=Gt("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
|
|
208
|
-
* @license lucide-react v0.453.0 - ISC
|
|
209
|
-
*
|
|
210
|
-
* This source code is licensed under the ISC license.
|
|
211
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
212
|
-
*/const Z5=Gt("IdCard",[["path",{d:"M16 10h2",key:"8sgtl7"}],["path",{d:"M16 14h2",key:"epxaof"}],["path",{d:"M6.17 15a3 3 0 0 1 5.66 0",key:"n6f512"}],["circle",{cx:"9",cy:"11",r:"2",key:"yxgjnd"}],["rect",{x:"2",y:"5",width:"20",height:"14",rx:"2",key:"qneu4z"}]]);/**
|
|
213
|
-
* @license lucide-react v0.453.0 - ISC
|
|
214
|
-
*
|
|
215
|
-
* This source code is licensed under the ISC license.
|
|
216
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
217
|
-
*/const e4=Gt("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
218
|
-
* @license lucide-react v0.453.0 - ISC
|
|
219
|
-
*
|
|
220
|
-
* This source code is licensed under the ISC license.
|
|
221
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
222
|
-
*/const t4=Gt("LightbulbOff",[["path",{d:"M16.8 11.2c.8-.9 1.2-2 1.2-3.2a6 6 0 0 0-9.3-5",key:"1fkcox"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M6.3 6.3a4.67 4.67 0 0 0 1.2 5.2c.7.7 1.3 1.5 1.5 2.5",key:"10m8kw"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
|
|
223
|
-
* @license lucide-react v0.453.0 - ISC
|
|
224
|
-
*
|
|
225
|
-
* This source code is licensed under the ISC license.
|
|
226
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
227
|
-
*/const n4=Gt("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
|
|
228
|
-
* @license lucide-react v0.453.0 - ISC
|
|
229
|
-
*
|
|
230
|
-
* This source code is licensed under the ISC license.
|
|
231
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
232
|
-
*/const r4=Gt("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
233
|
-
* @license lucide-react v0.453.0 - ISC
|
|
234
|
-
*
|
|
235
|
-
* This source code is licensed under the ISC license.
|
|
236
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
237
|
-
*/const i4=Gt("Percent",[["line",{x1:"19",x2:"5",y1:"5",y2:"19",key:"1x9vlm"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5",key:"4mh3h7"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5",key:"1mdrzq"}]]);/**
|
|
238
|
-
* @license lucide-react v0.453.0 - ISC
|
|
239
|
-
*
|
|
240
|
-
* This source code is licensed under the ISC license.
|
|
241
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
242
|
-
*/const jC=Gt("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
243
|
-
* @license lucide-react v0.453.0 - ISC
|
|
244
|
-
*
|
|
245
|
-
* This source code is licensed under the ISC license.
|
|
246
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
247
|
-
*/const o4=Gt("ScanSearch",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m16 16-1.9-1.9",key:"1dq9hf"}]]);/**
|
|
248
|
-
* @license lucide-react v0.453.0 - ISC
|
|
249
|
-
*
|
|
250
|
-
* This source code is licensed under the ISC license.
|
|
251
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
252
|
-
*/const s4=Gt("SearchX",[["path",{d:"m13.5 8.5-5 5",key:"1cs55j"}],["path",{d:"m8.5 8.5 5 5",key:"a8mexj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
253
|
-
* @license lucide-react v0.453.0 - ISC
|
|
254
|
-
*
|
|
255
|
-
* This source code is licensed under the ISC license.
|
|
256
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
257
|
-
*/const a4=Gt("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
258
|
-
* @license lucide-react v0.453.0 - ISC
|
|
259
|
-
*
|
|
260
|
-
* This source code is licensed under the ISC license.
|
|
261
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
262
|
-
*/const l4=Gt("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
263
|
-
* @license lucide-react v0.453.0 - ISC
|
|
264
|
-
*
|
|
265
|
-
* This source code is licensed under the ISC license.
|
|
266
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
267
|
-
*/const c4=Gt("Table",[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]]);/**
|
|
268
|
-
* @license lucide-react v0.453.0 - ISC
|
|
269
|
-
*
|
|
270
|
-
* This source code is licensed under the ISC license.
|
|
271
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
272
|
-
*/const u4=Gt("TreePalm",[["path",{d:"M13 8c0-2.76-2.46-5-5.5-5S2 5.24 2 8h2l1-1 1 1h4",key:"foxbe7"}],["path",{d:"M13 7.14A5.82 5.82 0 0 1 16.5 6c3.04 0 5.5 2.24 5.5 5h-3l-1-1-1 1h-3",key:"18arnh"}],["path",{d:"M5.89 9.71c-2.15 2.15-2.3 5.47-.35 7.43l4.24-4.25.7-.7.71-.71 2.12-2.12c-1.95-1.96-5.27-1.8-7.42.35",key:"ywahnh"}],["path",{d:"M11 15.5c.5 2.5-.17 4.5-1 6.5h4c2-5.5-.5-12-1-14",key:"ft0feo"}]]);/**
|
|
273
|
-
* @license lucide-react v0.453.0 - ISC
|
|
274
|
-
*
|
|
275
|
-
* This source code is licensed under the ISC license.
|
|
276
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
277
|
-
*/const d4=Gt("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);/**
|
|
278
|
-
* @license lucide-react v0.453.0 - ISC
|
|
279
|
-
*
|
|
280
|
-
* This source code is licensed under the ISC license.
|
|
281
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
282
|
-
*/const Md=Gt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Pee=({data:e,filename:t="output.csv"})=>{const n=()=>{if(e.length===0)return;const r=[],i=Object.keys(e[0]);r.push(i.join(","));for(const c of e){const u=i.map(d=>`"${(""+c[d]).replace(/"/g,'""')}"`);r.push(u.join(","))}const o=r.join(`
|
|
283
|
-
`),s=new Blob([o],{type:"text/csv"}),a=window.URL.createObjectURL(s),l=document.createElement("a");l.setAttribute("hidden",""),l.setAttribute("href",a),l.setAttribute("download",t),document.body.appendChild(l),l.click(),document.body.removeChild(l)};return y.jsx(Y5,{onClick:n,className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})};var id=1e3,od=id*60,sd=od*60,bc=sd*24,Tee=bc*7,Mee=bc*365.25,Oee=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return Dee(e);if(n==="number"&&isFinite(e))return t.long?kee(e):Aee(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Dee(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*Mee;case"weeks":case"week":case"w":return n*Tee;case"days":case"day":case"d":return n*bc;case"hours":case"hour":case"hrs":case"hr":case"h":return n*sd;case"minutes":case"minute":case"mins":case"min":case"m":return n*od;case"seconds":case"second":case"secs":case"sec":case"s":return n*id;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function Aee(e){var t=Math.abs(e);return t>=bc?Math.round(e/bc)+"d":t>=sd?Math.round(e/sd)+"h":t>=od?Math.round(e/od)+"m":t>=id?Math.round(e/id)+"s":e+"ms"}function kee(e){var t=Math.abs(e);return t>=bc?Jg(e,t,bc,"day"):t>=sd?Jg(e,t,sd,"hour"):t>=od?Jg(e,t,od,"minute"):t>=id?Jg(e,t,id,"second"):e+" ms"}function Jg(e,t,n,r){var i=t>=n*1.5;return Math.round(e/n)+" "+r+(i?"s":"")}const Iee=Oc(Oee);function Nee(e){const t=ye(u=>u.selectedSheetId),n=ye(u=>u.selectedLensId);ye(u=>u.dashboard.baseQueries);const r=ye(u=>u.dashboard.filters),i=ye(u=>u.filterValues),o=r==null?void 0:r.filter(u=>u.sheetId===t||!u.sheetId),s=i==null?void 0:i.filter(u=>(o==null?void 0:o.some(d=>d.id===u.filterId))||u.filterId.endsWith(t)),a=(e==null?void 0:e.sql)||"",l=Lee((e==null?void 0:e.python)||"");return{queryKey:["query",e==null?void 0:e.id,e==null?void 0:e.title,a,l,n||"",JSON.stringify(s)],sql:a,sheetFilterValues:s}}function Lee(e){return e===q_?"":e}function Wa(e,t){const{authToken:n}=Vi(),r=ye(p=>p.isVisualEditing),i=ye(p=>p.authToken),o=Iee((e==null?void 0:e.refreshInterval)||"0"),{queryKey:s,sql:a,sheetFilterValues:l}=Nee(e);let c={};return r||(c={refetchInterval:o,placeholderData:JK}),{...xp({queryKey:s,queryFn:async()=>{var h;return!(e!=null&&e.connectionId)||!((h=e==null?void 0:e.sql)!=null&&h.trim())?null:await Dy("https://semaphor.cloud/api/v1/query",(n==null?void 0:n.accessToken)||(i==null?void 0:i.accessToken)||"",{connection_id:e.connectionId,sql:a,python:e.python===q_?"":e.python,active_filters:l,cache_config:Q_()})},...c,enabled:!!(e!=null&&e.connectionId)&&!!(e!=null&&e.sql)&&!0&&!r}),queryKey:s}}function f4({frame:e}){var E;const t=ye(C=>C.isDashboardEditing),n=ye(C=>C.filterValues),r=ye(C=>C.isVisualEditing),i=ye(C=>C.selectedSheetId);ye(C=>C.currentBreakpoint);const{removeFrame:o}=ye(C=>C.actions),s=ye(C=>C.actions.setIsVisualEditing),a=Ur(C=>C.actions.setFilterValues),l=Ur(C=>C.actions.setApplyFilters),{setCard:c,setFrame:u,setQueryResultColumns:d}=Ur(C=>C.actions),p=Ur(C=>C.actions.setSelectedConnectionId),h=Ur(C=>C.actions.setSelectedDatamodelId),m=Ur(C=>C.actions.setSelectedDatabaseName),b=Ur(C=>C.actions.setSelectedSchemaName),v=Ur(C=>C.actions.setSelectedTableName),x=e.cards.find(C=>C.id===e.activeCardId),{data:S}=Wa(x);function _(){s(!r),c(x);const{dimensionKeys:C}=sr((S==null?void 0:S.records)||[]);d(C),u(e),x!=null&&x.connectionId&&p(x==null?void 0:x.connectionId),x!=null&&x.datamodelId&&x.datamodelId!=="none"&&(h(x==null?void 0:x.datamodelId),m("")),x!=null&&x.lastSelectedDatabase&&x.lastSelectedDatabase!=="none"&&(m(x==null?void 0:x.lastSelectedDatabase),h("")),x!=null&&x.lastSelectedSchema&&b(x==null?void 0:x.lastSelectedSchema),x!=null&&x.lastSelectedTable&&v(x==null?void 0:x.lastSelectedTable),n&&(a(n),l(!0))}return y.jsx("section",{onMouseDown:C=>{C.stopPropagation()},className:"absolute right-2 top-2 z-50",children:y.jsxs("div",{className:"flex items-center gap-2",children:[t&&(r?y.jsx("button",{onClick:()=>{s(!r)},children:y.jsx(eee,{className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})}):y.jsx("button",{role:"edit-visual",onClick:_,children:y.jsx(nee,{className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})})),t&&y.jsx("button",{onClick:()=>o(i,e.id),children:y.jsx($5,{className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})}),((E=x.preferences)==null?void 0:E.allowDownload)===!0&&y.jsx(Pee,{data:(S==null?void 0:S.records)||[],filename:x.title})]})})}function Fee(e,t){ye(s=>s.selectedSheetId);const n=ye(s=>s.selectedFrameId),r=ye(s=>s.isDashboardEditing),i=ye(s=>s.isVisualEditing);ye(s=>s.actions),P.useEffect(()=>{n===e.id&&r&&!i&&o()},[n,e.id,r,i]);function o(){const s=t==null?void 0:t.current;s==null||s.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}}const jee=P.createContext(null),Lx={didCatch:!1,error:null};class e0 extends P.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Lx}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var n,r,i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];(n=(r=this.props).onReset)===null||n===void 0||n.call(r,{args:o,reason:"imperative-api"}),this.setState(Lx)}}componentDidCatch(t,n){var r,i;(r=(i=this.props).onError)===null||r===void 0||r.call(i,t,n)}componentDidUpdate(t,n){const{didCatch:r}=this.state,{resetKeys:i}=this.props;if(r&&n.error!==null&&$ee(t.resetKeys,i)){var o,s;(o=(s=this.props).onReset)===null||o===void 0||o.call(s,{next:i,prev:t.resetKeys,reason:"keys"}),this.setState(Lx)}}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:i}=this.props,{didCatch:o,error:s}=this.state;let a=t;if(o){const l={error:s,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")a=n(l);else if(r)a=P.createElement(r,l);else if(i!==void 0)a=i;else throw s}return P.createElement(jee.Provider,{value:{didCatch:o,error:s,resetErrorBoundary:this.resetErrorBoundary}},a)}}function $ee(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((n,r)=>!Object.is(n,t[r]))}function $C({error:e}){return y.jsx("div",{className:"flex flex-col items-center justify-center",role:"alert",style:{height:"100%"},children:y.jsxs("div",{className:"flex flex-col justify-center space-y-2 rounded-md bg-muted p-10",children:[y.jsx("p",{className:"text-lg font-semibold",children:"Oops! Looks like we tripped on a loose wire!"}),y.jsx("p",{className:"text-sm",children:"Something went wrong:"}),y.jsx("pre",{className:"text-xs",children:e.message})]})})}function zee({error:e,frame:t}){return y.jsxs("div",{className:"flex h-full flex-col items-center justify-center border",role:"alert",children:[y.jsx(f4,{frame:t}),y.jsx("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10"}),y.jsxs("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10",children:[y.jsx("p",{className:"text-lg font-semibold",children:"Oops! Looks like we tripped on a loose wire!"}),y.jsx("p",{className:"text-sm",children:"Something went wrong:"}),y.jsx("pre",{className:"text-xs",children:e.message})]})]})}function Bee({error:e}){return y.jsxs("div",{className:"flex h-full flex-col items-center justify-center",role:"alert",children:[y.jsx("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10"}),y.jsxs("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10",children:[y.jsx("p",{className:"text-lg font-semibold",children:"Oops! Something went wrong!"}),y.jsx("p",{className:"text-sm",children:"Something went wrong:"}),y.jsx("pre",{className:"text-xs",children:e.message})]})]})}function Qs({number:e,decimalPlaces:t=0,useSuffix:n=!1,customSuffix:r="",currency:i="",locale:o="en-US"}){let s=1,a=r,l=o;const c=t;n&&!r&&(e>=1e9?(s=1e9,a="B"):e>=1e7&&o==="en-IN"?(s=1e7,a="Cr"):e>=1e5&&o==="en-IN"?(s=1e5,a="L"):e>=1e6?(s=1e6,a="M"):e>=1e3&&(s=1e3,a="K"));const u=e/s,d={maximumFractionDigits:c,minimumFractionDigits:c};if(i){d.style="currency",d.currency=i;try{new Intl.NumberFormat(o,d).format(0)}catch{}}try{new Intl.NumberFormat(o,d).format(0)}catch{l="en-US"}let h=new Intl.NumberFormat(l,d).format(u);return n&&(h+=a),h}function zC(e,t){if(!t)return"";const n=t.find(r=>e>=r.start&&e<=r.end);return(n==null?void 0:n.color)||""}function tS(e){try{const n=new Function("getDatalabelColor",e)(Cw);return{options:n==null?void 0:n.options,plugins:(n==null?void 0:n.plugins)||[]}}catch(t){return console.error("Error processing custom visual code",t),{options:{},plugins:[]}}}function Hee(e){const t=getComputedStyle(document.documentElement).getPropertyValue(e);return h4(t)}function h4(e){const[t,n,r]=e.split(" "),i=parseFloat(t),o=parseFloat(n),s=parseFloat(r),a=o/100,l=s/100,c=(1-Math.abs(2*l-1))*a,u=c*(1-Math.abs(i/60%2-1)),d=l-c/2;let p=0,h=0,m=0;0<=i&&i<60?(p=c,h=u,m=0):60<=i&&i<120?(p=u,h=c,m=0):120<=i&&i<180?(p=0,h=c,m=u):180<=i&&i<240?(p=0,h=u,m=c):240<=i&&i<300?(p=u,h=0,m=c):300<=i&&i<360&&(p=c,h=0,m=u),p=Math.round((p+d)*255),h=Math.round((h+d)*255),m=Math.round((m+d)*255);const b=v=>{const x=v.toString(16);return x.length==1?"0"+x:x};return`#${b(p)}${b(h)}${b(m)}`}function xl({data:e,cfg:t,customCfg:n,preferences:r,cardType:i}){ye.getState().themeStyle;const o=i==="radar"?.2:1,{dimensionKeys:s,metricKeys:a}=sr(e),l=yee(a,e,r,o),c=zf(l,n),u=s[0],d=Zw(e,u);BC(r,t),p4(r);const{options:p,plugins:h}=m4({cfg:t,preferences:r,customCfg:n});return{type:(n==null?void 0:n.type)||(t==null?void 0:t.type)||"bar",data:{labels:d,datasets:c},options:p,plugins:h}}function BC(e,t){var i,o,s;const n=((i=t==null?void 0:t.options)==null?void 0:i.indexAxis)==="y"?"x":"y";return(o=e==null?void 0:e.chartOptions)!=null&&o.indexAxis?((s=e==null?void 0:e.chartOptions)==null?void 0:s.indexAxis)==="x"?"y":"x":n}function p4(e){var n,r;return(n=e==null?void 0:e.chartOptions)!=null&&n.indexAxis?((r=e==null?void 0:e.chartOptions)==null?void 0:r.indexAxis)==="x"?"x":"y":"x"}function g4(e,t){var o,s,a,l,c,u,d,p,h,m,b,v;const n=BC(t,e),r=p4(t);return{...e==null?void 0:e.options,scales:{...(o=e==null?void 0:e.options)==null?void 0:o.scales,[n]:{...(a=(s=e==null?void 0:e.options)==null?void 0:s.scales)==null?void 0:a[n],ticks:{...(u=(c=(l=e==null?void 0:e.options)==null?void 0:l.scales)==null?void 0:c[n])==null?void 0:u.ticks,callback:x=>{var S,_,E,C;return Qs({number:Number(x),decimalPlaces:((S=t==null?void 0:t.numberAxisFormat)==null?void 0:S.decimalPlaces)||0,useSuffix:!!((_=t==null?void 0:t.numberAxisFormat)!=null&&_.suffix),customSuffix:"",locale:((E=t==null?void 0:t.numberAxisFormat)==null?void 0:E.locale)||"",currency:((C=t==null?void 0:t.numberAxisFormat)==null?void 0:C.currency)||""})}}},[r]:{...(h=(p=(d=e==null?void 0:e.options)==null?void 0:d.scales)==null?void 0:p[r])==null?void 0:h.ticks,callback:null}},plugins:{...(m=e==null?void 0:e.options)==null?void 0:m.plugins,datalabels:{...(v=(b=e==null?void 0:e.options)==null?void 0:b.plugins)==null?void 0:v.datalabels,formatter:function(x){var S,_,E,C;return Qs({number:Number(x),decimalPlaces:((S=t==null?void 0:t.numberAxisFormat)==null?void 0:S.decimalPlaces)||0,useSuffix:!!((_=t==null?void 0:t.numberAxisFormat)!=null&&_.suffix),customSuffix:"",locale:((E=t==null?void 0:t.numberAxisFormat)==null?void 0:E.locale)||"",currency:((C=t==null?void 0:t.numberAxisFormat)==null?void 0:C.currency)||""})}}}}}function m4({cfg:e,preferences:t,customCfg:n}){var p,h,m,b,v,x,S,_,E,C,M,O,k,N,F,j,$,X,V,L,U,B,W,q,A,Y,G,D,ee;const r=ye.getState().themeStyle,i=g4(e,t),o=Oi((e==null?void 0:e.options)||{},t==null?void 0:t.chartOptions),s=Oi(i,o),a=Oi(s,(n==null?void 0:n.options)||{}),l={...a,scales:{...a==null?void 0:a.scales,x:{...(p=a==null?void 0:a.scales)==null?void 0:p.x,grid:{...(m=(h=a==null?void 0:a.scales)==null?void 0:h.x)==null?void 0:m.grid,color:(_=(S=(x=(v=(b=r==null?void 0:r.chart)==null?void 0:b.options)==null?void 0:v.scales)==null?void 0:x.x)==null?void 0:S.grid)==null?void 0:_.color}},y:{...(E=a==null?void 0:a.scales)==null?void 0:E.y,grid:{...(M=(C=a==null?void 0:a.scales)==null?void 0:C.y)==null?void 0:M.grid,color:(j=(F=(N=(k=(O=r==null?void 0:r.chart)==null?void 0:O.options)==null?void 0:k.scales)==null?void 0:N.y)==null?void 0:F.grid)==null?void 0:j.color}}},plugins:{...a==null?void 0:a.plugins,tooltip:{...($=a==null?void 0:a.plugins)==null?void 0:$.tooltip,backgroundColor:(U=(L=(V=(X=r==null?void 0:r.chart)==null?void 0:X.options)==null?void 0:V.plugins)==null?void 0:L.tooltip)==null?void 0:U.backgroundColor,bodyColor:(A=(q=(W=(B=r==null?void 0:r.chart)==null?void 0:B.options)==null?void 0:W.plugins)==null?void 0:q.tooltip)==null?void 0:A.bodyColor,titleColor:(ee=(D=(G=(Y=r==null?void 0:r.chart)==null?void 0:Y.options)==null?void 0:G.plugins)==null?void 0:D.tooltip)==null?void 0:ee.titleColor}}},{plugins:c,options:u}=tS((t==null?void 0:t.customVisualCode)||"");return{options:Oi(l,u),plugins:c}}/*!
|
|
284
|
-
* @kurkle/color v0.3.4
|
|
285
|
-
* https://github.com/kurkle/color#readme
|
|
286
|
-
* (c) 2024 Jukka Kurkela
|
|
287
|
-
* Released under the MIT License
|
|
288
|
-
*/function Cp(e){return e+.5|0}const ka=(e,t,n)=>Math.max(Math.min(e,n),t);function Bf(e){return ka(Cp(e*2.55),0,255)}function za(e){return ka(Cp(e*255),0,255)}function zs(e){return ka(Cp(e/2.55)/100,0,1)}function GM(e){return ka(Cp(e*100),0,100)}const eo={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},nS=[..."0123456789ABCDEF"],Vee=e=>nS[e&15],Wee=e=>nS[(e&240)>>4]+nS[e&15],Zg=e=>(e&240)>>4===(e&15),Uee=e=>Zg(e.r)&&Zg(e.g)&&Zg(e.b)&&Zg(e.a);function Gee(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&eo[e[1]]*17,g:255&eo[e[2]]*17,b:255&eo[e[3]]*17,a:t===5?eo[e[4]]*17:255}:(t===7||t===9)&&(n={r:eo[e[1]]<<4|eo[e[2]],g:eo[e[3]]<<4|eo[e[4]],b:eo[e[5]]<<4|eo[e[6]],a:t===9?eo[e[7]]<<4|eo[e[8]]:255})),n}const qee=(e,t)=>e<255?t(e):"";function Yee(e){var t=Uee(e)?Vee:Wee;return e?"#"+t(e.r)+t(e.g)+t(e.b)+qee(e.a,t):void 0}const Kee=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function b4(e,t,n){const r=t*Math.min(n,1-n),i=(o,s=(o+e/30)%12)=>n-r*Math.max(Math.min(s-3,9-s,1),-1);return[i(0),i(8),i(4)]}function Xee(e,t,n){const r=(i,o=(i+e/60)%6)=>n-n*t*Math.max(Math.min(o,4-o,1),0);return[r(5),r(3),r(1)]}function Qee(e,t,n){const r=b4(e,1,.5);let i;for(t+n>1&&(i=1/(t+n),t*=i,n*=i),i=0;i<3;i++)r[i]*=1-t-n,r[i]+=t;return r}function Jee(e,t,n,r,i){return e===i?(t-n)/r+(t<n?6:0):t===i?(n-e)/r+2:(e-t)/r+4}function HC(e){const n=e.r/255,r=e.g/255,i=e.b/255,o=Math.max(n,r,i),s=Math.min(n,r,i),a=(o+s)/2;let l,c,u;return o!==s&&(u=o-s,c=a>.5?u/(2-o-s):u/(o+s),l=Jee(n,r,i,u,o),l=l*60+.5),[l|0,c||0,a]}function VC(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(za)}function WC(e,t,n){return VC(b4,e,t,n)}function Zee(e,t,n){return VC(Qee,e,t,n)}function ete(e,t,n){return VC(Xee,e,t,n)}function y4(e){return(e%360+360)%360}function tte(e){const t=Kee.exec(e);let n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?Bf(+t[5]):za(+t[5]));const i=y4(+t[2]),o=+t[3]/100,s=+t[4]/100;return t[1]==="hwb"?r=Zee(i,o,s):t[1]==="hsv"?r=ete(i,o,s):r=WC(i,o,s),{r:r[0],g:r[1],b:r[2],a:n}}function nte(e,t){var n=HC(e);n[0]=y4(n[0]+t),n=WC(n),e.r=n[0],e.g=n[1],e.b=n[2]}function rte(e){if(!e)return;const t=HC(e),n=t[0],r=GM(t[1]),i=GM(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${i}%, ${zs(e.a)})`:`hsl(${n}, ${r}%, ${i}%)`}const qM={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},YM={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function ite(){const e={},t=Object.keys(YM),n=Object.keys(qM);let r,i,o,s,a;for(r=0;r<t.length;r++){for(s=a=t[r],i=0;i<n.length;i++)o=n[i],a=a.replace(o,qM[o]);o=parseInt(YM[s],16),e[a]=[o>>16&255,o>>8&255,o&255]}return e}let em;function ote(e){em||(em=ite(),em.transparent=[0,0,0,0]);const t=em[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const ste=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function ate(e){const t=ste.exec(e);let n=255,r,i,o;if(t){if(t[7]!==r){const s=+t[7];n=t[8]?Bf(s):ka(s*255,0,255)}return r=+t[1],i=+t[3],o=+t[5],r=255&(t[2]?Bf(r):ka(r,0,255)),i=255&(t[4]?Bf(i):ka(i,0,255)),o=255&(t[6]?Bf(o):ka(o,0,255)),{r,g:i,b:o,a:n}}}function lte(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${zs(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const Fx=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,su=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function cte(e,t,n){const r=su(zs(e.r)),i=su(zs(e.g)),o=su(zs(e.b));return{r:za(Fx(r+n*(su(zs(t.r))-r))),g:za(Fx(i+n*(su(zs(t.g))-i))),b:za(Fx(o+n*(su(zs(t.b))-o))),a:e.a+n*(t.a-e.a)}}function tm(e,t,n){if(e){let r=HC(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=WC(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function v4(e,t){return e&&Object.assign(t||{},e)}function KM(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=za(e[3]))):(t=v4(e,{r:0,g:0,b:0,a:1}),t.a=za(t.a)),t}function ute(e){return e.charAt(0)==="r"?ate(e):tte(e)}let x4=class rS{constructor(t){if(t instanceof rS)return t;const n=typeof t;let r;n==="object"?r=KM(t):n==="string"&&(r=Gee(t)||ote(t)||ute(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var t=v4(this._rgb);return t&&(t.a=zs(t.a)),t}set rgb(t){this._rgb=KM(t)}rgbString(){return this._valid?lte(this._rgb):void 0}hexString(){return this._valid?Yee(this._rgb):void 0}hslString(){return this._valid?rte(this._rgb):void 0}mix(t,n){if(t){const r=this.rgb,i=t.rgb;let o;const s=n===o?.5:n,a=2*s-1,l=r.a-i.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,r.r=255&c*r.r+o*i.r+.5,r.g=255&c*r.g+o*i.g+.5,r.b=255&c*r.b+o*i.b+.5,r.a=s*r.a+(1-s)*i.a,this.rgb=r}return this}interpolate(t,n){return t&&(this._rgb=cte(this._rgb,t._rgb,n)),this}clone(){return new rS(this.rgb)}alpha(t){return this._rgb.a=za(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=Cp(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return tm(this._rgb,2,t),this}darken(t){return tm(this._rgb,2,-t),this}saturate(t){return tm(this._rgb,1,t),this}desaturate(t){return tm(this._rgb,1,-t),this}rotate(t){return nte(this._rgb,t),this}};/*!
|
|
289
|
-
* Chart.js v4.4.7
|
|
290
|
-
* https://www.chartjs.org
|
|
291
|
-
* (c) 2024 Chart.js Contributors
|
|
292
|
-
* Released under the MIT License
|
|
293
|
-
*/function Ds(){}const dte=(()=>{let e=0;return()=>e++})();function _t(e){return e==null}function Sn(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function Tt(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function Nn(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Mi(e,t){return Nn(e)?e:t}function nt(e,t){return typeof e>"u"?t:e}const fte=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,w4=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function sn(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function Qt(e,t,n,r){let i,o,s;if(Sn(e))for(o=e.length,i=0;i<o;i++)t.call(n,e[i],i);else if(Tt(e))for(s=Object.keys(e),o=s.length,i=0;i<o;i++)t.call(n,e[s[i]],s[i])}function Mb(e,t){let n,r,i,o;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(i=e[n],o=t[n],i.datasetIndex!==o.datasetIndex||i.index!==o.index)return!1;return!0}function Ob(e){if(Sn(e))return e.map(Ob);if(Tt(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let i=0;for(;i<r;++i)t[n[i]]=Ob(e[n[i]]);return t}return e}function S4(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function hte(e,t,n,r){if(!S4(e))return;const i=t[e],o=n[e];Tt(i)&&Tt(o)?cr(i,o,r):t[e]=Ob(o)}function cr(e,t,n){const r=Sn(t)?t:[t],i=r.length;if(!Tt(e))return e;n=n||{};const o=n.merger||hte;let s;for(let a=0;a<i;++a){if(s=r[a],!Tt(s))continue;const l=Object.keys(s);for(let c=0,u=l.length;c<u;++c)o(l[c],e,s,n)}return e}function th(e,t){return cr(e,t,{merger:pte})}function pte(e,t,n){if(!S4(e))return;const r=t[e],i=n[e];Tt(r)&&Tt(i)?th(r,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Ob(i))}const XM={"":e=>e,x:e=>e.x,y:e=>e.y};function gte(e){const t=e.split("."),n=[];let r="";for(const i of t)r+=i,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function mte(e){const t=gte(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function Ua(e,t){return(XM[t]||(XM[t]=mte(t)))(e)}function UC(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Rh=e=>typeof e<"u",Ga=e=>typeof e=="function",QM=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function bte(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const En=Math.PI,_n=2*En,yte=_n+En,Db=Number.POSITIVE_INFINITY,vte=En/180,Bn=En/2,wl=En/4,JM=En*2/3,Ia=Math.log10,ts=Math.sign;function nh(e,t,n){return Math.abs(e-t)<n}function ZM(e){const t=Math.round(e);e=nh(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(Ia(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function xte(e){const t=[],n=Math.sqrt(e);let r;for(r=1;r<n;r++)e%r===0&&(t.push(r),t.push(e/r));return n===(n|0)&&t.push(n),t.sort((i,o)=>i-o).pop(),t}function ad(e){return!isNaN(parseFloat(e))&&isFinite(e)}function wte(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function _4(e,t,n){let r,i,o;for(r=0,i=e.length;r<i;r++)o=e[r][n],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function Ro(e){return e*(En/180)}function GC(e){return e*(180/En)}function eO(e){if(!Nn(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function C4(e,t){const n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r);let o=Math.atan2(r,n);return o<-.5*En&&(o+=_n),{angle:o,distance:i}}function iS(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function Ste(e,t){return(e-t+yte)%_n-En}function ki(e){return(e%_n+_n)%_n}function Ph(e,t,n,r){const i=ki(e),o=ki(t),s=ki(n),a=ki(o-i),l=ki(s-i),c=ki(i-o),u=ki(i-s);return i===o||i===s||r&&o===s||a>l&&c<u}function lr(e,t,n){return Math.max(t,Math.min(n,e))}function _te(e){return lr(e,-32768,32767)}function Gs(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function qC(e,t,n){n=n||(s=>e[s]<t);let r=e.length-1,i=0,o;for(;r-i>1;)o=i+r>>1,n(o)?i=o:r=o;return{lo:i,hi:r}}const qs=(e,t,n,r)=>qC(e,n,r?i=>{const o=e[i][t];return o<n||o===n&&e[i+1][t]===n}:i=>e[i][t]<n),Cte=(e,t,n)=>qC(e,n,r=>e[r][t]>=n);function Ete(e,t,n){let r=0,i=e.length;for(;r<i&&e[r]<t;)r++;for(;i>r&&e[i-1]>n;)i--;return r>0||i<e.length?e.slice(r,i):e}const E4=["push","pop","shift","splice","unshift"];function Rte(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),E4.forEach(n=>{const r="_onData"+UC(n),i=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...o){const s=i.apply(this,o);return e._chartjs.listeners.forEach(a=>{typeof a[r]=="function"&&a[r](...o)}),s}})})}function tO(e,t){const n=e._chartjs;if(!n)return;const r=n.listeners,i=r.indexOf(t);i!==-1&&r.splice(i,1),!(r.length>0)&&(E4.forEach(o=>{delete e[o]}),delete e._chartjs)}function R4(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const P4=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function T4(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,P4.call(window,()=>{r=!1,e.apply(t,n)}))}}function Pte(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const YC=e=>e==="start"?"left":e==="end"?"right":"center",Rr=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,Tte=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function M4(e,t,n){const r=t.length;let i=0,o=r;if(e._sorted){const{iScale:s,_parsed:a}=e,l=s.axis,{min:c,max:u,minDefined:d,maxDefined:p}=s.getUserBounds();d&&(i=lr(Math.min(qs(a,l,c).lo,n?r:qs(t,l,s.getPixelForValue(c)).lo),0,r-1)),p?o=lr(Math.max(qs(a,s.axis,u,!0).hi+1,n?0:qs(t,l,s.getPixelForValue(u),!0).hi+1),i,r)-i:o=r-i}return{start:i,count:o}}function O4(e){const{xScale:t,yScale:n,_scaleRanges:r}=e,i={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=i,!0;const o=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,i),o}const nm=e=>e===0||e===1,nO=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*_n/n)),rO=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*_n/n)+1,rh={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*Bn)+1,easeOutSine:e=>Math.sin(e*Bn),easeInOutSine:e=>-.5*(Math.cos(En*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>nm(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>nm(e)?e:nO(e,.075,.3),easeOutElastic:e=>nm(e)?e:rO(e,.075,.3),easeInOutElastic(e){return nm(e)?e:e<.5?.5*nO(e*2,.1125,.45):.5+.5*rO(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-rh.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?rh.easeInBounce(e*2)*.5:rh.easeOutBounce(e*2-1)*.5+.5};function KC(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function iO(e){return KC(e)?e:new x4(e)}function jx(e){return KC(e)?e:new x4(e).saturate(.5).darken(.1).hexString()}const Mte=["x","y","borderWidth","radius","tension"],Ote=["color","borderColor","backgroundColor"];function Dte(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:Ote},numbers:{type:"number",properties:Mte}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function Ate(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const oO=new Map;function kte(e,t){t=t||{};const n=e+JSON.stringify(t);let r=oO.get(n);return r||(r=new Intl.NumberFormat(e,t),oO.set(n,r)),r}function Ep(e,t,n){return kte(t,n).format(e)}const D4={values(e){return Sn(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const r=this.chart.options.locale;let i,o=e;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(i="scientific"),o=Ite(e,n)}const s=Ia(Math.abs(o)),a=isNaN(s)?1:Math.max(Math.min(-1*Math.floor(s),20),0),l={notation:i,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Ep(e,r,l)},logarithmic(e,t,n){if(e===0)return"0";const r=n[t].significand||e/Math.pow(10,Math.floor(Ia(e)));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?D4.numeric.call(this,e,t,n):""}};function Ite(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var t0={formatters:D4};function Nte(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:t0.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const yc=Object.create(null),oS=Object.create(null);function ih(e,t){if(!t)return e;const n=t.split(".");for(let r=0,i=n.length;r<i;++r){const o=n[r];e=e[o]||(e[o]=Object.create(null))}return e}function $x(e,t,n){return typeof t=="string"?cr(ih(e,t),n):cr(ih(e,""),t)}class Lte{constructor(t,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=r=>r.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,i)=>jx(i.backgroundColor),this.hoverBorderColor=(r,i)=>jx(i.borderColor),this.hoverColor=(r,i)=>jx(i.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return $x(this,t,n)}get(t){return ih(this,t)}describe(t,n){return $x(oS,t,n)}override(t,n){return $x(yc,t,n)}route(t,n,r,i){const o=ih(this,t),s=ih(this,r),a="_"+n;Object.defineProperties(o,{[a]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=s[i];return Tt(l)?Object.assign({},c,l):nt(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var Cn=new Lte({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Dte,Ate,Nte]);function Fte(e){return!e||_t(e.size)||_t(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Ab(e,t,n,r,i){let o=t[i];return o||(o=t[i]=e.measureText(i).width,n.push(i)),o>r&&(r=o),r}function jte(e,t,n,r){r=r||{};let i=r.data=r.data||{},o=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(i=r.data={},o=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let s=0;const a=n.length;let l,c,u,d,p;for(l=0;l<a;l++)if(d=n[l],d!=null&&!Sn(d))s=Ab(e,i,o,s,d);else if(Sn(d))for(c=0,u=d.length;c<u;c++)p=d[c],p!=null&&!Sn(p)&&(s=Ab(e,i,o,s,p));e.restore();const h=o.length/2;if(h>n.length){for(l=0;l<h;l++)delete i[o[l]];o.splice(0,h)}return s}function Sl(e,t,n){const r=e.currentDevicePixelRatio,i=n!==0?Math.max(n/2,.5):0;return Math.round((t-i)*r)/r+i}function sO(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function kb(e,t,n,r){A4(e,t,n,r,null)}function A4(e,t,n,r,i){let o,s,a,l,c,u,d,p;const h=t.pointStyle,m=t.rotation,b=t.radius;let v=(m||0)*vte;if(h&&typeof h=="object"&&(o=h.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){e.save(),e.translate(n,r),e.rotate(v),e.drawImage(h,-h.width/2,-h.height/2,h.width,h.height),e.restore();return}if(!(isNaN(b)||b<=0)){switch(e.beginPath(),h){default:i?e.ellipse(n,r,i/2,b,0,0,_n):e.arc(n,r,b,0,_n),e.closePath();break;case"triangle":u=i?i/2:b,e.moveTo(n+Math.sin(v)*u,r-Math.cos(v)*b),v+=JM,e.lineTo(n+Math.sin(v)*u,r-Math.cos(v)*b),v+=JM,e.lineTo(n+Math.sin(v)*u,r-Math.cos(v)*b),e.closePath();break;case"rectRounded":c=b*.516,l=b-c,s=Math.cos(v+wl)*l,d=Math.cos(v+wl)*(i?i/2-c:l),a=Math.sin(v+wl)*l,p=Math.sin(v+wl)*(i?i/2-c:l),e.arc(n-d,r-a,c,v-En,v-Bn),e.arc(n+p,r-s,c,v-Bn,v),e.arc(n+d,r+a,c,v,v+Bn),e.arc(n-p,r+s,c,v+Bn,v+En),e.closePath();break;case"rect":if(!m){l=Math.SQRT1_2*b,u=i?i/2:l,e.rect(n-u,r-l,2*u,2*l);break}v+=wl;case"rectRot":d=Math.cos(v)*(i?i/2:b),s=Math.cos(v)*b,a=Math.sin(v)*b,p=Math.sin(v)*(i?i/2:b),e.moveTo(n-d,r-a),e.lineTo(n+p,r-s),e.lineTo(n+d,r+a),e.lineTo(n-p,r+s),e.closePath();break;case"crossRot":v+=wl;case"cross":d=Math.cos(v)*(i?i/2:b),s=Math.cos(v)*b,a=Math.sin(v)*b,p=Math.sin(v)*(i?i/2:b),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+p,r-s),e.lineTo(n-p,r+s);break;case"star":d=Math.cos(v)*(i?i/2:b),s=Math.cos(v)*b,a=Math.sin(v)*b,p=Math.sin(v)*(i?i/2:b),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+p,r-s),e.lineTo(n-p,r+s),v+=wl,d=Math.cos(v)*(i?i/2:b),s=Math.cos(v)*b,a=Math.sin(v)*b,p=Math.sin(v)*(i?i/2:b),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+p,r-s),e.lineTo(n-p,r+s);break;case"line":s=i?i/2:Math.cos(v)*b,a=Math.sin(v)*b,e.moveTo(n-s,r-a),e.lineTo(n+s,r+a);break;case"dash":e.moveTo(n,r),e.lineTo(n+Math.cos(v)*(i?i/2:b),r+Math.sin(v)*b);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function Ys(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function ec(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function tc(e){e.restore()}function $te(e,t,n,r,i){if(!t)return e.lineTo(n.x,n.y);if(i==="middle"){const o=(t.x+n.x)/2;e.lineTo(o,t.y),e.lineTo(o,n.y)}else i==="after"!=!!r?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function zte(e,t,n,r){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(r?t.cp1x:t.cp2x,r?t.cp1y:t.cp2y,r?n.cp2x:n.cp1x,r?n.cp2y:n.cp1y,n.x,n.y)}function Bte(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),_t(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function Hte(e,t,n,r,i){if(i.strikethrough||i.underline){const o=e.measureText(r),s=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=n-o.actualBoundingBoxAscent,c=n+o.actualBoundingBoxDescent,u=i.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=i.decorationWidth||2,e.moveTo(s,u),e.lineTo(a,u),e.stroke()}}function Vte(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function vc(e,t,n,r,i,o={}){const s=Sn(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(e.save(),e.font=i.string,Bte(e,o),l=0;l<s.length;++l)c=s[l],o.backdrop&&Vte(e,o.backdrop),a&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),_t(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(c,n,r,o.maxWidth)),e.fillText(c,n,r,o.maxWidth),Hte(e,n,r,c,o),r+=Number(i.lineHeight);e.restore()}function Th(e,t){const{x:n,y:r,w:i,h:o,radius:s}=t;e.arc(n+s.topLeft,r+s.topLeft,s.topLeft,1.5*En,En,!0),e.lineTo(n,r+o-s.bottomLeft),e.arc(n+s.bottomLeft,r+o-s.bottomLeft,s.bottomLeft,En,Bn,!0),e.lineTo(n+i-s.bottomRight,r+o),e.arc(n+i-s.bottomRight,r+o-s.bottomRight,s.bottomRight,Bn,0,!0),e.lineTo(n+i,r+s.topRight),e.arc(n+i-s.topRight,r+s.topRight,s.topRight,0,-Bn,!0),e.lineTo(n+s.topLeft,r)}const Wte=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Ute=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Gte(e,t){const n=(""+e).match(Wte);if(!n||n[1]==="normal")return t*1.2;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100;break}return t*e}const qte=e=>+e||0;function XC(e,t){const n={},r=Tt(t),i=r?Object.keys(t):t,o=Tt(e)?r?s=>nt(e[s],e[t[s]]):s=>e[s]:()=>e;for(const s of i)n[s]=qte(o(s));return n}function k4(e){return XC(e,{top:"y",right:"x",bottom:"y",left:"x"})}function nc(e){return XC(e,["topLeft","topRight","bottomLeft","bottomRight"])}function br(e){const t=k4(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Gn(e,t){e=e||{},t=t||Cn.font;let n=nt(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=nt(e.style,t.style);r&&!(""+r).match(Ute)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const i={family:nt(e.family,t.family),lineHeight:Gte(nt(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:nt(e.weight,t.weight),string:""};return i.string=Fte(i),i}function xn(e,t,n,r){let i,o,s;for(i=0,o=e.length;i<o;++i)if(s=e[i],s!==void 0&&(t!==void 0&&typeof s=="function"&&(s=s(t)),n!==void 0&&Sn(s)&&(s=s[n%s.length]),s!==void 0))return s}function Yte(e,t,n){const{min:r,max:i}=e,o=w4(t,(i-r)/2),s=(a,l)=>n&&a===0?0:a+l;return{min:s(r,-Math.abs(o)),max:s(i,o)}}function tl(e,t){return Object.assign(Object.create(e),t)}function QC(e,t=[""],n,r,i=()=>e[0]){const o=n||e;typeof r>"u"&&(r=F4("_fallback",e));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:r,_getTarget:i,override:a=>QC([a,...e],t,o,r)};return new Proxy(s,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return N4(a,l,()=>nne(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return lO(a).includes(l)},ownKeys(a){return lO(a)},set(a,l,c){const u=a._storage||(a._storage=i());return a[l]=u[l]=c,delete a._keys,!0}})}function ld(e,t,n,r){const i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:I4(e,r),setContext:o=>ld(e,o,n,r),override:o=>ld(e.override(o),t,n,r)};return new Proxy(i,{deleteProperty(o,s){return delete o[s],delete e[s],!0},get(o,s,a){return N4(o,s,()=>Xte(o,s,a))},getOwnPropertyDescriptor(o,s){return o._descriptors.allKeys?Reflect.has(e,s)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,s)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(o,s){return Reflect.has(e,s)},ownKeys(){return Reflect.ownKeys(e)},set(o,s,a){return e[s]=a,delete o[s],!0}})}function I4(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:n,indexable:r,isScriptable:Ga(n)?n:()=>n,isIndexable:Ga(r)?r:()=>r}}const Kte=(e,t)=>e?e+UC(t):t,JC=(e,t)=>Tt(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function N4(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const r=n();return e[t]=r,r}function Xte(e,t,n){const{_proxy:r,_context:i,_subProxy:o,_descriptors:s}=e;let a=r[t];return Ga(a)&&s.isScriptable(t)&&(a=Qte(t,a,e,n)),Sn(a)&&a.length&&(a=Jte(t,a,e,s.isIndexable)),JC(t,a)&&(a=ld(a,i,o&&o[t],s)),a}function Qte(e,t,n,r){const{_proxy:i,_context:o,_subProxy:s,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(o,s||r);return a.delete(e),JC(e,l)&&(l=ZC(i._scopes,i,e,l)),l}function Jte(e,t,n,r){const{_proxy:i,_context:o,_subProxy:s,_descriptors:a}=n;if(typeof o.index<"u"&&r(e))return t[o.index%t.length];if(Tt(t[0])){const l=t,c=i._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=ZC(c,i,e,u);t.push(ld(d,o,s&&s[e],a))}}return t}function L4(e,t,n){return Ga(e)?e(t,n):e}const Zte=(e,t)=>e===!0?t:typeof e=="string"?Ua(t,e):void 0;function ene(e,t,n,r,i){for(const o of t){const s=Zte(n,o);if(s){e.add(s);const a=L4(s._fallback,n,i);if(typeof a<"u"&&a!==n&&a!==r)return a}else if(s===!1&&typeof r<"u"&&n!==r)return null}return!1}function ZC(e,t,n,r){const i=t._rootScopes,o=L4(t._fallback,n,r),s=[...e,...i],a=new Set;a.add(r);let l=aO(a,s,n,o||n,r);return l===null||typeof o<"u"&&o!==n&&(l=aO(a,s,o,l,r),l===null)?!1:QC(Array.from(a),[""],i,o,()=>tne(t,n,r))}function aO(e,t,n,r,i){for(;n;)n=ene(e,t,n,r,i);return n}function tne(e,t,n){const r=e._getTarget();t in r||(r[t]={});const i=r[t];return Sn(i)&&Tt(n)?n:i||{}}function nne(e,t,n,r){let i;for(const o of t)if(i=F4(Kte(o,e),n),typeof i<"u")return JC(e,i)?ZC(n,r,e,i):i}function F4(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function lO(e){let t=e._keys;return t||(t=e._keys=rne(e._scopes)),t}function rne(e){const t=new Set;for(const n of e)for(const r of Object.keys(n).filter(i=>!i.startsWith("_")))t.add(r);return Array.from(t)}function j4(e,t,n,r){const{iScale:i}=e,{key:o="r"}=this._parsing,s=new Array(r);let a,l,c,u;for(a=0,l=r;a<l;++a)c=a+n,u=t[c],s[a]={r:i.parse(Ua(u,o),c)};return s}const ine=Number.EPSILON||1e-14,cd=(e,t)=>t<e.length&&!e[t].skip&&e[t],$4=e=>e==="x"?"y":"x";function one(e,t,n,r){const i=e.skip?t:e,o=t,s=n.skip?t:n,a=iS(o,i),l=iS(s,o);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=r*c,p=r*u;return{previous:{x:o.x-d*(s.x-i.x),y:o.y-d*(s.y-i.y)},next:{x:o.x+p*(s.x-i.x),y:o.y+p*(s.y-i.y)}}}function sne(e,t,n){const r=e.length;let i,o,s,a,l,c=cd(e,0);for(let u=0;u<r-1;++u)if(l=c,c=cd(e,u+1),!(!l||!c)){if(nh(t[u],0,ine)){n[u]=n[u+1]=0;continue}i=n[u]/t[u],o=n[u+1]/t[u],a=Math.pow(i,2)+Math.pow(o,2),!(a<=9)&&(s=3/Math.sqrt(a),n[u]=i*s*t[u],n[u+1]=o*s*t[u])}}function ane(e,t,n="x"){const r=$4(n),i=e.length;let o,s,a,l=cd(e,0);for(let c=0;c<i;++c){if(s=a,a=l,l=cd(e,c+1),!a)continue;const u=a[n],d=a[r];s&&(o=(u-s[n])/3,a[`cp1${n}`]=u-o,a[`cp1${r}`]=d-o*t[c]),l&&(o=(l[n]-u)/3,a[`cp2${n}`]=u+o,a[`cp2${r}`]=d+o*t[c])}}function lne(e,t="x"){const n=$4(t),r=e.length,i=Array(r).fill(0),o=Array(r);let s,a,l,c=cd(e,0);for(s=0;s<r;++s)if(a=l,l=c,c=cd(e,s+1),!!l){if(c){const u=c[t]-l[t];i[s]=u!==0?(c[n]-l[n])/u:0}o[s]=a?c?ts(i[s-1])!==ts(i[s])?0:(i[s-1]+i[s])/2:i[s-1]:i[s]}sne(e,i,o),ane(e,o,t)}function rm(e,t,n){return Math.max(Math.min(e,n),t)}function cne(e,t){let n,r,i,o,s,a=Ys(e[0],t);for(n=0,r=e.length;n<r;++n)s=o,o=a,a=n<r-1&&Ys(e[n+1],t),o&&(i=e[n],s&&(i.cp1x=rm(i.cp1x,t.left,t.right),i.cp1y=rm(i.cp1y,t.top,t.bottom)),a&&(i.cp2x=rm(i.cp2x,t.left,t.right),i.cp2y=rm(i.cp2y,t.top,t.bottom)))}function une(e,t,n,r,i){let o,s,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")lne(e,i);else{let c=r?e[e.length-1]:e[0];for(o=0,s=e.length;o<s;++o)a=e[o],l=one(c,a,e[Math.min(o+1,s-(r?0:1))%s],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&cne(e,n)}function eE(){return typeof window<"u"&&typeof document<"u"}function tE(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Ib(e,t,n){let r;return typeof e=="string"?(r=parseInt(e,10),e.indexOf("%")!==-1&&(r=r/100*t.parentNode[n])):r=e,r}const n0=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function dne(e,t){return n0(e).getPropertyValue(t)}const fne=["top","right","bottom","left"];function rc(e,t,n){const r={};n=n?"-"+n:"";for(let i=0;i<4;i++){const o=fne[i];r[o]=parseFloat(e[t+"-"+o+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const hne=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function pne(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:o}=r;let s=!1,a,l;if(hne(i,o,e.target))a=i,l=o;else{const c=t.getBoundingClientRect();a=r.clientX-c.left,l=r.clientY-c.top,s=!0}return{x:a,y:l,box:s}}function Tl(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,i=n0(n),o=i.boxSizing==="border-box",s=rc(i,"padding"),a=rc(i,"border","width"),{x:l,y:c,box:u}=pne(e,n),d=s.left+(u&&a.left),p=s.top+(u&&a.top);let{width:h,height:m}=t;return o&&(h-=s.width+a.width,m-=s.height+a.height),{x:Math.round((l-d)/h*n.width/r),y:Math.round((c-p)/m*n.height/r)}}function gne(e,t,n){let r,i;if(t===void 0||n===void 0){const o=e&&tE(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{const s=o.getBoundingClientRect(),a=n0(o),l=rc(a,"border","width"),c=rc(a,"padding");t=s.width-c.width-l.width,n=s.height-c.height-l.height,r=Ib(a.maxWidth,o,"clientWidth"),i=Ib(a.maxHeight,o,"clientHeight")}}return{width:t,height:n,maxWidth:r||Db,maxHeight:i||Db}}const im=e=>Math.round(e*10)/10;function mne(e,t,n,r){const i=n0(e),o=rc(i,"margin"),s=Ib(i.maxWidth,e,"clientWidth")||Db,a=Ib(i.maxHeight,e,"clientHeight")||Db,l=gne(e,t,n);let{width:c,height:u}=l;if(i.boxSizing==="content-box"){const p=rc(i,"border","width"),h=rc(i,"padding");c-=h.width+p.width,u-=h.height+p.height}return c=Math.max(0,c-o.width),u=Math.max(0,r?c/r:u-o.height),c=im(Math.min(c,s,l.maxWidth)),u=im(Math.min(u,a,l.maxHeight)),c&&!u&&(u=im(c/2)),(t!==void 0||n!==void 0)&&r&&l.height&&u>l.height&&(u=l.height,c=im(Math.floor(u*r))),{width:c,height:u}}function cO(e,t,n){const r=t||1,i=Math.floor(e.height*r),o=Math.floor(e.width*r);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const s=e.canvas;return s.style&&(n||!s.style.height&&!s.style.width)&&(s.style.height=`${e.height}px`,s.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||s.height!==i||s.width!==o?(e.currentDevicePixelRatio=r,s.height=i,s.width=o,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}const bne=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};eE()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function uO(e,t){const n=dne(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function Ml(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function yne(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:r==="middle"?n<.5?e.y:t.y:r==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function vne(e,t,n,r){const i={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},s=Ml(e,i,n),a=Ml(i,o,n),l=Ml(o,t,n),c=Ml(s,a,n),u=Ml(a,l,n);return Ml(c,u,n)}const xne=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,r){return n-r},leftForLtr(n,r){return n-r}}},wne=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Du(e,t,n){return e?xne(t,n):wne()}function z4(e,t){let n,r;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,r=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=r)}function B4(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function H4(e){return e==="angle"?{between:Ph,compare:Ste,normalize:ki}:{between:Gs,compare:(t,n)=>t-n,normalize:t=>t}}function dO({start:e,end:t,count:n,loop:r,style:i}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n===0,style:i}}function Sne(e,t,n){const{property:r,start:i,end:o}=n,{between:s,normalize:a}=H4(r),l=t.length;let{start:c,end:u,loop:d}=e,p,h;if(d){for(c+=l,u+=l,p=0,h=l;p<h&&s(a(t[c%l][r]),i,o);++p)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:d,style:e.style}}function V4(e,t,n){if(!n)return[e];const{property:r,start:i,end:o}=n,s=t.length,{compare:a,between:l,normalize:c}=H4(r),{start:u,end:d,loop:p,style:h}=Sne(e,t,n),m=[];let b=!1,v=null,x,S,_;const E=()=>l(i,_,x)&&a(i,_)!==0,C=()=>a(o,x)===0||l(o,_,x),M=()=>b||E(),O=()=>!b||C();for(let k=u,N=u;k<=d;++k)S=t[k%s],!S.skip&&(x=c(S[r]),x!==_&&(b=l(x,i,o),v===null&&M()&&(v=a(x,i)===0?k:N),v!==null&&O()&&(m.push(dO({start:v,end:k,loop:p,count:s,style:h})),v=null),N=k,_=x));return v!==null&&m.push(dO({start:v,end:d,loop:p,count:s,style:h})),m}function W4(e,t){const n=[],r=e.segments;for(let i=0;i<r.length;i++){const o=V4(r[i],e.points,t);o.length&&n.push(...o)}return n}function _ne(e,t,n,r){let i=0,o=t-1;if(n&&!r)for(;i<t&&!e[i].skip;)i++;for(;i<t&&e[i].skip;)i++;for(i%=t,n&&(o+=i);o>i&&e[o%t].skip;)o--;return o%=t,{start:i,end:o}}function Cne(e,t,n,r){const i=e.length,o=[];let s=t,a=e[t],l;for(l=t+1;l<=n;++l){const c=e[l%i];c.skip||c.stop?a.skip||(r=!1,o.push({start:t%i,end:(l-1)%i,loop:r}),t=s=c.stop?l:null):(s=l,a.skip&&(t=l)),a=c}return s!==null&&o.push({start:t%i,end:s%i,loop:r}),o}function Ene(e,t){const n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];const o=!!e._loop,{start:s,end:a}=_ne(n,i,o,r);if(r===!0)return fO(e,[{start:s,end:a,loop:o}],n,t);const l=a<s?a+i:a,c=!!e._fullLoop&&s===0&&a===i-1;return fO(e,Cne(n,s,l,c),n,t)}function fO(e,t,n,r){return!r||!r.setContext||!n?t:Rne(e,t,n,r)}function Rne(e,t,n,r){const i=e._chart.getContext(),o=hO(e.options),{_datasetIndex:s,options:{spanGaps:a}}=e,l=n.length,c=[];let u=o,d=t[0].start,p=d;function h(m,b,v,x){const S=a?-1:1;if(m!==b){for(m+=l;n[m%l].skip;)m-=S;for(;n[b%l].skip;)b+=S;m%l!==b%l&&(c.push({start:m%l,end:b%l,loop:v,style:x}),u=x,d=b%l)}}for(const m of t){d=a?d:m.start;let b=n[d%l],v;for(p=d+1;p<=m.end;p++){const x=n[p%l];v=hO(r.setContext(tl(i,{type:"segment",p0:b,p1:x,p0DataIndex:(p-1)%l,p1DataIndex:p%l,datasetIndex:s}))),Pne(v,u)&&h(d,p-1,m.loop,u),b=x,u=v}d<p-1&&h(d,p-1,m.loop,u)}return c}function hO(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function Pne(e,t){if(!t)return!1;const n=[],r=function(i,o){return KC(o)?(n.includes(o)||n.push(o),n.indexOf(o)):o};return JSON.stringify(e,r)!==JSON.stringify(t,r)}/*!
|
|
294
|
-
* Chart.js v4.4.7
|
|
295
|
-
* https://www.chartjs.org
|
|
296
|
-
* (c) 2024 Chart.js Contributors
|
|
297
|
-
* Released under the MIT License
|
|
298
|
-
*/class Tne{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,i){const o=n.listeners[i],s=n.duration;o.forEach(a=>a({chart:t,initial:n.initial,numSteps:s,currentStep:Math.min(r-n.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=P4.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,i)=>{if(!r.running||!r.items.length)return;const o=r.items;let s=o.length-1,a=!1,l;for(;s>=0;--s)l=o[s],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),a=!0):(o[s]=o[o.length-1],o.pop());a&&(i.draw(),this._notify(i,r,t,"progress")),o.length||(r.running=!1,this._notify(i,r,t,"complete"),r.initial=!1),n+=o.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,i)=>Math.max(r,i._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let i=r.length-1;for(;i>=0;--i)r[i].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Ns=new Tne;const pO="transparent",Mne={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=iO(e||pO),i=r.valid&&iO(t||pO);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class One{constructor(t,n,r,i){const o=n[r];i=xn([t.to,i,o,t.from]);const s=xn([t.from,o,i]);this._active=!0,this._fn=t.fn||Mne[t.type||typeof s],this._easing=rh[t.easing]||rh.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=s,this._to=i,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const i=this._target[this._prop],o=r-this._start,s=this._duration-o;this._start=r,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=xn([t.to,n,i,t.from]),this._from=xn([t.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,i=this._prop,o=this._from,s=this._loop,a=this._to;let l;if(this._active=o!==a&&(s||n<r),!this._active){this._target[i]=a,this._notify(!0);return}if(n<0){this._target[i]=o;return}l=n/r%2,l=s&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let i=0;i<r.length;i++)r[i][n]()}}class U4{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Tt(t))return;const n=Object.keys(Cn.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const o=t[i];if(!Tt(o))return;const s={};for(const a of n)s[a]=o[a];(Sn(o.properties)&&o.properties||[i]).forEach(a=>{(a===i||!r.has(a))&&r.set(a,s)})})}_animateOptions(t,n){const r=n.options,i=Ane(t,r);if(!i)return[];const o=this._createAnimations(i,r);return r.$shared&&Dne(t.options.$animations,r).then(()=>{t.options=r},()=>{}),o}_createAnimations(t,n){const r=this._properties,i=[],o=t.$animations||(t.$animations={}),s=Object.keys(n),a=Date.now();let l;for(l=s.length-1;l>=0;--l){const c=s[l];if(c.charAt(0)==="$")continue;if(c==="options"){i.push(...this._animateOptions(t,n));continue}const u=n[c];let d=o[c];const p=r.get(c);if(d)if(p&&d.active()){d.update(p,u,a);continue}else d.cancel();if(!p||!p.duration){t[c]=u;continue}o[c]=d=new One(p,t,c,u),i.push(d)}return i}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return Ns.add(this._chart,r),!0}}function Dne(e,t){const n=[],r=Object.keys(t);for(let i=0;i<r.length;i++){const o=e[r[i]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function Ane(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function gO(e,t){const n=e&&e.options||{},r=n.reverse,i=n.min===void 0?t:0,o=n.max===void 0?t:0;return{start:r?o:i,end:r?i:o}}function kne(e,t,n){if(n===!1)return!1;const r=gO(e,n),i=gO(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function Ine(e){let t,n,r,i;return Tt(e)?(t=e.top,n=e.right,r=e.bottom,i=e.left):t=n=r=i=e,{top:t,right:n,bottom:r,left:i,disabled:e===!1}}function G4(e,t){const n=[],r=e._getSortedDatasetMetas(t);let i,o;for(i=0,o=r.length;i<o;++i)n.push(r[i].index);return n}function mO(e,t,n,r={}){const i=e.keys,o=r.mode==="single";let s,a,l,c;if(t===null)return;let u=!1;for(s=0,a=i.length;s<a;++s){if(l=+i[s],l===n){if(u=!0,r.all)continue;break}c=e.values[l],Nn(c)&&(o||t===0||ts(t)===ts(c))&&(t+=c)}return!u&&!r.all?0:t}function Nne(e,t){const{iScale:n,vScale:r}=t,i=n.axis==="x"?"x":"y",o=r.axis==="x"?"x":"y",s=Object.keys(e),a=new Array(s.length);let l,c,u;for(l=0,c=s.length;l<c;++l)u=s[l],a[l]={[i]:u,[o]:e[u]};return a}function zx(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function Lne(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function Fne(e){const{min:t,max:n,minDefined:r,maxDefined:i}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:i?n:Number.POSITIVE_INFINITY}}function jne(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function bO(e,t,n,r){for(const i of t.getMatchingVisibleMetas(r).reverse()){const o=e[i.index];if(n&&o>0||!n&&o<0)return i.index}return null}function yO(e,t){const{chart:n,_cachedMeta:r}=e,i=n._stacks||(n._stacks={}),{iScale:o,vScale:s,index:a}=r,l=o.axis,c=s.axis,u=Lne(o,s,r),d=t.length;let p;for(let h=0;h<d;++h){const m=t[h],{[l]:b,[c]:v}=m,x=m._stacks||(m._stacks={});p=x[c]=jne(i,u,b),p[a]=v,p._top=bO(p,s,!0,r.type),p._bottom=bO(p,s,!1,r.type);const S=p._visualValues||(p._visualValues={});S[a]=v}}function Bx(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function $ne(e,t){return tl(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function zne(e,t,n){return tl(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function gf(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const i of t){const o=i._stacks;if(!o||o[r]===void 0||o[r][n]===void 0)return;delete o[r][n],o[r]._visualValues!==void 0&&o[r]._visualValues[n]!==void 0&&delete o[r]._visualValues[n]}}}const Hx=e=>e==="reset"||e==="none",vO=(e,t)=>t?e:Object.assign({},e),Bne=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:G4(n,!0),values:null};class ao{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=zx(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&gf(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(d,p,h,m)=>d==="x"?p:d==="r"?m:h,o=n.xAxisID=nt(r.xAxisID,Bx(t,"x")),s=n.yAxisID=nt(r.yAxisID,Bx(t,"y")),a=n.rAxisID=nt(r.rAxisID,Bx(t,"r")),l=n.indexAxis,c=n.iAxisID=i(l,o,s,a),u=n.vAxisID=i(l,s,o,a);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(s),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&tO(this._data,this),t._stacked&&gf(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(Tt(n)){const i=this._cachedMeta;this._data=Nne(n,i)}else if(r!==n){if(r){tO(r,this);const i=this._cachedMeta;gf(i),i._parsed=[]}n&&Object.isExtensible(n)&&Rte(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,r=this.getDataset();let i=!1;this._dataCheck();const o=n._stacked;n._stacked=zx(n.vScale,n),n.stack!==r.stack&&(i=!0,gf(n),n.stack=r.stack),this._resyncElements(t),(i||o!==n._stacked)&&(yO(this,n._parsed),n._stacked=zx(n.vScale,n))}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:i}=this,{iScale:o,_stacked:s}=r,a=o.axis;let l=t===0&&n===i.length?!0:r._sorted,c=t>0&&r._parsed[t-1],u,d,p;if(this._parsing===!1)r._parsed=i,r._sorted=!0,p=i;else{Sn(i[t])?p=this.parseArrayData(r,i,t,n):Tt(i[t])?p=this.parseObjectData(r,i,t,n):p=this.parsePrimitiveData(r,i,t,n);const h=()=>d[a]===null||c&&d[a]<c[a];for(u=0;u<n;++u)r._parsed[u+t]=d=p[u],l&&(h()&&(l=!1),c=d);r._sorted=l}s&&yO(this,p)}parsePrimitiveData(t,n,r,i){const{iScale:o,vScale:s}=t,a=o.axis,l=s.axis,c=o.getLabels(),u=o===s,d=new Array(i);let p,h,m;for(p=0,h=i;p<h;++p)m=p+r,d[p]={[a]:u||o.parse(c[m],m),[l]:s.parse(n[m],m)};return d}parseArrayData(t,n,r,i){const{xScale:o,yScale:s}=t,a=new Array(i);let l,c,u,d;for(l=0,c=i;l<c;++l)u=l+r,d=n[u],a[l]={x:o.parse(d[0],u),y:s.parse(d[1],u)};return a}parseObjectData(t,n,r,i){const{xScale:o,yScale:s}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(i);let u,d,p,h;for(u=0,d=i;u<d;++u)p=u+r,h=n[p],c[u]={x:o.parse(Ua(h,a),p),y:s.parse(Ua(h,l),p)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const i=this.chart,o=this._cachedMeta,s=n[t.axis],a={keys:G4(i,!0),values:n._stacks[t.axis]._visualValues};return mO(a,s,o.index,{mode:r})}updateRangeFromParsed(t,n,r,i){const o=r[n.axis];let s=o===null?NaN:o;const a=i&&r._stacks[n.axis];i&&a&&(i.values=a,s=mO(i,o,this._cachedMeta.index)),t.min=Math.min(t.min,s),t.max=Math.max(t.max,s)}getMinMax(t,n){const r=this._cachedMeta,i=r._parsed,o=r._sorted&&t===r.iScale,s=i.length,a=this._getOtherScale(t),l=Bne(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=Fne(a);let p,h;function m(){h=i[p];const b=h[a.axis];return!Nn(h[t.axis])||u>b||d<b}for(p=0;p<s&&!(!m()&&(this.updateRangeFromParsed(c,t,h,l),o));++p);if(o){for(p=s-1;p>=0;--p)if(!m()){this.updateRangeFromParsed(c,t,h,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let i,o,s;for(i=0,o=n.length;i<o;++i)s=n[i][t.axis],Nn(s)&&r.push(s);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,i=n.vScale,o=this.getParsed(t);return{label:r?""+r.getLabelForValue(o[r.axis]):"",value:i?""+i.getLabelForValue(o[i.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=Ine(nt(this.options.clip,kne(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,i=r.data||[],o=n.chartArea,s=[],a=this._drawStart||0,l=this._drawCount||i.length-a,c=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(t,o,a,l),u=a;u<a+l;++u){const d=i[u];d.hidden||(d.active&&c?s.push(d):d.draw(t,o))}for(u=0;u<s.length;++u)s[u].draw(t,o)}getStyle(t,n){const r=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,n,r){const i=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const s=this._cachedMeta.data[t];o=s.$context||(s.$context=zne(this.getContext(),t,s)),o.parsed=this.getParsed(t),o.raw=i.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=$ne(this.chart.getContext(),this.index)),o.dataset=i,o.index=o.datasetIndex=this.index;return o.active=!!n,o.mode=r,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",r){const i=n==="active",o=this._cachedDataOpts,s=t+"-"+n,a=o[s],l=this.enableOptionSharing&&Rh(r);if(a)return vO(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=i?[`${t}Hover`,"hover",t,""]:[t,""],p=c.getOptionScopes(this.getDataset(),u),h=Object.keys(Cn.elements[t]),m=()=>this.getContext(r,i,n),b=c.resolveNamedOptions(p,h,m,d);return b.$shared&&(b.$shared=l,o[s]=Object.freeze(vO(b,l))),b}_resolveAnimations(t,n,r){const i=this.chart,o=this._cachedDataOpts,s=`animation-${n}`,a=o[s];if(a)return a;let l;if(i.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),p=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(p,this.getContext(t,r,n))}const c=new U4(i,l&&l.animations);return l&&l._cacheable&&(o[s]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||Hx(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),i=this._sharedOptions,o=this.getSharedOptions(r),s=this.includeOptions(n,o)||o!==i;return this.updateSharedOptions(o,n,r),{sharedOptions:o,includeOptions:s}}updateElement(t,n,r,i){Hx(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!Hx(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,i){t.active=i;const o=this.getStyle(n,i);this._resolveAnimations(n,r,i).update(t,{options:!i&&this.getSharedOptions(o)||o})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,r=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const i=r.length,o=n.length,s=Math.min(o,i);s&&this.parse(0,s),o>i?this._insertElements(i,o-i,t):o<i&&this._removeElements(o,i-o)}_insertElements(t,n,r=!0){const i=this._cachedMeta,o=i.data,s=t+n;let a;const l=c=>{for(c.length+=n,a=c.length-1;a>=s;a--)c[a]=c[a-n]};for(l(o),a=t;a<s;++a)o[a]=new this.dataElementType;this._parsing&&l(i._parsed),this.parse(t,n),r&&this.updateElements(o,t,n,"reset")}updateElements(t,n,r,i){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const i=r._parsed.splice(t,n);r._stacked&&gf(r,i)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,i]=t;this[n](r,i)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}Me(ao,"defaults",{}),Me(ao,"datasetElementType",null),Me(ao,"dataElementType",null);function Hne(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let i=0,o=n.length;i<o;i++)r=r.concat(n[i].controller.getAllParsedValues(e));e._cache.$bar=R4(r.sort((i,o)=>i-o))}return e._cache.$bar}function Vne(e){const t=e.iScale,n=Hne(t,e.type);let r=t._length,i,o,s,a;const l=()=>{s===32767||s===-32768||(Rh(a)&&(r=Math.min(r,Math.abs(s-a)||r)),a=s)};for(i=0,o=n.length;i<o;++i)s=t.getPixelForValue(n[i]),l();for(a=void 0,i=0,o=t.ticks.length;i<o;++i)s=t.getPixelForTick(i),l();return r}function Wne(e,t,n,r){const i=n.barThickness;let o,s;return _t(i)?(o=t.min*n.categoryPercentage,s=n.barPercentage):(o=i*r,s=1),{chunk:o/r,ratio:s,start:t.pixels[e]-o/2}}function Une(e,t,n,r){const i=t.pixels,o=i[e];let s=e>0?i[e-1]:null,a=e<i.length-1?i[e+1]:null;const l=n.categoryPercentage;s===null&&(s=o-(a===null?t.end-t.start:a-o)),a===null&&(a=o+o-s);const c=o-(o-Math.min(s,a))/2*l;return{chunk:Math.abs(a-s)/2*l/r,ratio:n.barPercentage,start:c}}function Gne(e,t,n,r){const i=n.parse(e[0],r),o=n.parse(e[1],r),s=Math.min(i,o),a=Math.max(i,o);let l=s,c=a;Math.abs(s)>Math.abs(a)&&(l=a,c=s),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:i,end:o,min:s,max:a}}function q4(e,t,n,r){return Sn(e)?Gne(e,t,n,r):t[n.axis]=n.parse(e,r),t}function xO(e,t,n,r){const i=e.iScale,o=e.vScale,s=i.getLabels(),a=i===o,l=[];let c,u,d,p;for(c=n,u=n+r;c<u;++c)p=t[c],d={},d[i.axis]=a||i.parse(s[c],c),l.push(q4(p,d,o,c));return l}function Vx(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function qne(e,t,n){return e!==0?ts(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function Yne(e){let t,n,r,i,o;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(i="end",o="start"):(i="start",o="end"),{start:n,end:r,reverse:t,top:i,bottom:o}}function Kne(e,t,n,r){let i=t.borderSkipped;const o={};if(!i){e.borderSkipped=o;return}if(i===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:s,end:a,reverse:l,top:c,bottom:u}=Yne(e);i==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?i=c:(n._bottom||0)===r?i=u:(o[wO(u,s,a,l)]=!0,i=c)),o[wO(i,s,a,l)]=!0,e.borderSkipped=o}function wO(e,t,n,r){return r?(e=Xne(e,t,n),e=SO(e,n,t)):e=SO(e,t,n),e}function Xne(e,t,n){return e===t?n:e===n?t:e}function SO(e,t,n){return e==="start"?t:e==="end"?n:e}function Qne(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class Zm extends ao{parsePrimitiveData(t,n,r,i){return xO(t,n,r,i)}parseArrayData(t,n,r,i){return xO(t,n,r,i)}parseObjectData(t,n,r,i){const{iScale:o,vScale:s}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?a:l,u=s.axis==="x"?a:l,d=[];let p,h,m,b;for(p=r,h=r+i;p<h;++p)b=n[p],m={},m[o.axis]=o.parse(Ua(b,c),p),d.push(q4(Ua(b,u),m,s,p));return d}updateRangeFromParsed(t,n,r,i){super.updateRangeFromParsed(t,n,r,i);const o=r._custom;o&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:r,vScale:i}=n,o=this.getParsed(t),s=o._custom,a=Vx(s)?"["+s.start+", "+s.end+"]":""+i.getLabelForValue(o[i.axis]);return{label:""+r.getLabelForValue(o[r.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,r,i){const o=i==="reset",{index:s,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:p}=this._getSharedOptions(n,i);for(let h=n;h<n+r;h++){const m=this.getParsed(h),b=o||_t(m[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(h),v=this._calculateBarIndexPixels(h,u),x=(m._stacks||{})[a.axis],S={horizontal:c,base:b.base,enableBorderRadius:!x||Vx(m._custom)||s===x._top||s===x._bottom,x:c?b.head:v.center,y:c?v.center:b.head,height:c?v.size:Math.abs(b.size),width:c?Math.abs(b.size):v.size};p&&(S.options=d||this.resolveDataElementOptions(h,t[h].active?"active":i));const _=S.options||t[h].options;Kne(S,_,x,s),Qne(S,_,u.ratio),this.updateElement(t[h],h,S,i)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,i=r.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),o=r.options.stacked,s=[],a=this._cachedMeta.controller.getParsed(n),l=a&&a[r.axis],c=u=>{const d=u._parsed.find(h=>h[r.axis]===l),p=d&&d[u.vScale.axis];if(_t(p)||isNaN(p))return!0};for(const u of i)if(!(n!==void 0&&c(u))&&((o===!1||s.indexOf(u.stack)===-1||o===void 0&&u.stack===void 0)&&s.push(u.stack),u.index===t))break;return s.length||s.push(void 0),s}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,n,r){const i=this._getStacks(t,r),o=n!==void 0?i.indexOf(n):-1;return o===-1?i.length-1:o}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,i=[];let o,s;for(o=0,s=n.data.length;o<s;++o)i.push(r.getPixelForValue(this.getParsed(o)[r.axis],o));const a=t.barThickness;return{min:a||Vne(n),pixels:i,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:r,index:i},options:{base:o,minBarLength:s}}=this,a=o||0,l=this.getParsed(t),c=l._custom,u=Vx(c);let d=l[n.axis],p=0,h=r?this.applyStack(n,l,r):d,m,b;h!==d&&(p=h-d,h=d),u&&(d=c.barStart,h=c.barEnd-c.barStart,d!==0&&ts(d)!==ts(c.barEnd)&&(p=0),p+=d);const v=!_t(o)&&!u?o:p;let x=n.getPixelForValue(v);if(this.chart.getDataVisibility(t)?m=n.getPixelForValue(p+h):m=x,b=m-x,Math.abs(b)<s){b=qne(b,n,a)*s,d===a&&(x-=b/2);const S=n.getPixelForDecimal(0),_=n.getPixelForDecimal(1),E=Math.min(S,_),C=Math.max(S,_);x=Math.max(Math.min(x,C),E),m=x+b,r&&!u&&(l._stacks[n.axis]._visualValues[i]=n.getValueForPixel(m)-n.getValueForPixel(x))}if(x===n.getPixelForValue(a)){const S=ts(b)*n.getLineWidthForValue(a)/2;x+=S,b-=S}return{size:b,base:x,head:m,center:m+b/2}}_calculateBarIndexPixels(t,n){const r=n.scale,i=this.options,o=i.skipNull,s=nt(i.maxBarThickness,1/0);let a,l;if(n.grouped){const c=o?this._getStackCount(t):n.stackCount,u=i.barThickness==="flex"?Une(t,n,i,c):Wne(t,n,i,c),d=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);a=u.start+u.chunk*d+u.chunk/2,l=Math.min(s,u.chunk*u.ratio)}else a=r.getPixelForValue(this.getParsed(t)[r.axis],t),l=Math.min(s,n.min*n.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,r=t.data,i=r.length;let o=0;for(;o<i;++o)this.getParsed(o)[n.axis]!==null&&!r[o].hidden&&r[o].draw(this._ctx)}}Me(Zm,"id","bar"),Me(Zm,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),Me(Zm,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class eb extends ao{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,r,i){const o=super.parsePrimitiveData(t,n,r,i);for(let s=0;s<o.length;s++)o[s]._custom=this.resolveDataElementOptions(s+r).radius;return o}parseArrayData(t,n,r,i){const o=super.parseArrayData(t,n,r,i);for(let s=0;s<o.length;s++){const a=n[r+s];o[s]._custom=nt(a[2],this.resolveDataElementOptions(s+r).radius)}return o}parseObjectData(t,n,r,i){const o=super.parseObjectData(t,n,r,i);for(let s=0;s<o.length;s++){const a=n[r+s];o[s]._custom=nt(a&&a.r&&+a.r,this.resolveDataElementOptions(s+r).radius)}return o}getMaxOverflow(){const t=this._cachedMeta.data;let n=0;for(let r=t.length-1;r>=0;--r)n=Math.max(n,t[r].size(this.resolveDataElementOptions(r))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:i,yScale:o}=n,s=this.getParsed(t),a=i.getLabelForValue(s.x),l=o.getLabelForValue(s.y),c=s._custom;return{label:r[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,r,i){const o=i==="reset",{iScale:s,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,i),u=s.axis,d=a.axis;for(let p=n;p<n+r;p++){const h=t[p],m=!o&&this.getParsed(p),b={},v=b[u]=o?s.getPixelForDecimal(.5):s.getPixelForValue(m[u]),x=b[d]=o?a.getBasePixel():a.getPixelForValue(m[d]);b.skip=isNaN(v)||isNaN(x),c&&(b.options=l||this.resolveDataElementOptions(p,h.active?"active":i),o&&(b.options.radius=0)),this.updateElement(h,p,b,i)}}resolveDataElementOptions(t,n){const r=this.getParsed(t);let i=super.resolveDataElementOptions(t,n);i.$shared&&(i=Object.assign({},i,{$shared:!1}));const o=i.radius;return n!=="active"&&(i.radius=0),i.radius+=nt(r&&r._custom,o),i}}Me(eb,"id","bubble"),Me(eb,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),Me(eb,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Jne(e,t,n){let r=1,i=1,o=0,s=0;if(t<_n){const a=e,l=a+t,c=Math.cos(a),u=Math.sin(a),d=Math.cos(l),p=Math.sin(l),h=(_,E,C)=>Ph(_,a,l,!0)?1:Math.max(E,E*n,C,C*n),m=(_,E,C)=>Ph(_,a,l,!0)?-1:Math.min(E,E*n,C,C*n),b=h(0,c,d),v=h(Bn,u,p),x=m(En,c,d),S=m(En+Bn,u,p);r=(b-x)/2,i=(v-S)/2,o=-(b+x)/2,s=-(v+S)/2}return{ratioX:r,ratioY:i,offsetX:o,offsetY:s}}class $l extends ao{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const r=this.getDataset().data,i=this._cachedMeta;if(this._parsing===!1)i._parsed=r;else{let o=l=>+r[l];if(Tt(r[t])){const{key:l="value"}=this._parsing;o=c=>+Ua(r[c],l)}let s,a;for(s=t,a=t+n;s<a;++s)i._parsed[s]=o(s)}}_getRotation(){return Ro(this.options.rotation-90)}_getCircumference(){return Ro(this.options.circumference)}_getRotationExtents(){let t=_n,n=-_n;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const i=this.chart.getDatasetMeta(r).controller,o=i._getRotation(),s=i._getCircumference();t=Math.min(t,o),n=Math.max(n,o+s)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:r}=n,i=this._cachedMeta,o=i.data,s=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(r.width,r.height)-s)/2,0),l=Math.min(fte(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:p,ratioY:h,offsetX:m,offsetY:b}=Jne(d,u,l),v=(r.width-s)/p,x=(r.height-s)/h,S=Math.max(Math.min(v,x)/2,0),_=w4(this.options.radius,S),E=Math.max(_*l,0),C=(_-E)/this._getVisibleDatasetWeightTotal();this.offsetX=m*_,this.offsetY=b*_,i.total=this.calculateTotal(),this.outerRadius=_-C*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-C*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,n){const r=this.options,i=this._cachedMeta,o=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||i._parsed[t]===null||i.data[t].hidden?0:this.calculateCircumference(i._parsed[t]*o/_n)}updateElements(t,n,r,i){const o=i==="reset",s=this.chart,a=s.chartArea,c=s.options.animation,u=(a.left+a.right)/2,d=(a.top+a.bottom)/2,p=o&&c.animateScale,h=p?0:this.innerRadius,m=p?0:this.outerRadius,{sharedOptions:b,includeOptions:v}=this._getSharedOptions(n,i);let x=this._getRotation(),S;for(S=0;S<n;++S)x+=this._circumference(S,o);for(S=n;S<n+r;++S){const _=this._circumference(S,o),E=t[S],C={x:u+this.offsetX,y:d+this.offsetY,startAngle:x,endAngle:x+_,circumference:_,outerRadius:m,innerRadius:h};v&&(C.options=b||this.resolveDataElementOptions(S,E.active?"active":i)),x+=_,this.updateElement(E,S,C,i)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let r=0,i;for(i=0;i<n.length;i++){const o=t._parsed[i];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(i)&&!n[i].hidden&&(r+=Math.abs(o))}return r}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?_n*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,i=r.data.labels||[],o=Ep(n._parsed[t],r.options.locale);return{label:i[t]||"",value:o}}getMaxBorderWidth(t){let n=0;const r=this.chart;let i,o,s,a,l;if(!t){for(i=0,o=r.data.datasets.length;i<o;++i)if(r.isDatasetVisible(i)){s=r.getDatasetMeta(i),t=s.data,a=s.controller;break}}if(!t)return 0;for(i=0,o=t.length;i<o;++i)l=a.resolveDataElementOptions(i),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let r=0,i=t.length;r<i;++r){const o=this.resolveDataElementOptions(r);n=Math.max(n,o.offset||0,o.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let r=0;r<t;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(t){return Math.max(nt(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Me($l,"id","doughnut"),Me($l,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),Me($l,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),Me($l,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:i}}=t.legend.options;return n.labels.map((o,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:i,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}});class tb extends ao{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:r,data:i=[],_dataset:o}=n,s=this.chart._animationsDisabled;let{start:a,count:l}=M4(n,i,s);this._drawStart=a,this._drawCount=l,O4(n)&&(a=0,l=i.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!o._decimated,r.points=i;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!s,options:c},t),this.updateElements(i,a,l,t)}updateElements(t,n,r,i){const o=i==="reset",{iScale:s,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,i),p=s.axis,h=a.axis,{spanGaps:m,segment:b}=this.options,v=ad(m)?m:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||i==="none",S=n+r,_=t.length;let E=n>0&&this.getParsed(n-1);for(let C=0;C<_;++C){const M=t[C],O=x?M:{};if(C<n||C>=S){O.skip=!0;continue}const k=this.getParsed(C),N=_t(k[h]),F=O[p]=s.getPixelForValue(k[p],C),j=O[h]=o||N?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,k,l):k[h],C);O.skip=isNaN(F)||isNaN(j)||N,O.stop=C>0&&Math.abs(k[p]-E[p])>v,b&&(O.parsed=k,O.raw=c.data[C]),d&&(O.options=u||this.resolveDataElementOptions(C,M.active?"active":i)),x||this.updateElement(M,C,O,i),E=k}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,i=t.data||[];if(!i.length)return r;const o=i[0].size(this.resolveDataElementOptions(0)),s=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(r,o,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Me(tb,"id","line"),Me(tb,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Me(tb,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class oh extends ao{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,i=r.data.labels||[],o=Ep(n._parsed[t].r,r.options.locale);return{label:i[t]||"",value:o}}parseObjectData(t,n,r,i){return j4.bind(this)(t,n,r,i)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((r,i)=>{const o=this.getParsed(i).r;!isNaN(o)&&this.chart.getDataVisibility(i)&&(o<n.min&&(n.min=o),o>n.max&&(n.max=o))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,r=t.options,i=Math.min(n.right-n.left,n.bottom-n.top),o=Math.max(i/2,0),s=Math.max(r.cutoutPercentage?o/100*r.cutoutPercentage:1,0),a=(o-s)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,r,i){const o=i==="reset",s=this.chart,l=s.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,p=c.getIndexAngle(0)-.5*En;let h=p,m;const b=360/this.countVisibleElements();for(m=0;m<n;++m)h+=this._computeAngle(m,i,b);for(m=n;m<n+r;m++){const v=t[m];let x=h,S=h+this._computeAngle(m,i,b),_=s.getDataVisibility(m)?c.getDistanceFromCenterForValue(this.getParsed(m).r):0;h=S,o&&(l.animateScale&&(_=0),l.animateRotate&&(x=S=p));const E={x:u,y:d,innerRadius:0,outerRadius:_,startAngle:x,endAngle:S,options:this.resolveDataElementOptions(m,v.active?"active":i)};this.updateElement(v,m,E,i)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((r,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&n++}),n}_computeAngle(t,n,r){return this.chart.getDataVisibility(t)?Ro(this.resolveDataElementOptions(t,n).angle||r):0}}Me(oh,"id","polarArea"),Me(oh,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),Me(oh,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:i}}=t.legend.options;return n.labels.map((o,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:i,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class sS extends $l{}Me(sS,"id","pie"),Me(sS,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class nb extends ao{getLabelAndValue(t){const n=this._cachedMeta.vScale,r=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(r[n.axis])}}parseObjectData(t,n,r,i){return j4.bind(this)(t,n,r,i)}update(t){const n=this._cachedMeta,r=n.dataset,i=n.data||[],o=n.iScale.getLabels();if(r.points=i,t!=="resize"){const s=this.resolveDatasetElementOptions(t);this.options.showLine||(s.borderWidth=0);const a={_loop:!0,_fullLoop:o.length===i.length,options:s};this.updateElement(r,void 0,a,t)}this.updateElements(i,0,i.length,t)}updateElements(t,n,r,i){const o=this._cachedMeta.rScale,s=i==="reset";for(let a=n;a<n+r;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":i),u=o.getPointPositionForValue(a,this.getParsed(a).r),d=s?o.xCenter:u.x,p=s?o.yCenter:u.y,h={x:d,y:p,angle:u.angle,skip:isNaN(d)||isNaN(p),options:c};this.updateElement(l,a,h,i)}}}Me(nb,"id","radar"),Me(nb,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),Me(nb,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class rb extends ao{getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:i,yScale:o}=n,s=this.getParsed(t),a=i.getLabelForValue(s.x),l=o.getLabelForValue(s.y);return{label:r[t]||"",value:"("+a+", "+l+")"}}update(t){const n=this._cachedMeta,{data:r=[]}=n,i=this.chart._animationsDisabled;let{start:o,count:s}=M4(n,r,i);if(this._drawStart=o,this._drawCount=s,O4(n)&&(o=0,s=r.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:l}=n;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=r;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!i,options:c},t)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(r,o,s,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,r,i){const o=i==="reset",{iScale:s,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(n,i),d=this.getSharedOptions(u),p=this.includeOptions(i,d),h=s.axis,m=a.axis,{spanGaps:b,segment:v}=this.options,x=ad(b)?b:Number.POSITIVE_INFINITY,S=this.chart._animationsDisabled||o||i==="none";let _=n>0&&this.getParsed(n-1);for(let E=n;E<n+r;++E){const C=t[E],M=this.getParsed(E),O=S?C:{},k=_t(M[m]),N=O[h]=s.getPixelForValue(M[h],E),F=O[m]=o||k?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,M,l):M[m],E);O.skip=isNaN(N)||isNaN(F)||k,O.stop=E>0&&Math.abs(M[h]-_[h])>x,v&&(O.parsed=M,O.raw=c.data[E]),p&&(O.options=d||this.resolveDataElementOptions(E,C.active?"active":i)),S||this.updateElement(C,E,O,i),_=M}this.updateSharedOptions(d,i,u)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let l=n.length-1;l>=0;--l)a=Math.max(a,n[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const r=t.dataset,i=r.options&&r.options.borderWidth||0;if(!n.length)return i;const o=n[0].size(this.resolveDataElementOptions(0)),s=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,o,s)/2}}Me(rb,"id","scatter"),Me(rb,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),Me(rb,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Zne=Object.freeze({__proto__:null,BarController:Zm,BubbleController:eb,DoughnutController:$l,LineController:tb,PieController:sS,PolarAreaController:oh,RadarController:nb,ScatterController:rb});function _l(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class nE{constructor(t){Me(this,"options");this.options=t||{}}static override(t){Object.assign(nE.prototype,t)}init(){}formats(){return _l()}parse(){return _l()}format(){return _l()}add(){return _l()}diff(){return _l()}startOf(){return _l()}endOf(){return _l()}}var ere={_date:nE};function tre(e,t,n,r){const{controller:i,data:o,_sorted:s}=e,a=i._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&s&&o.length){const l=a._reversePixels?Cte:qs;if(r){if(i._sharedOptions){const c=o[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(o,t,n-u),p=l(o,t,n+u);return{lo:d.lo,hi:p.hi}}}}else return l(o,t,n)}return{lo:0,hi:o.length-1}}function Rp(e,t,n,r,i){const o=e.getSortedVisibleDatasetMetas(),s=n[t];for(let a=0,l=o.length;a<l;++a){const{index:c,data:u}=o[a],{lo:d,hi:p}=tre(o[a],t,s,i);for(let h=d;h<=p;++h){const m=u[h];m.skip||r(m,c,h)}}}function nre(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,i){const o=t?Math.abs(r.x-i.x):0,s=n?Math.abs(r.y-i.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(s,2))}}function Wx(e,t,n,r,i){const o=[];return!i&&!e.isPointInArea(t)||Rp(e,n,t,function(a,l,c){!i&&!Ys(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function rre(e,t,n,r){let i=[];function o(s,a,l){const{startAngle:c,endAngle:u}=s.getProps(["startAngle","endAngle"],r),{angle:d}=C4(s,{x:t.x,y:t.y});Ph(d,c,u)&&i.push({element:s,datasetIndex:a,index:l})}return Rp(e,n,t,o),i}function ire(e,t,n,r,i,o){let s=[];const a=nre(n);let l=Number.POSITIVE_INFINITY;function c(u,d,p){const h=u.inRange(t.x,t.y,i);if(r&&!h)return;const m=u.getCenterPoint(i);if(!(!!o||e.isPointInArea(m))&&!h)return;const v=a(t,m);v<l?(s=[{element:u,datasetIndex:d,index:p}],l=v):v===l&&s.push({element:u,datasetIndex:d,index:p})}return Rp(e,n,t,c),s}function Ux(e,t,n,r,i,o){return!o&&!e.isPointInArea(t)?[]:n==="r"&&!r?rre(e,t,n,i):ire(e,t,n,r,i,o)}function _O(e,t,n,r,i){const o=[],s=n==="x"?"inXRange":"inYRange";let a=!1;return Rp(e,n,t,(l,c,u)=>{l[s]&&l[s](t[n],i)&&(o.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,i))}),r&&!a?[]:o}var ore={evaluateInteractionItems:Rp,modes:{index(e,t,n,r){const i=Tl(t,e),o=n.axis||"x",s=n.includeInvisible||!1,a=n.intersect?Wx(e,i,o,r,s):Ux(e,i,o,!1,r,s),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,r){const i=Tl(t,e),o=n.axis||"xy",s=n.includeInvisible||!1;let a=n.intersect?Wx(e,i,o,r,s):Ux(e,i,o,!1,r,s);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:l,index:u})}return a},point(e,t,n,r){const i=Tl(t,e),o=n.axis||"xy",s=n.includeInvisible||!1;return Wx(e,i,o,r,s)},nearest(e,t,n,r){const i=Tl(t,e),o=n.axis||"xy",s=n.includeInvisible||!1;return Ux(e,i,o,n.intersect,r,s)},x(e,t,n,r){const i=Tl(t,e);return _O(e,i,"x",n.intersect,r)},y(e,t,n,r){const i=Tl(t,e);return _O(e,i,"y",n.intersect,r)}}};const Y4=["left","top","right","bottom"];function mf(e,t){return e.filter(n=>n.pos===t)}function CO(e,t){return e.filter(n=>Y4.indexOf(n.pos)===-1&&n.box.axis===t)}function bf(e,t){return e.sort((n,r)=>{const i=t?r:n,o=t?n:r;return i.weight===o.weight?i.index-o.index:i.weight-o.weight})}function sre(e){const t=[];let n,r,i,o,s,a;for(n=0,r=(e||[]).length;n<r;++n)i=e[n],{position:o,options:{stack:s,stackWeight:a=1}}=i,t.push({index:n,box:i,pos:o,horizontal:i.isHorizontal(),weight:i.weight,stack:s&&o+s,stackWeight:a});return t}function are(e){const t={};for(const n of e){const{stack:r,pos:i,stackWeight:o}=n;if(!r||!Y4.includes(i))continue;const s=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=o}return t}function lre(e,t){const n=are(e),{vBoxMaxWidth:r,hBoxMaxHeight:i}=t;let o,s,a;for(o=0,s=e.length;o<s;++o){a=e[o];const{fullSize:l}=a.box,c=n[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*r:l&&t.availableWidth,a.height=i):(a.width=r,a.height=u?u*i:l&&t.availableHeight)}return n}function cre(e){const t=sre(e),n=bf(t.filter(c=>c.box.fullSize),!0),r=bf(mf(t,"left"),!0),i=bf(mf(t,"right")),o=bf(mf(t,"top"),!0),s=bf(mf(t,"bottom")),a=CO(t,"x"),l=CO(t,"y");return{fullSize:n,leftAndTop:r.concat(o),rightAndBottom:i.concat(l).concat(s).concat(a),chartArea:mf(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:o.concat(s).concat(a)}}function EO(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function K4(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function ure(e,t,n,r){const{pos:i,box:o}=n,s=e.maxPadding;if(!Tt(i)){n.size&&(e[i]-=n.size);const d=r[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?o.height:o.width),n.size=d.size/d.count,e[i]+=n.size}o.getPadding&&K4(s,o.getPadding());const a=Math.max(0,t.outerWidth-EO(s,e,"left","right")),l=Math.max(0,t.outerHeight-EO(s,e,"top","bottom")),c=a!==e.w,u=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function dre(e){const t=e.maxPadding;function n(r){const i=Math.max(t[r]-e[r],0);return e[r]+=i,i}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function fre(e,t){const n=t.maxPadding;function r(i){const o={left:0,top:0,right:0,bottom:0};return i.forEach(s=>{o[s]=Math.max(t[s],n[s])}),o}return r(e?["left","right"]:["top","bottom"])}function Hf(e,t,n,r){const i=[];let o,s,a,l,c,u;for(o=0,s=e.length,c=0;o<s;++o){a=e[o],l=a.box,l.update(a.width||t.w,a.height||t.h,fre(a.horizontal,t));const{same:d,other:p}=ure(t,n,a,r);c|=d&&i.length,u=u||p,l.fullSize||i.push(a)}return c&&Hf(i,t,n,r)||u}function om(e,t,n,r,i){e.top=n,e.left=t,e.right=t+r,e.bottom=n+i,e.width=r,e.height=i}function RO(e,t,n,r){const i=n.padding;let{x:o,y:s}=t;for(const a of e){const l=a.box,c=r[a.stack]||{count:1,placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const d=t.w*u,p=c.size||l.height;Rh(c.start)&&(s=c.start),l.fullSize?om(l,i.left,s,n.outerWidth-i.right-i.left,p):om(l,t.left+c.placed,s,d,p),c.start=s,c.placed+=d,s=l.bottom}else{const d=t.h*u,p=c.size||l.width;Rh(c.start)&&(o=c.start),l.fullSize?om(l,o,i.top,p,n.outerHeight-i.bottom-i.top):om(l,o,t.top+c.placed,p,d),c.start=o,c.placed+=d,o=l.right}}t.x=o,t.y=s}var Mr={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;const i=br(e.options.layout.padding),o=Math.max(t-i.width,0),s=Math.max(n-i.height,0),a=cre(e.boxes),l=a.vertical,c=a.horizontal;Qt(e.boxes,b=>{typeof b.beforeLayout=="function"&&b.beforeLayout()});const u=l.reduce((b,v)=>v.box.options&&v.box.options.display===!1?b:b+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:o,availableHeight:s,vBoxMaxWidth:o/2/u,hBoxMaxHeight:s/2}),p=Object.assign({},i);K4(p,br(r));const h=Object.assign({maxPadding:p,w:o,h:s,x:i.left,y:i.top},i),m=lre(l.concat(c),d);Hf(a.fullSize,h,d,m),Hf(l,h,d,m),Hf(c,h,d,m)&&Hf(l,h,d,m),dre(h),RO(a.leftAndTop,h,d,m),h.x+=h.w,h.y+=h.h,RO(a.rightAndBottom,h,d,m),e.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},Qt(a.chartArea,b=>{const v=b.box;Object.assign(v,e.chartArea),v.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class X4{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,i){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,i?Math.floor(n/i):r)}}isAttached(t){return!0}updateConfig(t){}}class hre extends X4{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const ib="$chartjs",pre={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},PO=e=>e===null||e==="";function gre(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[ib]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",PO(i)){const o=uO(e,"width");o!==void 0&&(e.width=o)}if(PO(r))if(e.style.height==="")e.height=e.width/(t||2);else{const o=uO(e,"height");o!==void 0&&(e.height=o)}return e}const Q4=bne?{passive:!0}:!1;function mre(e,t,n){e&&e.addEventListener(t,n,Q4)}function bre(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,Q4)}function yre(e,t){const n=pre[e.type]||e.type,{x:r,y:i}=Tl(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function Nb(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function vre(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let s=!1;for(const a of o)s=s||Nb(a.addedNodes,r),s=s&&!Nb(a.removedNodes,r);s&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function xre(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let s=!1;for(const a of o)s=s||Nb(a.removedNodes,r),s=s&&!Nb(a.addedNodes,r);s&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const Mh=new Map;let TO=0;function J4(){const e=window.devicePixelRatio;e!==TO&&(TO=e,Mh.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function wre(e,t){Mh.size||window.addEventListener("resize",J4),Mh.set(e,t)}function Sre(e){Mh.delete(e),Mh.size||window.removeEventListener("resize",J4)}function _re(e,t,n){const r=e.canvas,i=r&&tE(r);if(!i)return;const o=T4((a,l)=>{const c=i.clientWidth;n(a,l),c<i.clientWidth&&n()},window),s=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||o(c,u)});return s.observe(i),wre(e,o),s}function Gx(e,t,n){n&&n.disconnect(),t==="resize"&&Sre(e)}function Cre(e,t,n){const r=e.canvas,i=T4(o=>{e.ctx!==null&&n(yre(o,e))},e);return mre(r,t,i),i}class Ere extends X4{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(gre(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[ib])return!1;const r=n[ib].initial;["height","width"].forEach(o=>{const s=r[o];_t(s)?n.removeAttribute(o):n.setAttribute(o,s)});const i=r.style||{};return Object.keys(i).forEach(o=>{n.style[o]=i[o]}),n.width=n.width,delete n[ib],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),s={attach:vre,detach:xre,resize:_re}[n]||Cre;i[n]=s(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:Gx,detach:Gx,resize:Gx}[n]||bre)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return mne(t,n,r,i)}isAttached(t){const n=t&&tE(t);return!!(n&&n.isConnected)}}function Rre(e){return!eE()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?hre:Ere}var Jm;let ms=(Jm=class{constructor(){Me(this,"x");Me(this,"y");Me(this,"active",!1);Me(this,"options");Me(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return ad(this.x)&&ad(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const i={};return t.forEach(o=>{i[o]=r[o]&&r[o].active()?r[o]._to:this[o]}),i}},Me(Jm,"defaults",{}),Me(Jm,"defaultRoutes"),Jm);function Pre(e,t){const n=e.options.ticks,r=Tre(e),i=Math.min(n.maxTicksLimit||r,r),o=n.major.enabled?Ore(t):[],s=o.length,a=o[0],l=o[s-1],c=[];if(s>i)return Dre(t,c,o,s/i),c;const u=Mre(o,t,i);if(s>0){let d,p;const h=s>1?Math.round((l-a)/(s-1)):null;for(sm(t,c,u,_t(h)?0:a-h,a),d=0,p=s-1;d<p;d++)sm(t,c,u,o[d],o[d+1]);return sm(t,c,u,l,_t(h)?t.length:l+h),c}return sm(t,c,u),c}function Tre(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),i=e._maxLength/n;return Math.floor(Math.min(r,i))}function Mre(e,t,n){const r=Are(e),i=t.length/n;if(!r)return Math.max(i,1);const o=xte(r);for(let s=0,a=o.length-1;s<a;s++){const l=o[s];if(l>i)return l}return Math.max(i,1)}function Ore(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function Dre(e,t,n,r){let i=0,o=n[0],s;for(r=Math.ceil(r),s=0;s<e.length;s++)s===o&&(t.push(e[s]),i++,o=n[i*r])}function sm(e,t,n,r,i){const o=nt(r,0),s=Math.min(nt(i,e.length),e.length);let a=0,l,c,u;for(n=Math.ceil(n),i&&(l=i-r,n=l/Math.floor(l/n)),u=o;u<0;)a++,u=Math.round(o+a*n);for(c=Math.max(o,0);c<s;c++)c===u&&(t.push(e[c]),a++,u=Math.round(o+a*n))}function Are(e){const t=e.length;let n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}const kre=e=>e==="left"?"right":e==="right"?"left":e,MO=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,OO=(e,t)=>Math.min(t||e,e);function DO(e,t){const n=[],r=e.length/t,i=e.length;let o=0;for(;o<i;o+=r)n.push(e[Math.floor(o)]);return n}function Ire(e,t,n){const r=e.ticks.length,i=Math.min(t,r-1),o=e._startPixel,s=e._endPixel,a=1e-6;let l=e.getPixelForTick(i),c;if(!(n&&(r===1?c=Math.max(l-o,s-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(i-1))/2,l+=i<t?c:-c,l<o-a||l>s+a)))return l}function Nre(e,t){Qt(e,n=>{const r=n.gc,i=r.length/2;let o;if(i>t){for(o=0;o<i;++o)delete n.data[r[o]];r.splice(0,i)}})}function yf(e){return e.drawTicks?e.tickLength:0}function AO(e,t){if(!e.display)return 0;const n=Gn(e.font,t),r=br(e.padding);return(Sn(e.text)?e.text.length:1)*n.lineHeight+r.height}function Lre(e,t){return tl(e,{scale:t,type:"scale"})}function Fre(e,t,n){return tl(e,{tick:n,index:t,type:"tick"})}function jre(e,t,n){let r=YC(e);return(n&&t!=="right"||!n&&t==="right")&&(r=kre(r)),r}function $re(e,t,n,r){const{top:i,left:o,bottom:s,right:a,chart:l}=e,{chartArea:c,scales:u}=l;let d=0,p,h,m;const b=s-i,v=a-o;if(e.isHorizontal()){if(h=Rr(r,o,a),Tt(n)){const x=Object.keys(n)[0],S=n[x];m=u[x].getPixelForValue(S)+b-t}else n==="center"?m=(c.bottom+c.top)/2+b-t:m=MO(e,n,t);p=a-o}else{if(Tt(n)){const x=Object.keys(n)[0],S=n[x];h=u[x].getPixelForValue(S)-v+t}else n==="center"?h=(c.left+c.right)/2-v+t:h=MO(e,n,t);m=Rr(r,s,i),d=n==="left"?-Bn:Bn}return{titleX:h,titleY:m,maxWidth:p,rotation:d}}class nl extends ms{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:r,_suggestedMax:i}=this;return t=Mi(t,Number.POSITIVE_INFINITY),n=Mi(n,Number.NEGATIVE_INFINITY),r=Mi(r,Number.POSITIVE_INFINITY),i=Mi(i,Number.NEGATIVE_INFINITY),{min:Mi(t,r),max:Mi(n,i),minDefined:Nn(t),maxDefined:Nn(n)}}getMinMax(t){let{min:n,max:r,minDefined:i,maxDefined:o}=this.getUserBounds(),s;if(i&&o)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)s=a[l].controller.getMinMax(this,t),i||(n=Math.min(n,s.min)),o||(r=Math.max(r,s.max));return n=o&&n>r?r:n,r=i&&n>r?n:r,{min:Mi(n,Mi(r,n)),max:Mi(r,Mi(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){sn(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:i,grace:o,ticks:s}=this.options,a=s.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Yte(this,o,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?DO(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=Pre(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,t=!t),this._startPixel=n,this._endPixel=r,this._reversePixels=t,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){sn(this.options.afterUpdate,[this])}beforeSetDimensions(){sn(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){sn(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),sn(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){sn(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,i,o;for(r=0,i=t.length;r<i;r++)o=t[r],o.label=sn(n.callback,[o.value,r,t],this)}afterTickToLabelConversion(){sn(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){sn(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=OO(this.ticks.length,t.ticks.maxTicksLimit),i=n.minRotation||0,o=n.maxRotation;let s=i,a,l,c;if(!this._isVisible()||!n.display||i>=o||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const u=this._getLabelSizes(),d=u.widest.width,p=u.highest.height,h=lr(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/r:h/(r-1),d+6>a&&(a=h/(r-(t.offset?.5:1)),l=this.maxHeight-yf(t.grid)-n.padding-AO(t.title,this.chart.options.font),c=Math.sqrt(d*d+p*p),s=GC(Math.min(Math.asin(lr((u.highest.height+6)/a,-1,1)),Math.asin(lr(l/c,-1,1))-Math.asin(lr(p/c,-1,1)))),s=Math.max(i,Math.min(o,s))),this.labelRotation=s}afterCalculateLabelRotation(){sn(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){sn(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:i,grid:o}}=this,s=this._isVisible(),a=this.isHorizontal();if(s){const l=AO(i,n.options.font);if(a?(t.width=this.maxWidth,t.height=yf(o)+l):(t.height=this.maxHeight,t.width=yf(o)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:p}=this._getLabelSizes(),h=r.padding*2,m=Ro(this.labelRotation),b=Math.cos(m),v=Math.sin(m);if(a){const x=r.mirror?0:v*d.width+b*p.height;t.height=Math.min(this.maxHeight,t.height+x+h)}else{const x=r.mirror?0:b*d.width+v*p.height;t.width=Math.min(this.maxWidth,t.width+x+h)}this._calculatePadding(c,u,v,b)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,i){const{ticks:{align:o,padding:s},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let p=0,h=0;l?c?(p=i*t.width,h=r*n.height):(p=r*t.height,h=i*n.width):o==="start"?h=n.width:o==="end"?p=t.width:o!=="inner"&&(p=t.width/2,h=n.width/2),this.paddingLeft=Math.max((p-u+s)*this.width/(this.width-u),0),this.paddingRight=Math.max((h-d+s)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;o==="start"?(u=0,d=t.height):o==="end"&&(u=n.height,d=0),this.paddingTop=u+s,this.paddingBottom=d+s}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){sn(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,r;for(n=0,r=t.length;n<r;n++)_t(t[n].label)&&(t.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=DO(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:i,_longestTextCache:o}=this,s=[],a=[],l=Math.floor(n/OO(n,r));let c=0,u=0,d,p,h,m,b,v,x,S,_,E,C;for(d=0;d<n;d+=l){if(m=t[d].label,b=this._resolveTickFontOptions(d),i.font=v=b.string,x=o[v]=o[v]||{data:{},gc:[]},S=b.lineHeight,_=E=0,!_t(m)&&!Sn(m))_=Ab(i,x.data,x.gc,_,m),E=S;else if(Sn(m))for(p=0,h=m.length;p<h;++p)C=m[p],!_t(C)&&!Sn(C)&&(_=Ab(i,x.data,x.gc,_,C),E+=S);s.push(_),a.push(E),c=Math.max(_,c),u=Math.max(E,u)}Nre(o,n);const M=s.indexOf(c),O=a.indexOf(u),k=N=>({width:s[N]||0,height:a[N]||0});return{first:k(0),last:k(n-1),widest:k(M),highest:k(O),widths:s,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return _te(this._alignToPixels?Sl(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const r=n[t];return r.$context||(r.$context=Fre(this.getContext(),t,r))}return this.$context||(this.$context=Lre(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Ro(this.labelRotation),r=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),o=this._getLabelSizes(),s=t.autoSkipPadding||0,a=o?o.widest.width+s:0,l=o?o.highest.height+s:0;return this.isHorizontal()?l*r>a*i?a/r:l/i:l*i<a*r?l/r:a/i}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,i=this.options,{grid:o,position:s,border:a}=i,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),p=yf(o),h=[],m=a.setContext(this.getContext()),b=m.display?m.width:0,v=b/2,x=function(U){return Sl(r,U,b)};let S,_,E,C,M,O,k,N,F,j,$,X;if(s==="top")S=x(this.bottom),O=this.bottom-p,N=S-v,j=x(t.top)+v,X=t.bottom;else if(s==="bottom")S=x(this.top),j=t.top,X=x(t.bottom)-v,O=S+v,N=this.top+p;else if(s==="left")S=x(this.right),M=this.right-p,k=S-v,F=x(t.left)+v,$=t.right;else if(s==="right")S=x(this.left),F=t.left,$=x(t.right)-v,M=S+v,k=this.left+p;else if(n==="x"){if(s==="center")S=x((t.top+t.bottom)/2+.5);else if(Tt(s)){const U=Object.keys(s)[0],B=s[U];S=x(this.chart.scales[U].getPixelForValue(B))}j=t.top,X=t.bottom,O=S+v,N=O+p}else if(n==="y"){if(s==="center")S=x((t.left+t.right)/2);else if(Tt(s)){const U=Object.keys(s)[0],B=s[U];S=x(this.chart.scales[U].getPixelForValue(B))}M=S-v,k=M-p,F=t.left,$=t.right}const V=nt(i.ticks.maxTicksLimit,d),L=Math.max(1,Math.ceil(d/V));for(_=0;_<d;_+=L){const U=this.getContext(_),B=o.setContext(U),W=a.setContext(U),q=B.lineWidth,A=B.color,Y=W.dash||[],G=W.dashOffset,D=B.tickWidth,ee=B.tickColor,K=B.tickBorderDash||[],oe=B.tickBorderDashOffset;E=Ire(this,_,l),E!==void 0&&(C=Sl(r,E,q),c?M=k=F=$=C:O=N=j=X=C,h.push({tx1:M,ty1:O,tx2:k,ty2:N,x1:F,y1:j,x2:$,y2:X,width:q,color:A,borderDash:Y,borderDashOffset:G,tickWidth:D,tickColor:ee,tickBorderDash:K,tickBorderDashOffset:oe}))}return this._ticksLength=d,this._borderValue=S,h}_computeLabelItems(t){const n=this.axis,r=this.options,{position:i,ticks:o}=r,s=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=o,p=yf(r.grid),h=p+u,m=d?-u:h,b=-Ro(this.labelRotation),v=[];let x,S,_,E,C,M,O,k,N,F,j,$,X="middle";if(i==="top")M=this.bottom-m,O=this._getXAxisLabelAlignment();else if(i==="bottom")M=this.top+m,O=this._getXAxisLabelAlignment();else if(i==="left"){const L=this._getYAxisLabelAlignment(p);O=L.textAlign,C=L.x}else if(i==="right"){const L=this._getYAxisLabelAlignment(p);O=L.textAlign,C=L.x}else if(n==="x"){if(i==="center")M=(t.top+t.bottom)/2+h;else if(Tt(i)){const L=Object.keys(i)[0],U=i[L];M=this.chart.scales[L].getPixelForValue(U)+h}O=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")C=(t.left+t.right)/2-h;else if(Tt(i)){const L=Object.keys(i)[0],U=i[L];C=this.chart.scales[L].getPixelForValue(U)}O=this._getYAxisLabelAlignment(p).textAlign}n==="y"&&(l==="start"?X="top":l==="end"&&(X="bottom"));const V=this._getLabelSizes();for(x=0,S=a.length;x<S;++x){_=a[x],E=_.label;const L=o.setContext(this.getContext(x));k=this.getPixelForTick(x)+o.labelOffset,N=this._resolveTickFontOptions(x),F=N.lineHeight,j=Sn(E)?E.length:1;const U=j/2,B=L.color,W=L.textStrokeColor,q=L.textStrokeWidth;let A=O;s?(C=k,O==="inner"&&(x===S-1?A=this.options.reverse?"left":"right":x===0?A=this.options.reverse?"right":"left":A="center"),i==="top"?c==="near"||b!==0?$=-j*F+F/2:c==="center"?$=-V.highest.height/2-U*F+F:$=-V.highest.height+F/2:c==="near"||b!==0?$=F/2:c==="center"?$=V.highest.height/2-U*F:$=V.highest.height-j*F,d&&($*=-1),b!==0&&!L.showLabelBackdrop&&(C+=F/2*Math.sin(b))):(M=k,$=(1-j)*F/2);let Y;if(L.showLabelBackdrop){const G=br(L.backdropPadding),D=V.heights[x],ee=V.widths[x];let K=$-G.top,oe=0-G.left;switch(X){case"middle":K-=D/2;break;case"bottom":K-=D;break}switch(O){case"center":oe-=ee/2;break;case"right":oe-=ee;break;case"inner":x===S-1?oe-=ee:x>0&&(oe-=ee/2);break}Y={left:oe,top:K,width:ee+G.width,height:D+G.height,color:L.backdropColor}}v.push({label:E,font:N,textOffset:$,options:{rotation:b,color:B,strokeColor:W,strokeWidth:q,textAlign:A,textBaseline:X,translation:[C,M],backdrop:Y}})}return v}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Ro(this.labelRotation))return t==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:i,padding:o}}=this.options,s=this._getLabelSizes(),a=t+o,l=s.widest.width;let c,u;return n==="left"?i?(u=this.right+o,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?i?(u=this.left+o,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:r,top:i,width:o,height:s}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,i,o,s),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(o=>o.value===t);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,s;const a=(l,c,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(n.display)for(o=0,s=i.length;o<s;++o){const l=i[o];n.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:r,grid:i}}=this,o=r.setContext(this.getContext()),s=r.display?o.width:0;if(!s)return;const a=i.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,p;this.isHorizontal()?(c=Sl(t,this.left,s)-s/2,u=Sl(t,this.right,a)+a/2,d=p=l):(d=Sl(t,this.top,s)-s/2,p=Sl(t,this.bottom,a)+a/2,c=u=l),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(c,d),n.lineTo(u,p),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,i=this._computeLabelArea();i&&ec(r,i);const o=this.getLabelItems(t);for(const s of o){const a=s.options,l=s.font,c=s.label,u=s.textOffset;vc(r,c,0,u,l,a)}i&&tc(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const o=Gn(r.font),s=br(r.padding),a=r.align;let l=o.lineHeight/2;n==="bottom"||n==="center"||Tt(n)?(l+=s.bottom,Sn(r.text)&&(l+=o.lineHeight*(r.text.length-1))):l+=s.top;const{titleX:c,titleY:u,maxWidth:d,rotation:p}=$re(this,l,n,a);vc(t,r.text,0,0,o,{color:r.color,maxWidth:d,rotation:p,textAlign:jre(a,n,i),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,r=nt(t.grid&&t.grid.z,-1),i=nt(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==nl.prototype.draw?[{z:n,draw:o=>{this.draw(o)}}]:[{z:r,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",i=[];let o,s;for(o=0,s=n.length;o<s;++o){const a=n[o];a[r]===this.id&&(!t||a.type===t)&&i.push(a)}return i}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return Gn(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class am{constructor(t,n,r){this.type=t,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let r;Hre(n)&&(r=this.register(n));const i=this.items,o=t.id,s=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in i||(i[o]=t,zre(t,s,r),this.override&&Cn.override(t.id,t.overrides)),s}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,i=this.scope;r in n&&delete n[r],i&&r in Cn[i]&&(delete Cn[i][r],this.override&&delete yc[r])}}function zre(e,t,n){const r=cr(Object.create(null),[n?Cn.get(n):{},Cn.get(t),e.defaults]);Cn.set(t,r),e.defaultRoutes&&Bre(t,e.defaultRoutes),e.descriptors&&Cn.describe(t,e.descriptors)}function Bre(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),i=r.pop(),o=[e].concat(r).join("."),s=t[n].split("."),a=s.pop(),l=s.join(".");Cn.route(o,i,l,a)})}function Hre(e){return"id"in e&&"defaults"in e}class Vre{constructor(){this.controllers=new am(ao,"datasets",!0),this.elements=new am(ms,"elements"),this.plugins=new am(Object,"plugins"),this.scales=new am(nl,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,r){[...n].forEach(i=>{const o=r||this._getRegistryForType(i);r||o.isForType(i)||o===this.plugins&&i.id?this._exec(t,o,i):Qt(i,s=>{const a=r||this._getRegistryForType(s);this._exec(t,a,s)})})}_exec(t,n,r){const i=UC(t);sn(r["before"+i],[],r),n[t](r),sn(r["after"+i],[],r)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(t))return r}return this.plugins}_get(t,n,r){const i=n.get(t);if(i===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return i}}var Gr=new Vre;class Wre{constructor(){this._init=[]}notify(t,n,r,i){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=i?this._descriptors(t).filter(i):this._descriptors(t),s=this._notify(o,t,n,r);return n==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),s}_notify(t,n,r,i){i=i||{};for(const o of t){const s=o.plugin,a=s[r],l=[n,i,o.options];if(sn(a,l,s)===!1&&i.cancelable)return!1}return!0}invalidate(){_t(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const r=t&&t.config,i=nt(r.options&&r.options.plugins,{}),o=Ure(r);return i===!1&&!n?[]:qre(t,o,i,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,i=(o,s)=>o.filter(a=>!s.some(l=>a.plugin.id===l.plugin.id));this._notify(i(n,r),t,"stop"),this._notify(i(r,n),t,"start")}}function Ure(e){const t={},n=[],r=Object.keys(Gr.plugins.items);for(let o=0;o<r.length;o++)n.push(Gr.getPlugin(r[o]));const i=e.plugins||[];for(let o=0;o<i.length;o++){const s=i[o];n.indexOf(s)===-1&&(n.push(s),t[s.id]=!0)}return{plugins:n,localIds:t}}function Gre(e,t){return!t&&e===!1?null:e===!0?{}:e}function qre(e,{plugins:t,localIds:n},r,i){const o=[],s=e.getContext();for(const a of t){const l=a.id,c=Gre(r[l],i);c!==null&&o.push({plugin:a,options:Yre(e.config,{plugin:a,local:n[l]},c,s)})}return o}function Yre(e,{plugin:t,local:n},r,i){const o=e.pluginScopeKeys(t),s=e.getOptionScopes(r,o);return n&&t.defaults&&s.push(t.defaults),e.createResolver(s,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function aS(e,t){const n=Cn.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function Kre(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function Xre(e,t){return e===t?"_index_":"_value_"}function kO(e){if(e==="x"||e==="y"||e==="r")return e}function Qre(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function lS(e,...t){if(kO(e))return e;for(const n of t){const r=n.axis||Qre(n.position)||e.length>1&&kO(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function IO(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function Jre(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(r=>r.xAxisID===e||r.yAxisID===e);if(n.length)return IO(e,"x",n[0])||IO(e,"y",n[0])}return{}}function Zre(e,t){const n=yc[e.type]||{scales:{}},r=t.scales||{},i=aS(e.type,t),o=Object.create(null);return Object.keys(r).forEach(s=>{const a=r[s];if(!Tt(a))return console.error(`Invalid scale configuration for scale: ${s}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${s}`);const l=lS(s,a,Jre(s,e),Cn.scales[a.type]),c=Xre(l,i),u=n.scales||{};o[s]=th(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(s=>{const a=s.type||e.type,l=s.indexAxis||aS(a,t),u=(yc[a]||{}).scales||{};Object.keys(u).forEach(d=>{const p=Kre(d,l),h=s[p+"AxisID"]||p;o[h]=o[h]||Object.create(null),th(o[h],[{axis:p},r[h],u[d]])})}),Object.keys(o).forEach(s=>{const a=o[s];th(a,[Cn.scales[a.type],Cn.scale])}),o}function Z4(e){const t=e.options||(e.options={});t.plugins=nt(t.plugins,{}),t.scales=Zre(e,t)}function e3(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function eie(e){return e=e||{},e.data=e3(e.data),Z4(e),e}const NO=new Map,t3=new Set;function lm(e,t){let n=NO.get(e);return n||(n=t(),NO.set(e,n),t3.add(n)),n}const vf=(e,t,n)=>{const r=Ua(t,n);r!==void 0&&e.add(r)};class tie{constructor(t){this._config=eie(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=e3(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Z4(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return lm(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return lm(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return lm(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return lm(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let i=r.get(t);return(!i||n)&&(i=new Map,r.set(t,i)),i}getOptionScopes(t,n,r){const{options:i,type:o}=this,s=this._cachedScopes(t,r),a=s.get(n);if(a)return a;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>vf(l,t,d))),u.forEach(d=>vf(l,i,d)),u.forEach(d=>vf(l,yc[o]||{},d)),u.forEach(d=>vf(l,Cn,d)),u.forEach(d=>vf(l,oS,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),t3.has(n)&&s.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,yc[n]||{},Cn.datasets[n]||{},{type:n},Cn,oS]}resolveNamedOptions(t,n,r,i=[""]){const o={$shared:!0},{resolver:s,subPrefixes:a}=LO(this._resolverCache,t,i);let l=s;if(rie(s,n)){o.$shared=!1,r=Ga(r)?r():r;const c=this.createResolver(t,r,a);l=ld(s,r,c)}for(const c of n)o[c]=l[c];return o}createResolver(t,n,r=[""],i){const{resolver:o}=LO(this._resolverCache,t,r);return Tt(n)?ld(o,n,void 0,i):o}}function LO(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const i=n.join();let o=r.get(i);return o||(o={resolver:QC(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(i,o)),o}const nie=e=>Tt(e)&&Object.getOwnPropertyNames(e).some(t=>Ga(e[t]));function rie(e,t){const{isScriptable:n,isIndexable:r}=I4(e);for(const i of t){const o=n(i),s=r(i),a=(s||o)&&e[i];if(o&&(Ga(a)||nie(a))||s&&Sn(a))return!0}return!1}var iie="4.4.7";const oie=["top","bottom","left","right","chartArea"];function FO(e,t){return e==="top"||e==="bottom"||oie.indexOf(e)===-1&&t==="x"}function jO(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function $O(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),sn(n&&n.onComplete,[e],t)}function sie(e){const t=e.chart,n=t.options.animation;sn(n&&n.onProgress,[e],t)}function n3(e){return eE()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const ob={},zO=e=>{const t=n3(e);return Object.values(ob).filter(n=>n.canvas===t).pop()};function aie(e,t,n){const r=Object.keys(e);for(const i of r){const o=+i;if(o>=t){const s=e[i];delete e[i],(n>0||o>t)&&(e[o+n]=s)}}}function lie(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}function cm(e,t,n){return e.options.clip?e[n]:t[n]}function cie(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:cm(n,t,"left"),right:cm(n,t,"right"),top:cm(r,t,"top"),bottom:cm(r,t,"bottom")}:t}class Mn{static register(...t){Gr.add(...t),BO()}static unregister(...t){Gr.remove(...t),BO()}constructor(t,n){const r=this.config=new tie(n),i=n3(t),o=zO(i);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const s=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||Rre(i)),this.platform.updateConfig(r);const a=this.platform.acquireContext(i,s.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=dte(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=s,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Wre,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Pte(d=>this.update(d),s.resizeDelay||0),this._dataChanges=[],ob[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Ns.listen(this,"complete",$O),Ns.listen(this,"progress",sie),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:i,_aspectRatio:o}=this;return _t(t)?n&&o?o:i?r/i:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Gr}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():cO(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return sO(this.canvas,this.ctx),this}stop(){return Ns.stop(this),this}resize(t,n){Ns.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,i=this.canvas,o=r.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(i,t,n,o),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,cO(this,a,!0)&&(this.notifyPlugins("resize",{size:s}),sn(r.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Qt(n,(r,i)=>{r.id=i})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,i=Object.keys(r).reduce((s,a)=>(s[a]=!1,s),{});let o=[];n&&(o=o.concat(Object.keys(n).map(s=>{const a=n[s],l=lS(s,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Qt(o,s=>{const a=s.options,l=a.id,c=lS(l,a),u=nt(a.type,s.dtype);(a.position===void 0||FO(a.position,c)!==FO(s.dposition))&&(a.position=s.dposition),i[l]=!0;let d=null;if(l in r&&r[l].type===u)d=r[l];else{const p=Gr.getScale(u);d=new p({id:l,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(a,t)}),Qt(i,(s,a)=>{s||delete r[a]}),Qt(r,s=>{Mr.configure(this,s,s.options),Mr.addBox(this,s)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((i,o)=>i.index-o.index),r>n){for(let i=n;i<r;++i)this._destroyDatasetMeta(i);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(jO("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,i)=>{n.filter(o=>o===r._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,i;for(this._removeUnreferencedMetasets(),r=0,i=n.length;r<i;r++){const o=n[r];let s=this.getDatasetMeta(r);const a=o.type||this.config.type;if(s.type&&s.type!==a&&(this._destroyDatasetMeta(r),s=this.getDatasetMeta(r)),s.type=a,s.indexAxis=o.indexAxis||aS(a,this.options),s.order=o.order||0,s.index=r,s.label=""+o.label,s.visible=this.isDatasetVisible(r),s.controller)s.controller.updateIndex(r),s.controller.linkScales();else{const l=Gr.getController(a),{datasetElementType:c,dataElementType:u}=Cn.datasets[a];Object.assign(l,{dataElementType:Gr.getElement(u),datasetElementType:c&&Gr.getElement(c)}),s.controller=new l(this,r),t.push(s.controller)}}return this._updateMetasets(),t}_resetElements(){Qt(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),p=!i&&o.indexOf(d)===-1;d.buildOrUpdateElements(p),s=Math.max(+d.getMaxOverflow(),s)}s=this._minPadding=r.layout.autoPadding?s:0,this._updateLayout(s),i||Qt(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(jO("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Qt(this.scales,t=>{Mr.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!QM(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:i,count:o}of n){const s=r==="_removeElements"?-o:o;aie(t,i,s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=o=>new Set(t.filter(s=>s[0]===o).map((s,a)=>a+","+s.splice(1).join(","))),i=r(0);for(let o=1;o<n;o++)if(!QM(i,r(o)))return;return Array.from(i).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Mr.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Qt(this.boxes,i=>{r&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,o)=>{i._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,Ga(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),i={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",i)!==!1&&(r.controller._update(n),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Ns.has(this)?this.attached&&!Ns.running(this)&&Ns.start(this):(this.draw(),$O({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:i}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,i)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,r=[];let i,o;for(i=0,o=n.length;i<o;++i){const s=n[i];(!t||s.visible)&&r.push(s)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r=t._clip,i=!r.disabled,o=cie(t,this.chartArea),s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(i&&ec(n,{left:r.left===!1?0:o.left-r.left,right:r.right===!1?this.width:o.right+r.right,top:r.top===!1?0:o.top-r.top,bottom:r.bottom===!1?this.height:o.bottom+r.bottom}),t.controller.draw(),i&&tc(n),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return Ys(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const o=ore.modes[n];return typeof o=="function"?o(this,t,r,i):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let i=r.filter(o=>o&&o._dataset===n).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},r.push(i)),i}getContext(){return this.$context||(this.$context=tl(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){const r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){const i=r?"show":"hide",o=this.getDatasetMeta(t),s=o.controller._resolveAnimations(void 0,i);Rh(n)?(o.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),s.update(o,{visible:r}),this.update(a=>a.datasetIndex===t?i:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),Ns.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),sO(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete ob[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,n=this.platform,r=(o,s)=>{n.addEventListener(this,o,s),t[o]=s},i=(o,s,a)=>{o.offsetX=s,o.offsetY=a,this._eventHandler(o)};Qt(this.options.events,o=>r(o,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},i=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let s;const a=()=>{i("attach",a),this.attached=!0,this.resize(),r("resize",o),r("detach",s)};s=()=>{this.attached=!1,i("resize",o),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():s()}unbindEvents(){Qt(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Qt(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const i=r?"set":"remove";let o,s,a,l;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+i+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){s=t[a];const c=s&&this.getDatasetMeta(s.datasetIndex).controller;c&&c[i+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:o,index:s})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[s],index:s}});!Mb(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const i=this.options.hover,o=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),s=o(n,t),a=r?t:o(t,n);s.length&&this.updateHoverStyle(s,i.mode,!1),a.length&&i.mode&&this.updateHoverStyle(a,i.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},i=s=>(s.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,i)===!1)return;const o=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,i),(o||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:i=[],options:o}=this,s=n,a=this._getActiveElements(t,i,r,s),l=bte(t),c=lie(t,this._lastEvent,r,l);r&&(this._lastEvent=null,sn(o.onHover,[t,a,this],this),l&&sn(o.onClick,[t,a,this],this));const u=!Mb(a,i);return(u||n)&&(this._active=a,this._updateHoverStyles(a,i,n)),this._lastEvent=c,u}_getActiveElements(t,n,r,i){if(t.type==="mouseout")return[];if(!r)return n;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,i)}}Me(Mn,"defaults",Cn),Me(Mn,"instances",ob),Me(Mn,"overrides",yc),Me(Mn,"registry",Gr),Me(Mn,"version",iie),Me(Mn,"getChart",zO);function BO(){return Qt(Mn.instances,e=>e._plugins.invalidate())}function uie(e,t,n){const{startAngle:r,pixelMargin:i,x:o,y:s,outerRadius:a,innerRadius:l}=t;let c=i/a;e.beginPath(),e.arc(o,s,a,r-c,n+c),l>i?(c=i/l,e.arc(o,s,l,n+c,r-c,!0)):e.arc(o,s,i,n+Bn,r-Bn),e.closePath(),e.clip()}function die(e){return XC(e,["outerStart","outerEnd","innerStart","innerEnd"])}function fie(e,t,n,r){const i=die(e.options.borderRadius),o=(n-t)/2,s=Math.min(o,r*t/2),a=l=>{const c=(n-Math.min(o,l))*r/2;return lr(l,0,Math.min(o,c))};return{outerStart:a(i.outerStart),outerEnd:a(i.outerEnd),innerStart:lr(i.innerStart,0,s),innerEnd:lr(i.innerEnd,0,s)}}function au(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function Lb(e,t,n,r,i,o){const{x:s,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+r+n-c,0),p=u>0?u+r+n+c:0;let h=0;const m=i-l;if(r){const L=u>0?u-r:0,U=d>0?d-r:0,B=(L+U)/2,W=B!==0?m*B/(B+r):m;h=(m-W)/2}const b=Math.max(.001,m*d-n/En)/d,v=(m-b)/2,x=l+v+h,S=i-v-h,{outerStart:_,outerEnd:E,innerStart:C,innerEnd:M}=fie(t,p,d,S-x),O=d-_,k=d-E,N=x+_/O,F=S-E/k,j=p+C,$=p+M,X=x+C/j,V=S-M/$;if(e.beginPath(),o){const L=(N+F)/2;if(e.arc(s,a,d,N,L),e.arc(s,a,d,L,F),E>0){const q=au(k,F,s,a);e.arc(q.x,q.y,E,F,S+Bn)}const U=au($,S,s,a);if(e.lineTo(U.x,U.y),M>0){const q=au($,V,s,a);e.arc(q.x,q.y,M,S+Bn,V+Math.PI)}const B=(S-M/p+(x+C/p))/2;if(e.arc(s,a,p,S-M/p,B,!0),e.arc(s,a,p,B,x+C/p,!0),C>0){const q=au(j,X,s,a);e.arc(q.x,q.y,C,X+Math.PI,x-Bn)}const W=au(O,x,s,a);if(e.lineTo(W.x,W.y),_>0){const q=au(O,N,s,a);e.arc(q.x,q.y,_,x-Bn,N)}}else{e.moveTo(s,a);const L=Math.cos(N)*d+s,U=Math.sin(N)*d+a;e.lineTo(L,U);const B=Math.cos(F)*d+s,W=Math.sin(F)*d+a;e.lineTo(B,W)}e.closePath()}function hie(e,t,n,r,i){const{fullCircles:o,startAngle:s,circumference:a}=t;let l=t.endAngle;if(o){Lb(e,t,n,r,l,i);for(let c=0;c<o;++c)e.fill();isNaN(a)||(l=s+(a%_n||_n))}return Lb(e,t,n,r,l,i),e.fill(),l}function pie(e,t,n,r,i){const{fullCircles:o,startAngle:s,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:p}=l,h=l.borderAlign==="inner";if(!c)return;e.setLineDash(d||[]),e.lineDashOffset=p,h?(e.lineWidth=c*2,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");let m=t.endAngle;if(o){Lb(e,t,n,r,m,i);for(let b=0;b<o;++b)e.stroke();isNaN(a)||(m=s+(a%_n||_n))}h&&uie(e,t,m),o||(Lb(e,t,n,r,m,i),e.stroke())}class xu extends ms{constructor(n){super();Me(this,"circumference");Me(this,"endAngle");Me(this,"fullCircles");Me(this,"innerRadius");Me(this,"outerRadius");Me(this,"pixelMargin");Me(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,n&&Object.assign(this,n)}inRange(n,r,i){const o=this.getProps(["x","y"],i),{angle:s,distance:a}=C4(o,{x:n,y:r}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:d,circumference:p}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),h=(this.options.spacing+this.options.borderWidth)/2,m=nt(p,c-l),b=Ph(s,l,c)&&l!==c,v=m>=_n||b,x=Gs(a,u+h,d+h);return v&&x}getCenterPoint(n){const{x:r,y:i,startAngle:o,endAngle:s,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:u}=this.options,d=(o+s)/2,p=(a+l+u+c)/2;return{x:r+Math.cos(d)*p,y:i+Math.sin(d)*p}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:r,circumference:i}=this,o=(r.offset||0)/4,s=(r.spacing||0)/2,a=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=i>_n?Math.floor(i/_n):0,i===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*o,Math.sin(l)*o);const c=1-Math.sin(Math.min(En,i||0)),u=o*c;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,hie(n,this,u,s,a),pie(n,this,u,s,a),n.restore()}}Me(xu,"id","arc"),Me(xu,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),Me(xu,"defaultRoutes",{backgroundColor:"backgroundColor"}),Me(xu,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function r3(e,t,n=t){e.lineCap=nt(n.borderCapStyle,t.borderCapStyle),e.setLineDash(nt(n.borderDash,t.borderDash)),e.lineDashOffset=nt(n.borderDashOffset,t.borderDashOffset),e.lineJoin=nt(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=nt(n.borderWidth,t.borderWidth),e.strokeStyle=nt(n.borderColor,t.borderColor)}function gie(e,t,n){e.lineTo(n.x,n.y)}function mie(e){return e.stepped?$te:e.tension||e.cubicInterpolationMode==="monotone"?zte:gie}function i3(e,t,n={}){const r=e.length,{start:i=0,end:o=r-1}=n,{start:s,end:a}=t,l=Math.max(i,s),c=Math.min(o,a),u=i<s&&o<s||i>a&&o>a;return{count:r,start:l,loop:t.loop,ilen:c<l&&!u?r+c-l:c-l}}function bie(e,t,n,r){const{points:i,options:o}=t,{count:s,start:a,loop:l,ilen:c}=i3(i,n,r),u=mie(o);let{move:d=!0,reverse:p}=r||{},h,m,b;for(h=0;h<=c;++h)m=i[(a+(p?c-h:h))%s],!m.skip&&(d?(e.moveTo(m.x,m.y),d=!1):u(e,b,m,p,o.stepped),b=m);return l&&(m=i[(a+(p?c:0))%s],u(e,b,m,p,o.stepped)),!!l}function yie(e,t,n,r){const i=t.points,{count:o,start:s,ilen:a}=i3(i,n,r),{move:l=!0,reverse:c}=r||{};let u=0,d=0,p,h,m,b,v,x;const S=E=>(s+(c?a-E:E))%o,_=()=>{b!==v&&(e.lineTo(u,v),e.lineTo(u,b),e.lineTo(u,x))};for(l&&(h=i[S(0)],e.moveTo(h.x,h.y)),p=0;p<=a;++p){if(h=i[S(p)],h.skip)continue;const E=h.x,C=h.y,M=E|0;M===m?(C<b?b=C:C>v&&(v=C),u=(d*u+E)/++d):(_(),e.lineTo(E,C),m=M,d=0,b=v=C),x=C}_()}function cS(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?yie:bie}function vie(e){return e.stepped?yne:e.tension||e.cubicInterpolationMode==="monotone"?vne:Ml}function xie(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),r3(e,t.options),e.stroke(i)}function wie(e,t,n,r){const{segments:i,options:o}=t,s=cS(t);for(const a of i)r3(e,o,a.style),e.beginPath(),s(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const Sie=typeof Path2D=="function";function _ie(e,t,n,r){Sie&&!t.options.segment?xie(e,t,n,r):wie(e,t,n,r)}class Na extends ms{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const i=r.spanGaps?this._loop:this._fullLoop;une(this._points,r,t,i,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Ene(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,r=t.length;return r&&n[t[r-1].end]}interpolate(t,n){const r=this.options,i=t[n],o=this.points,s=W4(this,{property:n,start:i,end:i});if(!s.length)return;const a=[],l=vie(r);let c,u;for(c=0,u=s.length;c<u;++c){const{start:d,end:p}=s[c],h=o[d],m=o[p];if(h===m){a.push(h);continue}const b=Math.abs((i-h[n])/(m[n]-h[n])),v=l(h,m,b,r.stepped);v[n]=t[n],a.push(v)}return a.length===1?a[0]:a}pathSegment(t,n,r){return cS(this)(t,this,n,r)}path(t,n,r){const i=this.segments,o=cS(this);let s=this._loop;n=n||0,r=r||this.points.length-n;for(const a of i)s&=o(t,this,a,{start:n,end:n+r-1});return!!s}draw(t,n,r,i){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),_ie(t,this,r,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}Me(Na,"id","line"),Me(Na,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),Me(Na,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),Me(Na,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function HO(e,t,n,r){const i=e.options,{[n]:o}=e.getProps([n],r);return Math.abs(t-o)<i.radius+i.hitRadius}class ic extends ms{constructor(n){super();Me(this,"parsed");Me(this,"skip");Me(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,r,i){const o=this.options,{x:s,y:a}=this.getProps(["x","y"],i);return Math.pow(n-s,2)+Math.pow(r-a,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(n,r){return HO(this,n,"x",r)}inYRange(n,r){return HO(this,n,"y",r)}getCenterPoint(n){const{x:r,y:i}=this.getProps(["x","y"],n);return{x:r,y:i}}size(n){n=n||this.options||{};let r=n.radius||0;r=Math.max(r,r&&n.hoverRadius||0);const i=r&&n.borderWidth||0;return(r+i)*2}draw(n,r){const i=this.options;this.skip||i.radius<.1||!Ys(this,r,this.size(i)/2)||(n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.fillStyle=i.backgroundColor,kb(n,i,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}Me(ic,"id","point"),Me(ic,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),Me(ic,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function o3(e,t){const{x:n,y:r,base:i,width:o,height:s}=e.getProps(["x","y","base","width","height"],t);let a,l,c,u,d;return e.horizontal?(d=s/2,a=Math.min(n,i),l=Math.max(n,i),c=r-d,u=r+d):(d=o/2,a=n-d,l=n+d,c=Math.min(r,i),u=Math.max(r,i)),{left:a,top:c,right:l,bottom:u}}function La(e,t,n,r){return e?0:lr(t,n,r)}function Cie(e,t,n){const r=e.options.borderWidth,i=e.borderSkipped,o=k4(r);return{t:La(i.top,o.top,0,n),r:La(i.right,o.right,0,t),b:La(i.bottom,o.bottom,0,n),l:La(i.left,o.left,0,t)}}function Eie(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),i=e.options.borderRadius,o=nc(i),s=Math.min(t,n),a=e.borderSkipped,l=r||Tt(i);return{topLeft:La(!l||a.top||a.left,o.topLeft,0,s),topRight:La(!l||a.top||a.right,o.topRight,0,s),bottomLeft:La(!l||a.bottom||a.left,o.bottomLeft,0,s),bottomRight:La(!l||a.bottom||a.right,o.bottomRight,0,s)}}function Rie(e){const t=o3(e),n=t.right-t.left,r=t.bottom-t.top,i=Cie(e,n/2,r/2),o=Eie(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:o},inner:{x:t.left+i.l,y:t.top+i.t,w:n-i.l-i.r,h:r-i.t-i.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,o.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(i.b,i.r))}}}}function qx(e,t,n,r){const i=t===null,o=n===null,a=e&&!(i&&o)&&o3(e,r);return a&&(i||Gs(t,a.left,a.right))&&(o||Gs(n,a.top,a.bottom))}function Pie(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function Tie(e,t){e.rect(t.x,t.y,t.w,t.h)}function Yx(e,t,n={}){const r=e.x!==n.x?-t:0,i=e.y!==n.y?-t:0,o=(e.x+e.w!==n.x+n.w?t:0)-r,s=(e.y+e.h!==n.y+n.h?t:0)-i;return{x:e.x+r,y:e.y+i,w:e.w+o,h:e.h+s,radius:e.radius}}class oc extends ms{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:n,options:{borderColor:r,backgroundColor:i}}=this,{inner:o,outer:s}=Rie(this),a=Pie(s.radius)?Th:Tie;t.save(),(s.w!==o.w||s.h!==o.h)&&(t.beginPath(),a(t,Yx(s,n,o)),t.clip(),a(t,Yx(o,-n,s)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),a(t,Yx(o,n)),t.fillStyle=i,t.fill(),t.restore()}inRange(t,n,r){return qx(this,t,n,r)}inXRange(t,n){return qx(this,t,null,n)}inYRange(t,n){return qx(this,null,t,n)}getCenterPoint(t){const{x:n,y:r,base:i,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(n+i)/2:n,y:o?r:(r+i)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}Me(oc,"id","bar"),Me(oc,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),Me(oc,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var Mie=Object.freeze({__proto__:null,ArcElement:xu,BarElement:oc,LineElement:Na,PointElement:ic});const uS=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],VO=uS.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function s3(e){return uS[e%uS.length]}function a3(e){return VO[e%VO.length]}function Oie(e,t){return e.borderColor=s3(t),e.backgroundColor=a3(t),++t}function Die(e,t){return e.backgroundColor=e.data.map(()=>s3(t++)),t}function Aie(e,t){return e.backgroundColor=e.data.map(()=>a3(t++)),t}function kie(e){let t=0;return(n,r)=>{const i=e.getDatasetMeta(r).controller;i instanceof $l?t=Die(n,t):i instanceof oh?t=Aie(n,t):i&&(t=Oie(n,t))}}function WO(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function Iie(e){return e&&(e.borderColor||e.backgroundColor)}function Nie(){return Cn.borderColor!=="rgba(0,0,0,0.1)"||Cn.backgroundColor!=="rgba(0,0,0,0.1)"}var Lie={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:r},options:i}=e.config,{elements:o}=i,s=WO(r)||Iie(i)||o&&WO(o)||Nie();if(!n.forceOverride&&s)return;const a=kie(e);r.forEach(a)}};function Fie(e,t,n,r,i){const o=i.samples||r;if(o>=n)return e.slice(t,t+n);const s=[],a=(n-2)/(o-2);let l=0;const c=t+n-1;let u=t,d,p,h,m,b;for(s[l++]=e[u],d=0;d<o-2;d++){let v=0,x=0,S;const _=Math.floor((d+1)*a)+1+t,E=Math.min(Math.floor((d+2)*a)+1,n)+t,C=E-_;for(S=_;S<E;S++)v+=e[S].x,x+=e[S].y;v/=C,x/=C;const M=Math.floor(d*a)+1+t,O=Math.min(Math.floor((d+1)*a)+1,n)+t,{x:k,y:N}=e[u];for(h=m=-1,S=M;S<O;S++)m=.5*Math.abs((k-v)*(e[S].y-N)-(k-e[S].x)*(x-N)),m>h&&(h=m,p=e[S],b=S);s[l++]=p,u=b}return s[l++]=e[c],s}function jie(e,t,n,r){let i=0,o=0,s,a,l,c,u,d,p,h,m,b;const v=[],x=t+n-1,S=e[t].x,E=e[x].x-S;for(s=t;s<t+n;++s){a=e[s],l=(a.x-S)/E*r,c=a.y;const C=l|0;if(C===u)c<m?(m=c,d=s):c>b&&(b=c,p=s),i=(o*i+a.x)/++o;else{const M=s-1;if(!_t(d)&&!_t(p)){const O=Math.min(d,p),k=Math.max(d,p);O!==h&&O!==M&&v.push({...e[O],x:i}),k!==h&&k!==M&&v.push({...e[k],x:i})}s>0&&M!==h&&v.push(e[M]),v.push(a),u=C,o=0,m=b=c,d=p=h=s}}return v}function l3(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function UO(e){e.data.datasets.forEach(t=>{l3(t)})}function $ie(e,t){const n=t.length;let r=0,i;const{iScale:o}=e,{min:s,max:a,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(r=lr(qs(t,o.axis,s).lo,0,n-1)),c?i=lr(qs(t,o.axis,a).hi+1,r,n)-r:i=n-r,{start:r,count:i}}var zie={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){UO(e);return}const r=e.width;e.data.datasets.forEach((i,o)=>{const{_data:s,indexAxis:a}=i,l=e.getDatasetMeta(o),c=s||i.data;if(xn([a,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=e.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:d,count:p}=$ie(l,c);const h=n.threshold||4*r;if(p<=h){l3(i);return}_t(s)&&(i._data=c,delete i.data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(b){this._data=b}}));let m;switch(n.algorithm){case"lttb":m=Fie(c,d,p,r,n);break;case"min-max":m=jie(c,d,p,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}i._decimated=m})},destroy(e){UO(e)}};function Bie(e,t,n){const r=e.segments,i=e.points,o=t.points,s=[];for(const a of r){let{start:l,end:c}=a;c=rE(l,c,i);const u=dS(n,i[l],i[c],a.loop);if(!t.segments){s.push({source:a,target:u,start:i[l],end:i[c]});continue}const d=W4(t,u);for(const p of d){const h=dS(n,o[p.start],o[p.end],p.loop),m=V4(a,i,h);for(const b of m)s.push({source:b,target:p,start:{[n]:GO(u,h,"start",Math.max)},end:{[n]:GO(u,h,"end",Math.min)}})}}return s}function dS(e,t,n,r){if(r)return;let i=t[e],o=n[e];return e==="angle"&&(i=ki(i),o=ki(o)),{property:e,start:i,end:o}}function Hie(e,t){const{x:n=null,y:r=null}=e||{},i=t.points,o=[];return t.segments.forEach(({start:s,end:a})=>{a=rE(s,a,i);const l=i[s],c=i[a];r!==null?(o.push({x:l.x,y:r}),o.push({x:c.x,y:r})):n!==null&&(o.push({x:n,y:l.y}),o.push({x:n,y:c.y}))}),o}function rE(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function GO(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function c3(e,t){let n=[],r=!1;return Sn(e)?(r=!0,n=e):n=Hie(e,t),n.length?new Na({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function qO(e){return e&&e.fill!==!1}function Vie(e,t,n){let i=e[t].fill;const o=[t];let s;if(!n)return i;for(;i!==!1&&o.indexOf(i)===-1;){if(!Nn(i))return i;if(s=e[i],!s)return!1;if(s.visible)return i;o.push(i),i=s.fill}return!1}function Wie(e,t,n){const r=Yie(e);if(Tt(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return Nn(i)&&Math.floor(i)===i?Uie(r[0],t,i,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function Uie(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function Gie(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:Tt(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function qie(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:Tt(e)?r=e.value:r=t.getBaseValue(),r}function Yie(e){const t=e.options,n=t.fill;let r=nt(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function Kie(e){const{scale:t,index:n,line:r}=e,i=[],o=r.segments,s=r.points,a=Xie(t,n);a.push(c3({x:null,y:t.bottom},r));for(let l=0;l<o.length;l++){const c=o[l];for(let u=c.start;u<=c.end;u++)Qie(i,s[u],a)}return new Na({points:i,options:{}})}function Xie(e,t){const n=[],r=e.getMatchingVisibleMetas("line");for(let i=0;i<r.length;i++){const o=r[i];if(o.index===t)break;o.hidden||n.unshift(o.dataset)}return n}function Qie(e,t,n){const r=[];for(let i=0;i<n.length;i++){const o=n[i],{first:s,last:a,point:l}=Jie(o,t,"x");if(!(!l||s&&a)){if(s)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function Jie(e,t,n){const r=e.interpolate(t,n);if(!r)return{};const i=r[n],o=e.segments,s=e.points;let a=!1,l=!1;for(let c=0;c<o.length;c++){const u=o[c],d=s[u.start][n],p=s[u.end][n];if(Gs(i,d,p)){a=i===d,l=i===p;break}}return{first:a,last:l,point:r}}class u3{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,r){const{x:i,y:o,radius:s}=this;return n=n||{start:0,end:_n},t.arc(i,o,s,n.end,n.start,!0),!r.bounds}interpolate(t){const{x:n,y:r,radius:i}=this,o=t.angle;return{x:n+Math.cos(o)*i,y:r+Math.sin(o)*i,angle:o}}}function Zie(e){const{chart:t,fill:n,line:r}=e;if(Nn(n))return eoe(t,n);if(n==="stack")return Kie(e);if(n==="shape")return!0;const i=toe(e);return i instanceof u3?i:c3(i,r)}function eoe(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function toe(e){return(e.scale||{}).getPointPositionForValue?roe(e):noe(e)}function noe(e){const{scale:t={},fill:n}=e,r=Gie(n,t);if(Nn(r)){const i=t.isHorizontal();return{x:i?r:null,y:i?null:r}}return null}function roe(e){const{scale:t,fill:n}=e,r=t.options,i=t.getLabels().length,o=r.reverse?t.max:t.min,s=qie(n,t,o),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,o);return new u3({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(s)})}for(let l=0;l<i;++l)a.push(t.getPointPositionForValue(l,s));return a}function Kx(e,t,n){const r=Zie(t),{line:i,scale:o,axis:s}=t,a=i.options,l=a.fill,c=a.backgroundColor,{above:u=c,below:d=c}=l||{};r&&i.points.length&&(ec(e,n),ioe(e,{line:i,target:r,above:u,below:d,area:n,scale:o,axis:s}),tc(e))}function ioe(e,t){const{line:n,target:r,above:i,below:o,area:s,scale:a}=t,l=n._loop?"angle":t.axis;e.save(),l==="x"&&o!==i&&(YO(e,r,s.top),KO(e,{line:n,target:r,color:i,scale:a,property:l}),e.restore(),e.save(),YO(e,r,s.bottom)),KO(e,{line:n,target:r,color:o,scale:a,property:l}),e.restore()}function YO(e,t,n){const{segments:r,points:i}=t;let o=!0,s=!1;e.beginPath();for(const a of r){const{start:l,end:c}=a,u=i[l],d=i[rE(l,c,i)];o?(e.moveTo(u.x,u.y),o=!1):(e.lineTo(u.x,n),e.lineTo(u.x,u.y)),s=!!t.pathSegment(e,a,{move:s}),s?e.closePath():e.lineTo(d.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function KO(e,t){const{line:n,target:r,property:i,color:o,scale:s}=t,a=Bie(n,r,i);for(const{source:l,target:c,start:u,end:d}of a){const{style:{backgroundColor:p=o}={}}=l,h=r!==!0;e.save(),e.fillStyle=p,ooe(e,s,h&&dS(i,u,d)),e.beginPath();const m=!!n.pathSegment(e,l);let b;if(h){m?e.closePath():XO(e,r,d,i);const v=!!r.pathSegment(e,c,{move:m,reverse:!0});b=m&&v,b||XO(e,r,u,i)}e.closePath(),e.fill(b?"evenodd":"nonzero"),e.restore()}}function ooe(e,t,n){const{top:r,bottom:i}=t.chart.chartArea,{property:o,start:s,end:a}=n||{};o==="x"&&(e.beginPath(),e.rect(s,r,a-s,i-r),e.clip())}function XO(e,t,n,r){const i=t.interpolate(n,r);i&&e.lineTo(i.x,i.y)}var soe={id:"filler",afterDatasetsUpdate(e,t,n){const r=(e.data.datasets||[]).length,i=[];let o,s,a,l;for(s=0;s<r;++s)o=e.getDatasetMeta(s),a=o.dataset,l=null,a&&a.options&&a instanceof Na&&(l={visible:e.isDatasetVisible(s),index:s,fill:Wie(a,s,r),chart:e,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=l,i.push(l);for(s=0;s<r;++s)l=i[s],!(!l||l.fill===!1)&&(l.fill=Vie(i,s,n.propagate))},beforeDraw(e,t,n){const r=n.drawTime==="beforeDraw",i=e.getSortedVisibleDatasetMetas(),o=e.chartArea;for(let s=i.length-1;s>=0;--s){const a=i[s].$filler;a&&(a.line.updateControlPoints(o,a.axis),r&&a.fill&&Kx(e.ctx,a,o))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=e.getSortedVisibleDatasetMetas();for(let i=r.length-1;i>=0;--i){const o=r[i].$filler;qO(o)&&Kx(e.ctx,o,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!qO(r)||n.drawTime!=="beforeDatasetDraw"||Kx(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const QO=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},aoe=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class JO extends ms{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,r){this.maxWidth=t,this.maxHeight=n,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=sn(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,i)=>t.sort(r,i,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,i=Gn(r.font),o=i.size,s=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=QO(r,o);let c,u;n.font=i.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(s,o,a,l)+10):(u=this.maxHeight,c=this._fitCols(s,i,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,i){const{ctx:o,maxWidth:s,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=i+a;let d=t;o.textAlign="left",o.textBaseline="middle";let p=-1,h=-u;return this.legendItems.forEach((m,b)=>{const v=r+n/2+o.measureText(m.text).width;(b===0||c[c.length-1]+v+2*a>s)&&(d+=u,c[c.length-(b>0?0:1)]=0,h+=u,p++),l[b]={left:0,top:h,row:p,width:v,height:i},c[c.length-1]+=v+a}),d}_fitCols(t,n,r,i){const{ctx:o,maxHeight:s,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=s-t;let d=a,p=0,h=0,m=0,b=0;return this.legendItems.forEach((v,x)=>{const{itemWidth:S,itemHeight:_}=loe(r,n,o,v,i);x>0&&h+_+2*a>u&&(d+=p+a,c.push({width:p,height:h}),m+=p+a,b++,p=h=0),l[x]={left:m,top:h,col:b,width:S,height:_},p=Math.max(p,S),h+=_+a}),d+=p,c.push({width:p,height:h}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:i},rtl:o}}=this,s=Du(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=Rr(r,this.left+i,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=Rr(r,this.left+i,this.right-this.lineWidths[a])),c.top+=this.top+t+i,c.left=s.leftForLtr(s.x(l),c.width),l+=c.width+i}else{let a=0,l=Rr(r,this.top+t+i,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=Rr(r,this.top+t+i,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+i,c.left=s.leftForLtr(s.x(c.left),c.width),l+=c.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;ec(t,this),this._draw(),tc(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:o,labels:s}=t,a=Cn.color,l=Du(t.rtl,this.left,this.width),c=Gn(s.font),{padding:u}=s,d=c.size,p=d/2;let h;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=c.string;const{boxWidth:m,boxHeight:b,itemHeight:v}=QO(s,d),x=function(M,O,k){if(isNaN(m)||m<=0||isNaN(b)||b<0)return;i.save();const N=nt(k.lineWidth,1);if(i.fillStyle=nt(k.fillStyle,a),i.lineCap=nt(k.lineCap,"butt"),i.lineDashOffset=nt(k.lineDashOffset,0),i.lineJoin=nt(k.lineJoin,"miter"),i.lineWidth=N,i.strokeStyle=nt(k.strokeStyle,a),i.setLineDash(nt(k.lineDash,[])),s.usePointStyle){const F={radius:b*Math.SQRT2/2,pointStyle:k.pointStyle,rotation:k.rotation,borderWidth:N},j=l.xPlus(M,m/2),$=O+p;A4(i,F,j,$,s.pointStyleWidth&&m)}else{const F=O+Math.max((d-b)/2,0),j=l.leftForLtr(M,m),$=nc(k.borderRadius);i.beginPath(),Object.values($).some(X=>X!==0)?Th(i,{x:j,y:F,w:m,h:b,radius:$}):i.rect(j,F,m,b),i.fill(),N!==0&&i.stroke()}i.restore()},S=function(M,O,k){vc(i,k.text,M,O+v/2,c,{strikethrough:k.hidden,textAlign:l.textAlign(k.textAlign)})},_=this.isHorizontal(),E=this._computeTitleHeight();_?h={x:Rr(o,this.left+u,this.right-r[0]),y:this.top+u+E,line:0}:h={x:this.left+u,y:Rr(o,this.top+E+u,this.bottom-n[0].height),line:0},z4(this.ctx,t.textDirection);const C=v+u;this.legendItems.forEach((M,O)=>{i.strokeStyle=M.fontColor,i.fillStyle=M.fontColor;const k=i.measureText(M.text).width,N=l.textAlign(M.textAlign||(M.textAlign=s.textAlign)),F=m+p+k;let j=h.x,$=h.y;l.setWidth(this.width),_?O>0&&j+F+u>this.right&&($=h.y+=C,h.line++,j=h.x=Rr(o,this.left+u,this.right-r[h.line])):O>0&&$+C>this.bottom&&(j=h.x=j+n[h.line].width+u,h.line++,$=h.y=Rr(o,this.top+E+u,this.bottom-n[h.line].height));const X=l.x(j);if(x(X,$,M),j=Tte(N,j+m+p,_?j+F:this.right,t.rtl),S(l.x(j),$,M),_)h.x+=F+u;else if(typeof M.text!="string"){const V=c.lineHeight;h.y+=d3(M,V)+u}else h.y+=C}),B4(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=Gn(n.font),i=br(n.padding);if(!n.display)return;const o=Du(t.rtl,this.left,this.width),s=this.ctx,a=n.position,l=r.size/2,c=i.top+l;let u,d=this.left,p=this.width;if(this.isHorizontal())p=Math.max(...this.lineWidths),u=this.top+c,d=Rr(t.align,d,this.right-p);else{const m=this.columnSizes.reduce((b,v)=>Math.max(b,v.height),0);u=c+Rr(t.align,this.top,this.bottom-m-t.labels.padding-this._computeTitleHeight())}const h=Rr(a,d,d+p);s.textAlign=o.textAlign(YC(a)),s.textBaseline="middle",s.strokeStyle=n.color,s.fillStyle=n.color,s.font=r.string,vc(s,n.text,h,u,r)}_computeTitleHeight(){const t=this.options.title,n=Gn(t.font),r=br(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,i,o;if(Gs(t,this.left,this.right)&&Gs(n,this.top,this.bottom)){for(o=this.legendHitBoxes,r=0;r<o.length;++r)if(i=o[r],Gs(t,i.left,i.left+i.width)&&Gs(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!doe(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,o=aoe(i,r);i&&!o&&sn(n.onLeave,[t,i,this],this),this._hoveredItem=r,r&&!o&&sn(n.onHover,[t,r,this],this)}else r&&sn(n.onClick,[t,r,this],this)}}function loe(e,t,n,r,i){const o=coe(r,e,t,n),s=uoe(i,r,t.lineHeight);return{itemWidth:o,itemHeight:s}}function coe(e,t,n,r){let i=e.text;return i&&typeof i!="string"&&(i=i.reduce((o,s)=>o.length>s.length?o:s)),t+n.size/2+r.measureText(i).width}function uoe(e,t,n){let r=e;return typeof t.text!="string"&&(r=d3(t,n)),r}function d3(e,t){const n=e.text?e.text.length:0;return t*n}function doe(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var foe={id:"legend",_element:JO,start(e,t,n){const r=e.legend=new JO({ctx:e.ctx,options:n,chart:e});Mr.configure(e,r,n),Mr.addBox(e,r)},stop(e){Mr.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;Mr.configure(e,r,n),r.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const r=t.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:i,color:o,useBorderRadius:s,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=br(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:i||c.textAlign,borderRadius:s&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};let iE=class extends ms{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const i=Sn(r.text)?r.text.length:1;this._padding=br(r.padding);const o=i*Gn(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:i,right:o,options:s}=this,a=s.align;let l=0,c,u,d;return this.isHorizontal()?(u=Rr(a,r,o),d=n+t,c=o-r):(s.position==="left"?(u=r+t,d=Rr(a,i,n),l=En*-.5):(u=o-t,d=Rr(a,n,i),l=En*.5),c=i-n),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=Gn(n.font),o=r.lineHeight/2+this._padding.top,{titleX:s,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);vc(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:YC(n.align),textBaseline:"middle",translation:[s,a]})}};function hoe(e,t){const n=new iE({ctx:e.ctx,options:t,chart:e});Mr.configure(e,n,t),Mr.addBox(e,n),e.titleBlock=n}var poe={id:"title",_element:iE,start(e,t,n){hoe(e,n)},stop(e){const t=e.titleBlock;Mr.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;Mr.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const um=new WeakMap;var goe={id:"subtitle",start(e,t,n){const r=new iE({ctx:e.ctx,options:n,chart:e});Mr.configure(e,r,n),Mr.addBox(e,r),um.set(e,r)},stop(e){Mr.removeBox(e,um.get(e)),um.delete(e)},beforeUpdate(e,t,n){const r=um.get(e);Mr.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Vf={average(e){if(!e.length)return!1;let t,n,r=new Set,i=0,o=0;for(t=0,n=e.length;t<n;++t){const a=e[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();r.add(l.x),i+=l.y,++o}}return o===0||r.size===0?!1:{x:[...r].reduce((a,l)=>a+l)/r.size,y:i/o}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=Number.POSITIVE_INFINITY,o,s,a;for(o=0,s=e.length;o<s;++o){const l=e[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=iS(t,c);u<i&&(i=u,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function zo(e,t){return t&&(Sn(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Ls(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
299
|
-
`)>-1?e.split(`
|
|
300
|
-
`):e}function moe(e,t){const{element:n,datasetIndex:r,index:i}=t,o=e.getDatasetMeta(r).controller,{label:s,value:a}=o.getLabelAndValue(i);return{chart:e,label:s,parsed:o.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:a,dataset:o.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function ZO(e,t){const n=e.chart.ctx,{body:r,footer:i,title:o}=e,{boxWidth:s,boxHeight:a}=t,l=Gn(t.bodyFont),c=Gn(t.titleFont),u=Gn(t.footerFont),d=o.length,p=i.length,h=r.length,m=br(t.padding);let b=m.height,v=0,x=r.reduce((E,C)=>E+C.before.length+C.lines.length+C.after.length,0);if(x+=e.beforeBody.length+e.afterBody.length,d&&(b+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),x){const E=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;b+=h*E+(x-h)*l.lineHeight+(x-1)*t.bodySpacing}p&&(b+=t.footerMarginTop+p*u.lineHeight+(p-1)*t.footerSpacing);let S=0;const _=function(E){v=Math.max(v,n.measureText(E).width+S)};return n.save(),n.font=c.string,Qt(e.title,_),n.font=l.string,Qt(e.beforeBody.concat(e.afterBody),_),S=t.displayColors?s+2+t.boxPadding:0,Qt(r,E=>{Qt(E.before,_),Qt(E.lines,_),Qt(E.after,_)}),S=0,n.font=u.string,Qt(e.footer,_),n.restore(),v+=m.width,{width:v,height:b}}function boe(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function yoe(e,t,n,r){const{x:i,width:o}=r,s=n.caretSize+n.caretPadding;if(e==="left"&&i+o+s>t.width||e==="right"&&i-o-s<0)return!0}function voe(e,t,n,r){const{x:i,width:o}=n,{width:s,chartArea:{left:a,right:l}}=e;let c="center";return r==="center"?c=i<=(a+l)/2?"left":"right":i<=o/2?c="left":i>=s-o/2&&(c="right"),yoe(c,e,t,n)&&(c="center"),c}function eD(e,t,n){const r=n.yAlign||t.yAlign||boe(e,n);return{xAlign:n.xAlign||t.xAlign||voe(e,t,n,r),yAlign:r}}function xoe(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function woe(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function tD(e,t,n,r){const{caretSize:i,caretPadding:o,cornerRadius:s}=e,{xAlign:a,yAlign:l}=n,c=i+o,{topLeft:u,topRight:d,bottomLeft:p,bottomRight:h}=nc(s);let m=xoe(t,a);const b=woe(t,l,c);return l==="center"?a==="left"?m+=c:a==="right"&&(m-=c):a==="left"?m-=Math.max(u,p)+i:a==="right"&&(m+=Math.max(d,h)+i),{x:lr(m,0,r.width-t.width),y:lr(b,0,r.height-t.height)}}function dm(e,t,n){const r=br(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function nD(e){return zo([],Ls(e))}function Soe(e,t,n){return tl(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function rD(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const f3={beforeTitle:Ds,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:Ds,beforeBody:Ds,beforeLabel:Ds,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return _t(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Ds,afterBody:Ds,beforeFooter:Ds,footer:Ds,afterFooter:Ds};function oi(e,t,n,r){const i=e[t].call(n,r);return typeof i>"u"?f3[t].call(n,r):i}var fw;let iD=(fw=class extends ms{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),i=r.enabled&&n.options.animation&&r.animations,o=new U4(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Soe(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=oi(r,"beforeTitle",this,t),o=oi(r,"title",this,t),s=oi(r,"afterTitle",this,t);let a=[];return a=zo(a,Ls(i)),a=zo(a,Ls(o)),a=zo(a,Ls(s)),a}getBeforeBody(t,n){return nD(oi(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return Qt(t,o=>{const s={before:[],lines:[],after:[]},a=rD(r,o);zo(s.before,Ls(oi(a,"beforeLabel",this,o))),zo(s.lines,oi(a,"label",this,o)),zo(s.after,Ls(oi(a,"afterLabel",this,o))),i.push(s)}),i}getAfterBody(t,n){return nD(oi(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=oi(r,"beforeFooter",this,t),o=oi(r,"footer",this,t),s=oi(r,"afterFooter",this,t);let a=[];return a=zo(a,Ls(i)),a=zo(a,Ls(o)),a=zo(a,Ls(s)),a}_createItems(t){const n=this._active,r=this.chart.data,i=[],o=[],s=[];let a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push(moe(this.chart,n[l]));return t.filter&&(a=a.filter((u,d,p)=>t.filter(u,d,p,r))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,r))),Qt(a,u=>{const d=rD(t.callbacks,u);i.push(oi(d,"labelColor",this,u)),o.push(oi(d,"labelPointStyle",this,u)),s.push(oi(d,"labelTextColor",this,u))}),this.labelColors=i,this.labelPointStyles=o,this.labelTextColors=s,this.dataPoints=a,a}update(t,n){const r=this.options.setContext(this.getContext()),i=this._active;let o,s=[];if(!i.length)this.opacity!==0&&(o={opacity:0});else{const a=Vf[r.position].call(this,i,this._eventPosition);s=this._createItems(r),this.title=this.getTitle(s,r),this.beforeBody=this.getBeforeBody(s,r),this.body=this.getBody(s,r),this.afterBody=this.getAfterBody(s,r),this.footer=this.getFooter(s,r);const l=this._size=ZO(this,r),c=Object.assign({},a,l),u=eD(this.chart,r,c),d=tD(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=s,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,i){const o=this.getCaretPosition(t,r,i);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(t,n,r){const{xAlign:i,yAlign:o}=this,{caretSize:s,cornerRadius:a}=r,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=nc(a),{x:p,y:h}=t,{width:m,height:b}=n;let v,x,S,_,E,C;return o==="center"?(E=h+b/2,i==="left"?(v=p,x=v-s,_=E+s,C=E-s):(v=p+m,x=v+s,_=E-s,C=E+s),S=v):(i==="left"?x=p+Math.max(l,u)+s:i==="right"?x=p+m-Math.max(c,d)-s:x=this.caretX,o==="top"?(_=h,E=_-s,v=x-s,S=x+s):(_=h+b,E=_+s,v=x+s,S=x-s),C=_),{x1:v,x2:x,x3:S,y1:_,y2:E,y3:C}}drawTitle(t,n,r){const i=this.title,o=i.length;let s,a,l;if(o){const c=Du(r.rtl,this.x,this.width);for(t.x=dm(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",s=Gn(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=s.string,l=0;l<o;++l)n.fillText(i[l],c.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+a,l+1===o&&(t.y+=r.titleMarginBottom-a)}}_drawColorBox(t,n,r,i,o){const s=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=o,u=Gn(o.bodyFont),d=dm(this,"left",o),p=i.x(d),h=l<u.lineHeight?(u.lineHeight-l)/2:0,m=n.y+h;if(o.usePointStyle){const b={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},v=i.leftForLtr(p,c)+c/2,x=m+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,kb(t,b,v,x),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,kb(t,b,v,x)}else{t.lineWidth=Tt(s.borderWidth)?Math.max(...Object.values(s.borderWidth)):s.borderWidth||1,t.strokeStyle=s.borderColor,t.setLineDash(s.borderDash||[]),t.lineDashOffset=s.borderDashOffset||0;const b=i.leftForLtr(p,c),v=i.leftForLtr(i.xPlus(p,1),c-2),x=nc(s.borderRadius);Object.values(x).some(S=>S!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Th(t,{x:b,y:m,w:c,h:l,radius:x}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),Th(t,{x:v,y:m+1,w:c-2,h:l-2,radius:x}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(b,m,c,l),t.strokeRect(b,m,c,l),t.fillStyle=s.backgroundColor,t.fillRect(v,m+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:i}=this,{bodySpacing:o,bodyAlign:s,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=r,d=Gn(r.bodyFont);let p=d.lineHeight,h=0;const m=Du(r.rtl,this.x,this.width),b=function(k){n.fillText(k,m.x(t.x+h),t.y+p/2),t.y+=p+o},v=m.textAlign(s);let x,S,_,E,C,M,O;for(n.textAlign=s,n.textBaseline="middle",n.font=d.string,t.x=dm(this,v,r),n.fillStyle=r.bodyColor,Qt(this.beforeBody,b),h=a&&v!=="right"?s==="center"?c/2+u:c+2+u:0,E=0,M=i.length;E<M;++E){for(x=i[E],S=this.labelTextColors[E],n.fillStyle=S,Qt(x.before,b),_=x.lines,a&&_.length&&(this._drawColorBox(n,t,E,m,r),p=Math.max(d.lineHeight,l)),C=0,O=_.length;C<O;++C)b(_[C]),p=d.lineHeight;Qt(x.after,b)}h=0,p=d.lineHeight,Qt(this.afterBody,b),t.y-=o}drawFooter(t,n,r){const i=this.footer,o=i.length;let s,a;if(o){const l=Du(r.rtl,this.x,this.width);for(t.x=dm(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",s=Gn(r.footerFont),n.fillStyle=r.footerColor,n.font=s.string,a=0;a<o;++a)n.fillText(i[a],l.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+r.footerSpacing}}drawBackground(t,n,r,i){const{xAlign:o,yAlign:s}=this,{x:a,y:l}=t,{width:c,height:u}=r,{topLeft:d,topRight:p,bottomLeft:h,bottomRight:m}=nc(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(a+d,l),s==="top"&&this.drawCaret(t,n,r,i),n.lineTo(a+c-p,l),n.quadraticCurveTo(a+c,l,a+c,l+p),s==="center"&&o==="right"&&this.drawCaret(t,n,r,i),n.lineTo(a+c,l+u-m),n.quadraticCurveTo(a+c,l+u,a+c-m,l+u),s==="bottom"&&this.drawCaret(t,n,r,i),n.lineTo(a+h,l+u),n.quadraticCurveTo(a,l+u,a,l+u-h),s==="center"&&o==="left"&&this.drawCaret(t,n,r,i),n.lineTo(a,l+d),n.quadraticCurveTo(a,l,a+d,l),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,i=r&&r.x,o=r&&r.y;if(i||o){const s=Vf[t.position].call(this,this._active,this._eventPosition);if(!s)return;const a=this._size=ZO(this,t),l=Object.assign({},s,this._size),c=eD(n,t,l),u=tD(t,l,c,n);(i._to!==u.x||o._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=s.x,this.caretY=s.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},o={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const s=br(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=r,this.drawBackground(o,t,i,n),z4(t,n.textDirection),o.y+=s.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),B4(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,i=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!Mb(r,i),s=this._positionChanged(i,n);(o||s)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,o=this._active||[],s=this._getActiveElements(t,o,n,r),a=this._positionChanged(s,t),l=n||!Mb(s,o)||a;return l&&(this._active=s,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,i){const o=this.options;if(t.type==="mouseout")return[];if(!i)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const s=this.chart.getElementsAtEventForMode(t,o.mode,o,r);return o.reverse&&s.reverse(),s}_positionChanged(t,n){const{caretX:r,caretY:i,options:o}=this,s=Vf[o.position].call(this,t,n);return s!==!1&&(r!==s.x||i!==s.y)}},Me(fw,"positioners",Vf),fw);var h3={id:"tooltip",_element:iD,positioners:Vf,afterInit(e,t,n){n&&(e.tooltip=new iD({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:f3},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},_oe=Object.freeze({__proto__:null,Colors:Lie,Decimation:zie,Filler:soe,Legend:foe,SubTitle:goe,Title:poe,Tooltip:h3});const Coe=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function Eoe(e,t,n,r){const i=e.indexOf(t);if(i===-1)return Coe(e,t,n,r);const o=e.lastIndexOf(t);return i!==o?n:i}const Roe=(e,t)=>e===null?null:lr(Math.round(e),0,t);function oD(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Fb extends nl{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:i,label:o}of n)r[i]===o&&r.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(_t(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:Eoe(r,t,nt(n,t),this._addedLabels),Roe(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(i=this.getLabels().length-1)),this.min=r,this.max=i}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,i=[];let o=this.getLabels();o=t===0&&n===o.length-1?o:o.slice(t,n+1),this._valueRange=Math.max(o.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let s=t;s<=n;s++)i.push({value:s});return i}getLabelForValue(t){return oD.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}Me(Fb,"id","category"),Me(Fb,"defaults",{ticks:{callback:oD}});function Poe(e,t){const n=[],{bounds:i,step:o,min:s,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:p}=e,h=o||1,m=u-1,{min:b,max:v}=t,x=!_t(s),S=!_t(a),_=!_t(c),E=(v-b)/(d+1);let C=ZM((v-b)/m/h)*h,M,O,k,N;if(C<1e-14&&!x&&!S)return[{value:b},{value:v}];N=Math.ceil(v/C)-Math.floor(b/C),N>m&&(C=ZM(N*C/m/h)*h),_t(l)||(M=Math.pow(10,l),C=Math.ceil(C*M)/M),i==="ticks"?(O=Math.floor(b/C)*C,k=Math.ceil(v/C)*C):(O=b,k=v),x&&S&&o&&wte((a-s)/o,C/1e3)?(N=Math.round(Math.min((a-s)/C,u)),C=(a-s)/N,O=s,k=a):_?(O=x?s:O,k=S?a:k,N=c-1,C=(k-O)/N):(N=(k-O)/C,nh(N,Math.round(N),C/1e3)?N=Math.round(N):N=Math.ceil(N));const F=Math.max(eO(C),eO(O));M=Math.pow(10,_t(l)?F:l),O=Math.round(O*M)/M,k=Math.round(k*M)/M;let j=0;for(x&&(p&&O!==s?(n.push({value:s}),O<s&&j++,nh(Math.round((O+j*C)*M)/M,s,sD(s,E,e))&&j++):O<s&&j++);j<N;++j){const $=Math.round((O+j*C)*M)/M;if(S&&$>a)break;n.push({value:$})}return S&&p&&k!==a?n.length&&nh(n[n.length-1].value,a,sD(a,E,e))?n[n.length-1].value=a:n.push({value:a}):(!S||k===a)&&n.push({value:k}),n}function sD(e,t,{horizontal:n,minRotation:r}){const i=Ro(r),o=(n?Math.sin(i):Math.cos(i))||.001,s=.75*t*(""+e).length;return Math.min(t/o,s)}class jb extends nl{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return _t(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:i,max:o}=this;const s=l=>i=n?i:l,a=l=>o=r?o:l;if(t){const l=ts(i),c=ts(o);l<0&&c<0?a(0):l>0&&c>0&&s(0)}if(i===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||s(i-l)}this.min=i,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},o=this._range||this,s=Poe(i,o);return t.bounds==="ticks"&&_4(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const i=(r-n)/Math.max(t.length-1,1)/2;n-=i,r+=i}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return Ep(t,this.chart.options.locale,this.options.ticks.format)}}class ud extends jb{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Nn(t)?t:0,this.max=Nn(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Ro(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}Me(ud,"id","linear"),Me(ud,"defaults",{ticks:{callback:t0.formatters.numeric}});const Oh=e=>Math.floor(Ia(e)),Cl=(e,t)=>Math.pow(10,Oh(e)+t);function aD(e){return e/Math.pow(10,Oh(e))===1}function lD(e,t,n){const r=Math.pow(10,n),i=Math.floor(e/r);return Math.ceil(t/r)-i}function Toe(e,t){const n=t-e;let r=Oh(n);for(;lD(e,t,r)>10;)r++;for(;lD(e,t,r)<10;)r--;return Math.min(r,Oh(e))}function Moe(e,{min:t,max:n}){t=Mi(e.min,t);const r=[],i=Oh(t);let o=Toe(t,n),s=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=i>o?Math.pow(10,i):0,c=Math.round((t-l)*s)/s,u=Math.floor((t-l)/a/10)*a*10;let d=Math.floor((c-u)/Math.pow(10,o)),p=Mi(e.min,Math.round((l+u+d*Math.pow(10,o))*s)/s);for(;p<n;)r.push({value:p,major:aD(p),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,s=o>=0?1:s),p=Math.round((l+u+d*Math.pow(10,o))*s)/s;const h=Mi(e.max,p);return r.push({value:h,major:aD(h),significand:d}),r}class dd extends nl{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=jb.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return Nn(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Nn(t)?Math.max(0,t):null,this.max=Nn(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Nn(this._userMin)&&(this.min=t===Cl(this.min,0)?Cl(this.min,-1):Cl(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let r=this.min,i=this.max;const o=a=>r=t?r:a,s=a=>i=n?i:a;r===i&&(r<=0?(o(1),s(10)):(o(Cl(r,-1)),s(Cl(i,1)))),r<=0&&o(Cl(i,-1)),i<=0&&s(Cl(r,1)),this.min=r,this.max=i}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=Moe(n,this);return t.bounds==="ticks"&&_4(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(t){return t===void 0?"0":Ep(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Ia(t),this._valueRange=Ia(this.max)-Ia(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Ia(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}Me(dd,"id","logarithmic"),Me(dd,"defaults",{ticks:{callback:t0.formatters.logarithmic,major:{enabled:!0}}});function fS(e){const t=e.ticks;if(t.display&&e.display){const n=br(t.backdropPadding);return nt(t.font&&t.font.size,Cn.font.size)+n.height}return 0}function Ooe(e,t,n){return n=Sn(n)?n:[n],{w:jte(e,t.string,n),h:n.length*t.lineHeight}}function cD(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:e<r||e>i?{start:t-n,end:t}:{start:t,end:t+n}}function Doe(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],i=[],o=e._pointLabels.length,s=e.options.pointLabels,a=s.centerPointLabels?En/o:0;for(let l=0;l<o;l++){const c=s.setContext(e.getPointLabelContext(l));i[l]=c.padding;const u=e.getPointPosition(l,e.drawingArea+i[l],a),d=Gn(c.font),p=Ooe(e.ctx,d,e._pointLabels[l]);r[l]=p;const h=ki(e.getIndexAngle(l)+a),m=Math.round(GC(h)),b=cD(m,u.x,p.w,0,180),v=cD(m,u.y,p.h,90,270);Aoe(n,t,h,b,v)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=Noe(e,r,i)}function Aoe(e,t,n,r,i){const o=Math.abs(Math.sin(n)),s=Math.abs(Math.cos(n));let a=0,l=0;r.start<t.l?(a=(t.l-r.start)/o,e.l=Math.min(e.l,t.l-a)):r.end>t.r&&(a=(r.end-t.r)/o,e.r=Math.max(e.r,t.r+a)),i.start<t.t?(l=(t.t-i.start)/s,e.t=Math.min(e.t,t.t-l)):i.end>t.b&&(l=(i.end-t.b)/s,e.b=Math.max(e.b,t.b+l))}function koe(e,t,n){const r=e.drawingArea,{extra:i,additionalAngle:o,padding:s,size:a}=n,l=e.getPointPosition(t,r+i+s,o),c=Math.round(GC(ki(l.angle+Bn))),u=joe(l.y,a.h,c),d=Loe(c),p=Foe(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:p,top:u,right:p+a.w,bottom:u+a.h}}function Ioe(e,t){if(!t)return!0;const{left:n,top:r,right:i,bottom:o}=e;return!(Ys({x:n,y:r},t)||Ys({x:n,y:o},t)||Ys({x:i,y:r},t)||Ys({x:i,y:o},t))}function Noe(e,t,n){const r=[],i=e._pointLabels.length,o=e.options,{centerPointLabels:s,display:a}=o.pointLabels,l={extra:fS(o)/2,additionalAngle:s?En/i:0};let c;for(let u=0;u<i;u++){l.padding=n[u],l.size=t[u];const d=koe(e,u,l);r.push(d),a==="auto"&&(d.visible=Ioe(d,c),d.visible&&(c=d))}return r}function Loe(e){return e===0||e===180?"center":e<180?"left":"right"}function Foe(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function joe(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function $oe(e,t,n){const{left:r,top:i,right:o,bottom:s}=n,{backdropColor:a}=t;if(!_t(a)){const l=nc(t.borderRadius),c=br(t.backdropPadding);e.fillStyle=a;const u=r-c.left,d=i-c.top,p=o-r+c.width,h=s-i+c.height;Object.values(l).some(m=>m!==0)?(e.beginPath(),Th(e,{x:u,y:d,w:p,h,radius:l}),e.fill()):e.fillRect(u,d,p,h)}}function zoe(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){const o=e._pointLabelItems[i];if(!o.visible)continue;const s=r.setContext(e.getPointLabelContext(i));$oe(n,s,o);const a=Gn(s.font),{x:l,y:c,textAlign:u}=o;vc(n,e._pointLabels[i],l,c+a.lineHeight/2,a,{color:s.color,textAlign:u,textBaseline:"middle"})}}function p3(e,t,n,r){const{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,_n);else{let o=e.getPointPosition(0,t);i.moveTo(o.x,o.y);for(let s=1;s<r;s++)o=e.getPointPosition(s,t),i.lineTo(o.x,o.y)}}function Boe(e,t,n,r,i){const o=e.ctx,s=t.circular,{color:a,lineWidth:l}=t;!s&&!r||!a||!l||n<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(i.dash||[]),o.lineDashOffset=i.dashOffset,o.beginPath(),p3(e,n,s,r),o.closePath(),o.stroke(),o.restore())}function Hoe(e,t,n){return tl(e,{label:n,index:t,type:"pointLabel"})}class Wf extends jb{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=br(fS(this.options)/2),n=this.width=this.maxWidth-t.width,r=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+r/2+t.top),this.drawingArea=Math.floor(Math.min(n,r)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=Nn(t)&&!isNaN(t)?t:0,this.max=Nn(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/fS(this.options))}generateTickLabels(t){jb.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const i=sn(this.options.pointLabels.callback,[n,r],this);return i||i===0?i:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?Doe(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,i){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,i))}getIndexAngle(t){const n=_n/(this._pointLabels.length||1),r=this.options.startAngle||0;return ki(t*n+Ro(r))}getDistanceFromCenterForValue(t){if(_t(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(_t(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const r=n[t];return Hoe(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const i=this.getIndexAngle(t)-Bn+r;return{x:Math.cos(i)*n+this.xCenter,y:Math.sin(i)*n+this.yCenter,angle:i}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:r,right:i,bottom:o}=this._pointLabelItems[t];return{left:n,top:r,right:i,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),p3(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=t,r.fill(),r.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:r,grid:i,border:o}=n,s=this._pointLabels.length;let a,l,c;if(n.pointLabels.display&&zoe(this,s),i.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const p=this.getContext(d),h=i.setContext(p),m=o.setContext(p);Boe(this,h,l,s,m)}}),r.display){for(t.save(),a=s-1;a>=0;a--){const u=r.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:p}=u;!p||!d||(t.lineWidth=p,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const i=this.getIndexAngle(0);let o,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;const c=r.setContext(this.getContext(l)),u=Gn(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,s=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=br(c.backdropPadding);t.fillRect(-s/2-d.left,-o-u.size/2-d.top,s+d.width,u.size+d.height)}vc(t,a.label,0,-o,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}Me(Wf,"id","radialLinear"),Me(Wf,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:t0.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),Me(Wf,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),Me(Wf,"descriptors",{angleLines:{_fallback:"grid"}});const r0={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},fi=Object.keys(r0);function uD(e,t){return e-t}function dD(e,t){if(_t(t))return null;const n=e._adapter,{parser:r,round:i,isoWeekday:o}=e._parseOpts;let s=t;return typeof r=="function"&&(s=r(s)),Nn(s)||(s=typeof r=="string"?n.parse(s,r):n.parse(s)),s===null?null:(i&&(s=i==="week"&&(ad(o)||o===!0)?n.startOf(s,"isoWeek",o):n.startOf(s,i)),+s)}function fD(e,t,n,r){const i=fi.length;for(let o=fi.indexOf(e);o<i-1;++o){const s=r0[fi[o]],a=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((n-t)/(a*s.size))<=r)return fi[o]}return fi[i-1]}function Voe(e,t,n,r,i){for(let o=fi.length-1;o>=fi.indexOf(n);o--){const s=fi[o];if(r0[s].common&&e._adapter.diff(i,r,s)>=t-1)return s}return fi[n?fi.indexOf(n):0]}function Woe(e){for(let t=fi.indexOf(e)+1,n=fi.length;t<n;++t)if(r0[fi[t]].common)return fi[t]}function hD(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=qC(n,t),o=n[r]>=t?n[r]:n[i];e[o]=!0}}function Uoe(e,t,n,r){const i=e._adapter,o=+i.startOf(t[0].value,r),s=t[t.length-1].value;let a,l;for(a=o;a<=s;a=+i.add(a,1,r))l=n[a],l>=0&&(t[l].major=!0);return t}function pD(e,t,n){const r=[],i={},o=t.length;let s,a;for(s=0;s<o;++s)a=t[s],i[a]=s,r.push({value:a,major:!1});return o===0||!n?r:Uoe(e,r,i,n)}class Dh extends nl{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const r=t.time||(t.time={}),i=this._adapter=new ere._date(t.adapters.date);i.init(n),th(r.displayFormats,i.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:dD(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:i,max:o,minDefined:s,maxDefined:a}=this.getUserBounds();function l(c){!s&&!isNaN(c.min)&&(i=Math.min(i,c.min)),!a&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!s||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=Nn(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),o=Nn(o)&&!isNaN(o)?o:+n.endOf(Date.now(),r)+1,this.min=Math.min(i,o-1),this.max=Math.max(i+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,i=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const o=this.min,s=this.max,a=Ete(i,o,s);return this._unit=n.unit||(r.autoSkip?fD(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):Voe(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:Woe(this._unit),this.initOffsets(i),t.reverse&&a.reverse(),pD(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,i,o;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?n=1-i:n=(this.getDecimalForValue(t[1])-i)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?r=o:r=(o-this.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;n=lr(n,0,s),r=lr(r,0,s),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,i=this.options,o=i.time,s=o.unit||fD(o.minUnit,n,r,this._getLabelCapacity(n)),a=nt(i.ticks.stepSize,1),l=s==="week"?o.isoWeekday:!1,c=ad(l)||l===!0,u={};let d=n,p,h;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":s),t.diff(r,n,s)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+s);const m=i.ticks.source==="data"&&this.getDataTimestamps();for(p=d,h=0;p<r;p=+t.add(p,a,s),h++)hD(u,p,m);return(p===r||i.bounds==="ticks"||h===1)&&hD(u,p,m),Object.keys(u).sort(uD).map(b=>+b)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const i=this.options.time.displayFormats,o=this._unit,s=n||i[o];return this._adapter.format(t,s)}_tickFormatFunction(t,n,r,i){const o=this.options,s=o.ticks.callback;if(s)return sn(s,[t,n,r],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],p=r[n],h=c&&d&&p&&p.major;return this._adapter.format(t,i||(h?d:u))}generateTickLabels(t){let n,r,i;for(n=0,r=t.length;n<r;++n)i=t[n],i.label=this._tickFormatFunction(i.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,i=Ro(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(i),s=Math.sin(i),a=this._resolveTickFontOptions(0).size;return{w:r*o+a*s,h:r*s+a*o}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,i=r[n.unit]||r.millisecond,o=this._tickFormatFunction(t,0,pD(this,[t],this._majorUnit),i),s=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/s.w:this.height/s.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n<r;++n)t=t.concat(i[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const i=this.getLabels();for(n=0,r=i.length;n<r;++n)t.push(dD(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return R4(t.sort(uD))}}Me(Dh,"id","time"),Me(Dh,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function fm(e,t,n){let r=0,i=e.length-1,o,s,a,l;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=qs(e,"pos",t)),{pos:o,time:a}=e[r],{pos:s,time:l}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=qs(e,"time",t)),{time:o,pos:a}=e[r],{time:s,pos:l}=e[i]);const c=s-o;return c?a+(l-a)*(t-o)/c:a}class hS extends Dh{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=fm(n,this.min),this._tableRange=fm(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,i=[],o=[];let s,a,l,c,u;for(s=0,a=t.length;s<a;++s)c=t[s],c>=n&&c<=r&&i.push(c);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(s=0,a=i.length;s<a;++s)u=i[s+1],l=i[s-1],c=i[s],Math.round((u+l)/2)!==c&&o.push({time:c,pos:s/(a-1)});return o}_generate(){const t=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((i,o)=>i-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(fm(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return fm(this._table,r*this._tableRange+this._minPos,!0)}}Me(hS,"id","timeseries"),Me(hS,"defaults",Dh.defaults);var Goe=Object.freeze({__proto__:null,CategoryScale:Fb,LinearScale:ud,LogarithmicScale:dd,RadialLinearScale:Wf,TimeScale:Dh,TimeSeriesScale:hS});const qoe=[Zne,Mie,_oe,Goe];class qa{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let r=0;for(let i=0;i<this._n&&i<32;i++){const o=n[i],s=t+o,a=Math.abs(t)<Math.abs(o)?t-(s-o):o-(s-t);a&&(n[r++]=a),t=s}return n[r]=t,this._n=r+1,this}valueOf(){const t=this._partials;let n=this._n,r,i,o,s=0;if(n>0){for(s=t[--n];n>0&&(r=s,i=t[--n],s=r+i,o=i-(s-r),!o););n>0&&(o<0&&t[n-1]<0||o>0&&t[n-1]>0)&&(i=o*2,r=s+i,i==r-s&&(s=r))}return s}}function*Yoe(e){for(const t of e)yield*t}function g3(e){return Array.from(Yoe(e))}function wu(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(i);++r<i;)o[r]=e+r*n;return o}var Xe=1e-6,m3=1e-12,St=Math.PI,In=St/2,gD=St/4,zi=St*2,Vr=180/St,an=St/180,zt=Math.abs,Od=Math.atan,ss=Math.atan2,ct=Math.cos,hm=Math.ceil,b3=Math.exp,$b=Math.log,Xx=Math.pow,it=Math.sin,so=Math.sign||function(e){return e>0?1:e<0?-1:0},Kr=Math.sqrt,oE=Math.tan;function y3(e){return e>1?0:e<-1?St:Math.acos(e)}function co(e){return e>1?In:e<-1?-In:Math.asin(e)}function ar(){}function zb(e,t){e&&bD.hasOwnProperty(e.type)&&bD[e.type](e,t)}var mD={Feature:function(e,t){zb(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)zb(n[r].geometry,t)}},bD={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){pS(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)pS(n[r],t,0)},Polygon:function(e,t){yD(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)yD(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)zb(n[r],t)}};function pS(e,t,n){var r=-1,i=e.length-n,o;for(t.lineStart();++r<i;)o=e[r],t.point(o[0],o[1],o[2]);t.lineEnd()}function yD(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)pS(e[n],t,1);t.polygonEnd()}function Al(e,t){e&&mD.hasOwnProperty(e.type)?mD[e.type](e,t):zb(e,t)}function gS(e){return[ss(e[1],e[0]),co(e[2])]}function fd(e){var t=e[0],n=e[1],r=ct(n);return[r*ct(t),r*it(t),it(n)]}function pm(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Bb(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function Qx(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function gm(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function mS(e){var t=Kr(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function bS(e,t){function n(r,i){return r=e(r,i),t(r[0],r[1])}return e.invert&&t.invert&&(n.invert=function(r,i){return r=t.invert(r,i),r&&e.invert(r[0],r[1])}),n}function yS(e,t){return zt(e)>St&&(e-=Math.round(e/zi)*zi),[e,t]}yS.invert=yS;function v3(e,t,n){return(e%=zi)?t||n?bS(xD(e),wD(t,n)):xD(e):t||n?wD(t,n):yS}function vD(e){return function(t,n){return t+=e,zt(t)>St&&(t-=Math.round(t/zi)*zi),[t,n]}}function xD(e){var t=vD(e);return t.invert=vD(-e),t}function wD(e,t){var n=ct(e),r=it(e),i=ct(t),o=it(t);function s(a,l){var c=ct(l),u=ct(a)*c,d=it(a)*c,p=it(l),h=p*n+u*r;return[ss(d*i-h*o,u*n-p*r),co(h*i+d*o)]}return s.invert=function(a,l){var c=ct(l),u=ct(a)*c,d=it(a)*c,p=it(l),h=p*i-d*o;return[ss(d*i+p*o,u*n+h*r),co(h*n-u*r)]},s}function Koe(e){e=v3(e[0]*an,e[1]*an,e.length>2?e[2]*an:0);function t(n){return n=e(n[0]*an,n[1]*an),n[0]*=Vr,n[1]*=Vr,n}return t.invert=function(n){return n=e.invert(n[0]*an,n[1]*an),n[0]*=Vr,n[1]*=Vr,n},t}function Xoe(e,t,n,r,i,o){if(n){var s=ct(t),a=it(t),l=r*n;i==null?(i=t+r*zi,o=t-l/2):(i=SD(s,i),o=SD(s,o),(r>0?i<o:i>o)&&(i+=r*zi));for(var c,u=i;r>0?u>o:u<o;u-=l)c=gS([s,-a*ct(u),-a*it(u)]),e.point(c[0],c[1])}}function SD(e,t){t=fd(t),t[0]-=e,mS(t);var n=y3(-t[1]);return((-t[2]<0?-n:n)+zi-Xe)%zi}function x3(){var e=[],t;return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:ar,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function sb(e,t){return zt(e[0]-t[0])<Xe&&zt(e[1]-t[1])<Xe}function mm(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function w3(e,t,n,r,i){var o=[],s=[],a,l;if(e.forEach(function(m){if(!((b=m.length-1)<=0)){var b,v=m[0],x=m[b],S;if(sb(v,x)){if(!v[2]&&!x[2]){for(i.lineStart(),a=0;a<b;++a)i.point((v=m[a])[0],v[1]);i.lineEnd();return}x[0]+=2*Xe}o.push(S=new mm(v,m,null,!0)),s.push(S.o=new mm(v,null,S,!1)),o.push(S=new mm(x,m,null,!1)),s.push(S.o=new mm(x,null,S,!0))}}),!!o.length){for(s.sort(t),_D(o),_D(s),a=0,l=s.length;a<l;++a)s[a].e=n=!n;for(var c=o[0],u,d;;){for(var p=c,h=!0;p.v;)if((p=p.n)===c)return;u=p.z,i.lineStart();do{if(p.v=p.o.v=!0,p.e){if(h)for(a=0,l=u.length;a<l;++a)i.point((d=u[a])[0],d[1]);else r(p.x,p.n.x,1,i);p=p.n}else{if(h)for(u=p.p.z,a=u.length-1;a>=0;--a)i.point((d=u[a])[0],d[1]);else r(p.x,p.p.x,-1,i);p=p.p}p=p.o,u=p.z,h=!h}while(!p.v);i.lineEnd()}}}function _D(e){if(t=e.length){for(var t,n=0,r=e[0],i;++n<t;)r.n=i=e[n],i.p=r,r=i;r.n=i=e[0],i.p=r}}function Jx(e){return zt(e[0])<=St?e[0]:so(e[0])*((zt(e[0])+St)%zi-St)}function S3(e,t){var n=Jx(t),r=t[1],i=it(r),o=[it(n),-ct(n),0],s=0,a=0,l=new qa;i===1?r=In+Xe:i===-1&&(r=-In-Xe);for(var c=0,u=e.length;c<u;++c)if(p=(d=e[c]).length)for(var d,p,h=d[p-1],m=Jx(h),b=h[1]/2+gD,v=it(b),x=ct(b),S=0;S<p;++S,m=E,v=M,x=O,h=_){var _=d[S],E=Jx(_),C=_[1]/2+gD,M=it(C),O=ct(C),k=E-m,N=k>=0?1:-1,F=N*k,j=F>St,$=v*M;if(l.add(ss($*N*it(F),x*O+$*ct(F))),s+=j?k+N*zi:k,j^m>=n^E>=n){var X=Bb(fd(h),fd(_));mS(X);var V=Bb(o,X);mS(V);var L=(j^k>=0?-1:1)*co(V[2]);(r>L||r===L&&(X[0]||X[1]))&&(a+=j^k>=0?1:-1)}}return(s<-1e-6||s<Xe&&l<-1e-12)^a&1}function _3(e,t,n,r){return function(i){var o=t(i),s=x3(),a=t(s),l=!1,c,u,d,p={point:h,lineStart:b,lineEnd:v,polygonStart:function(){p.point=x,p.lineStart=S,p.lineEnd=_,u=[],c=[]},polygonEnd:function(){p.point=h,p.lineStart=b,p.lineEnd=v,u=g3(u);var E=S3(c,r);u.length?(l||(i.polygonStart(),l=!0),w3(u,Joe,E,n,i)):E&&(l||(i.polygonStart(),l=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),l&&(i.polygonEnd(),l=!1),u=c=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function h(E,C){e(E,C)&&i.point(E,C)}function m(E,C){o.point(E,C)}function b(){p.point=m,o.lineStart()}function v(){p.point=h,o.lineEnd()}function x(E,C){d.push([E,C]),a.point(E,C)}function S(){a.lineStart(),d=[]}function _(){x(d[0][0],d[0][1]),a.lineEnd();var E=a.clean(),C=s.result(),M,O=C.length,k,N,F;if(d.pop(),c.push(d),d=null,!!O){if(E&1){if(N=C[0],(k=N.length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),M=0;M<k;++M)i.point((F=N[M])[0],F[1]);i.lineEnd()}return}O>1&&E&2&&C.push(C.pop().concat(C.shift())),u.push(C.filter(Qoe))}}return p}}function Qoe(e){return e.length>1}function Joe(e,t){return((e=e.x)[0]<0?e[1]-In-Xe:In-e[1])-((t=t.x)[0]<0?t[1]-In-Xe:In-t[1])}const CD=_3(function(){return!0},Zoe,tse,[-St,-In]);function Zoe(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(o,s){var a=o>0?St:-St,l=zt(o-t);zt(l-St)<Xe?(e.point(t,n=(n+s)/2>0?In:-In),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(a,n),e.point(o,n),i=0):r!==a&&l>=St&&(zt(t-r)<Xe&&(t-=r*Xe),zt(o-a)<Xe&&(o-=a*Xe),n=ese(t,n,o,s),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(a,n),i=0),e.point(t=o,n=s),r=a},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-i}}}function ese(e,t,n,r){var i,o,s=it(e-n);return zt(s)>Xe?Od((it(t)*(o=ct(r))*it(n)-it(r)*(i=ct(t))*it(e))/(i*o*s)):(t+r)/2}function tse(e,t,n,r){var i;if(e==null)i=n*In,r.point(-St,i),r.point(0,i),r.point(St,i),r.point(St,0),r.point(St,-i),r.point(0,-i),r.point(-St,-i),r.point(-St,0),r.point(-St,i);else if(zt(e[0]-t[0])>Xe){var o=e[0]<t[0]?St:-St;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(t[0],t[1])}function nse(e){var t=ct(e),n=2*an,r=t>0,i=zt(t)>Xe;function o(u,d,p,h){Xoe(h,e,n,p,u,d)}function s(u,d){return ct(u)*ct(d)>t}function a(u){var d,p,h,m,b;return{lineStart:function(){m=h=!1,b=1},point:function(v,x){var S=[v,x],_,E=s(v,x),C=r?E?0:c(v,x):E?c(v+(v<0?St:-St),x):0;if(!d&&(m=h=E)&&u.lineStart(),E!==h&&(_=l(d,S),(!_||sb(d,_)||sb(S,_))&&(S[2]=1)),E!==h)b=0,E?(u.lineStart(),_=l(S,d),u.point(_[0],_[1])):(_=l(d,S),u.point(_[0],_[1],2),u.lineEnd()),d=_;else if(i&&d&&r^E){var M;!(C&p)&&(M=l(S,d,!0))&&(b=0,r?(u.lineStart(),u.point(M[0][0],M[0][1]),u.point(M[1][0],M[1][1]),u.lineEnd()):(u.point(M[1][0],M[1][1]),u.lineEnd(),u.lineStart(),u.point(M[0][0],M[0][1],3)))}E&&(!d||!sb(d,S))&&u.point(S[0],S[1]),d=S,h=E,p=C},lineEnd:function(){h&&u.lineEnd(),d=null},clean:function(){return b|(m&&h)<<1}}}function l(u,d,p){var h=fd(u),m=fd(d),b=[1,0,0],v=Bb(h,m),x=pm(v,v),S=v[0],_=x-S*S;if(!_)return!p&&u;var E=t*x/_,C=-t*S/_,M=Bb(b,v),O=gm(b,E),k=gm(v,C);Qx(O,k);var N=M,F=pm(O,N),j=pm(N,N),$=F*F-j*(pm(O,O)-1);if(!($<0)){var X=Kr($),V=gm(N,(-F-X)/j);if(Qx(V,O),V=gS(V),!p)return V;var L=u[0],U=d[0],B=u[1],W=d[1],q;U<L&&(q=L,L=U,U=q);var A=U-L,Y=zt(A-St)<Xe,G=Y||A<Xe;if(!Y&&W<B&&(q=B,B=W,W=q),G?Y?B+W>0^V[1]<(zt(V[0]-L)<Xe?B:W):B<=V[1]&&V[1]<=W:A>St^(L<=V[0]&&V[0]<=U)){var D=gm(N,(-F+X)/j);return Qx(D,O),[V,gS(D)]}}}function c(u,d){var p=r?e:St-e,h=0;return u<-p?h|=1:u>p&&(h|=2),d<-p?h|=4:d>p&&(h|=8),h}return _3(s,a,o,r?[0,-e]:[-St,e-St])}function rse(e,t,n,r,i,o){var s=e[0],a=e[1],l=t[0],c=t[1],u=0,d=1,p=l-s,h=c-a,m;if(m=n-s,!(!p&&m>0)){if(m/=p,p<0){if(m<u)return;m<d&&(d=m)}else if(p>0){if(m>d)return;m>u&&(u=m)}if(m=i-s,!(!p&&m<0)){if(m/=p,p<0){if(m>d)return;m>u&&(u=m)}else if(p>0){if(m<u)return;m<d&&(d=m)}if(m=r-a,!(!h&&m>0)){if(m/=h,h<0){if(m<u)return;m<d&&(d=m)}else if(h>0){if(m>d)return;m>u&&(u=m)}if(m=o-a,!(!h&&m<0)){if(m/=h,h<0){if(m>d)return;m>u&&(u=m)}else if(h>0){if(m<u)return;m<d&&(d=m)}return u>0&&(e[0]=s+u*p,e[1]=a+u*h),d<1&&(t[0]=s+d*p,t[1]=a+d*h),!0}}}}}var bm=1e9,ym=-1e9;function ise(e,t,n,r){function i(c,u){return e<=c&&c<=n&&t<=u&&u<=r}function o(c,u,d,p){var h=0,m=0;if(c==null||(h=s(c,d))!==(m=s(u,d))||l(c,u)<0^d>0)do p.point(h===0||h===3?e:n,h>1?r:t);while((h=(h+d+4)%4)!==m);else p.point(u[0],u[1])}function s(c,u){return zt(c[0]-e)<Xe?u>0?0:3:zt(c[0]-n)<Xe?u>0?2:1:zt(c[1]-t)<Xe?u>0?1:0:u>0?3:2}function a(c,u){return l(c.x,u.x)}function l(c,u){var d=s(c,1),p=s(u,1);return d!==p?d-p:d===0?u[1]-c[1]:d===1?c[0]-u[0]:d===2?c[1]-u[1]:u[0]-c[0]}return function(c){var u=c,d=x3(),p,h,m,b,v,x,S,_,E,C,M,O={point:k,lineStart:$,lineEnd:X,polygonStart:F,polygonEnd:j};function k(L,U){i(L,U)&&u.point(L,U)}function N(){for(var L=0,U=0,B=h.length;U<B;++U)for(var W=h[U],q=1,A=W.length,Y=W[0],G,D,ee=Y[0],K=Y[1];q<A;++q)G=ee,D=K,Y=W[q],ee=Y[0],K=Y[1],D<=r?K>r&&(ee-G)*(r-D)>(K-D)*(e-G)&&++L:K<=r&&(ee-G)*(r-D)<(K-D)*(e-G)&&--L;return L}function F(){u=d,p=[],h=[],M=!0}function j(){var L=N(),U=M&&L,B=(p=g3(p)).length;(U||B)&&(c.polygonStart(),U&&(c.lineStart(),o(null,null,1,c),c.lineEnd()),B&&w3(p,a,L,o,c),c.polygonEnd()),u=c,p=h=m=null}function $(){O.point=V,h&&h.push(m=[]),C=!0,E=!1,S=_=NaN}function X(){p&&(V(b,v),x&&E&&d.rejoin(),p.push(d.result())),O.point=k,E&&u.lineEnd()}function V(L,U){var B=i(L,U);if(h&&m.push([L,U]),C)b=L,v=U,x=B,C=!1,B&&(u.lineStart(),u.point(L,U));else if(B&&E)u.point(L,U);else{var W=[S=Math.max(ym,Math.min(bm,S)),_=Math.max(ym,Math.min(bm,_))],q=[L=Math.max(ym,Math.min(bm,L)),U=Math.max(ym,Math.min(bm,U))];rse(W,q,e,t,n,r)?(E||(u.lineStart(),u.point(W[0],W[1])),u.point(q[0],q[1]),B||u.lineEnd(),M=!1):B&&(u.lineStart(),u.point(L,U),M=!1)}S=L,_=U,E=B}return O}}var vS,xS,ab,lb,hd={sphere:ar,point:ar,lineStart:ose,lineEnd:ar,polygonStart:ar,polygonEnd:ar};function ose(){hd.point=ase,hd.lineEnd=sse}function sse(){hd.point=hd.lineEnd=ar}function ase(e,t){e*=an,t*=an,xS=e,ab=it(t),lb=ct(t),hd.point=lse}function lse(e,t){e*=an,t*=an;var n=it(t),r=ct(t),i=zt(e-xS),o=ct(i),s=it(i),a=r*s,l=lb*n-ab*r*o,c=ab*n+lb*r*o;vS.add(ss(Kr(a*a+l*l),c)),xS=e,ab=n,lb=r}function cse(e){return vS=new qa,Al(e,hd),+vS}var wS=[null,null],use={type:"LineString",coordinates:wS};function SS(e,t){return wS[0]=e,wS[1]=t,cse(use)}var ED={Feature:function(e,t){return Hb(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)if(Hb(n[r].geometry,t))return!0;return!1}},RD={Sphere:function(){return!0},Point:function(e,t){return PD(e.coordinates,t)},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(PD(n[r],t))return!0;return!1},LineString:function(e,t){return TD(e.coordinates,t)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(TD(n[r],t))return!0;return!1},Polygon:function(e,t){return MD(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(MD(n[r],t))return!0;return!1},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)if(Hb(n[r],t))return!0;return!1}};function Hb(e,t){return e&&RD.hasOwnProperty(e.type)?RD[e.type](e,t):!1}function PD(e,t){return SS(e,t)===0}function TD(e,t){for(var n,r,i,o=0,s=e.length;o<s;o++){if(r=SS(e[o],t),r===0||o>0&&(i=SS(e[o],e[o-1]),i>0&&n<=i&&r<=i&&(n+r-i)*(1-Math.pow((n-r)/i,2))<m3*i))return!0;n=r}return!1}function MD(e,t){return!!S3(e.map(dse),C3(t))}function dse(e){return e=e.map(C3),e.pop(),e}function C3(e){return[e[0]*an,e[1]*an]}function fse(e,t){return(e&&ED.hasOwnProperty(e.type)?ED[e.type]:Hb)(e,t)}function OD(e,t,n){var r=wu(e,t-Xe,n).concat(t);return function(i){return r.map(function(o){return[i,o]})}}function DD(e,t,n){var r=wu(e,t-Xe,n).concat(t);return function(i){return r.map(function(o){return[o,i]})}}function E3(){var e,t,n,r,i,o,s,a,l=10,c=l,u=90,d=360,p,h,m,b,v=2.5;function x(){return{type:"MultiLineString",coordinates:S()}}function S(){return wu(hm(r/u)*u,n,u).map(m).concat(wu(hm(a/d)*d,s,d).map(b)).concat(wu(hm(t/l)*l,e,l).filter(function(_){return zt(_%u)>Xe}).map(p)).concat(wu(hm(o/c)*c,i,c).filter(function(_){return zt(_%d)>Xe}).map(h))}return x.lines=function(){return S().map(function(_){return{type:"LineString",coordinates:_}})},x.outline=function(){return{type:"Polygon",coordinates:[m(r).concat(b(s).slice(1),m(n).reverse().slice(1),b(a).reverse().slice(1))]}},x.extent=function(_){return arguments.length?x.extentMajor(_).extentMinor(_):x.extentMinor()},x.extentMajor=function(_){return arguments.length?(r=+_[0][0],n=+_[1][0],a=+_[0][1],s=+_[1][1],r>n&&(_=r,r=n,n=_),a>s&&(_=a,a=s,s=_),x.precision(v)):[[r,a],[n,s]]},x.extentMinor=function(_){return arguments.length?(t=+_[0][0],e=+_[1][0],o=+_[0][1],i=+_[1][1],t>e&&(_=t,t=e,e=_),o>i&&(_=o,o=i,i=_),x.precision(v)):[[t,o],[e,i]]},x.step=function(_){return arguments.length?x.stepMajor(_).stepMinor(_):x.stepMinor()},x.stepMajor=function(_){return arguments.length?(u=+_[0],d=+_[1],x):[u,d]},x.stepMinor=function(_){return arguments.length?(l=+_[0],c=+_[1],x):[l,c]},x.precision=function(_){return arguments.length?(v=+_,p=OD(o,i,90),h=DD(t,e,v),m=OD(a,s,90),b=DD(r,n,v),x):v},x.extentMajor([[-180,-90+Xe],[180,90-Xe]]).extentMinor([[-180,-80-Xe],[180,80+Xe]])}function hse(){return E3()()}const _S=e=>e;var Zx=new qa,CS=new qa,R3,P3,ES,RS,Hs={point:ar,lineStart:ar,lineEnd:ar,polygonStart:function(){Hs.lineStart=pse,Hs.lineEnd=mse},polygonEnd:function(){Hs.lineStart=Hs.lineEnd=Hs.point=ar,Zx.add(zt(CS)),CS=new qa},result:function(){var e=Zx/2;return Zx=new qa,e}};function pse(){Hs.point=gse}function gse(e,t){Hs.point=T3,R3=ES=e,P3=RS=t}function T3(e,t){CS.add(RS*e-ES*t),ES=e,RS=t}function mse(){T3(R3,P3)}var pd=1/0,Vb=pd,Ah=-pd,Wb=Ah,Ub={point:bse,lineStart:ar,lineEnd:ar,polygonStart:ar,polygonEnd:ar,result:function(){var e=[[pd,Vb],[Ah,Wb]];return Ah=Wb=-(Vb=pd=1/0),e}};function bse(e,t){e<pd&&(pd=e),e>Ah&&(Ah=e),t<Vb&&(Vb=t),t>Wb&&(Wb=t)}var PS=0,TS=0,Uf=0,Gb=0,qb=0,Su=0,MS=0,OS=0,Gf=0,M3,O3,Ko,Xo,oo={point:xc,lineStart:AD,lineEnd:kD,polygonStart:function(){oo.lineStart=xse,oo.lineEnd=wse},polygonEnd:function(){oo.point=xc,oo.lineStart=AD,oo.lineEnd=kD},result:function(){var e=Gf?[MS/Gf,OS/Gf]:Su?[Gb/Su,qb/Su]:Uf?[PS/Uf,TS/Uf]:[NaN,NaN];return PS=TS=Uf=Gb=qb=Su=MS=OS=Gf=0,e}};function xc(e,t){PS+=e,TS+=t,++Uf}function AD(){oo.point=yse}function yse(e,t){oo.point=vse,xc(Ko=e,Xo=t)}function vse(e,t){var n=e-Ko,r=t-Xo,i=Kr(n*n+r*r);Gb+=i*(Ko+e)/2,qb+=i*(Xo+t)/2,Su+=i,xc(Ko=e,Xo=t)}function kD(){oo.point=xc}function xse(){oo.point=Sse}function wse(){D3(M3,O3)}function Sse(e,t){oo.point=D3,xc(M3=Ko=e,O3=Xo=t)}function D3(e,t){var n=e-Ko,r=t-Xo,i=Kr(n*n+r*r);Gb+=i*(Ko+e)/2,qb+=i*(Xo+t)/2,Su+=i,i=Xo*e-Ko*t,MS+=i*(Ko+e),OS+=i*(Xo+t),Gf+=i*3,xc(Ko=e,Xo=t)}function A3(e){this._context=e}A3.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,zi);break}}},result:ar};var DS=new qa,e1,k3,I3,qf,Yf,kh={point:ar,lineStart:function(){kh.point=_se},lineEnd:function(){e1&&N3(k3,I3),kh.point=ar},polygonStart:function(){e1=!0},polygonEnd:function(){e1=null},result:function(){var e=+DS;return DS=new qa,e}};function _se(e,t){kh.point=N3,k3=qf=e,I3=Yf=t}function N3(e,t){qf-=e,Yf-=t,DS.add(Kr(qf*qf+Yf*Yf)),qf=e,Yf=t}let ID,Yb,ND,LD;class FD{constructor(t){this._append=t==null?L3:Cse(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==ND||this._append!==Yb){const r=this._radius,i=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,ND=r,Yb=this._append,LD=this._,this._=i}this._+=LD;break}}}result(){const t=this._;return this._="",t.length?t:null}}function L3(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Cse(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return L3;if(t!==ID){const n=10**t;ID=t,Yb=function(i){let o=1;this._+=i[0];for(const s=i.length;o<s;++o)this._+=Math.round(arguments[o]*n)/n+i[o]}}return Yb}function jD(e,t){let n=3,r=4.5,i,o;function s(a){return a&&(typeof r=="function"&&o.pointRadius(+r.apply(this,arguments)),Al(a,i(o))),o.result()}return s.area=function(a){return Al(a,i(Hs)),Hs.result()},s.measure=function(a){return Al(a,i(kh)),kh.result()},s.bounds=function(a){return Al(a,i(Ub)),Ub.result()},s.centroid=function(a){return Al(a,i(oo)),oo.result()},s.projection=function(a){return arguments.length?(i=a==null?(e=null,_S):(e=a).stream,s):e},s.context=function(a){return arguments.length?(o=a==null?(t=null,new FD(n)):new A3(t=a),typeof r!="function"&&o.pointRadius(r),s):t},s.pointRadius=function(a){return arguments.length?(r=typeof a=="function"?a:(o.pointRadius(+a),+a),s):r},s.digits=function(a){if(!arguments.length)return n;if(a==null)n=null;else{const l=Math.floor(a);if(!(l>=0))throw new RangeError(`invalid digits: ${a}`);n=l}return t===null&&(o=new FD(n)),s},s.projection(e).digits(n).context(t)}function sE(e){return function(t){var n=new AS;for(var r in e)n[r]=e[r];return n.stream=t,n}}function AS(){}AS.prototype={constructor:AS,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function aE(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),Al(n,e.stream(Ub)),t(Ub.result()),r!=null&&e.clipExtent(r),e}function lE(e,t,n){return aE(e,function(r){var i=t[1][0]-t[0][0],o=t[1][1]-t[0][1],s=Math.min(i/(r[1][0]-r[0][0]),o/(r[1][1]-r[0][1])),a=+t[0][0]+(i-s*(r[1][0]+r[0][0]))/2,l=+t[0][1]+(o-s*(r[1][1]+r[0][1]))/2;e.scale(150*s).translate([a,l])},n)}function F3(e,t,n){return lE(e,[[0,0],t],n)}function j3(e,t,n){return aE(e,function(r){var i=+t,o=i/(r[1][0]-r[0][0]),s=(i-o*(r[1][0]+r[0][0]))/2,a=-o*r[0][1];e.scale(150*o).translate([s,a])},n)}function $3(e,t,n){return aE(e,function(r){var i=+t,o=i/(r[1][1]-r[0][1]),s=-o*r[0][0],a=(i-o*(r[1][1]+r[0][1]))/2;e.scale(150*o).translate([s,a])},n)}var $D=16,Ese=ct(30*an);function zD(e,t){return+t?Pse(e,t):Rse(e)}function Rse(e){return sE({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function Pse(e,t){function n(r,i,o,s,a,l,c,u,d,p,h,m,b,v){var x=c-r,S=u-i,_=x*x+S*S;if(_>4*t&&b--){var E=s+p,C=a+h,M=l+m,O=Kr(E*E+C*C+M*M),k=co(M/=O),N=zt(zt(M)-1)<Xe||zt(o-d)<Xe?(o+d)/2:ss(C,E),F=e(N,k),j=F[0],$=F[1],X=j-r,V=$-i,L=S*X-x*V;(L*L/_>t||zt((x*X+S*V)/_-.5)>.3||s*p+a*h+l*m<Ese)&&(n(r,i,o,s,a,l,j,$,N,E/=O,C/=O,M,b,v),v.point(j,$),n(j,$,N,E,C,M,c,u,d,p,h,m,b,v))}}return function(r){var i,o,s,a,l,c,u,d,p,h,m,b,v={point:x,lineStart:S,lineEnd:E,polygonStart:function(){r.polygonStart(),v.lineStart=C},polygonEnd:function(){r.polygonEnd(),v.lineStart=S}};function x(k,N){k=e(k,N),r.point(k[0],k[1])}function S(){d=NaN,v.point=_,r.lineStart()}function _(k,N){var F=fd([k,N]),j=e(k,N);n(d,p,u,h,m,b,d=j[0],p=j[1],u=k,h=F[0],m=F[1],b=F[2],$D,r),r.point(d,p)}function E(){v.point=x,r.lineEnd()}function C(){S(),v.point=M,v.lineEnd=O}function M(k,N){_(i=k,N),o=d,s=p,a=h,l=m,c=b,v.point=_}function O(){n(d,p,u,h,m,b,o,s,i,a,l,c,$D,r),v.lineEnd=E,E()}return v}}var Tse=sE({point:function(e,t){this.stream.point(e*an,t*an)}});function Mse(e){return sE({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function Ose(e,t,n,r,i){function o(s,a){return s*=r,a*=i,[t+e*s,n-e*a]}return o.invert=function(s,a){return[(s-t)/e*r,(n-a)/e*i]},o}function BD(e,t,n,r,i,o){if(!o)return Ose(e,t,n,r,i);var s=ct(o),a=it(o),l=s*e,c=a*e,u=s/e,d=a/e,p=(a*n-s*t)/e,h=(a*t+s*n)/e;function m(b,v){return b*=r,v*=i,[l*b-c*v+t,n-c*b-l*v]}return m.invert=function(b,v){return[r*(u*b-d*v+p),i*(h-d*b-u*v)]},m}function na(e){return z3(function(){return e})()}function z3(e){var t,n=150,r=480,i=250,o=0,s=0,a=0,l=0,c=0,u,d=0,p=1,h=1,m=null,b=CD,v=null,x,S,_,E=_S,C=.5,M,O,k,N,F;function j(L){return k(L[0]*an,L[1]*an)}function $(L){return L=k.invert(L[0],L[1]),L&&[L[0]*Vr,L[1]*Vr]}j.stream=function(L){return N&&F===L?N:N=Tse(Mse(u)(b(M(E(F=L)))))},j.preclip=function(L){return arguments.length?(b=L,m=void 0,V()):b},j.postclip=function(L){return arguments.length?(E=L,v=x=S=_=null,V()):E},j.clipAngle=function(L){return arguments.length?(b=+L?nse(m=L*an):(m=null,CD),V()):m*Vr},j.clipExtent=function(L){return arguments.length?(E=L==null?(v=x=S=_=null,_S):ise(v=+L[0][0],x=+L[0][1],S=+L[1][0],_=+L[1][1]),V()):v==null?null:[[v,x],[S,_]]},j.scale=function(L){return arguments.length?(n=+L,X()):n},j.translate=function(L){return arguments.length?(r=+L[0],i=+L[1],X()):[r,i]},j.center=function(L){return arguments.length?(o=L[0]%360*an,s=L[1]%360*an,X()):[o*Vr,s*Vr]},j.rotate=function(L){return arguments.length?(a=L[0]%360*an,l=L[1]%360*an,c=L.length>2?L[2]%360*an:0,X()):[a*Vr,l*Vr,c*Vr]},j.angle=function(L){return arguments.length?(d=L%360*an,X()):d*Vr},j.reflectX=function(L){return arguments.length?(p=L?-1:1,X()):p<0},j.reflectY=function(L){return arguments.length?(h=L?-1:1,X()):h<0},j.precision=function(L){return arguments.length?(M=zD(O,C=L*L),V()):Kr(C)},j.fitExtent=function(L,U){return lE(j,L,U)},j.fitSize=function(L,U){return F3(j,L,U)},j.fitWidth=function(L,U){return j3(j,L,U)},j.fitHeight=function(L,U){return $3(j,L,U)};function X(){var L=BD(n,0,0,p,h,d).apply(null,t(o,s)),U=BD(n,r-L[0],i-L[1],p,h,d);return u=v3(a,l,c),O=bS(t,U),k=bS(u,O),M=zD(O,C),V()}function V(){return N=F=null,j}return function(){return t=e.apply(this,arguments),j.invert=t.invert&&$,X()}}function cE(e){var t=0,n=St/3,r=z3(e),i=r(t,n);return i.parallels=function(o){return arguments.length?r(t=o[0]*an,n=o[1]*an):[t*Vr,n*Vr]},i}function Dse(e){var t=ct(e);function n(r,i){return[r*t,it(i)/t]}return n.invert=function(r,i){return[r/t,co(i*t)]},n}function Ase(e,t){var n=it(e),r=(n+it(t))/2;if(zt(r)<Xe)return Dse(e);var i=1+n*(2*r-n),o=Kr(i)/r;function s(a,l){var c=Kr(i-2*r*it(l))/r;return[c*it(a*=r),o-c*ct(a)]}return s.invert=function(a,l){var c=o-l,u=ss(a,zt(c))*so(c);return c*r<0&&(u-=St*so(a)*so(c)),[u/r,co((i-(a*a+c*c)*r*r)/(2*r))]},s}function Kb(){return cE(Ase).scale(155.424).center([0,33.6442])}function B3(){return Kb().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function kse(e){var t=e.length;return{point:function(n,r){for(var i=-1;++i<t;)e[i].point(n,r)},sphere:function(){for(var n=-1;++n<t;)e[n].sphere()},lineStart:function(){for(var n=-1;++n<t;)e[n].lineStart()},lineEnd:function(){for(var n=-1;++n<t;)e[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<t;)e[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<t;)e[n].polygonEnd()}}}function Ise(){var e,t,n=B3(),r,i=Kb().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o,s=Kb().rotate([157,0]).center([-3,19.9]).parallels([8,18]),a,l,c={point:function(p,h){l=[p,h]}};function u(p){var h=p[0],m=p[1];return l=null,r.point(h,m),l||(o.point(h,m),l)||(a.point(h,m),l)}u.invert=function(p){var h=n.scale(),m=n.translate(),b=(p[0]-m[0])/h,v=(p[1]-m[1])/h;return(v>=.12&&v<.234&&b>=-.425&&b<-.214?i:v>=.166&&v<.234&&b>=-.214&&b<-.115?s:n).invert(p)},u.stream=function(p){return e&&t===p?e:e=kse([n.stream(t=p),i.stream(p),s.stream(p)])},u.precision=function(p){return arguments.length?(n.precision(p),i.precision(p),s.precision(p),d()):n.precision()},u.scale=function(p){return arguments.length?(n.scale(p),i.scale(p*.35),s.scale(p),u.translate(n.translate())):n.scale()},u.translate=function(p){if(!arguments.length)return n.translate();var h=n.scale(),m=+p[0],b=+p[1];return r=n.translate(p).clipExtent([[m-.455*h,b-.238*h],[m+.455*h,b+.238*h]]).stream(c),o=i.translate([m-.307*h,b+.201*h]).clipExtent([[m-.425*h+Xe,b+.12*h+Xe],[m-.214*h-Xe,b+.234*h-Xe]]).stream(c),a=s.translate([m-.205*h,b+.212*h]).clipExtent([[m-.214*h+Xe,b+.166*h+Xe],[m-.115*h-Xe,b+.234*h-Xe]]).stream(c),d()},u.fitExtent=function(p,h){return lE(u,p,h)},u.fitSize=function(p,h){return F3(u,p,h)},u.fitWidth=function(p,h){return j3(u,p,h)},u.fitHeight=function(p,h){return $3(u,p,h)};function d(){return e=t=null,u}return u.scale(1070)}function H3(e){return function(t,n){var r=ct(t),i=ct(n),o=e(r*i);return o===1/0?[2,0]:[o*i*it(t),o*it(n)]}}function Pp(e){return function(t,n){var r=Kr(t*t+n*n),i=e(r),o=it(i),s=ct(i);return[ss(t*o,r*s),co(r&&n*o/r)]}}var V3=H3(function(e){return Kr(2/(1+e))});V3.invert=Pp(function(e){return 2*co(e/2)});function Nse(){return na(V3).scale(124.75).clipAngle(180-.001)}var W3=H3(function(e){return(e=y3(e))&&e/it(e)});W3.invert=Pp(function(e){return e});function Lse(){return na(W3).scale(79.4188).clipAngle(180-.001)}function i0(e,t){return[e,$b(oE((In+t)/2))]}i0.invert=function(e,t){return[e,2*Od(b3(t))-In]};function Fse(){return U3(i0).scale(961/zi)}function U3(e){var t=na(e),n=t.center,r=t.scale,i=t.translate,o=t.clipExtent,s=null,a,l,c;t.scale=function(d){return arguments.length?(r(d),u()):r()},t.translate=function(d){return arguments.length?(i(d),u()):i()},t.center=function(d){return arguments.length?(n(d),u()):n()},t.clipExtent=function(d){return arguments.length?(d==null?s=a=l=c=null:(s=+d[0][0],a=+d[0][1],l=+d[1][0],c=+d[1][1]),u()):s==null?null:[[s,a],[l,c]]};function u(){var d=St*r(),p=t(Koe(t.rotate()).invert([0,0]));return o(s==null?[[p[0]-d,p[1]-d],[p[0]+d,p[1]+d]]:e===i0?[[Math.max(p[0]-d,s),a],[Math.min(p[0]+d,l),c]]:[[s,Math.max(p[1]-d,a)],[l,Math.min(p[1]+d,c)]])}return u()}function vm(e){return oE((In+e)/2)}function jse(e,t){var n=ct(e),r=e===t?it(e):$b(n/ct(t))/$b(vm(t)/vm(e)),i=n*Xx(vm(e),r)/r;if(!r)return i0;function o(s,a){i>0?a<-In+Xe&&(a=-In+Xe):a>In-Xe&&(a=In-Xe);var l=i/Xx(vm(a),r);return[l*it(r*s),i-l*ct(r*s)]}return o.invert=function(s,a){var l=i-a,c=so(r)*Kr(s*s+l*l),u=ss(s,zt(l))*so(l);return l*r<0&&(u-=St*so(s)*so(l)),[u/r,2*Od(Xx(i/c,1/r))-In]},o}function $se(){return cE(jse).scale(109.5).parallels([30,30])}function Xb(e,t){return[e,t]}Xb.invert=Xb;function zse(){return na(Xb).scale(152.63)}function Bse(e,t){var n=ct(e),r=e===t?it(e):(n-ct(t))/(t-e),i=n/r+e;if(zt(r)<Xe)return Xb;function o(s,a){var l=i-a,c=r*s;return[l*it(c),i-l*ct(c)]}return o.invert=function(s,a){var l=i-a,c=ss(s,zt(l))*so(l);return l*r<0&&(c-=St*so(s)*so(l)),[c/r,i-so(r)*Kr(s*s+l*l)]},o}function Hse(){return cE(Bse).scale(131.154).center([0,13.9389])}var sh=1.340264,ah=-.081106,lh=893e-6,ch=.003796,Qb=Kr(3)/2,Vse=12;function G3(e,t){var n=co(Qb*it(t)),r=n*n,i=r*r*r;return[e*ct(n)/(Qb*(sh+3*ah*r+i*(7*lh+9*ch*r))),n*(sh+ah*r+i*(lh+ch*r))]}G3.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,o=0,s,a,l;o<Vse&&(a=n*(sh+ah*r+i*(lh+ch*r))-t,l=sh+3*ah*r+i*(7*lh+9*ch*r),n-=s=a/l,r=n*n,i=r*r*r,!(zt(s)<m3));++o);return[Qb*e*(sh+3*ah*r+i*(7*lh+9*ch*r))/ct(n),co(it(n)/Qb)]};function Wse(){return na(G3).scale(177.158)}function q3(e,t){var n=ct(t),r=ct(e)*n;return[n*it(e)/r,it(t)/r]}q3.invert=Pp(Od);function Use(){return na(q3).scale(144.049).clipAngle(60)}function Y3(e,t){var n=t*t,r=n*n;return[e*(.8707-.131979*n+r*(-.013791+r*(.003971*n-.001529*r))),t*(1.007226+n*(.015085+r*(-.044475+.028874*n-.005916*r)))]}Y3.invert=function(e,t){var n=t,r=25,i;do{var o=n*n,s=o*o;n-=i=(n*(1.007226+o*(.015085+s*(-.044475+.028874*o-.005916*s)))-t)/(1.007226+o*(.015085*3+s*(-.044475*7+.028874*9*o-.005916*11*s)))}while(zt(i)>Xe&&--r>0);return[e/(.8707+(o=n*n)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),n]};function Gse(){return na(Y3).scale(175.295)}function K3(e,t){return[ct(t)*it(e),it(t)]}K3.invert=Pp(co);function qse(){return na(K3).scale(249.5).clipAngle(90+Xe)}function X3(e,t){var n=ct(t),r=1+ct(e)*n;return[n*it(e)/r,it(t)/r]}X3.invert=Pp(function(e){return 2*Od(e)});function Yse(){return na(X3).scale(250).clipAngle(142)}function Q3(e,t){return[$b(oE((In+t)/2)),-e]}Q3.invert=function(e,t){return[-t,2*Od(b3(e))-In]};function Kse(){var e=U3(Q3),t=e.center,n=e.rotate;return e.center=function(r){return arguments.length?t([-r[1],r[0]]):(r=t(),[r[1],-r[0]])},e.rotate=function(r){return arguments.length?n([r[0],r[1],r.length>2?r[2]+90:90]):(r=n(),[r[0],r[1],r[2]-90])},n([0,0,90]).scale(159.155)}function qt(e){for(var t=e.length/6|0,n=new Array(t),r=0;r<t;)n[r]="#"+e.slice(r*6,++r*6);return n}function o0(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function uE(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Dd(){}var wc=.7,gd=1/wc,Au="\\s*([+-]?\\d+)\\s*",Ih="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ns="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Xse=/^#([0-9a-f]{3,8})$/,Qse=new RegExp(`^rgb\\(${Au},${Au},${Au}\\)$`),Jse=new RegExp(`^rgb\\(${ns},${ns},${ns}\\)$`),Zse=new RegExp(`^rgba\\(${Au},${Au},${Au},${Ih}\\)$`),eae=new RegExp(`^rgba\\(${ns},${ns},${ns},${Ih}\\)$`),tae=new RegExp(`^hsl\\(${Ih},${ns},${ns}\\)$`),nae=new RegExp(`^hsla\\(${Ih},${ns},${ns},${Ih}\\)$`),HD={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};o0(Dd,dE,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:VD,formatHex:VD,formatHex8:rae,formatHsl:iae,formatRgb:WD,toString:WD});function VD(){return this.rgb().formatHex()}function rae(){return this.rgb().formatHex8()}function iae(){return Z3(this).formatHsl()}function WD(){return this.rgb().formatRgb()}function dE(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Xse.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?UD(t):n===3?new Or(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?xm(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?xm(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Qse.exec(e))?new Or(t[1],t[2],t[3],1):(t=Jse.exec(e))?new Or(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Zse.exec(e))?xm(t[1],t[2],t[3],t[4]):(t=eae.exec(e))?xm(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=tae.exec(e))?YD(t[1],t[2]/100,t[3]/100,1):(t=nae.exec(e))?YD(t[1],t[2]/100,t[3]/100,t[4]):HD.hasOwnProperty(e)?UD(HD[e]):e==="transparent"?new Or(NaN,NaN,NaN,0):null}function UD(e){return new Or(e>>16&255,e>>8&255,e&255,1)}function xm(e,t,n,r){return r<=0&&(e=t=n=NaN),new Or(e,t,n,r)}function J3(e){return e instanceof Dd||(e=dE(e)),e?(e=e.rgb(),new Or(e.r,e.g,e.b,e.opacity)):new Or}function Nh(e,t,n,r){return arguments.length===1?J3(e):new Or(e,t,n,r??1)}function Or(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}o0(Or,Nh,uE(Dd,{brighter(e){return e=e==null?gd:Math.pow(gd,e),new Or(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?wc:Math.pow(wc,e),new Or(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Or(sc(this.r),sc(this.g),sc(this.b),Jb(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:GD,formatHex:GD,formatHex8:oae,formatRgb:qD,toString:qD}));function GD(){return`#${zl(this.r)}${zl(this.g)}${zl(this.b)}`}function oae(){return`#${zl(this.r)}${zl(this.g)}${zl(this.b)}${zl((isNaN(this.opacity)?1:this.opacity)*255)}`}function qD(){const e=Jb(this.opacity);return`${e===1?"rgb(":"rgba("}${sc(this.r)}, ${sc(this.g)}, ${sc(this.b)}${e===1?")":`, ${e})`}`}function Jb(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function sc(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function zl(e){return e=sc(e),(e<16?"0":"")+e.toString(16)}function YD(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Eo(e,t,n,r)}function Z3(e){if(e instanceof Eo)return new Eo(e.h,e.s,e.l,e.opacity);if(e instanceof Dd||(e=dE(e)),!e)return new Eo;if(e instanceof Eo)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,a=o-i,l=(o+i)/2;return a?(t===o?s=(n-r)/a+(n<r)*6:n===o?s=(r-t)/a+2:s=(t-n)/a+4,a/=l<.5?o+i:2-o-i,s*=60):a=l>0&&l<1?0:s,new Eo(s,a,l,e.opacity)}function sae(e,t,n,r){return arguments.length===1?Z3(e):new Eo(e,t,n,r??1)}function Eo(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}o0(Eo,sae,uE(Dd,{brighter(e){return e=e==null?gd:Math.pow(gd,e),new Eo(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?wc:Math.pow(wc,e),new Eo(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Or(t1(e>=240?e-240:e+120,i,r),t1(e,i,r),t1(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Eo(KD(this.h),wm(this.s),wm(this.l),Jb(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Jb(this.opacity);return`${e===1?"hsl(":"hsla("}${KD(this.h)}, ${wm(this.s)*100}%, ${wm(this.l)*100}%${e===1?")":`, ${e})`}`}}));function KD(e){return e=(e||0)%360,e<0?e+360:e}function wm(e){return Math.max(0,Math.min(1,e||0))}function t1(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const aae=Math.PI/180,lae=180/Math.PI;var eL=-.14861,fE=1.78277,hE=-.29227,s0=-.90649,Lh=1.97294,XD=Lh*s0,QD=Lh*fE,JD=fE*hE-s0*eL;function cae(e){if(e instanceof ac)return new ac(e.h,e.s,e.l,e.opacity);e instanceof Or||(e=J3(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(JD*r+XD*t-QD*n)/(JD+XD-QD),o=r-i,s=(Lh*(n-i)-hE*o)/s0,a=Math.sqrt(s*s+o*o)/(Lh*i*(1-i)),l=a?Math.atan2(s,o)*lae-120:NaN;return new ac(l<0?l+360:l,a,i,e.opacity)}function as(e,t,n,r){return arguments.length===1?cae(e):new ac(e,t,n,r??1)}function ac(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}o0(ac,as,uE(Dd,{brighter(e){return e=e==null?gd:Math.pow(gd,e),new ac(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?wc:Math.pow(wc,e),new ac(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*aae,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new Or(255*(t+n*(eL*r+fE*i)),255*(t+n*(hE*r+s0*i)),255*(t+n*(Lh*r)),this.opacity)}}));function uae(e,t,n,r,i){var o=e*e,s=o*e;return((1-3*e+3*o-s)*t+(4-6*o+3*s)*n+(1+3*e+3*o-3*s)*r+s*i)/6}function dae(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),i=e[r],o=e[r+1],s=r>0?e[r-1]:2*i-o,a=r<t-1?e[r+2]:2*o-i;return uae((n-r/t)*t,s,i,o,a)}}const pE=e=>()=>e;function tL(e,t){return function(n){return e+n*t}}function fae(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function hae(e,t){var n=t-e;return n?tL(e,n>180||n<-180?n-360*Math.round(n/360):n):pE(isNaN(e)?t:e)}function pae(e){return(e=+e)==1?ku:function(t,n){return n-t?fae(t,n,e):pE(isNaN(t)?n:t)}}function ku(e,t){var n=t-e;return n?tL(e,n):pE(isNaN(e)?t:e)}(function e(t){var n=pae(t);function r(i,o){var s=n((i=Nh(i)).r,(o=Nh(o)).r),a=n(i.g,o.g),l=n(i.b,o.b),c=ku(i.opacity,o.opacity);return function(u){return i.r=s(u),i.g=a(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=e,r})(1);function gae(e){return function(t){var n=t.length,r=new Array(n),i=new Array(n),o=new Array(n),s,a;for(s=0;s<n;++s)a=Nh(t[s]),r[s]=a.r||0,i[s]=a.g||0,o[s]=a.b||0;return r=e(r),i=e(i),o=e(o),a.opacity=1,function(l){return a.r=r(l),a.g=i(l),a.b=o(l),a+""}}}var mae=gae(dae);function nL(e){return function t(n){n=+n;function r(i,o){var s=e((i=as(i)).h,(o=as(o)).h),a=ku(i.s,o.s),l=ku(i.l,o.l),c=ku(i.opacity,o.opacity);return function(u){return i.h=s(u),i.s=a(u),i.l=l(Math.pow(u,n)),i.opacity=c(u),i+""}}return r.gamma=t,r}(1)}nL(hae);var gE=nL(ku);const cn=e=>mae(e[e.length-1]);var bae=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(qt);const yae=cn(bae);var vae=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(qt);const xae=cn(vae);var wae=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(qt);const Sae=cn(wae);var _ae=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(qt);const Cae=cn(_ae);var Eae=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(qt);const Rae=cn(Eae);var Pae=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(qt);const Tae=cn(Pae);var Mae=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(qt);const Oae=cn(Mae);var Dae=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(qt);const Aae=cn(Dae);var kae=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(qt);const Iae=cn(kae);var Nae=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(qt);const Lae=cn(Nae);var Fae=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(qt);const jae=cn(Fae);var $ae=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(qt);const zae=cn($ae);var Bae=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(qt);const Hae=cn(Bae);var Vae=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(qt);const Wae=cn(Vae);var Uae=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(qt);const Gae=cn(Uae);var qae=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(qt);const Yae=cn(qae);var Kae=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(qt);const Xae=cn(Kae);var Qae=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(qt);const Jae=cn(Qae);var Zae=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(qt);const ele=cn(Zae);var tle=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(qt);const nle=cn(tle);var rle=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(qt);const ile=cn(rle);var ole=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(qt);const sle=cn(ole);var ale=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(qt);const lle=cn(ale);var cle=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(qt);const ule=cn(cle);var dle=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(qt);const fle=cn(dle);var hle=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(qt);const ple=cn(hle);var gle=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(qt);const mle=cn(gle);function ble(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-e*(35.34-e*(2381.73-e*(6402.7-e*(7024.72-e*2710.57)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+e*(170.73+e*(52.82-e*(131.46-e*(176.58-e*67.37)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+e*(442.36-e*(2482.43-e*(6167.24-e*(6614.94-e*2475.67)))))))+")"}const yle=gE(as(300,.5,0),as(-240,.5,1));var vle=gE(as(-100,.75,.35),as(80,1.5,.8)),xle=gE(as(260,.75,.35),as(80,1.5,.8)),Sm=as();function wle(e){(e<0||e>1)&&(e-=Math.floor(e));var t=Math.abs(e-.5);return Sm.h=360*e-100,Sm.s=1.5-1.5*t,Sm.l=.8-.9*t,Sm+""}var _m=Nh(),Sle=Math.PI/3,_le=Math.PI*2/3;function Cle(e){var t;return e=(.5-e)*Math.PI,_m.r=255*(t=Math.sin(e))*t,_m.g=255*(t=Math.sin(e+Sle))*t,_m.b=255*(t=Math.sin(e+_le))*t,_m+""}function Ele(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+e*(1172.33-e*(10793.56-e*(33300.12-e*(38394.49-e*14825.05)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+e*(557.33+e*(1225.33-e*(3574.96-e*(1073.77+e*707.56)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+e*(3211.1-e*(15327.97-e*(27814-e*(22569.18-e*6838.66)))))))+")"}function a0(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}const Rle=a0(qt("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var Ple=a0(qt("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),Tle=a0(qt("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),Mle=a0(qt("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function Ole(e){return e}function Dle(e){if(e==null)return Ole;var t,n,r=e.scale[0],i=e.scale[1],o=e.translate[0],s=e.translate[1];return function(a,l){l||(t=n=0);var c=2,u=a.length,d=new Array(u);for(d[0]=(t+=a[0])*r+o,d[1]=(n+=a[1])*i+s;c<u;)d[c]=a[c],++c;return d}}function Ale(e,t){for(var n,r=e.length,i=r-t;i<--r;)n=e[i],e[i++]=e[r],e[r]=n}function kle(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return ZD(e,n)})}:ZD(e,t)}function ZD(e,t){var n=t.id,r=t.bbox,i=t.properties==null?{}:t.properties,o=Ile(e,t);return n==null&&r==null?{type:"Feature",properties:i,geometry:o}:r==null?{type:"Feature",id:n,properties:i,geometry:o}:{type:"Feature",id:n,bbox:r,properties:i,geometry:o}}function Ile(e,t){var n=Dle(e.transform),r=e.arcs;function i(u,d){d.length&&d.pop();for(var p=r[u<0?~u:u],h=0,m=p.length;h<m;++h)d.push(n(p[h],h));u<0&&Ale(d,m)}function o(u){return n(u)}function s(u){for(var d=[],p=0,h=u.length;p<h;++p)i(u[p],d);return d.length<2&&d.push(d[0]),d}function a(u){for(var d=s(u);d.length<4;)d.push(d[0]);return d}function l(u){return u.map(a)}function c(u){var d=u.type,p;switch(d){case"GeometryCollection":return{type:d,geometries:u.geometries.map(c)};case"Point":p=o(u.coordinates);break;case"MultiPoint":p=u.coordinates.map(o);break;case"LineString":p=s(u.arcs);break;case"MultiLineString":p=u.arcs.map(s);break;case"Polygon":p=l(u.arcs);break;case"MultiPolygon":p=u.arcs.map(l);break;default:return null}return{type:d,coordinates:p}}return c(t)}const uh={geoAzimuthalEqualArea:Nse,geoAzimuthalEquidistant:Lse,geoGnomonic:Use,geoOrthographic:qse,geoStereographic:Yse,geoEqualEarth:Wse,geoAlbers:B3,geoAlbersUsa:Ise,geoConicConformal:$se,geoConicEqualArea:Kb,geoConicEquidistant:Hse,geoEquirectangular:zse,geoMercator:Fse,geoTransverseMercator:Kse,geoNaturalEarth1:Gse};Object.keys(uh).forEach(e=>{uh[`${e.charAt(3).toLowerCase()}${e.slice(4)}`]=uh[e]});class Nc extends nl{constructor(t){super(t),this.outlineBounds=null,this.oldChartBounds=null,this.geoPath=jD()}init(t){t.position="chartArea",super.init(t),typeof t.projection=="function"?this.projection=t.projection:this.projection=(uh[t.projection]||uh.albersUsa)(),this.geoPath.projection(this.projection),this.outlineBounds=null,this.oldChartBounds=null}computeBounds(t){const n=jD(this.projection.fitWidth(1e3,t)).bounds(t),r=Math.ceil(n[1][1]-n[0][1]),i=Math.ceil(n[1][0]-n[0][0]),o=this.projection.translate();this.outlineBounds={width:i,height:r,aspectRatio:i/r,refScale:this.projection.scale(),refX:o[0],refY:o[1]}}updateBounds(){const t=this.chart.chartArea,n=this.outlineBounds;if(!n)return!1;const r=this.options.padding,i=typeof r=="number"?r:r.top,o=typeof r=="number"?r:r.left,s=typeof r=="number"?r:r.bottom,a=typeof r=="number"?r:r.right,l=t.right-t.left-o-a,c=t.bottom-t.top-i-s,u=this.oldChartBounds;this.oldChartBounds={chartWidth:l,chartHeight:c};const d=Math.min(l/n.width,c/n.height),p=n.width*d,h=n.height*d,m=(l-p)*.5+t.left+o,b=(c-h)*.5+t.top+i,v=this.options;return this.projection.scale(n.refScale*d*v.projectionScale).translate([d*n.refX+m+v.projectionOffset[0],d*n.refY+b+v.projectionOffset[1]]),!u||u.chartWidth!==this.oldChartBounds.chartWidth||u.chartHeight!==this.oldChartBounds.chartHeight}}Nc.id="projection";Nc.defaults={projection:"albersUsa",projectionScale:1,projectionOffset:[0,0],padding:0};Nc.descriptors={_scriptable:e=>e!=="projection",_indexable:e=>e!=="projectionOffset"};const l0={position:"chartArea",property:"value",grid:{z:1,drawOnChartArea:!1},ticks:{z:1},legend:{align:"right",position:"bottom-right",length:100,width:50,margin:8,indicatorWidth:10}};function Nle(e){const{indicatorWidth:t,align:n,margin:r}=e,i=(typeof r=="number"?r:r.left)+(n==="right"?t:0),o=(typeof r=="number"?r:r.top)+(n==="bottom"?t:0),s=(typeof r=="number"?r:r.right)+(n==="left"?t:0),a=(typeof r=="number"?r:r.bottom)+(n==="top"?t:0);return{left:i,top:o,right:s,bottom:a}}function Lle(e,t,n,r,i){const{indicatorWidth:o,align:s,position:a}=t,l=s==="top"||s==="bottom",c=(s==="left"?i.w:n)+(l?o:0),u=(s==="top"?i.h:r)+(l?0:o),d=Nle(t);if(typeof a=="string")switch(a){case"top-left":return[d.left,d.top];case"top":return[(e.right-c)/2,d.top];case"left":return[d.left,(e.bottom-u)/2];case"top-right":return[e.right-c-d.right,d.top];case"bottom-right":return[e.right-c-d.right,e.bottom-u-d.bottom];case"bottom":return[(e.right-c)/2,e.bottom-u-d.bottom];case"bottom-left":return[d.left,e.bottom-u-d.bottom];default:return[e.right-c-d.right,(e.bottom-u)/2]}return[a.x,a.y]}class _u extends ud{constructor(){super(...arguments),this.legendSize={w:0,h:0}}init(t){t.position="chartArea",super.init(t),this.axis="r"}parse(t,n){return t&&typeof t[this.options.property]=="number"?t[this.options.property]:super.parse(t,n)}isHorizontal(){return this.options.legend.align==="top"||this.options.legend.align==="bottom"}_getNormalizedValue(t){return t==null||Number.isNaN(t)?null:(t-this._startValue)/this._valueRange}update(t,n,r){const i=Math.min(n,this.bottom==null?Number.POSITIVE_INFINITY:this.bottom),o=Math.min(t,this.right==null?Number.POSITIVE_INFINITY:this.right),s=this.options.legend,a=this.isHorizontal(),l=(h,m)=>h<1?m*h:h,c=Math.min(o,l(a?s.length:s.width,o))-(a?0:s.indicatorWidth),u=Math.min(i,l(a?s.width:s.length,i))-(a?s.indicatorWidth:0);this.legendSize={w:c,h:u},this.bottom=u,this.height=u,this.right=c,this.width=c;const d=this.options.position;this.options.position=this.options.legend.align;const p=super.update(c,u,r);return this.options.position=d,this.height=Math.min(u,this.height),this.width=Math.min(c,this.width),p}_computeLabelArea(){}draw(t){if(!this._isVisible())return;const n=Lle(t,this.options.legend,this.width,this.height,this.legendSize),{ctx:r}=this;r.save(),r.translate(n[0],n[1]);const i=this.options.position;this.options.position=this.options.legend.align,super.draw({...t,bottom:this.height+10,right:this.width}),this.options.position=i;const{indicatorWidth:o}=this.options.legend;switch(this.options.legend.align){case"left":r.translate(this.legendSize.w,0);break;case"top":r.translate(0,this.legendSize.h);break;case"bottom":r.translate(0,-o);break;default:r.translate(-o,0);break}this._drawIndicator(),r.restore()}_drawIndicator(){}}class rL extends dd{constructor(){super(...arguments),this.legendSize={w:0,h:0}}init(t){_u.prototype.init.call(this,t)}parse(t,n){return _u.prototype.parse.call(this,t,n)}isHorizontal(){return this.options.legend.align==="top"||this.options.legend.align==="bottom"}_getNormalizedValue(t){return t==null||Number.isNaN(t)?null:(Math.log10(t)-this._startValue)/this._valueRange}update(t,n,r){return _u.prototype.update.call(this,t,n,r)}_computeLabelArea(){}draw(t){return _u.prototype.draw.call(this,t)}_drawIndicator(){}}const Vs={interpolateBlues:sle,interpolateBrBG:yae,interpolateBuGn:Lae,interpolateBuPu:jae,interpolateCividis:ble,interpolateCool:xle,interpolateCubehelixDefault:yle,interpolateGnBu:zae,interpolateGreens:lle,interpolateGreys:ule,interpolateInferno:Tle,interpolateMagma:Ple,interpolateOrRd:Hae,interpolateOranges:mle,interpolatePRGn:xae,interpolatePiYG:Sae,interpolatePlasma:Mle,interpolatePuBu:Gae,interpolatePuBuGn:Wae,interpolatePuOr:Cae,interpolatePuRd:Yae,interpolatePurples:fle,interpolateRainbow:wle,interpolateRdBu:Rae,interpolateRdGy:Tae,interpolateRdPu:Xae,interpolateRdYlBu:Oae,interpolateRdYlGn:Aae,interpolateReds:ple,interpolateSinebow:Cle,interpolateSpectral:Iae,interpolateTurbo:Ele,interpolateViridis:Rle,interpolateWarm:vle,interpolateYlGn:ele,interpolateYlGnBu:Jae,interpolateYlOrBr:nle,interpolateYlOrRd:ile};Object.keys(Vs).forEach(e=>{Vs[`${e.charAt(11).toLowerCase()}${e.slice(12)}`]=Vs[e],Vs[e.slice(11)]=Vs[e]});function iL(e,t){const n=1/t;if(e<=n)return 0;if(e>=1-n)return 1;for(let r=0;r<1;r+=n)if(e<r)return r-n/2;return e}const oL={interpolate:"blues",missing:"transparent",quantize:0};class Ya extends _u{get interpolate(){const t=this.options;return t?typeof t.interpolate=="function"?t.interpolate:Vs[t.interpolate]||Vs.blues:n=>`rgb(${n},${n},${n})`}getColorForValue(t){const n=this._getNormalizedValue(t);return n==null||Number.isNaN(n)?this.options.missing:this.getColor(n)}getColor(t){let n=t;return this.options.quantize>0&&(n=iL(n,this.options.quantize)),this.interpolate(n)}_drawIndicator(){const{indicatorWidth:t}=this.options.legend,n=this._reversePixels;if(this.isHorizontal()){const r=this.width;if(this.options.quantize>0){const i=r/this.options.quantize,o=n?s=>r-i-s:s=>s;for(let s=0;s<r;s+=i){const a=(s+i/2)/r;this.ctx.fillStyle=this.getColor(a),this.ctx.fillRect(o(s),0,i,t)}}else{const i=n?o=>r-1-o:o=>o;for(let o=0;o<r;o+=1)this.ctx.fillStyle=this.getColor((o+.5)/r),this.ctx.fillRect(i(o),0,1,t)}}else{const r=this.height;if(this.options.quantize>0){const i=r/this.options.quantize,o=n?s=>r-i-s:s=>s;for(let s=0;s<r;s+=i){const a=(s+i/2)/r;this.ctx.fillStyle=this.getColor(a),this.ctx.fillRect(0,o(s),t,i)}}else{const i=n?o=>r-1-o:o=>o;for(let o=0;o<r;o+=1)this.ctx.fillStyle=this.getColor((o+.5)/r),this.ctx.fillRect(0,i(o),t,1)}}}}Ya.id="color";Ya.defaults=cr({},[ud.defaults,l0,oL]);Ya.descriptors={_scriptable:e=>e!=="interpolate",_indexable:!1};class mE extends rL{constructor(){super(...arguments),this.interpolate=t=>`rgb(${t},${t},${t})`}init(t){super.init(t),typeof t.interpolate=="function"?this.interpolate=t.interpolate:this.interpolate=Vs[t.interpolate]||Vs.blues}getColorForValue(t){return Ya.prototype.getColorForValue.call(this,t)}getColor(t){let n=t;return this.options.quantize>0&&(n=iL(n,this.options.quantize)),this.interpolate(n)}_drawIndicator(){return Ya.prototype._drawIndicator.call(this)}}mE.id="colorLogarithmic";mE.defaults=cr({},[dd.defaults,l0,oL]);mE.descriptors={_scriptable:e=>e!=="interpolate",_indexable:!1};const sL={missing:1,mode:"area",range:[2,20],legend:{align:"bottom",length:90,width:70,indicatorWidth:42}};class Ka extends _u{constructor(){super(...arguments),this._model=null}getSizeForValue(t){const n=this._getNormalizedValue(t);return n==null||Number.isNaN(n)?this.options.missing:this.getSizeImpl(n)}getSizeImpl(t){const[n,r]=this.options.range;if(this.options.mode==="area"){const o=r*r*Math.PI,s=n*n*Math.PI,a=o-s,l=t*a+s;return Math.sqrt(l/Math.PI)}const i=r-n;return t*i+n}_drawIndicator(){const{ctx:t}=this,n=this.options.legend.indicatorWidth/2,r=this.isHorizontal(),i=this.ticks,o=this.getLabelItems(),s=o?o.map(a=>({[r?"x":"y"]:a.options.translation[r?0:1]})):i.map((a,l)=>({[r?"x":"y"]:this.getPixelForTick(l)}));if((this._gridLineItems||[]).forEach(a=>{if(t.save(),t.strokeStyle=a.color,t.lineWidth=a.width,t.setLineDash&&(t.setLineDash(a.borderDash),t.lineDashOffset=a.borderDashOffset),t.beginPath(),this.options.grid.drawTicks)switch(this.options.legend.align){case"left":t.moveTo(0,a.ty1),t.lineTo(n,a.ty2);break;case"top":t.moveTo(a.tx1,0),t.lineTo(a.tx2,n);break;case"bottom":t.moveTo(a.tx1,n),t.lineTo(a.tx2,n*2);break;default:t.moveTo(n,a.ty1),t.lineTo(n*2,a.ty2);break}t.stroke(),t.restore()}),this._model){const a=this._model;t.strokeStyle=a.borderColor,t.lineWidth=a.borderWidth||0,t.fillStyle=a.backgroundColor}else t.fillStyle="blue";i.forEach((a,l)=>{const c=s[l],u=this.getSizeForValue(a.value),d=r?c.x:n,p=r?n:c.y,h={pointStyle:"circle",borderWidth:0,...this._model||{},radius:u};kb(t,h,d,p)})}}Ka.id="size";Ka.defaults=cr({},[ud.defaults,l0,sL]);Ka.descriptors={_scriptable:!0,_indexable:e=>e!=="range"};class aL extends rL{constructor(){super(...arguments),this._model=null}getSizeForValue(t){const n=this._getNormalizedValue(t);return n==null||Number.isNaN(n)?this.options.missing:this.getSizeImpl(n)}getSizeImpl(t){return Ka.prototype.getSizeImpl.call(this,t)}_drawIndicator(){Ka.prototype._drawIndicator.call(this)}}aL.id="sizeLogarithmic";aL.defaults=cr({},[dd.defaults,l0,sL]);function Fle(e,t){return[[e[0][0]-t,e[0][1]-t],[e[1][0]+t,e[1][1]+t]]}class Zs extends ms{constructor(){super(...arguments),this.cache=void 0}inRange(t,n){const r=this.getBounds(),i=(Number.isNaN(t)||t>=r.x&&t<=r.x2)&&(Number.isNaN(n)||n>=r.y&&n<=r.y2),o=this.projectionScale.geoPath.projection();if(i&&!Number.isNaN(t)&&!Number.isNaN(n)&&typeof o.invert=="function"){const s=o.invert([t,n]);return s!=null&&fse(this.feature,s)}return i}inXRange(t){return this.inRange(t,Number.NaN)}inYRange(t){return this.inRange(Number.NaN,t)}getCenterPoint(){if(this.cache&&this.cache.center)return this.cache.center;let t;if(this.center){const n=this.projectionScale.projection([this.center.longitude,this.center.latitude]);t={x:n[0],y:n[1]}}else{const n=this.projectionScale.geoPath.centroid(this.feature);t={x:n[0],y:n[1]}}return this.cache={...this.cache||{},center:t},t}getBounds(){if(this.cache&&this.cache.bounds)return this.cache.bounds;const t=Fle(this.projectionScale.geoPath.bounds(this.feature),this.options.borderWidth/2),n={x:t[0][0],x2:t[1][0],y:t[0][1],y2:t[1][1],width:t[1][0]-t[0][0],height:t[1][1]-t[0][1]};return this.cache={...this.cache||{},bounds:n},n}_drawInCache(t){const n=this.getBounds();if(!Number.isFinite(n.x))return;const r=this.cache&&this.cache.canvas?this.cache.canvas:t.createElement("canvas"),i=Math.floor(n.x),o=Math.floor(n.y),s=Math.ceil(n.x+n.width),a=Math.ceil(n.y+n.height),l=this.pixelRatio||1,c=Math.ceil(Math.max(s-i,1)*l),u=Math.ceil(Math.max(a-o,1)*l);if(c<=0||u<=0)return;r.width=c,r.height=u;const d=r.getContext("2d");d&&(d.clearRect(0,0,r.width,r.height),d.save(),d.scale(l,l),d.translate(-i,-o),this._drawImpl(d),d.restore(),this.cache={...this.cache||{},canvas:r,canvasKey:this._optionsToKey()})}_optionsToKey(){const{options:t}=this;return`${t.backgroundColor};${t.borderColor};${t.borderWidth};${this.pixelRatio}`}_drawImpl(t){const{feature:n}=this,{options:r}=this;t.beginPath(),this.projectionScale.geoPath.context(t)(n),r.backgroundColor&&(t.fillStyle=r.backgroundColor,t.fill()),r.borderColor&&(t.strokeStyle=r.borderColor,t.lineWidth=r.borderWidth,t.stroke())}draw(t){const{feature:n}=this;if(!n)return;(!this.cache||this.cache.canvasKey!==this._optionsToKey())&&t.canvas.ownerDocument!=null&&this._drawInCache(t.canvas.ownerDocument);const r=this.getBounds();if(this.cache&&this.cache.canvas&&this.cache.canvas.width>0&&this.cache.canvas.height>0){const i=Math.floor(r.x),o=Math.floor(r.y),s=Math.ceil(r.x+r.width),a=Math.ceil(r.y+r.height),l=s-i,c=a-o;l>0&&c>0&&t.drawImage(this.cache.canvas,i,o,s-i,a-o)}else Number.isFinite(r.x)&&(t.save(),this._drawImpl(t),t.restore())}}Zs.id="geoFeature";Zs.defaults={...oc.defaults,outlineBackgroundColor:null,outlineBorderWidth:0,graticuleBorderColor:"#CCCCCC",graticuleBorderWidth:0};Zs.defaultRoutes={outlineBorderColor:"borderColor",...oc.defaultRoutes||{}};const lL={showOutline:!1,showGraticule:!1,clipMap:!0},cL={scales:{projection:{axis:"x",type:Nc.id,position:"chartArea",display:!1}}};function eA(e){const t={...e};return Object.keys(e).forEach(n=>{let r=n;if(n.startsWith("outline")){const i=n.slice(7);r=i[0].toLowerCase()+i.slice(1)}else if(n.startsWith("hoverOutline"))r=`hover${n.slice(12)}`;else return;delete t[n],t[r]=e[n]}),t}class uL extends ao{getGeoDataset(){return super.getDataset()}getGeoOptions(){return this.chart.options}getProjectionScale(){return this.getScaleForId("projection")}linkScales(){const t=this.getGeoDataset(),n=this.getMeta();n.xAxisID="projection",t.xAxisID="projection",n.yAxisID="projection",t.yAxisID="projection",n.xScale=this.getScaleForId("projection"),n.yScale=this.getScaleForId("projection"),this.getProjectionScale().computeBounds(this.resolveOutline())}showOutline(){return nt(this.getGeoDataset().showOutline,this.getGeoOptions().showOutline)}clipMap(){return nt(this.getGeoDataset().clipMap,this.getGeoOptions().clipMap)}getGraticule(){return nt(this.getGeoDataset().showGraticule,this.getGeoOptions().showGraticule)}update(t){super.update(t);const n=this.getMeta(),r=this.getProjectionScale(),i=r.updateBounds();if(this.showOutline()){const o=n.dataset;if(i&&delete o.cache,o.projectionScale=r,o.pixelRatio=this.chart.currentDevicePixelRatio,t!=="resize"){const s=eA(this.resolveDatasetElementOptions(t)),a={feature:this.resolveOutline(),options:s};this.updateElement(o,void 0,a,t),this.getGraticule()&&(n.graticule=s)}}else this.getGraticule()&&t!=="resize"&&(n.graticule=eA(this.resolveDatasetElementOptions(t)));this.updateElements(n.data,0,n.data.length,t),i&&n.data.forEach(o=>delete o.cache)}resolveOutline(){const n=this.getGeoDataset().outline||{type:"Sphere"};return Array.isArray(n)?{type:"FeatureCollection",features:n}:n}showGraticule(){const t=this.getGraticule(),n=this.getMeta().graticule;if(!t||!n)return;const{ctx:r}=this.chart,o=this.getProjectionScale().geoPath.context(r);if(r.save(),r.beginPath(),typeof t=="boolean")t&&o(hse());else{const s=E3();t.stepMajor&&s.stepMajor(t.stepMajor),t.stepMinor&&s.stepMinor(t.stepMinor),o(s())}r.strokeStyle=n.graticuleBorderColor,r.lineWidth=n.graticuleBorderWidth,r.stroke(),r.restore()}draw(){const{chart:t}=this,n=this.clipMap();let r=!1;(n===!0||n==="outline"||n==="outline+graticule")&&(r=!0,ec(t.ctx,t.chartArea)),this.showOutline()&&this.getMeta().dataset&&this.getMeta().dataset.draw.call(this.getMeta().dataset,t.ctx,t.chartArea),n===!0||n==="graticule"||n==="outline+graticule"?r||ec(t.ctx,t.chartArea):r&&(r=!1,tc(t.ctx)),this.showGraticule(),n===!0||n==="items"?r||ec(t.ctx,t.chartArea):r&&(r=!1,tc(t.ctx)),this.getMeta().data.forEach(i=>i.draw.call(i,t.ctx,t.chartArea)),r&&(r=!1,tc(t.ctx))}}function dL(e,t,n,r=[],i=[]){Gr.addControllers(n),Array.isArray(r)?Gr.addElements(...r):Gr.addElements(r),Array.isArray(i)?Gr.addScales(...i):Gr.addScales(i);const o=t;return o.type=e,o}class Ad extends uL{initialize(){super.initialize(),this.enableOptionSharing=!0}linkScales(){super.linkScales();const t=this.getGeoDataset(),n=this.getMeta();n.vAxisID="color",n.rAxisID="color",t.vAxisID="color",t.rAxisID="color",n.rScale=this.getScaleForId("color"),n.vScale=n.rScale,n.iScale=n.xScale,n.iAxisID=n.xAxisID,t.iAxisID=n.xAxisID}_getOtherScale(t){return t}parse(t,n){const r=this.getMeta().rScale,{data:i}=this.getDataset(),o=this._cachedMeta;for(let s=t;s<t+n;s+=1)o._parsed[s]={[r.axis]:r.parse(i[s],s)}}updateElements(t,n,r,i){const o=this.resolveDataElementOptions(n,i),s=this.getSharedOptions(o),a=this.includeOptions(i,s),l=this.getProjectionScale();this.updateSharedOptions(s,i,o);for(let c=n;c<n+r;c+=1){const u=t[c];u.projectionScale=l,u.feature=this._data[c].feature,u.center=this._data[c].center,u.pixelRatio=this.chart.currentDevicePixelRatio;const d=u.getCenterPoint(),p={x:d.x,y:d.y};a&&(p.options=s||this.resolveDataElementOptions(c,i)),this.updateElement(u,c,p,i)}}indexToColor(t){const n=this.getMeta().rScale;return n.getColorForValue(this.getParsed(t)[n.axis])}}Ad.id="choropleth";Ad.defaults=cr({},[lL,{datasetElementType:Zs.id,dataElementType:Zs.id}]);Ad.overrides=cr({},[cL,{plugins:{tooltip:{callbacks:{title(){return""},label(e){var t,n,r,i;return e.formattedValue==null?(n=(t=e.chart.data)===null||t===void 0?void 0:t.labels)===null||n===void 0?void 0:n[e.dataIndex]:`${(i=(r=e.chart.data)===null||r===void 0?void 0:r.labels)===null||i===void 0?void 0:i[e.dataIndex]}: ${e.formattedValue}`}}},colors:{enabled:!1}},scales:{color:{type:Ya.id,axis:"x"}},elements:{geoFeature:{backgroundColor(e){return e.dataIndex==null?null:e.chart.getDatasetMeta(e.datasetIndex).controller.indexToColor(e.dataIndex)}}}}]);class jle extends Mn{constructor(t,n){super(t,dL("choropleth",n,Ad,Zs,[Ya,Nc]))}}jle.id=Ad.id;class kd extends uL{initialize(){super.initialize(),this.enableOptionSharing=!0}linkScales(){super.linkScales();const t=this.getGeoDataset(),n=this.getMeta();n.vAxisID="size",n.rAxisID="size",t.vAxisID="size",t.rAxisID="size",n.rScale=this.getScaleForId("size"),n.vScale=n.rScale,n.iScale=n.xScale,n.iAxisID=n.xAxisID,t.iAxisID=n.xAxisID}_getOtherScale(t){return t}parse(t,n){const r=this.getMeta().rScale,i=this.getDataset().data,o=this._cachedMeta;for(let s=t;s<t+n;s+=1){const a=i[s];o._parsed[s]={x:a.longitude==null?a.x:a.longitude,y:a.latitude==null?a.y:a.latitude,[r.axis]:r.parse(a,s)}}}updateElements(t,n,r,i){const o=i==="reset",s=this.resolveDataElementOptions(n,i),a=this.getSharedOptions(s),l=this.includeOptions(i,a),c=this.getProjectionScale();this.getMeta().rScale._model=s,this.updateSharedOptions(a,i,s);for(let u=n;u<n+r;u+=1){const d=t[u],p=this.getParsed(u),h=c.projection([p.x,p.y]),m={x:h?h[0]:0,y:h?h[1]:0,skip:Number.isNaN(p.x)||Number.isNaN(p.y)};l&&(m.options=a||this.resolveDataElementOptions(u,i),o&&(m.options.radius=0)),this.updateElement(d,u,m,i)}}indexToRadius(t){const n=this.getMeta().rScale;return n.getSizeForValue(this.getParsed(t)[n.axis])}}kd.id="bubbleMap";kd.defaults=cr({},[lL,{dataElementType:ic.id,datasetElementType:Zs.id,showOutline:!0,clipMap:"outline+graticule"}]);kd.overrides=cr({},[cL,{plugins:{tooltip:{callbacks:{title(){return""},label(e){var t,n,r,i;return e.formattedValue==null?(n=(t=e.chart.data)===null||t===void 0?void 0:t.labels)===null||n===void 0?void 0:n[e.dataIndex]:`${(i=(r=e.chart.data)===null||r===void 0?void 0:r.labels)===null||i===void 0?void 0:i[e.dataIndex]}: ${e.formattedValue}`}}}},scales:{size:{axis:"x",type:Ka.id}},elements:{point:{radius(e){return e.dataIndex==null?null:e.chart.getDatasetMeta(e.datasetIndex).controller.indexToRadius(e.dataIndex)},hoverRadius(e){return e.dataIndex==null?null:e.chart.getDatasetMeta(e.datasetIndex).controller.indexToRadius(e.dataIndex)+1}}}}]);class $le extends Mn{constructor(t,n){super(t,dL("bubbleMap",n,kd,Zs,[Ka,Nc]))}}$le.id=kd.id;function zle(e){var n;return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{display:!0},y:{display:!0}},plugins:{...(n=e==null?void 0:e.options)==null?void 0:n.plugins,legend:{position:"bottom",align:"center"}}}}}function Ble(e){var n;return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{beginAtZero:!0,stack:1,reverse:!0},y:{stacked:!0,beginAtZero:!0}},plugins:{...(n=e==null?void 0:e.options)==null?void 0:n.plugins,legend:{position:"bottom",align:"center"}}}}}function Hle(e){var n;return{...e,type:"bar",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}},plugins:{...(n=e==null?void 0:e.options)==null?void 0:n.plugins,legend:{position:"bottom",align:"center"}}}}}function Vle(e,t=!1){var r;return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{display:!0,beginAtZero:!1},y:{display:!0,stacked:t}},plugins:{...(r=e==null?void 0:e.options)==null?void 0:r.plugins,legend:{position:"bottom",align:"center"}}}}}function Wle(e,t){var r,i,o,s,a;return{...e,type:t==="stackedBar"?"bar":"line",options:{...e==null?void 0:e.options,scales:{x:{...(i=(r=e==null?void 0:e.options)==null?void 0:r.scales)==null?void 0:i.x,display:!0,stacked:!0},y:{...(s=(o=e==null?void 0:e.options)==null?void 0:o.scales)==null?void 0:s.y,display:!0,stacked:t==="stackedBar"}},plugins:{...(a=e==null?void 0:e.options)==null?void 0:a.plugins,legend:{position:"bottom",align:"center"}}}}}function Ule(e){var n;return{...e,type:"line",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}},plugins:{...(n=e==null?void 0:e.options)==null?void 0:n.plugins,legend:{position:"bottom",align:"center"}}}}}function Gle(e,t){var r;return{...t,type:e,options:{...t==null?void 0:t.options,scales:{x:{display:!1},y:{display:!1}},plugins:{...(r=t==null?void 0:t.options)==null?void 0:r.plugins,legend:{position:"bottom",align:"center",maxHeight:0,labels:{useBorderRadius:!0,borderRadius:2}}},borderRadius:0}}}function qle(e){var r,i;const t=ye.getState().theme;let n={...e,type:"radar",options:{...e==null?void 0:e.options,scales:{x:{display:!1},y:{display:!1},r:{grid:{display:!0},angleLines:{},ticks:{}}},plugins:{...(r=e==null?void 0:e.options)==null?void 0:r.plugins,legend:{position:"bottom",align:"center"}}}};return t==="dark"&&(n={...n,options:{...n.options,scales:{...(i=n==null?void 0:n.options)==null?void 0:i.scales,r:{grid:{color:Ft.slate[800]},angleLines:{color:Ft.slate[800]},ticks:{color:Ft.slate[800],showLabelBackdrop:!1}}}}}),n}function bE({data:e,cardType:t="bar",cfg:n,customCfg:r,provider:i="chartjs",userSettings:o,preferences:s,topoJson:a}){var l,c,u,d,p,h,m,b,v,x;if(t==="map"){if(!a)return null;const S=(l=s==null?void 0:s.mapVisualOptions)==null?void 0:l.objectKey;if(!S)return null;const _=kle(a,(c=a==null?void 0:a.objects)==null?void 0:c[S]).features;if(!_)return null;const E={plugins:{datalabels:{display:!1}},scales:{x:{display:!1,grid:{display:!1}},y:{display:!1,grid:{display:!1}},projection:{axis:"x",projection:((u=s==null?void 0:s.mapVisualOptions)==null?void 0:u.projection)||"mercator",projectionScale:((d=s==null?void 0:s.mapVisualOptions)==null?void 0:d.projectionScale)||1,projectionOffset:((p=s==null?void 0:s.mapVisualOptions)==null?void 0:p.projectionOffset)||[0,0]},color:{axis:"x",interpolate:((h=s==null?void 0:s.mapVisualOptions)==null?void 0:h.colorScale)||"blues",quantize:5,legend:{position:"bottom-right",align:"right"}}}},{keys:C}=sr(e),M=_.map($=>{var U;const X=C==null?void 0:C[0],V=C==null?void 0:C[1],L=(U=e.find(B=>(B==null?void 0:B[X])===$.properties.NAME||(B==null?void 0:B[X])===$.properties.name))==null?void 0:U[V];return{feature:$,value:L}}),k=zf([{label:S,data:M,borderColor:"lightgray"}],r),N={type:"choropleth",data:{labels:_.map($=>$.properties.NAME||$.properties.name),datasets:k},options:E},{options:F}=m4({cfg:N,preferences:s,customCfg:r});return{...N,options:F}}if(t==="bar"){const S=Hle(n);return xl({data:e,cfg:S,customCfg:r,cardType:t,userSettings:o,provider:i,preferences:s})}if(t==="horizontalBar"){const S=zle(n);return xl({data:e,cfg:S,customCfg:r,cardType:t,userSettings:o,provider:i,preferences:s})}if(t==="pyramid"){const S=Ble(n),{dimensionKeys:_,metricKeys:E}=sr(e),C=Tb({dataArray:e,groupKey:_[0],pivotKey:_[1],valueKey:E[0]}),M=xl({data:C,cfg:S,customCfg:r,cardType:t,userSettings:o,provider:i,preferences:s}),O="x2";return{...M,data:{...M.data,datasets:M.data.datasets.map((N,F)=>F===1?{...N,xAxisID:O}:N)},options:{...M.options,scales:{...(m=M==null?void 0:M.options)==null?void 0:m.scales,[O]:{beginAtZero:!0,stack:1}}}}}if(t==="stackedBar"||t==="stackedLine"){const S=Wle(n,t),{dimensionKeys:_,metricKeys:E}=sr(e),C=Tb({dataArray:e,groupKey:_[0],pivotKey:_[1],valueKey:E[0],sortChart:s==null?void 0:s.sortChart});return xl({data:C,cfg:S,customCfg:r,cardType:t,userSettings:o,provider:i,preferences:s})}if(t==="line"){const S=Ule(n);return xl({data:e,cfg:S,customCfg:r,cardType:t,userSettings:o,provider:i,preferences:s})}if(t==="range"){const S=Vle(n),_=wee(e),E=zf(_,r),{plugins:C,options:M}=tS((s==null?void 0:s.customVisualCode)||""),O=Oi(S==null?void 0:S.options,(n==null?void 0:n.options)||{}),k=Oi(O,(s==null?void 0:s.chartOptions)||{}),N=Oi(k,(r==null?void 0:r.options)||{}),F=Oi(N,M),j=g4(n,s),$=Oi(F,j),X={...$,plugins:{...$==null?void 0:$.plugins,datalabels:{...(b=$==null?void 0:$.plugins)==null?void 0:b.datalabels,formatter:(W,q)=>W.map(Y=>{var G,D,ee,K;return Qs({number:Number(Y),decimalPlaces:((G=s==null?void 0:s.numberAxisFormat)==null?void 0:G.decimalPlaces)||0,useSuffix:!!((D=s==null?void 0:s.numberAxisFormat)!=null&&D.suffix),customSuffix:"",locale:((ee=s==null?void 0:s.numberAxisFormat)==null?void 0:ee.locale)||"",currency:((K=s==null?void 0:s.numberAxisFormat)==null?void 0:K.currency)||""})}).slice(0,2).join(" - ")}}},{dimensionKeys:V}=sr(e),L=V[0];return{type:"bar",data:{labels:[...new Set(Zw(e,L))],datasets:E},options:X,plugins:[...C]}}if(t==="pie"||t==="doughnut"||t==="polarArea"){const S=Gle(t,n),{dimensionKeys:_,metricKeys:E}=sr(e),C=See(E,e),M=zf(C,r),{plugins:O,options:k}=tS((s==null?void 0:s.customVisualCode)||""),N=_[0],F=Zw(e,N),j=Oi(S==null?void 0:S.options,(r==null?void 0:r.options)||{}),$=Oi(j,(s==null?void 0:s.chartOptions)||{});({...$,plugins:{...$.plugins,datalabels:{...(v=$.plugins)==null?void 0:v.datalabels},tooltip:{...(x=$.plugins)==null?void 0:x.tooltip}}});const X=Oi($,k);return{type:t,data:{labels:F,datasets:M},options:X,plugins:[t==="doughnut"?{id:"doughnutLabel",beforeDatasetsDraw:function(U,B,W){var J,Z,ae,ce;const{ctx:q,data:A}=U;q.save();const Y=U.getDatasetMeta(0).data[0].x,G=U.getDatasetMeta(0).data[0].y,D=nd(_h()),ee=window.getComputedStyle(q.canvas).fontFamily;q.font=`1em ${ee}`,q.fontWeight="bolder",q.fillStyle=D,q.textAlign="center",q.textBaseline="middle";const K=A.datasets[0].data.reduce((pe,ie)=>pe+ie,0),oe=Qs({number:Number(K),decimalPlaces:((J=s==null?void 0:s.numberAxisFormat)==null?void 0:J.decimalPlaces)||0,useSuffix:!!((Z=s==null?void 0:s.numberAxisFormat)!=null&&Z.suffix),customSuffix:"",locale:((ae=s==null?void 0:s.numberAxisFormat)==null?void 0:ae.locale)||"",currency:((ce=s==null?void 0:s.numberAxisFormat)==null?void 0:ce.currency)||""});q.fillText(oe,Y,G)}}:"",...O]}}if(t==="radar"){const S=qle(n);return xl({data:e,cfg:S,customCfg:r,cardType:t,userSettings:o,provider:i,preferences:s})}if(t==="bubble"||t==="scatter"){const{metricKeys:S}=sr(e);if(S.length<3){console.log("Bubble charts require 3 numeric columns");return}const _=xee(e),E=zf(_,r),C={plugins:{datalabels:{display:!0}},scales:{x:{title:{display:!0,text:S[0]},beginAtZero:!0,ticks:{precision:0}},y:{title:{display:!0,text:S[1]},beginAtZero:!0,ticks:{precision:0}}}},M=Oi(C,(r==null?void 0:r.options)||{});return{type:t,data:{datasets:E},options:M}}return xl({data:e,cfg:n,customCfg:r,cardType:t,userSettings:o,provider:i,preferences:s})}function Yle({chart:e,elementIndex:t,datasetIndex:n,cardType:r,cfg:i,apply:o}){const s=ye.getState().theme;if(!i)return;const a=s==="dark"?"rgb(238,238,238,0.2)":"rgb(238,238,238,0.8)";["bar","line","horizontalBar","bubble","scatter"].includes(r)&&Xle(e,t,i,o,a),["pie","doughnut","polarArea"].includes(r)&&Qle(e,t,i,o,a),["stackedBar","pyramid"].includes(r)&&Kle({chart:e,elementIndex:t,datasetIndex:n,cfg:i,apply:o,blurColor:a})}function Kle(e){var a,l,c,u;const{chart:t,elementIndex:n,datasetIndex:r,cfg:i,apply:o,blurColor:s}=e;o?(l=(a=t==null?void 0:t.data)==null?void 0:a.datasets)==null||l.forEach((d,p)=>{var h,m;typeof d.backgroundColor=="string"&&(d.backgroundColor=new Array(d.data.length).fill(d.backgroundColor),d.borderColor=new Array(d.data.length).fill(d.borderColor)),d.backgroundColor=(h=d==null?void 0:d.backgroundColor)==null?void 0:h.map((b,v)=>v===n&&p===r?b:s),d.borderColor=(m=d==null?void 0:d.borderColor)==null?void 0:m.map((b,v)=>v===n&&p===r?b:s)}):(u=(c=t==null?void 0:t.data)==null?void 0:c.datasets)==null||u.forEach((d,p)=>{var h,m,b,v,x,S;d.backgroundColor=new Array(d.data.length).fill((b=(m=(h=i==null?void 0:i.data)==null?void 0:h.datasets)==null?void 0:m[p])==null?void 0:b.backgroundColor),d.borderColor=new Array(d.data.length).fill((S=(x=(v=i==null?void 0:i.data)==null?void 0:v.datasets)==null?void 0:x[p])==null?void 0:S.borderColor)}),t==null||t.update()}function Xle(e,t,n,r,i){var o,s,a,l;r?(s=(o=e==null?void 0:e.data)==null?void 0:o.datasets)==null||s.forEach(c=>{var u,d;typeof c.backgroundColor=="string"&&(c.backgroundColor=new Array(c.data.length).fill(c.backgroundColor),c.borderColor=new Array(c.data.length).fill(c.borderColor)),c.backgroundColor=(u=c==null?void 0:c.backgroundColor)==null?void 0:u.map((p,h)=>h===t?p:i),c.borderColor=(d=c==null?void 0:c.borderColor)==null?void 0:d.map((p,h)=>h===t?p:i)}):(l=(a=e==null?void 0:e.data)==null?void 0:a.datasets)==null||l.forEach((c,u)=>{var d,p,h,m,b,v;c.backgroundColor=new Array(c.data.length).fill((h=(p=(d=n==null?void 0:n.data)==null?void 0:d.datasets)==null?void 0:p[u])==null?void 0:h.backgroundColor),c.borderColor=new Array(c.data.length).fill((v=(b=(m=n==null?void 0:n.data)==null?void 0:m.datasets)==null?void 0:b[u])==null?void 0:v.borderColor)}),e==null||e.update()}function Qle(e,t,n,r,i){var o,s,a,l;r?(s=(o=e==null?void 0:e.data)==null?void 0:o.datasets)==null||s.forEach(c=>{var u,d;c.backgroundColor=(u=c==null?void 0:c.backgroundColor)==null?void 0:u.map((p,h)=>h===t?p:i),c.borderColor=(d=c==null?void 0:c.borderColor)==null?void 0:d.map((p,h)=>h===t?p:i)}):(l=(a=e==null?void 0:e.data)==null?void 0:a.datasets)==null||l.forEach((c,u)=>{var d,p,h,m,b,v,x,S;typeof c.backgroundColor=="string"&&(c.backgroundColor=(h=(p=(d=n==null?void 0:n.data)==null?void 0:d.datasets)==null?void 0:p[u])==null?void 0:h.backgroundColor,c.borderColor=(v=(b=(m=n==null?void 0:n.data)==null?void 0:m.datasets)==null?void 0:b[u])==null?void 0:v.borderColor),c.backgroundColor=(x=c==null?void 0:c.backgroundColor)==null?void 0:x.map((_,E)=>{var C;return(C=n.data.datasets[u].backgroundColor)==null?void 0:C[E]}),c.borderColor=(S=c==null?void 0:c.borderColor)==null?void 0:S.map((_,E)=>{var C;return(C=n.data.datasets[u].borderColor)==null?void 0:C[E]})}),e==null||e.update()}function Jle({card:e,data:t,datasetIndex:n,clickIndex:r,value:i}){var o,s,a,l,c,u;try{if(!t)return;const{keys:d,dimensionKeys:p,metricKeys:h}=sr(t);if(e.type==="map"){const m=d[0],b=((s=(o=i==null?void 0:i.feature)==null?void 0:o.properties)==null?void 0:s.name)||((l=(a=i==null?void 0:i.feature)==null?void 0:a.properties)==null?void 0:l.NAME);return[{columnName:m,columnValue:b}]}if(["bar","horizontalBar","line","pie","doughnut","radar","polarArea"].includes(e.type)){const m=p[0],b=(c=t[r])==null?void 0:c[m];return[{columnName:m,columnValue:b,metric:h[n],value:i}]}if(["stackedBar","pyramid"].includes(e.type)){const m=Tb({dataArray:t,groupKey:p[0],pivotKey:p[1],valueKey:h[0]}),b=p[0],v=(u=m[r])==null?void 0:u[b],x=p[1],{metricKeys:S}=sr(m),_=S[n];return[{columnName:b,columnValue:v,metric:h[0],value:i},{columnName:x,columnValue:_,metric:h[0],value:i}]}if(e.type==="bubble"||e.type==="scatter"){const m=p[0],b=i.label;return[{columnName:m,columnValue:b,metric1:h[0],value1:i.x,metric2:h[1],value2:i.y,metric3:h==null?void 0:h[2],value3:i==null?void 0:i.r}]}}catch(d){console.error("Error in getAdhocFilter",d)}}function Zle(e,t){var r,i;if((((r=e.data.datasets)==null?void 0:r.filter(o=>!!o.fill))||[]).length>0){const o=(i=e==null?void 0:e.data.datasets)==null?void 0:i.map(a=>({...a,backgroundColor:[a.backgroundColor].map(l=>{const c=t.createLinearGradient(0,0,0,400);return c.addColorStop(0,l),c.addColorStop(.7,Hee("--semaphor-background")),c})}));return{...e,data:{...e.data,datasets:o}}}return e}function fL(e){var a,l,c,u,d,p;const t=(((l=(a=e.preferences)==null?void 0:a.mapVisualOptions)==null?void 0:l.topoJsonUrl)==="custom"?(u=(c=e.preferences)==null?void 0:c.mapVisualOptions)==null?void 0:u.customTopoJsonUrl:(p=(d=e.preferences)==null?void 0:d.mapVisualOptions)==null?void 0:p.topoJsonUrl)||"",n=!!t&&e.type==="map",{data:r,isLoading:i,isFetching:o,isError:s}=xp({queryKey:["topojson",t],queryFn:()=>fetch(t).then(h=>h.json()),enabled:n,staleTime:1/0});return{data:r,isLoading:i,isFetching:o,isError:s}}function ece(e){var s,a;const[t]=P.useState({id:"",title:"",type:"bar"}),{getCard:n}=Hn(),r=n(e),i=hL(r||t),o={...r,data:((s=i==null?void 0:i.data)==null?void 0:s.records)||[]};return{...i,data:((a=i==null?void 0:i.data)==null?void 0:a.records)||[],card:o}}function hL(e){var X,V,L,U;const{onChartElementClicked:t}=Vi(),[n,r]=P.useState(0);((X=e==null?void 0:e.preferences)==null?void 0:X.filterOnClickColumnIndex)===void 0||(V=e.preferences)==null||V.filterOnClickColumnIndex;const i=ye(B=>B.isVisualEditing),o=ye(B=>B.filteringCards),s=ye(B=>B.selectedSheetId),a=ye(B=>B.selectedLensId);ye(B=>B.selectedCardId),ye(B=>B.dashboard),ye(B=>B.isDashboardEditing),ye(B=>B.themeStyle);const l=ye(B=>B.filterValues),c=P.useRef(l),u=(L=e==null?void 0:e.preferences)==null?void 0:L.onClickFilter,{addFilteringCard:d,getCardFrame:p,addOrUpdateFilterValues:h,removeFilterValues:m,removeFilteringCard:b}=Hn(),{data:v,isLoading:x,isFetching:S,isError:_,queryKey:E}=Wa(e),{data:C}=fL(e),M=o==null?void 0:o.find(B=>B.id===e.id),O=p(e.id),k=(O==null?void 0:O.cards)||[],N=(k==null?void 0:k.length)==1;let F;v&&v.records&&((U=v.records)==null?void 0:U.length)>0&&e.type!=="custom"&&(F=bE({data:v==null?void 0:v.records,cardType:e.type,cfg:e.cfg,customCfg:e.customCfg,preferences:e.preferences,topoJson:C}));const j=P.useRef({filteringCards:o});P.useEffect(()=>{!(v!=null&&v.records)||x||S||M&&N||i||r(B=>B+1)},[v==null?void 0:v.records,x,S,M,N,i]),P.useEffect(()=>{e.connectionId&&!M&&(c.current=l)},[l,a,e.connectionId,M]),P.useEffect(()=>{var W;M&&(j.current.filteringCards=[...o||[]]),!M&&((W=j.current.filteringCards)==null?void 0:W.find(q=>q.id===e.id))&&N&&r(q=>q+1)},[M,N,e.id,o]);function $(B,W,q,A){var D;let Y=!1;if(!(v!=null&&v.records))return;const G=Jle({card:e,data:v==null?void 0:v.records,datasetIndex:W,clickIndex:q,value:A});if(console.log("fieldValues",G),t==null||t(e,G),!!(((D=e==null?void 0:e.preferences)==null?void 0:D.onClickFilter)??[]).length){if(M){const ee=e.id;m(ee),b(e)}else{if(Y=!0,!G)return;const ee=[];G.forEach((K,oe)=>{const J=u==null?void 0:u.find(ae=>ae.columnIndex===oe);if(!J)return;const Z={filterId:e.id+"-"+K.columnName+"-"+s,connectionId:e==null?void 0:e.connectionId,tableName:e.lastSelectedTable,name:K.columnName,expression:J.expression,valueType:Oy(G[J.columnIndex].columnValue),operation:"=",values:[G[J.columnIndex].columnValue]};ee.push(Z)}),h(ee),d(e)}Yle({chart:B,elementIndex:q,datasetIndex:W,cardType:e.type,cfg:F,apply:Y})}}return{isError:_,isLoading:x,isFetching:S,data:v,visualKey:n,handleDatapointClick:$,cfg:F,queryKey:E}}function rs({children:e,containerClassName:t,className:n,text:r,onSave:i,type:o="input"}){const[s,a]=P.useState(!1),[l,c]=P.useState(r),u=ye(h=>h.isDashboardEditing),d=h=>{h.stopPropagation(),u&&a(!0)};function p(){return o==="textarea"?y.jsx("textarea",{className:be("grow rounded-sm bg-background px-2 py-1 text-sm outline-dashed outline-[0.5px] outline-primary/50",n),onChange:h=>c(h.target.value),value:l,autoFocus:!0,onBlur:()=>a(!1),onKeyDown:h=>{h.stopPropagation(),!(h.key==="Enter"&&h.shiftKey)&&(h.key==="Enter"||h.key==="Tab")&&(a(!1),i(l))}}):y.jsx("input",{onMouseDown:h=>h.stopPropagation(),type:"text",className:be("rounded-sm bg-background px-2 py-1 text-sm outline-dashed outline-[0.5px] outline-primary/50",n),onChange:h=>c(h.target.value),value:l,autoFocus:!0,onBlur:()=>a(!1),onKeyDown:h=>{h.stopPropagation(),(h.key==="Enter"||h.key==="Tab")&&(a(!1),i(l))}})}return y.jsx("div",{className:be("flex",t),role:"editable",onDoubleClick:d,children:s?p():e})}function pL(e){const{authToken:t}=Vi(),n=VK(t==null?void 0:t.accessToken);function r(){var o,s,a,l,c,u;if((s=(o=e.preferences)==null?void 0:o.formatNumber)!=null&&s.currency&&((l=(a=e.preferences)==null?void 0:a.formatNumber)==null?void 0:l.currency)!=="none")return n!=null&&n.currency?n==null?void 0:n.currency:(u=(c=e.preferences)==null?void 0:c.formatNumber)==null?void 0:u.currency}function i(){var o,s,a,l,c,u;if((s=(o=e.preferences)==null?void 0:o.formatNumber)!=null&&s.locale&&((l=(a=e.preferences)==null?void 0:a.formatNumber)==null?void 0:l.locale)!=="none")return n!=null&&n.locale?n==null?void 0:n.locale:(u=(c=e.preferences)==null?void 0:c.formatNumber)==null?void 0:u.locale}return{getCurrency:r,getLocale:i}}function Zb({card:e,data:t}){var S,_,E,C,M,O,k,N,F,j,$,X,V,L,U,B;const n=ye(W=>W.actions.setCardTitle),r=ye(W=>W.actions.setCardDescription),i=ye(W=>W.isVisualEditing),o=Ur(W=>W.card),s=Ur(W=>W.actions.setCard);Ur(W=>W.actions.setNumberFormat);const{getCurrency:a,getLocale:l}=pL(e),c=ye(W=>W.selectedSheetId),u=(_=(S=e.preferences)==null?void 0:S.formatNumber)==null?void 0:_.colorRanges,{metricKeys:d}=sr(t),p=(E=t==null?void 0:t[0])==null?void 0:E[d==null?void 0:d[0]],h=(C=t==null?void 0:t[0])==null?void 0:C[d==null?void 0:d[1]],m=t&&t.length>0;function b(W){i?s({...o,title:W}):n(c,e.id,W)}function v(W){i?s({...o,description:W}):r(c,e.id,W)}const x=h&&h-p!==0?(p-h)/h:null;return y.jsxs("div",{className:"kpi-card flex grow flex-col overflow-auto",children:[y.jsxs(Ay,{className:"grow pb-3",children:[y.jsx(rs,{text:i?o.title:e.title,onSave:b,children:y.jsx("div",{className:"flex items-center gap-2",children:y.jsx(Rd,{className:"text-base font-medium text-muted-foreground",children:e.title})})}),m&&y.jsxs("div",{className:"flex flex-wrap items-end gap-3 text-foreground",children:[y.jsx("p",{style:{color:zC(p,u)},className:"text-3xl font-semibold",children:Qs({number:p,decimalPlaces:((O=(M=e.preferences)==null?void 0:M.formatNumber)==null?void 0:O.decimalPlaces)||0,useSuffix:!!((N=(k=e.preferences)==null?void 0:k.formatNumber)!=null&&N.suffix),customSuffix:((j=(F=e.preferences)==null?void 0:F.formatNumber)==null?void 0:j.suffix)||"",locale:l()||"",currency:a()||""})}),h&&y.jsxs("span",{className:"min-w-fit text-base font-normal text-muted-foreground",children:["from ",Qs({number:h,decimalPlaces:((X=($=e.preferences)==null?void 0:$.formatNumber)==null?void 0:X.decimalPlaces)||0,useSuffix:!!((L=(V=e.preferences)==null?void 0:V.formatNumber)!=null&&L.suffix),customSuffix:((B=(U=e.preferences)==null?void 0:U.formatNumber)==null?void 0:B.suffix)||"",locale:l()||"",currency:a()||""})]})]})]}),x&&y.jsxs(ky,{className:"grow items-start gap-1 pb-4 text-sm",children:[y.jsx(gL,{children:x}),y.jsxs("div",{className:"flex gap-1 text-muted-foreground",children:[x>0?"up ":"down ",y.jsx(rs,{text:e.description||"",onSave:v,children:e.description})]})]})]})}function gL({children:e,className:t}){var o,s;const n=ye(a=>a.themeStyle),r=e>0?y.jsx("span",{children:"+"}):y.jsx("span",{children:"-"}),i=`${Math.abs(e*100).toFixed(0)}%`;return y.jsxs("div",{style:{borderRadius:(s=(o=n==null?void 0:n.chart)==null?void 0:o.options)==null?void 0:s.borderRadius},className:be("flex items-center px-1 text-sm font-semibold",{"bg-green-600/10 text-green-600":e>0,"bg-destructive/10 text-destructive":e<0},t),children:[r,y.jsx("span",{className:"ml-[1px]",children:i})]})}const tce=["top","right","bottom","left"],ea=Math.min,Pr=Math.max,Fh=Math.round,Cm=Math.floor,is=e=>({x:e,y:e}),nce={left:"right",right:"left",bottom:"top",top:"bottom"},rce={start:"end",end:"start"};function kS(e,t,n){return Pr(e,ea(t,n))}function ls(e,t){return typeof e=="function"?e(t):e}function ta(e){return e.split("-")[0]}function Id(e){return e.split("-")[1]}function yE(e){return e==="x"?"y":"x"}function vE(e){return e==="y"?"height":"width"}function Xa(e){return["top","bottom"].includes(ta(e))?"y":"x"}function xE(e){return yE(Xa(e))}function ice(e,t,n){n===void 0&&(n=!1);const r=Id(e),i=xE(e),o=vE(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=ey(s)),[s,ey(s)]}function oce(e){const t=ey(e);return[IS(e),t,IS(t)]}function IS(e){return e.replace(/start|end/g,t=>rce[t])}function sce(e,t,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?o:s;default:return[]}}function ace(e,t,n,r){const i=Id(e);let o=sce(ta(e),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),t&&(o=o.concat(o.map(IS)))),o}function ey(e){return e.replace(/left|right|bottom|top/g,t=>nce[t])}function lce(e){return{top:0,right:0,bottom:0,left:0,...e}}function mL(e){return typeof e!="number"?lce(e):{top:e,right:e,bottom:e,left:e}}function ty(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function tA(e,t,n){let{reference:r,floating:i}=e;const o=Xa(t),s=xE(t),a=vE(s),l=ta(t),c=o==="y",u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,p=r[a]/2-i[a]/2;let h;switch(l){case"top":h={x:u,y:r.y-i.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-i.width,y:d};break;default:h={x:r.x,y:r.y}}switch(Id(t)){case"start":h[s]-=p*(n&&c?-1:1);break;case"end":h[s]+=p*(n&&c?-1:1);break}return h}const cce=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=tA(c,r,l),p=r,h={},m=0;for(let b=0;b<a.length;b++){const{name:v,fn:x}=a[b],{x:S,y:_,data:E,reset:C}=await x({x:u,y:d,initialPlacement:r,placement:p,strategy:i,middlewareData:h,rects:c,platform:s,elements:{reference:e,floating:t}});u=S??u,d=_??d,h={...h,[v]:{...h[v],...E}},C&&m<=50&&(m++,typeof C=="object"&&(C.placement&&(p=C.placement),C.rects&&(c=C.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):C.rects),{x:u,y:d}=tA(c,p,l)),b=-1)}return{x:u,y:d,placement:p,strategy:i,middlewareData:h}};async function md(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:h=0}=ls(t,e),m=mL(h),v=a[p?d==="floating"?"reference":"floating":d],x=ty(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(v)))==null||n?v:v.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),S=d==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,_=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),E=await(o.isElement==null?void 0:o.isElement(_))?await(o.getScale==null?void 0:o.getScale(_))||{x:1,y:1}:{x:1,y:1},C=ty(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:S,offsetParent:_,strategy:l}):S);return{top:(x.top-C.top+m.top)/E.y,bottom:(C.bottom-x.bottom+m.bottom)/E.y,left:(x.left-C.left+m.left)/E.x,right:(C.right-x.right+m.right)/E.x}}const uce=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=ls(e,t)||{};if(c==null)return{};const d=mL(u),p={x:n,y:r},h=xE(i),m=vE(h),b=await s.getDimensions(c),v=h==="y",x=v?"top":"left",S=v?"bottom":"right",_=v?"clientHeight":"clientWidth",E=o.reference[m]+o.reference[h]-p[h]-o.floating[m],C=p[h]-o.reference[h],M=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let O=M?M[_]:0;(!O||!await(s.isElement==null?void 0:s.isElement(M)))&&(O=a.floating[_]||o.floating[m]);const k=E/2-C/2,N=O/2-b[m]/2-1,F=ea(d[x],N),j=ea(d[S],N),$=F,X=O-b[m]-j,V=O/2-b[m]/2+k,L=kS($,V,X),U=!l.arrow&&Id(i)!=null&&V!==L&&o.reference[m]/2-(V<$?F:j)-b[m]/2<0,B=U?V<$?V-$:V-X:0;return{[h]:p[h]+B,data:{[h]:L,centerOffset:V-L-B,...U&&{alignmentOffset:B}},reset:U}}}),dce=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:b=!0,...v}=ls(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const x=ta(i),S=Xa(a),_=ta(a)===a,E=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=p||(_||!b?[ey(a)]:oce(a)),M=m!=="none";!p&&M&&C.push(...ace(a,b,m,E));const O=[a,...C],k=await md(t,v),N=[];let F=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&N.push(k[x]),d){const V=ice(i,s,E);N.push(k[V[0]],k[V[1]])}if(F=[...F,{placement:i,overflows:N}],!N.every(V=>V<=0)){var j,$;const V=(((j=o.flip)==null?void 0:j.index)||0)+1,L=O[V];if(L)return{data:{index:V,overflows:F},reset:{placement:L}};let U=($=F.filter(B=>B.overflows[0]<=0).sort((B,W)=>B.overflows[1]-W.overflows[1])[0])==null?void 0:$.placement;if(!U)switch(h){case"bestFit":{var X;const B=(X=F.filter(W=>{if(M){const q=Xa(W.placement);return q===S||q==="y"}return!0}).map(W=>[W.placement,W.overflows.filter(q=>q>0).reduce((q,A)=>q+A,0)]).sort((W,q)=>W[1]-q[1])[0])==null?void 0:X[0];B&&(U=B);break}case"initialPlacement":U=a;break}if(i!==U)return{reset:{placement:U}}}return{}}}};function nA(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function rA(e){return tce.some(t=>e[t]>=0)}const fce=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=ls(e,t);switch(r){case"referenceHidden":{const o=await md(t,{...i,elementContext:"reference"}),s=nA(o,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:rA(s)}}}case"escaped":{const o=await md(t,{...i,altBoundary:!0}),s=nA(o,n.floating);return{data:{escapedOffsets:s,escaped:rA(s)}}}default:return{}}}}};async function hce(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=ta(n),a=Id(n),l=Xa(n)==="y",c=["left","top"].includes(s)?-1:1,u=o&&l?-1:1,d=ls(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof m=="number"&&(h=a==="end"?m*-1:m),l?{x:h*u,y:p*c}:{x:p*c,y:h*u}}const pce=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:s,middlewareData:a}=t,l=await hce(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:s}}}}},gce=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:v=>{let{x,y:S}=v;return{x,y:S}}},...l}=ls(e,t),c={x:n,y:r},u=await md(t,l),d=Xa(ta(i)),p=yE(d);let h=c[p],m=c[d];if(o){const v=p==="y"?"top":"left",x=p==="y"?"bottom":"right",S=h+u[v],_=h-u[x];h=kS(S,h,_)}if(s){const v=d==="y"?"top":"left",x=d==="y"?"bottom":"right",S=m+u[v],_=m-u[x];m=kS(S,m,_)}const b=a.fn({...t,[p]:h,[d]:m});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[p]:o,[d]:s}}}}}},mce=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=ls(e,t),u={x:n,y:r},d=Xa(i),p=yE(d);let h=u[p],m=u[d];const b=ls(a,t),v=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(l){const _=p==="y"?"height":"width",E=o.reference[p]-o.floating[_]+v.mainAxis,C=o.reference[p]+o.reference[_]-v.mainAxis;h<E?h=E:h>C&&(h=C)}if(c){var x,S;const _=p==="y"?"width":"height",E=["top","left"].includes(ta(i)),C=o.reference[d]-o.floating[_]+(E&&((x=s.offset)==null?void 0:x[d])||0)+(E?0:v.crossAxis),M=o.reference[d]+o.reference[_]+(E?0:((S=s.offset)==null?void 0:S[d])||0)-(E?v.crossAxis:0);m<C?m=C:m>M&&(m=M)}return{[p]:h,[d]:m}}}},bce=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:s,elements:a}=t,{apply:l=()=>{},...c}=ls(e,t),u=await md(t,c),d=ta(i),p=Id(i),h=Xa(i)==="y",{width:m,height:b}=o.floating;let v,x;d==="top"||d==="bottom"?(v=d,x=p===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(x=d,v=p==="end"?"top":"bottom");const S=b-u.top-u.bottom,_=m-u.left-u.right,E=ea(b-u[v],S),C=ea(m-u[x],_),M=!t.middlewareData.shift;let O=E,k=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(k=_),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(O=S),M&&!p){const F=Pr(u.left,0),j=Pr(u.right,0),$=Pr(u.top,0),X=Pr(u.bottom,0);h?k=m-2*(F!==0||j!==0?F+j:Pr(u.left,u.right)):O=b-2*($!==0||X!==0?$+X:Pr(u.top,u.bottom))}await l({...t,availableWidth:k,availableHeight:O});const N=await s.getDimensions(a.floating);return m!==N.width||b!==N.height?{reset:{rects:!0}}:{}}}};function c0(){return typeof window<"u"}function Nd(e){return bL(e)?(e.nodeName||"").toLowerCase():"#document"}function Fi(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function bs(e){var t;return(t=(bL(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function bL(e){return c0()?e instanceof Node||e instanceof Fi(e).Node:!1}function Dr(e){return c0()?e instanceof Element||e instanceof Fi(e).Element:!1}function cs(e){return c0()?e instanceof HTMLElement||e instanceof Fi(e).HTMLElement:!1}function iA(e){return!c0()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Fi(e).ShadowRoot}function Tp(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Do(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function yce(e){return["table","td","th"].includes(Nd(e))}function u0(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function wE(e){const t=SE(),n=Dr(e)?Do(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function vce(e){let t=Qa(e);for(;cs(t)&&!bd(t);){if(wE(t))return t;if(u0(t))return null;t=Qa(t)}return null}function SE(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function bd(e){return["html","body","#document"].includes(Nd(e))}function Do(e){return Fi(e).getComputedStyle(e)}function d0(e){return Dr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Qa(e){if(Nd(e)==="html")return e;const t=e.assignedSlot||e.parentNode||iA(e)&&e.host||bs(e);return iA(t)?t.host:t}function yL(e){const t=Qa(e);return bd(t)?e.ownerDocument?e.ownerDocument.body:e.body:cs(t)&&Tp(t)?t:yL(t)}function jh(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=yL(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=Fi(i);if(o){const a=NS(s);return t.concat(s,s.visualViewport||[],Tp(i)?i:[],a&&n?jh(a):[])}return t.concat(i,jh(i,[],n))}function NS(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function vL(e){const t=Do(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=cs(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=Fh(n)!==o||Fh(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function _E(e){return Dr(e)?e:e.contextElement}function Iu(e){const t=_E(e);if(!cs(t))return is(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=vL(t);let s=(o?Fh(n.width):n.width)/r,a=(o?Fh(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const xce=is(0);function xL(e){const t=Fi(e);return!SE()||!t.visualViewport?xce:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function wce(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Fi(e)?!1:t}function Sc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=_E(e);let s=is(1);t&&(r?Dr(r)&&(s=Iu(r)):s=Iu(e));const a=wce(o,n,r)?xL(o):is(0);let l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,u=i.width/s.x,d=i.height/s.y;if(o){const p=Fi(o),h=r&&Dr(r)?Fi(r):r;let m=p,b=NS(m);for(;b&&r&&h!==m;){const v=Iu(b),x=b.getBoundingClientRect(),S=Do(b),_=x.left+(b.clientLeft+parseFloat(S.paddingLeft))*v.x,E=x.top+(b.clientTop+parseFloat(S.paddingTop))*v.y;l*=v.x,c*=v.y,u*=v.x,d*=v.y,l+=_,c+=E,m=Fi(b),b=NS(m)}}return ty({width:u,height:d,x:l,y:c})}function CE(e,t){const n=d0(e).scrollLeft;return t?t.left+n:Sc(bs(e)).left+n}function wL(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-(n?0:CE(e,r)),o=r.top+t.scrollTop;return{x:i,y:o}}function Sce(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",s=bs(r),a=t?u0(t.floating):!1;if(r===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},c=is(1);const u=is(0),d=cs(r);if((d||!d&&!o)&&((Nd(r)!=="body"||Tp(s))&&(l=d0(r)),cs(r))){const h=Sc(r);c=Iu(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const p=s&&!d&&!o?wL(s,l,!0):is(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+p.x,y:n.y*c.y-l.scrollTop*c.y+u.y+p.y}}function _ce(e){return Array.from(e.getClientRects())}function Cce(e){const t=bs(e),n=d0(e),r=e.ownerDocument.body,i=Pr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Pr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+CE(e);const a=-n.scrollTop;return Do(r).direction==="rtl"&&(s+=Pr(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}function Ece(e,t){const n=Fi(e),r=bs(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;const c=SE();(!c||c&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a,y:l}}function Rce(e,t){const n=Sc(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=cs(e)?Iu(e):is(1),s=e.clientWidth*o.x,a=e.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:s,height:a,x:l,y:c}}function oA(e,t,n){let r;if(t==="viewport")r=Ece(e,n);else if(t==="document")r=Cce(bs(e));else if(Dr(t))r=Rce(t,n);else{const i=xL(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return ty(r)}function SL(e,t){const n=Qa(e);return n===t||!Dr(n)||bd(n)?!1:Do(n).position==="fixed"||SL(n,t)}function Pce(e,t){const n=t.get(e);if(n)return n;let r=jh(e,[],!1).filter(a=>Dr(a)&&Nd(a)!=="body"),i=null;const o=Do(e).position==="fixed";let s=o?Qa(e):e;for(;Dr(s)&&!bd(s);){const a=Do(s),l=wE(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Tp(s)&&!l&&SL(e,s))?r=r.filter(u=>u!==s):i=a,s=Qa(s)}return t.set(e,r),r}function Tce(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?u0(t)?[]:Pce(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const d=oA(t,u,i);return c.top=Pr(d.top,c.top),c.right=ea(d.right,c.right),c.bottom=ea(d.bottom,c.bottom),c.left=Pr(d.left,c.left),c},oA(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Mce(e){const{width:t,height:n}=vL(e);return{width:t,height:n}}function Oce(e,t,n){const r=cs(t),i=bs(t),o=n==="fixed",s=Sc(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=is(0);if(r||!r&&!o)if((Nd(t)!=="body"||Tp(i))&&(a=d0(t)),r){const p=Sc(t,!0,o,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else i&&(l.x=CE(i));const c=i&&!r&&!o?wL(i,a):is(0),u=s.left+a.scrollLeft-l.x-c.x,d=s.top+a.scrollTop-l.y-c.y;return{x:u,y:d,width:s.width,height:s.height}}function n1(e){return Do(e).position==="static"}function sA(e,t){if(!cs(e)||Do(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return bs(e)===n&&(n=n.ownerDocument.body),n}function _L(e,t){const n=Fi(e);if(u0(e))return n;if(!cs(e)){let i=Qa(e);for(;i&&!bd(i);){if(Dr(i)&&!n1(i))return i;i=Qa(i)}return n}let r=sA(e,t);for(;r&&yce(r)&&n1(r);)r=sA(r,t);return r&&bd(r)&&n1(r)&&!wE(r)?n:r||vce(e)||n}const Dce=async function(e){const t=this.getOffsetParent||_L,n=this.getDimensions,r=await n(e.floating);return{reference:Oce(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ace(e){return Do(e).direction==="rtl"}const kce={convertOffsetParentRelativeRectToViewportRelativeRect:Sce,getDocumentElement:bs,getClippingRect:Tce,getOffsetParent:_L,getElementRects:Dce,getClientRects:_ce,getDimensions:Mce,getScale:Iu,isElement:Dr,isRTL:Ace};function CL(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ice(e,t){let n=null,r;const i=bs(e);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const c=e.getBoundingClientRect(),{left:u,top:d,width:p,height:h}=c;if(a||t(),!p||!h)return;const m=Cm(d),b=Cm(i.clientWidth-(u+p)),v=Cm(i.clientHeight-(d+h)),x=Cm(u),_={rootMargin:-m+"px "+-b+"px "+-v+"px "+-x+"px",threshold:Pr(0,ea(1,l))||1};let E=!0;function C(M){const O=M[0].intersectionRatio;if(O!==l){if(!E)return s();O?s(!1,O):r=setTimeout(()=>{s(!1,1e-7)},1e3)}O===1&&!CL(c,e.getBoundingClientRect())&&s(),E=!1}try{n=new IntersectionObserver(C,{..._,root:i.ownerDocument})}catch{n=new IntersectionObserver(C,_)}n.observe(e)}return s(!0),o}function EL(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=_E(e),u=i||o?[...c?jh(c):[],...jh(t)]:[];u.forEach(x=>{i&&x.addEventListener("scroll",n,{passive:!0}),o&&x.addEventListener("resize",n)});const d=c&&a?Ice(c,n):null;let p=-1,h=null;s&&(h=new ResizeObserver(x=>{let[S]=x;S&&S.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var _;(_=h)==null||_.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let m,b=l?Sc(e):null;l&&v();function v(){const x=Sc(e);b&&!CL(b,x)&&n(),b=x,m=requestAnimationFrame(v)}return n(),()=>{var x;u.forEach(S=>{i&&S.removeEventListener("scroll",n),o&&S.removeEventListener("resize",n)}),d==null||d(),(x=h)==null||x.disconnect(),h=null,l&&cancelAnimationFrame(m)}}const r1=md,Nce=pce,Lce=gce,Fce=dce,jce=bce,$ce=fce,aA=uce,zce=mce,Bce=(e,t,n)=>{const r=new Map,i={platform:kce,...n},o={...i.platform,_c:r};return cce(e,t,{...i,platform:o})};var cb=typeof document<"u"?P.useLayoutEffect:P.useEffect;function ny(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ny(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!ny(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function RL(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function lA(e,t){const n=RL(e);return Math.round(t*n)/n}function i1(e){const t=R.useRef(e);return cb(()=>{t.current=e}),t}function PL(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,d]=R.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=R.useState(r);ny(p,r)||h(r);const[m,b]=R.useState(null),[v,x]=R.useState(null),S=R.useCallback(W=>{W!==M.current&&(M.current=W,b(W))},[]),_=R.useCallback(W=>{W!==O.current&&(O.current=W,x(W))},[]),E=o||m,C=s||v,M=R.useRef(null),O=R.useRef(null),k=R.useRef(u),N=l!=null,F=i1(l),j=i1(i),$=i1(c),X=R.useCallback(()=>{if(!M.current||!O.current)return;const W={placement:t,strategy:n,middleware:p};j.current&&(W.platform=j.current),Bce(M.current,O.current,W).then(q=>{const A={...q,isPositioned:$.current!==!1};V.current&&!ny(k.current,A)&&(k.current=A,hc.flushSync(()=>{d(A)}))})},[p,t,n,j,$]);cb(()=>{c===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,d(W=>({...W,isPositioned:!1})))},[c]);const V=R.useRef(!1);cb(()=>(V.current=!0,()=>{V.current=!1}),[]),cb(()=>{if(E&&(M.current=E),C&&(O.current=C),E&&C){if(F.current)return F.current(E,C,X);X()}},[E,C,X,F,N]);const L=R.useMemo(()=>({reference:M,floating:O,setReference:S,setFloating:_}),[S,_]),U=R.useMemo(()=>({reference:E,floating:C}),[E,C]),B=R.useMemo(()=>{const W={position:n,left:0,top:0};if(!U.floating)return W;const q=lA(U.floating,u.x),A=lA(U.floating,u.y);return a?{...W,transform:"translate("+q+"px, "+A+"px)",...RL(U.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:q,top:A}},[n,a,U.floating,u.x,u.y]);return R.useMemo(()=>({...u,update:X,refs:L,elements:U,floatingStyles:B}),[u,X,L,U,B])}const Hce=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?aA({element:r.current,padding:i}).fn(n):{}:r?aA({element:r,padding:i}).fn(n):{}}}},EE=(e,t)=>({...Nce(e),options:[e,t]}),TL=(e,t)=>({...Lce(e),options:[e,t]}),Vce=(e,t)=>({...zce(e),options:[e,t]}),ML=(e,t)=>({...Fce(e),options:[e,t]}),OL=(e,t)=>({...jce(e),options:[e,t]}),Wce=(e,t)=>({...$ce(e),options:[e,t]}),Uce=(e,t)=>({...Hce(e),options:[e,t]});var Gce="Arrow",DL=R.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return y.jsx(Ne.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:y.jsx("polygon",{points:"0,0 30,0 15,10"})})});DL.displayName=Gce;var qce=DL;function f0(e){const[t,n]=R.useState(void 0);return mr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let s,a;if("borderBoxSize"in o){const l=o.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var RE="Popper",[AL,ys]=tr(RE),[Yce,kL]=AL(RE),IL=e=>{const{__scopePopper:t,children:n}=e,[r,i]=R.useState(null);return y.jsx(Yce,{scope:t,anchor:r,onAnchorChange:i,children:n})};IL.displayName=RE;var NL="PopperAnchor",LL=R.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=kL(NL,n),s=R.useRef(null),a=rt(t,s);return R.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:y.jsx(Ne.div,{...i,ref:a})});LL.displayName=NL;var PE="PopperContent",[Kce,Xce]=AL(PE),FL=R.forwardRef((e,t)=>{var J,Z,ae,ce,pe,ie;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:m,...b}=e,v=kL(PE,n),[x,S]=R.useState(null),_=rt(t,ge=>S(ge)),[E,C]=R.useState(null),M=f0(E),O=(M==null?void 0:M.width)??0,k=(M==null?void 0:M.height)??0,N=r+(o!=="center"?"-"+o:""),F=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},j=Array.isArray(c)?c:[c],$=j.length>0,X={padding:F,boundary:j.filter(Jce),altBoundary:$},{refs:V,floatingStyles:L,placement:U,isPositioned:B,middlewareData:W}=PL({strategy:"fixed",placement:N,whileElementsMounted:(...ge)=>EL(...ge,{animationFrame:h==="always"}),elements:{reference:v.anchor},middleware:[EE({mainAxis:i+k,alignmentAxis:s}),l&&TL({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?Vce():void 0,...X}),l&&ML({...X}),OL({...X,apply:({elements:ge,rects:de,availableWidth:Ee,availableHeight:De})=>{const{width:$e,height:Te}=de.reference,ze=ge.floating.style;ze.setProperty("--radix-popper-available-width",`${Ee}px`),ze.setProperty("--radix-popper-available-height",`${De}px`),ze.setProperty("--radix-popper-anchor-width",`${$e}px`),ze.setProperty("--radix-popper-anchor-height",`${Te}px`)}}),E&&Uce({element:E,padding:a}),Zce({arrowWidth:O,arrowHeight:k}),p&&Wce({strategy:"referenceHidden",...X})]}),[q,A]=zL(U),Y=er(m);mr(()=>{B&&(Y==null||Y())},[B,Y]);const G=(J=W.arrow)==null?void 0:J.x,D=(Z=W.arrow)==null?void 0:Z.y,ee=((ae=W.arrow)==null?void 0:ae.centerOffset)!==0,[K,oe]=R.useState();return mr(()=>{x&&oe(window.getComputedStyle(x).zIndex)},[x]),y.jsx("div",{ref:V.setFloating,"data-radix-popper-content-wrapper":"",style:{...L,transform:B?L.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[(ce=W.transformOrigin)==null?void 0:ce.x,(pe=W.transformOrigin)==null?void 0:pe.y].join(" "),...((ie=W.hide)==null?void 0:ie.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:y.jsx(Kce,{scope:n,placedSide:q,onArrowChange:C,arrowX:G,arrowY:D,shouldHideArrow:ee,children:y.jsx(Ne.div,{"data-side":q,"data-align":A,...b,ref:_,style:{...b.style,animation:B?void 0:"none"}})})})});FL.displayName=PE;var jL="PopperArrow",Qce={top:"bottom",right:"left",bottom:"top",left:"right"},$L=R.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=Xce(jL,r),s=Qce[o.placedSide];return y.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:y.jsx(qce,{...i,ref:n,style:{...i.style,display:"block"}})})});$L.displayName=jL;function Jce(e){return e!==null}var Zce=e=>({name:"transformOrigin",options:e,fn(t){var v,x,S;const{placement:n,rects:r,middlewareData:i}=t,s=((v=i.arrow)==null?void 0:v.centerOffset)!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[c,u]=zL(n),d={start:"0%",center:"50%",end:"100%"}[u],p=(((x=i.arrow)==null?void 0:x.x)??0)+a/2,h=(((S=i.arrow)==null?void 0:S.y)??0)+l/2;let m="",b="";return c==="bottom"?(m=s?d:`${p}px`,b=`${-l}px`):c==="top"?(m=s?d:`${p}px`,b=`${r.floating.height+l}px`):c==="right"?(m=`${-l}px`,b=s?d:`${h}px`):c==="left"&&(m=`${r.floating.width+l}px`,b=s?d:`${h}px`),{data:{x:m,y:b}}}});function zL(e){const[t,n="center"]=e.split("-");return[t,n]}var Mp=IL,Ld=LL,Op=FL,Dp=$L,eue="Portal",Ap=R.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[i,o]=R.useState(!1);mr(()=>o(!0),[]);const s=n||i&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?Tr.createPortal(y.jsx(Ne.div,{...r,ref:t}),s):null});Ap.displayName=eue;function tue(e,t=globalThis==null?void 0:globalThis.document){const n=er(e);R.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var nue="DismissableLayer",LS="dismissableLayer.update",rue="dismissableLayer.pointerDownOutside",iue="dismissableLayer.focusOutside",cA,BL=R.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Lc=R.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,onDismiss:a,...l}=e,c=R.useContext(BL),[u,d]=R.useState(null),p=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=R.useState({}),m=rt(t,O=>d(O)),b=Array.from(c.layers),[v]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),x=b.indexOf(v),S=u?b.indexOf(u):-1,_=c.layersWithOutsidePointerEventsDisabled.size>0,E=S>=x,C=aue(O=>{const k=O.target,N=[...c.branches].some(F=>F.contains(k));!E||N||(i==null||i(O),s==null||s(O),O.defaultPrevented||a==null||a())},p),M=lue(O=>{const k=O.target;[...c.branches].some(F=>F.contains(k))||(o==null||o(O),s==null||s(O),O.defaultPrevented||a==null||a())},p);return tue(O=>{S===c.layers.size-1&&(r==null||r(O),!O.defaultPrevented&&a&&(O.preventDefault(),a()))},p),R.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(cA=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),uA(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=cA)}},[u,p,n,c]),R.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),uA())},[u,c]),R.useEffect(()=>{const O=()=>h({});return document.addEventListener(LS,O),()=>document.removeEventListener(LS,O)},[]),y.jsx(Ne.div,{...l,ref:m,style:{pointerEvents:_?E?"auto":"none":void 0,...e.style},onFocusCapture:Re(e.onFocusCapture,M.onFocusCapture),onBlurCapture:Re(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:Re(e.onPointerDownCapture,C.onPointerDownCapture)})});Lc.displayName=nue;var oue="DismissableLayerBranch",sue=R.forwardRef((e,t)=>{const n=R.useContext(BL),r=R.useRef(null),i=rt(t,r);return R.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),y.jsx(Ne.div,{...e,ref:i})});sue.displayName=oue;function aue(e,t=globalThis==null?void 0:globalThis.document){const n=er(e),r=R.useRef(!1),i=R.useRef(()=>{});return R.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let l=function(){HL(rue,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=l,t.addEventListener("click",i.current,{once:!0})):l()}else t.removeEventListener("click",i.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function lue(e,t=globalThis==null?void 0:globalThis.document){const n=er(e),r=R.useRef(!1);return R.useEffect(()=>{const i=o=>{o.target&&!r.current&&HL(iue,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function uA(){const e=new CustomEvent(LS);document.dispatchEvent(e)}function HL(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?AN(i,o):i.dispatchEvent(o)}var o1,TE="HoverCard",[VL,nMe]=tr(TE,[ys]),h0=ys(),[cue,ME]=VL(TE),WL=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:i,onOpenChange:o,openDelay:s=700,closeDelay:a=300}=e,l=h0(t),c=R.useRef(0),u=R.useRef(0),d=R.useRef(!1),p=R.useRef(!1),[h=!1,m]=Ar({prop:r,defaultProp:i,onChange:o}),b=R.useCallback(()=>{clearTimeout(u.current),c.current=window.setTimeout(()=>m(!0),s)},[s,m]),v=R.useCallback(()=>{clearTimeout(c.current),!d.current&&!p.current&&(u.current=window.setTimeout(()=>m(!1),a))},[a,m]),x=R.useCallback(()=>m(!1),[m]);return R.useEffect(()=>()=>{clearTimeout(c.current),clearTimeout(u.current)},[]),y.jsx(cue,{scope:t,open:h,onOpenChange:m,onOpen:b,onClose:v,onDismiss:x,hasSelectionRef:d,isPointerDownOnContentRef:p,children:y.jsx(Mp,{...l,children:n})})};WL.displayName=TE;var UL="HoverCardTrigger",GL=R.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,i=ME(UL,n),o=h0(n);return y.jsx(Ld,{asChild:!0,...o,children:y.jsx(Ne.a,{"data-state":i.open?"open":"closed",...r,ref:t,onPointerEnter:Re(e.onPointerEnter,iy(i.onOpen)),onPointerLeave:Re(e.onPointerLeave,iy(i.onClose)),onFocus:Re(e.onFocus,i.onOpen),onBlur:Re(e.onBlur,i.onClose),onTouchStart:Re(e.onTouchStart,s=>s.preventDefault())})})});GL.displayName=UL;var uue="HoverCardPortal",[rMe,due]=VL(uue,{forceMount:void 0}),ry="HoverCardContent",qL=R.forwardRef((e,t)=>{const n=due(ry,e.__scopeHoverCard),{forceMount:r=n.forceMount,...i}=e,o=ME(ry,e.__scopeHoverCard);return y.jsx(Yn,{present:r||o.open,children:y.jsx(fue,{"data-state":o.open?"open":"closed",...i,onPointerEnter:Re(e.onPointerEnter,iy(o.onOpen)),onPointerLeave:Re(e.onPointerLeave,iy(o.onClose)),ref:t})})});qL.displayName=ry;var fue=R.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,...a}=e,l=ME(ry,n),c=h0(n),u=R.useRef(null),d=rt(t,u),[p,h]=R.useState(!1);return R.useEffect(()=>{if(p){const m=document.body;return o1=m.style.userSelect||m.style.webkitUserSelect,m.style.userSelect="none",m.style.webkitUserSelect="none",()=>{m.style.userSelect=o1,m.style.webkitUserSelect=o1}}},[p]),R.useEffect(()=>{if(u.current){const m=()=>{h(!1),l.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var v;((v=document.getSelection())==null?void 0:v.toString())!==""&&(l.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",m),()=>{document.removeEventListener("pointerup",m),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!1}}},[l.isPointerDownOnContentRef,l.hasSelectionRef]),R.useEffect(()=>{u.current&&gue(u.current).forEach(b=>b.setAttribute("tabindex","-1"))}),y.jsx(Lc,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:s,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:Re(o,m=>{m.preventDefault()}),onDismiss:l.onDismiss,children:y.jsx(Op,{...c,...a,onPointerDown:Re(a.onPointerDown,m=>{m.currentTarget.contains(m.target)&&h(!0),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!0}),ref:d,style:{...a.style,userSelect:p?"text":void 0,WebkitUserSelect:p?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),hue="HoverCardArrow",pue=R.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,i=h0(n);return y.jsx(Dp,{...i,...r,ref:t})});pue.displayName=hue;function iy(e){return t=>t.pointerType==="touch"?void 0:e()}function gue(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}var mue=WL,bue=GL,YL=qL;const Fd=mue,jd=bue,Fc=R.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},i)=>y.jsx(YL,{ref:i,align:t,sideOffset:n,className:be("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));Fc.displayName=YL.displayName;function KL({card:e}){const{setCardInfo:t}=Hn();return y.jsxs(Fd,{openDelay:0,children:[y.jsx(jd,{children:y.jsx(e4,{className:"size-4 text-muted-foreground/40"})}),y.jsx(Fc,{align:"start",className:"w-[300px]",onMouseDown:n=>n.stopPropagation(),children:y.jsx(rs,{type:"textarea",text:e.info||"",onSave:n=>t(e.id,n),children:y.jsx("p",{className:"text-sm text-muted-foreground",children:e.info||"Double-click to add info"})})})]})}function yue({card:e,renderFilterInfo:t}){var m,b,v,x,S,_,E,C,M,O,k,N,F,j,$,X;ye(V=>V.themeStyle);const{data:n,isLoading:r}=Wa(e),i=(n==null?void 0:n.records)||[],o=ye(V=>V.isDashboardEditing),{getCurrency:s,getLocale:a}=pL(e),l=(b=(m=e.preferences)==null?void 0:m.formatNumber)==null?void 0:b.colorRanges,{metricKeys:c}=sr(i),u=(v=i==null?void 0:i[0])==null?void 0:v[c==null?void 0:c[0]],d=(x=i==null?void 0:i[0])==null?void 0:x[c==null?void 0:c[1]],p=(i==null?void 0:i.length)>0,h=d&&d-u!==0?(u-d)/d:null;return y.jsx("div",{className:"flex min-w-fit grow flex-col overflow-auto",children:y.jsxs("div",{className:"grow",children:[p?y.jsx("div",{className:"",children:y.jsxs("div",{className:be("flex items-end gap-1.5",{"animate-pulse":r}),children:[y.jsx("p",{style:{color:zC(u,l)},className:"text-3xl font-semibold",children:Qs({number:u,decimalPlaces:((_=(S=e.preferences)==null?void 0:S.formatNumber)==null?void 0:_.decimalPlaces)||0,useSuffix:!!((C=(E=e.preferences)==null?void 0:E.formatNumber)!=null&&C.suffix),customSuffix:((O=(M=e.preferences)==null?void 0:M.formatNumber)==null?void 0:O.suffix)||"",locale:a()||"",currency:s()||""})}),h&&y.jsxs("div",{className:"flex items-end gap-1",children:[y.jsx(gL,{className:"",children:h}),d&&y.jsx("div",{className:"ml-0.5 mr-1 min-w-fit text-sm font-normal text-muted-foreground",children:`from ${Qs({number:d,decimalPlaces:((N=(k=e.preferences)==null?void 0:k.formatNumber)==null?void 0:N.decimalPlaces)||0,useSuffix:!!((j=(F=e.preferences)==null?void 0:F.formatNumber)!=null&&j.suffix),customSuffix:((X=($=e.preferences)==null?void 0:$.formatNumber)==null?void 0:X.suffix)||"",locale:a()||"",currency:s()||""})}`})]})]})}):y.jsx("div",{className:"flex h-9 items-center justify-center"}),y.jsxs("div",{className:"flex items-center gap-3",children:[y.jsxs(Rd,{className:"flex items-center gap-2 text-base font-medium text-muted-foreground",children:[e.title,(o||e.info)&&y.jsx(KL,{card:e})]}),t==null?void 0:t()]})]})})}var vue="VisuallyHidden",OE=R.forwardRef((e,t)=>y.jsx(Ne.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));OE.displayName=vue;var xue=OE,[p0,iMe]=tr("Tooltip",[ys]),g0=ys(),XL="TooltipProvider",wue=700,FS="tooltip.open",[Sue,DE]=p0(XL),QL=e=>{const{__scopeTooltip:t,delayDuration:n=wue,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,[s,a]=R.useState(!0),l=R.useRef(!1),c=R.useRef(0);return R.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),y.jsx(Sue,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:R.useCallback(()=>{window.clearTimeout(c.current),a(!1)},[]),onClose:R.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:R.useCallback(u=>{l.current=u},[]),disableHoverableContent:i,children:o})};QL.displayName=XL;var m0="Tooltip",[_ue,b0]=p0(m0),JL=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i=!1,onOpenChange:o,disableHoverableContent:s,delayDuration:a}=e,l=DE(m0,e.__scopeTooltip),c=g0(t),[u,d]=R.useState(null),p=qn(),h=R.useRef(0),m=s??l.disableHoverableContent,b=a??l.delayDuration,v=R.useRef(!1),[x=!1,S]=Ar({prop:r,defaultProp:i,onChange:O=>{O?(l.onOpen(),document.dispatchEvent(new CustomEvent(FS))):l.onClose(),o==null||o(O)}}),_=R.useMemo(()=>x?v.current?"delayed-open":"instant-open":"closed",[x]),E=R.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,S(!0)},[S]),C=R.useCallback(()=>{window.clearTimeout(h.current),h.current=0,S(!1)},[S]),M=R.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,S(!0),h.current=0},b)},[b,S]);return R.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),y.jsx(Mp,{...c,children:y.jsx(_ue,{scope:t,contentId:p,open:x,stateAttribute:_,trigger:u,onTriggerChange:d,onTriggerEnter:R.useCallback(()=>{l.isOpenDelayed?M():E()},[l.isOpenDelayed,M,E]),onTriggerLeave:R.useCallback(()=>{m?C():(window.clearTimeout(h.current),h.current=0)},[C,m]),onOpen:E,onClose:C,disableHoverableContent:m,children:n})})};JL.displayName=m0;var jS="TooltipTrigger",AE=R.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=b0(jS,n),o=DE(jS,n),s=g0(n),a=R.useRef(null),l=rt(t,a,i.onTriggerChange),c=R.useRef(!1),u=R.useRef(!1),d=R.useCallback(()=>c.current=!1,[]);return R.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),y.jsx(Ld,{asChild:!0,...s,children:y.jsx(Ne.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:l,onPointerMove:Re(e.onPointerMove,p=>{p.pointerType!=="touch"&&!u.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:Re(e.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:Re(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Re(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:Re(e.onBlur,i.onClose),onClick:Re(e.onClick,i.onClose)})})});AE.displayName=jS;var Cue="TooltipPortal",[oMe,Eue]=p0(Cue,{forceMount:void 0}),yd="TooltipContent",ZL=R.forwardRef((e,t)=>{const n=Eue(yd,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,s=b0(yd,e.__scopeTooltip);return y.jsx(Yn,{present:r||s.open,children:s.disableHoverableContent?y.jsx(e6,{side:i,...o,ref:t}):y.jsx(Rue,{side:i,...o,ref:t})})}),Rue=R.forwardRef((e,t)=>{const n=b0(yd,e.__scopeTooltip),r=DE(yd,e.__scopeTooltip),i=R.useRef(null),o=rt(t,i),[s,a]=R.useState(null),{trigger:l,onClose:c}=n,u=i.current,{onPointerInTransitChange:d}=r,p=R.useCallback(()=>{a(null),d(!1)},[d]),h=R.useCallback((m,b)=>{const v=m.currentTarget,x={x:m.clientX,y:m.clientY},S=Oue(x,v.getBoundingClientRect()),_=Due(x,S),E=Aue(b.getBoundingClientRect()),C=Iue([..._,...E]);a(C),d(!0)},[d]);return R.useEffect(()=>()=>p(),[p]),R.useEffect(()=>{if(l&&u){const m=v=>h(v,u),b=v=>h(v,l);return l.addEventListener("pointerleave",m),u.addEventListener("pointerleave",b),()=>{l.removeEventListener("pointerleave",m),u.removeEventListener("pointerleave",b)}}},[l,u,h,p]),R.useEffect(()=>{if(s){const m=b=>{const v=b.target,x={x:b.clientX,y:b.clientY},S=(l==null?void 0:l.contains(v))||(u==null?void 0:u.contains(v)),_=!kue(x,s);S?p():_&&(p(),c())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[l,u,s,c,p]),y.jsx(e6,{...e,ref:o})}),[Pue,Tue]=p0(m0,{isInside:!1}),e6=R.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:s,...a}=e,l=b0(yd,n),c=g0(n),{onClose:u}=l;return R.useEffect(()=>(document.addEventListener(FS,u),()=>document.removeEventListener(FS,u)),[u]),R.useEffect(()=>{if(l.trigger){const d=p=>{const h=p.target;h!=null&&h.contains(l.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,u]),y.jsx(Lc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:y.jsxs(Op,{"data-state":l.stateAttribute,...c,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[y.jsx(iC,{children:r}),y.jsx(Pue,{scope:n,isInside:!0,children:y.jsx(xue,{id:l.contentId,role:"tooltip",children:i||r})})]})})});ZL.displayName=yd;var t6="TooltipArrow",Mue=R.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=g0(n);return Tue(t6,n).isInside?null:y.jsx(Dp,{...i,...r,ref:t})});Mue.displayName=t6;function Oue(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Due(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Aue(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function kue(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,s=t.length-1;o<t.length;s=o++){const a=t[o].x,l=t[o].y,c=t[s].x,u=t[s].y;l>r!=u>r&&n<(c-a)*(r-l)/(u-l)+a&&(i=!i)}return i}function Iue(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Nue(t)}function Nue(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const o=t[t.length-1],s=t[t.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const o=n[n.length-1],s=n[n.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Lue=QL,Fue=JL,jue=AE,n6=ZL;const $ue=Lue,r6=Fue,i6=jue,kE=R.forwardRef(({className:e,sideOffset:t=4,...n},r)=>y.jsx(n6,{ref:r,sideOffset:t,className:be("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));kE.displayName=n6.displayName;/*! @license DOMPurify 3.2.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.3/LICENSE */const{entries:o6,setPrototypeOf:dA,isFrozen:zue,getPrototypeOf:Bue,getOwnPropertyDescriptor:Hue}=Object;let{freeze:Xr,seal:uo,create:s6}=Object,{apply:$S,construct:zS}=typeof Reflect<"u"&&Reflect;Xr||(Xr=function(t){return t});uo||(uo=function(t){return t});$S||($S=function(t,n,r){return t.apply(n,r)});zS||(zS=function(t,n){return new t(...n)});const Em=Bi(Array.prototype.forEach),fA=Bi(Array.prototype.pop),xf=Bi(Array.prototype.push),ub=Bi(String.prototype.toLowerCase),s1=Bi(String.prototype.toString),hA=Bi(String.prototype.match),wf=Bi(String.prototype.replace),Vue=Bi(String.prototype.indexOf),Wue=Bi(String.prototype.trim),xo=Bi(Object.prototype.hasOwnProperty),$r=Bi(RegExp.prototype.test),Sf=Uue(TypeError);function Bi(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return $S(e,t,r)}}function Uue(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return zS(e,n)}}function Pt(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ub;dA&&dA(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const o=n(i);o!==i&&(zue(t)||(t[r]=o),i=o)}e[i]=!0}return e}function Gue(e){for(let t=0;t<e.length;t++)xo(e,t)||(e[t]=null);return e}function Ol(e){const t=s6(null);for(const[n,r]of o6(e))xo(e,n)&&(Array.isArray(r)?t[n]=Gue(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=Ol(r):t[n]=r);return t}function _f(e,t){for(;e!==null;){const r=Hue(e,t);if(r){if(r.get)return Bi(r.get);if(typeof r.value=="function")return Bi(r.value)}e=Bue(e)}function n(){return null}return n}const pA=Xr(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),a1=Xr(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),l1=Xr(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),que=Xr(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),c1=Xr(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Yue=Xr(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),gA=Xr(["#text"]),mA=Xr(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),u1=Xr(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),bA=Xr(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Rm=Xr(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Kue=uo(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Xue=uo(/<%[\w\W]*|[\w\W]*%>/gm),Que=uo(/\$\{[\w\W]*}/gm),Jue=uo(/^data-[\-\w.\u00B7-\uFFFF]+$/),Zue=uo(/^aria-[\-\w]+$/),a6=uo(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ede=uo(/^(?:\w+script|data):/i),tde=uo(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),l6=uo(/^html$/i),nde=uo(/^[a-z][.\w]*(-[.\w]+)+$/i);var yA=Object.freeze({__proto__:null,ARIA_ATTR:Zue,ATTR_WHITESPACE:tde,CUSTOM_ELEMENT:nde,DATA_ATTR:Jue,DOCTYPE_NAME:l6,ERB_EXPR:Xue,IS_ALLOWED_URI:a6,IS_SCRIPT_OR_DATA:ede,MUSTACHE_EXPR:Kue,TMPLIT_EXPR:Que});const Cf={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},rde=function(){return typeof window>"u"?null:window},ide=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const o="dompurify"+(r?"#"+r:"");try{return t.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},vA=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function c6(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:rde();const t=Ie=>c6(Ie);if(t.version="3.2.3",t.removed=[],!e||!e.document||e.document.nodeType!==Cf.document)return t.isSupported=!1,t;let{document:n}=e;const r=n,i=r.currentScript,{DocumentFragment:o,HTMLTemplateElement:s,Node:a,Element:l,NodeFilter:c,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:p,trustedTypes:h}=e,m=l.prototype,b=_f(m,"cloneNode"),v=_f(m,"remove"),x=_f(m,"nextSibling"),S=_f(m,"childNodes"),_=_f(m,"parentNode");if(typeof s=="function"){const Ie=n.createElement("template");Ie.content&&Ie.content.ownerDocument&&(n=Ie.content.ownerDocument)}let E,C="";const{implementation:M,createNodeIterator:O,createDocumentFragment:k,getElementsByTagName:N}=n,{importNode:F}=r;let j=vA();t.isSupported=typeof o6=="function"&&typeof _=="function"&&M&&M.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:$,ERB_EXPR:X,TMPLIT_EXPR:V,DATA_ATTR:L,ARIA_ATTR:U,IS_SCRIPT_OR_DATA:B,ATTR_WHITESPACE:W,CUSTOM_ELEMENT:q}=yA;let{IS_ALLOWED_URI:A}=yA,Y=null;const G=Pt({},[...pA,...a1,...l1,...c1,...gA]);let D=null;const ee=Pt({},[...mA,...u1,...bA,...Rm]);let K=Object.seal(s6(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),oe=null,J=null,Z=!0,ae=!0,ce=!1,pe=!0,ie=!1,ge=!0,de=!1,Ee=!1,De=!1,$e=!1,Te=!1,ze=!1,yt=!0,Mt=!1;const mn="user-content-";let Ot=!0,un=!1,Zt={},fe=null;const _e=Pt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Be=null;const Je=Pt({},["audio","video","img","source","image","track"]);let st=null;const On=Pt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Fn="http://www.w3.org/1998/Math/MathML",Rn="http://www.w3.org/2000/svg",on="http://www.w3.org/1999/xhtml";let jn=on,en=!1,nr=null;const Kn=Pt({},[Fn,Rn,on],s1);let Ui=Pt({},["mi","mo","mn","ms","mtext"]),yr=Pt({},["annotation-xml"]);const Lo=Pt({},["title","style","font","a","script"]);let vr=null;const Ir=["application/xhtml+xml","text/html"],ll="text/html";let Le=null,vt=null;const Bt=n.createElement("form"),Xn=function(ne){return ne instanceof RegExp||ne instanceof Function},Qn=function(){let ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(vt&&vt===ne)){if((!ne||typeof ne!="object")&&(ne={}),ne=Ol(ne),vr=Ir.indexOf(ne.PARSER_MEDIA_TYPE)===-1?ll:ne.PARSER_MEDIA_TYPE,Le=vr==="application/xhtml+xml"?s1:ub,Y=xo(ne,"ALLOWED_TAGS")?Pt({},ne.ALLOWED_TAGS,Le):G,D=xo(ne,"ALLOWED_ATTR")?Pt({},ne.ALLOWED_ATTR,Le):ee,nr=xo(ne,"ALLOWED_NAMESPACES")?Pt({},ne.ALLOWED_NAMESPACES,s1):Kn,st=xo(ne,"ADD_URI_SAFE_ATTR")?Pt(Ol(On),ne.ADD_URI_SAFE_ATTR,Le):On,Be=xo(ne,"ADD_DATA_URI_TAGS")?Pt(Ol(Je),ne.ADD_DATA_URI_TAGS,Le):Je,fe=xo(ne,"FORBID_CONTENTS")?Pt({},ne.FORBID_CONTENTS,Le):_e,oe=xo(ne,"FORBID_TAGS")?Pt({},ne.FORBID_TAGS,Le):{},J=xo(ne,"FORBID_ATTR")?Pt({},ne.FORBID_ATTR,Le):{},Zt=xo(ne,"USE_PROFILES")?ne.USE_PROFILES:!1,Z=ne.ALLOW_ARIA_ATTR!==!1,ae=ne.ALLOW_DATA_ATTR!==!1,ce=ne.ALLOW_UNKNOWN_PROTOCOLS||!1,pe=ne.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ie=ne.SAFE_FOR_TEMPLATES||!1,ge=ne.SAFE_FOR_XML!==!1,de=ne.WHOLE_DOCUMENT||!1,$e=ne.RETURN_DOM||!1,Te=ne.RETURN_DOM_FRAGMENT||!1,ze=ne.RETURN_TRUSTED_TYPE||!1,De=ne.FORCE_BODY||!1,yt=ne.SANITIZE_DOM!==!1,Mt=ne.SANITIZE_NAMED_PROPS||!1,Ot=ne.KEEP_CONTENT!==!1,un=ne.IN_PLACE||!1,A=ne.ALLOWED_URI_REGEXP||a6,jn=ne.NAMESPACE||on,Ui=ne.MATHML_TEXT_INTEGRATION_POINTS||Ui,yr=ne.HTML_INTEGRATION_POINTS||yr,K=ne.CUSTOM_ELEMENT_HANDLING||{},ne.CUSTOM_ELEMENT_HANDLING&&Xn(ne.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(K.tagNameCheck=ne.CUSTOM_ELEMENT_HANDLING.tagNameCheck),ne.CUSTOM_ELEMENT_HANDLING&&Xn(ne.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(K.attributeNameCheck=ne.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),ne.CUSTOM_ELEMENT_HANDLING&&typeof ne.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(K.allowCustomizedBuiltInElements=ne.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ie&&(ae=!1),Te&&($e=!0),Zt&&(Y=Pt({},gA),D=[],Zt.html===!0&&(Pt(Y,pA),Pt(D,mA)),Zt.svg===!0&&(Pt(Y,a1),Pt(D,u1),Pt(D,Rm)),Zt.svgFilters===!0&&(Pt(Y,l1),Pt(D,u1),Pt(D,Rm)),Zt.mathMl===!0&&(Pt(Y,c1),Pt(D,bA),Pt(D,Rm))),ne.ADD_TAGS&&(Y===G&&(Y=Ol(Y)),Pt(Y,ne.ADD_TAGS,Le)),ne.ADD_ATTR&&(D===ee&&(D=Ol(D)),Pt(D,ne.ADD_ATTR,Le)),ne.ADD_URI_SAFE_ATTR&&Pt(st,ne.ADD_URI_SAFE_ATTR,Le),ne.FORBID_CONTENTS&&(fe===_e&&(fe=Ol(fe)),Pt(fe,ne.FORBID_CONTENTS,Le)),Ot&&(Y["#text"]=!0),de&&Pt(Y,["html","head","body"]),Y.table&&(Pt(Y,["tbody"]),delete oe.tbody),ne.TRUSTED_TYPES_POLICY){if(typeof ne.TRUSTED_TYPES_POLICY.createHTML!="function")throw Sf('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof ne.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Sf('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');E=ne.TRUSTED_TYPES_POLICY,C=E.createHTML("")}else E===void 0&&(E=ide(h,i)),E!==null&&typeof C=="string"&&(C=E.createHTML(""));Xr&&Xr(ne),vt=ne}},Nr=Pt({},[...a1,...l1,...que]),ur=Pt({},[...c1,...Yue]),rr=function(ne){let we=_(ne);(!we||!we.tagName)&&(we={namespaceURI:jn,tagName:"template"});const Ae=ub(ne.tagName),Dt=ub(we.tagName);return nr[ne.namespaceURI]?ne.namespaceURI===Rn?we.namespaceURI===on?Ae==="svg":we.namespaceURI===Fn?Ae==="svg"&&(Dt==="annotation-xml"||Ui[Dt]):!!Nr[Ae]:ne.namespaceURI===Fn?we.namespaceURI===on?Ae==="math":we.namespaceURI===Rn?Ae==="math"&&yr[Dt]:!!ur[Ae]:ne.namespaceURI===on?we.namespaceURI===Rn&&!yr[Dt]||we.namespaceURI===Fn&&!Ui[Dt]?!1:!ur[Ae]&&(Lo[Ae]||!Nr[Ae]):!!(vr==="application/xhtml+xml"&&nr[ne.namespaceURI]):!1},bn=function(ne){xf(t.removed,{element:ne});try{_(ne).removeChild(ne)}catch{v(ne)}},oa=function(ne,we){try{xf(t.removed,{attribute:we.getAttributeNode(ne),from:we})}catch{xf(t.removed,{attribute:null,from:we})}if(we.removeAttribute(ne),ne==="is")if($e||Te)try{bn(we)}catch{}else try{we.setAttribute(ne,"")}catch{}},Bc=function(ne){let we=null,Ae=null;if(De)ne="<remove></remove>"+ne;else{const Et=hA(ne,/^[\r\n\t ]+/);Ae=Et&&Et[0]}vr==="application/xhtml+xml"&&jn===on&&(ne='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+ne+"</body></html>");const Dt=E?E.createHTML(ne):ne;if(jn===on)try{we=new p().parseFromString(Dt,vr)}catch{}if(!we||!we.documentElement){we=M.createDocument(jn,"template",null);try{we.documentElement.innerHTML=en?C:Dt}catch{}}const dn=we.body||we.documentElement;return ne&&Ae&&dn.insertBefore(n.createTextNode(Ae),dn.childNodes[0]||null),jn===on?N.call(we,de?"html":"body")[0]:de?we.documentElement:dn},Hc=function(ne){return O.call(ne.ownerDocument||ne,ne,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},te=function(ne){return ne instanceof d&&(typeof ne.nodeName!="string"||typeof ne.textContent!="string"||typeof ne.removeChild!="function"||!(ne.attributes instanceof u)||typeof ne.removeAttribute!="function"||typeof ne.setAttribute!="function"||typeof ne.namespaceURI!="string"||typeof ne.insertBefore!="function"||typeof ne.hasChildNodes!="function")},Ce=function(ne){return typeof a=="function"&&ne instanceof a};function Oe(Ie,ne,we){Em(Ie,Ae=>{Ae.call(t,ne,we,vt)})}const Ve=function(ne){let we=null;if(Oe(j.beforeSanitizeElements,ne,null),te(ne))return bn(ne),!0;const Ae=Le(ne.nodeName);if(Oe(j.uponSanitizeElement,ne,{tagName:Ae,allowedTags:Y}),ne.hasChildNodes()&&!Ce(ne.firstElementChild)&&$r(/<[/\w]/g,ne.innerHTML)&&$r(/<[/\w]/g,ne.textContent)||ne.nodeType===Cf.progressingInstruction||ge&&ne.nodeType===Cf.comment&&$r(/<[/\w]/g,ne.data))return bn(ne),!0;if(!Y[Ae]||oe[Ae]){if(!oe[Ae]&&$t(Ae)&&(K.tagNameCheck instanceof RegExp&&$r(K.tagNameCheck,Ae)||K.tagNameCheck instanceof Function&&K.tagNameCheck(Ae)))return!1;if(Ot&&!fe[Ae]){const Dt=_(ne)||ne.parentNode,dn=S(ne)||ne.childNodes;if(dn&&Dt){const Et=dn.length;for(let Vn=Et-1;Vn>=0;--Vn){const Jr=b(dn[Vn],!0);Jr.__removalCount=(ne.__removalCount||0)+1,Dt.insertBefore(Jr,x(ne))}}}return bn(ne),!0}return ne instanceof l&&!rr(ne)||(Ae==="noscript"||Ae==="noembed"||Ae==="noframes")&&$r(/<\/no(script|embed|frames)/i,ne.innerHTML)?(bn(ne),!0):(ie&&ne.nodeType===Cf.text&&(we=ne.textContent,Em([$,X,V],Dt=>{we=wf(we,Dt," ")}),ne.textContent!==we&&(xf(t.removed,{element:ne.cloneNode()}),ne.textContent=we)),Oe(j.afterSanitizeElements,ne,null),!1)},kt=function(ne,we,Ae){if(yt&&(we==="id"||we==="name")&&(Ae in n||Ae in Bt))return!1;if(!(ae&&!J[we]&&$r(L,we))){if(!(Z&&$r(U,we))){if(!D[we]||J[we]){if(!($t(ne)&&(K.tagNameCheck instanceof RegExp&&$r(K.tagNameCheck,ne)||K.tagNameCheck instanceof Function&&K.tagNameCheck(ne))&&(K.attributeNameCheck instanceof RegExp&&$r(K.attributeNameCheck,we)||K.attributeNameCheck instanceof Function&&K.attributeNameCheck(we))||we==="is"&&K.allowCustomizedBuiltInElements&&(K.tagNameCheck instanceof RegExp&&$r(K.tagNameCheck,Ae)||K.tagNameCheck instanceof Function&&K.tagNameCheck(Ae))))return!1}else if(!st[we]){if(!$r(A,wf(Ae,W,""))){if(!((we==="src"||we==="xlink:href"||we==="href")&&ne!=="script"&&Vue(Ae,"data:")===0&&Be[ne])){if(!(ce&&!$r(B,wf(Ae,W,"")))){if(Ae)return!1}}}}}}return!0},$t=function(ne){return ne!=="annotation-xml"&&hA(ne,q)},xt=function(ne){Oe(j.beforeSanitizeAttributes,ne,null);const{attributes:we}=ne;if(!we||te(ne))return;const Ae={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:D,forceKeepAttr:void 0};let Dt=we.length;for(;Dt--;){const dn=we[Dt],{name:Et,namespaceURI:Vn,value:Jr}=dn,xs=Le(Et);let ir=Et==="value"?Jr:Wue(Jr);if(Ae.attrName=xs,Ae.attrValue=ir,Ae.keepAttr=!0,Ae.forceKeepAttr=void 0,Oe(j.uponSanitizeAttribute,ne,Ae),ir=Ae.attrValue,Mt&&(xs==="id"||xs==="name")&&(oa(Et,ne),ir=mn+ir),ge&&$r(/((--!?|])>)|<\/(style|title)/i,ir)){oa(Et,ne);continue}if(Ae.forceKeepAttr||(oa(Et,ne),!Ae.keepAttr))continue;if(!pe&&$r(/\/>/i,ir)){oa(Et,ne);continue}ie&&Em([$,X,V],Gd=>{ir=wf(ir,Gd," ")});const Ud=Le(ne.nodeName);if(kt(Ud,xs,ir)){if(E&&typeof h=="object"&&typeof h.getAttributeType=="function"&&!Vn)switch(h.getAttributeType(Ud,xs)){case"TrustedHTML":{ir=E.createHTML(ir);break}case"TrustedScriptURL":{ir=E.createScriptURL(ir);break}}try{Vn?ne.setAttributeNS(Vn,Et,ir):ne.setAttribute(Et,ir),te(ne)?bn(ne):fA(t.removed)}catch{}}}Oe(j.afterSanitizeAttributes,ne,null)},pt=function Ie(ne){let we=null;const Ae=Hc(ne);for(Oe(j.beforeSanitizeShadowDOM,ne,null);we=Ae.nextNode();)Oe(j.uponSanitizeShadowNode,we,null),Ve(we),xt(we),we.content instanceof o&&Ie(we.content);Oe(j.afterSanitizeShadowDOM,ne,null)};return t.sanitize=function(Ie){let ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},we=null,Ae=null,Dt=null,dn=null;if(en=!Ie,en&&(Ie="<!-->"),typeof Ie!="string"&&!Ce(Ie))if(typeof Ie.toString=="function"){if(Ie=Ie.toString(),typeof Ie!="string")throw Sf("dirty is not a string, aborting")}else throw Sf("toString is not a function");if(!t.isSupported)return Ie;if(Ee||Qn(ne),t.removed=[],typeof Ie=="string"&&(un=!1),un){if(Ie.nodeName){const Jr=Le(Ie.nodeName);if(!Y[Jr]||oe[Jr])throw Sf("root node is forbidden and cannot be sanitized in-place")}}else if(Ie instanceof a)we=Bc("<!---->"),Ae=we.ownerDocument.importNode(Ie,!0),Ae.nodeType===Cf.element&&Ae.nodeName==="BODY"||Ae.nodeName==="HTML"?we=Ae:we.appendChild(Ae);else{if(!$e&&!ie&&!de&&Ie.indexOf("<")===-1)return E&&ze?E.createHTML(Ie):Ie;if(we=Bc(Ie),!we)return $e?null:ze?C:""}we&&De&&bn(we.firstChild);const Et=Hc(un?Ie:we);for(;Dt=Et.nextNode();)Ve(Dt),xt(Dt),Dt.content instanceof o&&pt(Dt.content);if(un)return Ie;if($e){if(Te)for(dn=k.call(we.ownerDocument);we.firstChild;)dn.appendChild(we.firstChild);else dn=we;return(D.shadowroot||D.shadowrootmode)&&(dn=F.call(r,dn,!0)),dn}let Vn=de?we.outerHTML:we.innerHTML;return de&&Y["!doctype"]&&we.ownerDocument&&we.ownerDocument.doctype&&we.ownerDocument.doctype.name&&$r(l6,we.ownerDocument.doctype.name)&&(Vn="<!DOCTYPE "+we.ownerDocument.doctype.name+`>
|
|
301
|
-
`+Vn),ie&&Em([$,X,V],Jr=>{Vn=wf(Vn,Jr," ")}),E&&ze?E.createHTML(Vn):Vn},t.setConfig=function(){let Ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Qn(Ie),Ee=!0},t.clearConfig=function(){vt=null,Ee=!1},t.isValidAttribute=function(Ie,ne,we){vt||Qn({});const Ae=Le(Ie),Dt=Le(ne);return kt(Ae,Dt,we)},t.addHook=function(Ie,ne){typeof ne=="function"&&xf(j[Ie],ne)},t.removeHook=function(Ie){return fA(j[Ie])},t.removeHooks=function(Ie){j[Ie]=[]},t.removeAllHooks=function(){j=vA()},t}var BS=c6();function oy({card:e,isLoading:t,data:n}){var p,h;const r=n||[],{keys:i}=sr(r),o=ye(m=>m.selectedSheetId),s=ye(m=>m.isVisualEditing),a=(h=(p=e==null?void 0:e.preferences)==null?void 0:p.textVisualOptions)==null?void 0:h.isDynamicText,{setCardDescription:l}=Hn(),{setCard:c}=Qy();function u(){var x;if(t)return y.jsxs("div",{className:"space-y-2",children:[y.jsx(Mu,{className:"h-3 w-full animate-pulse bg-muted"}),y.jsx(Mu,{className:"h-3 w-3/4 animate-pulse bg-muted"}),y.jsx(Mu,{className:"h-3 w-1/2 animate-pulse bg-muted"})]});const m=(x=r==null?void 0:r[0])==null?void 0:x[i[0]],b=BS.sanitize(m),v=y.jsx("div",{dangerouslySetInnerHTML:{__html:b}});return y.jsx("div",{className:"text-sm text-foreground/80 hover:cursor-text",onMouseDown:S=>S.stopPropagation(),children:v})}function d(){return y.jsx("div",{onMouseDown:m=>m.stopPropagation(),children:y.jsx(rs,{type:"textarea",className:"w-full rounded-md bg-muted",text:(e==null?void 0:e.description)||"Double click to add description",onSave:m=>{s===!1&&l(o,e.id,m),s===!0&&c({...e,description:m})},children:y.jsx("div",{className:"text-sm text-foreground/70 hover:cursor-text",dangerouslySetInnerHTML:{__html:BS.sanitize((e==null?void 0:e.description)||(s?"Edit Description":"")||"")}})})})}return y.jsxs(y.Fragment,{children:[!a&&d(),a===!0&&u()]})}const xA=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,wA=mb,IE=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return wA(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=t,s=Object.keys(i).map(c=>{const u=n==null?void 0:n[c],d=o==null?void 0:o[c];if(u===null)return null;const p=xA(u)||xA(d);return i[c][p]}),a=n&&Object.entries(n).reduce((c,u)=>{let[d,p]=u;return p===void 0||(c[d]=p),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:p,...h}=u;return Object.entries(h).every(m=>{let[b,v]=m;return Array.isArray(v)?v.includes({...o,...a}[b]):{...o,...a}[b]===v})?[...c,d,p]:c},[]);return wA(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},$h=IE("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),pi=R.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},o)=>{const s=r?Js:"button";return y.jsx(s,{className:be($h({variant:t,size:n,className:e})),ref:o,...i})});pi.displayName="Button";var ode="Separator",SA="horizontal",sde=["horizontal","vertical"],u6=R.forwardRef((e,t)=>{const{decorative:n,orientation:r=SA,...i}=e,o=ade(r)?r:SA,a=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return y.jsx(Ne.div,{"data-orientation":o,...a,...i,ref:t})});u6.displayName=ode;function ade(e){return sde.includes(e)}var d6=u6;const kp=R.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},i)=>y.jsx(d6,{ref:i,decorative:n,orientation:t,className:be("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));kp.displayName=d6.displayName;function lde(){var b,v;const e=ye(x=>x.themeStyle),t=ye(x=>x.filterValues),n=ye(x=>x.dashboard.filters),r=ye(x=>x.filteringCards),i=ye(x=>x.selectedSheetId),{removeFilterValues:o,removeFilteringCard:s,setFilterValues:a,setFilteringCards:l}=Hn(),c=n==null?void 0:n.filter(x=>x.sheetId===i||!x.sheetId),u=t==null?void 0:t.filter(x=>(c==null?void 0:c.some(S=>S.id===x.filterId))||x.filterId.endsWith(i));if(!u||u.length===0)return null;const d=u.map(x=>{const S=n==null?void 0:n.find(_=>_.id===x.filterId);return{filterId:x.filterId,name:(S==null?void 0:S.title)||x.name,values:x.values}});function p(x){return x instanceof Date?x.toLocaleDateString():x}function h(x){const S=r==null?void 0:r.find(_=>x.filterId.startsWith(_.id));S&&s(S),o(x.filterId)}function m(x){var S,_;return y.jsxs("div",{className:"space-y-2",children:[y.jsxs("div",{style:{borderRadius:(_=(S=e==null?void 0:e.chart)==null?void 0:S.options)==null?void 0:_.borderRadius},className:"flex w-fit items-center gap-2 bg-muted-foreground px-2 py-1 font-semibold text-muted",children:[y.jsx("span",{className:"break-words",children:x.name}),y.jsx(Md,{onClick:()=>h(x),className:"size-3 text-muted hover:cursor-pointer hover:text-background"})]}),y.jsx("div",{className:"flex flex-wrap gap-1",children:x.values.map(E=>{var C,M;return y.jsx("span",{style:{borderRadius:(M=(C=e==null?void 0:e.chart)==null?void 0:C.options)==null?void 0:M.borderRadius},className:"inline-block",children:p(E)},E==null?void 0:E.toString())})})]})}return y.jsxs(Fd,{openDelay:100,children:[y.jsx(jd,{children:y.jsx(Q5,{className:"z-100 size-3.5 text-muted-foreground/40"})}),y.jsxs(Fc,{style:{borderRadius:(v=(b=e==null?void 0:e.chart)==null?void 0:b.options)==null?void 0:v.borderRadius},className:"relative flex min-h-fit w-[300px] flex-col px-0 text-xs",align:"start",children:[y.jsx(FC,{onClick:()=>{l([]),a([])},className:"absolute right-4 size-3.5 text-muted-foreground/40 hover:cursor-pointer"}),y.jsx("div",{className:"h-fit max-h-[150px] min-h-0 grow overflow-auto",children:d==null?void 0:d.map(x=>y.jsxs("div",{className:"px-5",children:[m(x),y.jsx(kp,{className:"my-2"})]},x.name))})]})]})}const cde=R.forwardRef(({className:e,containerClassName:t,containerStyle:n,...r},i)=>y.jsx("div",{style:n,className:be("relative w-full overflow-auto",t),children:y.jsx("table",{ref:i,className:be("w-full caption-bottom text-sm",e),...r})}));cde.displayName="Table";const NE=R.forwardRef(({className:e,...t},n)=>y.jsx("thead",{ref:n,className:be("[&_tr]:border-b",e),...t}));NE.displayName="TableHeader";const LE=R.forwardRef(({className:e,...t},n)=>y.jsx("tbody",{ref:n,className:be("[&_tr:last-child]:border-0",e),...t}));LE.displayName="TableBody";const ude=R.forwardRef(({className:e,...t},n)=>y.jsx("tfoot",{ref:n,className:be("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));ude.displayName="TableFooter";const dh=R.forwardRef(({className:e,...t},n)=>y.jsx("tr",{ref:n,className:be("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));dh.displayName="TableRow";const FE=R.forwardRef(({className:e,...t},n)=>y.jsx("th",{ref:n,className:be("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));FE.displayName="TableHead";const jE=R.forwardRef(({className:e,...t},n)=>y.jsx("td",{ref:n,className:be("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));jE.displayName="TableCell";const dde=R.forwardRef(({className:e,...t},n)=>y.jsx("caption",{ref:n,className:be("mt-4 text-sm text-muted-foreground",e),...t}));dde.displayName="TableCaption";/**
|
|
302
|
-
* table-core
|
|
303
|
-
*
|
|
304
|
-
* Copyright (c) TanStack
|
|
305
|
-
*
|
|
306
|
-
* This source code is licensed under the MIT license found in the
|
|
307
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
308
|
-
*
|
|
309
|
-
* @license MIT
|
|
310
|
-
*/function Fa(e,t){return typeof e=="function"?e(t):e}function Hi(e,t){return n=>{t.setState(r=>({...r,[e]:Fa(n,r[e])}))}}function y0(e){return e instanceof Function}function fde(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function hde(e,t){const n=[],r=i=>{i.forEach(o=>{n.push(o);const s=t(o);s!=null&&s.length&&r(s)})};return r(e),n}function Ye(e,t,n){let r=[],i;return o=>{let s;n.key&&n.debug&&(s=Date.now());const a=e(o);if(!(a.length!==r.length||a.some((u,d)=>r[d]!==u)))return i;r=a;let c;if(n.key&&n.debug&&(c=Date.now()),i=t(...a),n==null||n.onChange==null||n.onChange(i),n.key&&n.debug&&n!=null&&n.debug()){const u=Math.round((Date.now()-s)*100)/100,d=Math.round((Date.now()-c)*100)/100,p=d/16,h=(m,b)=>{for(m=String(m);m.length<b;)m=" "+m;return m};console.info(`%c⏱ ${h(d,5)} /${h(u,5)} ms`,`
|
|
311
|
-
font-size: .6rem;
|
|
312
|
-
font-weight: bold;
|
|
313
|
-
color: hsl(${Math.max(0,Math.min(120-120*p,120))}deg 100% 31%);`,n==null?void 0:n.key)}return i}}function Ke(e,t,n,r){return{debug:()=>{var i;return(i=e==null?void 0:e.debugAll)!=null?i:e[t]},key:process.env.NODE_ENV==="development"&&n,onChange:r}}function pde(e,t,n,r){const i=()=>{var s;return(s=o.getValue())!=null?s:e.options.renderFallbackValue},o={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:i,getContext:Ye(()=>[e,n,t,o],(s,a,l,c)=>({table:s,column:a,row:l,cell:c,getValue:c.getValue,renderValue:c.renderValue}),Ke(e.options,"debugCells","cell.getContext"))};return e._features.forEach(s=>{s.createCell==null||s.createCell(o,n,t,e)},{}),o}function gde(e,t,n,r){var i,o;const a={...e._getDefaultColumnDef(),...t},l=a.accessorKey;let c=(i=(o=a.id)!=null?o:l?typeof String.prototype.replaceAll=="function"?l.replaceAll(".","_"):l.replace(/\./g,"_"):void 0)!=null?i:typeof a.header=="string"?a.header:void 0,u;if(a.accessorFn?u=a.accessorFn:l&&(l.includes(".")?u=p=>{let h=p;for(const b of l.split(".")){var m;h=(m=h)==null?void 0:m[b],process.env.NODE_ENV!=="production"&&h===void 0&&console.warn(`"${b}" in deeply nested key "${l}" returned undefined.`)}return h}:u=p=>p[a.accessorKey]),!c)throw process.env.NODE_ENV!=="production"?new Error(a.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let d={id:`${String(c)}`,accessorFn:u,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:Ye(()=>[!0],()=>{var p;return[d,...(p=d.columns)==null?void 0:p.flatMap(h=>h.getFlatColumns())]},Ke(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:Ye(()=>[e._getOrderColumnsFn()],p=>{var h;if((h=d.columns)!=null&&h.length){let m=d.columns.flatMap(b=>b.getLeafColumns());return p(m)}return[d]},Ke(e.options,"debugColumns","column.getLeafColumns"))};for(const p of e._features)p.createColumn==null||p.createColumn(d,e);return d}const _r="debugHeaders";function _A(e,t,n){var r;let o={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const s=[],a=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(a),s.push(l)};return a(o),s},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach(s=>{s.createHeader==null||s.createHeader(o,e)}),o}const mde={createTable:e=>{e.getHeaderGroups=Ye(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>{var o,s;const a=(o=r==null?void 0:r.map(d=>n.find(p=>p.id===d)).filter(Boolean))!=null?o:[],l=(s=i==null?void 0:i.map(d=>n.find(p=>p.id===d)).filter(Boolean))!=null?s:[],c=n.filter(d=>!(r!=null&&r.includes(d.id))&&!(i!=null&&i.includes(d.id)));return Pm(t,[...a,...c,...l],e)},Ke(e.options,_r,"getHeaderGroups")),e.getCenterHeaderGroups=Ye(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>(n=n.filter(o=>!(r!=null&&r.includes(o.id))&&!(i!=null&&i.includes(o.id))),Pm(t,n,e,"center")),Ke(e.options,_r,"getCenterHeaderGroups")),e.getLeftHeaderGroups=Ye(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var i;const o=(i=r==null?void 0:r.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?i:[];return Pm(t,o,e,"left")},Ke(e.options,_r,"getLeftHeaderGroups")),e.getRightHeaderGroups=Ye(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var i;const o=(i=r==null?void 0:r.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?i:[];return Pm(t,o,e,"right")},Ke(e.options,_r,"getRightHeaderGroups")),e.getFooterGroups=Ye(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Ke(e.options,_r,"getFooterGroups")),e.getLeftFooterGroups=Ye(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Ke(e.options,_r,"getLeftFooterGroups")),e.getCenterFooterGroups=Ye(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Ke(e.options,_r,"getCenterFooterGroups")),e.getRightFooterGroups=Ye(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Ke(e.options,_r,"getRightFooterGroups")),e.getFlatHeaders=Ye(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ke(e.options,_r,"getFlatHeaders")),e.getLeftFlatHeaders=Ye(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ke(e.options,_r,"getLeftFlatHeaders")),e.getCenterFlatHeaders=Ye(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ke(e.options,_r,"getCenterFlatHeaders")),e.getRightFlatHeaders=Ye(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ke(e.options,_r,"getRightFlatHeaders")),e.getCenterLeafHeaders=Ye(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Ke(e.options,_r,"getCenterLeafHeaders")),e.getLeftLeafHeaders=Ye(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Ke(e.options,_r,"getLeftLeafHeaders")),e.getRightLeafHeaders=Ye(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Ke(e.options,_r,"getRightLeafHeaders")),e.getLeafHeaders=Ye(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var i,o,s,a,l,c;return[...(i=(o=t[0])==null?void 0:o.headers)!=null?i:[],...(s=(a=n[0])==null?void 0:a.headers)!=null?s:[],...(l=(c=r[0])==null?void 0:c.headers)!=null?l:[]].map(u=>u.getLeafHeaders()).flat()},Ke(e.options,_r,"getLeafHeaders"))}};function Pm(e,t,n,r){var i,o;let s=0;const a=function(p,h){h===void 0&&(h=1),s=Math.max(s,h),p.filter(m=>m.getIsVisible()).forEach(m=>{var b;(b=m.columns)!=null&&b.length&&a(m.columns,h+1)},0)};a(e);let l=[];const c=(p,h)=>{const m={depth:h,id:[r,`${h}`].filter(Boolean).join("_"),headers:[]},b=[];p.forEach(v=>{const x=[...b].reverse()[0],S=v.column.depth===m.depth;let _,E=!1;if(S&&v.column.parent?_=v.column.parent:(_=v.column,E=!0),x&&(x==null?void 0:x.column)===_)x.subHeaders.push(v);else{const C=_A(n,_,{id:[r,h,_.id,v==null?void 0:v.id].filter(Boolean).join("_"),isPlaceholder:E,placeholderId:E?`${b.filter(M=>M.column===_).length}`:void 0,depth:h,index:b.length});C.subHeaders.push(v),b.push(C)}m.headers.push(v),v.headerGroup=m}),l.push(m),h>0&&c(b,h-1)},u=t.map((p,h)=>_A(n,p,{depth:s,index:h}));c(u,s-1),l.reverse();const d=p=>p.filter(m=>m.column.getIsVisible()).map(m=>{let b=0,v=0,x=[0];m.subHeaders&&m.subHeaders.length?(x=[],d(m.subHeaders).forEach(_=>{let{colSpan:E,rowSpan:C}=_;b+=E,x.push(C)})):b=1;const S=Math.min(...x);return v=v+S,m.colSpan=b,m.rowSpan=v,{colSpan:b,rowSpan:v}});return d((i=(o=l[0])==null?void 0:o.headers)!=null?i:[]),l}const bde=(e,t,n,r,i,o,s)=>{let a={id:t,index:r,original:n,depth:i,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(a._valuesCache.hasOwnProperty(l))return a._valuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return a._valuesCache[l]=c.accessorFn(a.original,r),a._valuesCache[l]},getUniqueValues:l=>{if(a._uniqueValuesCache.hasOwnProperty(l))return a._uniqueValuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(a._uniqueValuesCache[l]=c.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[l]):(a._uniqueValuesCache[l]=[a.getValue(l)],a._uniqueValuesCache[l])},renderValue:l=>{var c;return(c=a.getValue(l))!=null?c:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>hde(a.subRows,l=>l.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let l=[],c=a;for(;;){const u=c.getParentRow();if(!u)break;l.push(u),c=u}return l.reverse()},getAllCells:Ye(()=>[e.getAllLeafColumns()],l=>l.map(c=>pde(e,a,c,c.id)),Ke(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:Ye(()=>[a.getAllCells()],l=>l.reduce((c,u)=>(c[u.column.id]=u,c),{}),Ke(e.options,"debugRows","getAllCellsByColumnId"))};for(let l=0;l<e._features.length;l++){const c=e._features[l];c==null||c.createRow==null||c.createRow(a,e)}return a},yde={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},f6=(e,t,n)=>{var r,i;const o=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((i=e.getValue(t))==null||(i=i.toString())==null||(i=i.toLowerCase())==null)&&i.includes(o))};f6.autoRemove=e=>To(e);const h6=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};h6.autoRemove=e=>To(e);const p6=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};p6.autoRemove=e=>To(e);const g6=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};g6.autoRemove=e=>To(e)||!(e!=null&&e.length);const m6=(e,t,n)=>!n.some(r=>{var i;return!((i=e.getValue(t))!=null&&i.includes(r))});m6.autoRemove=e=>To(e)||!(e!=null&&e.length);const b6=(e,t,n)=>n.some(r=>{var i;return(i=e.getValue(t))==null?void 0:i.includes(r)});b6.autoRemove=e=>To(e)||!(e!=null&&e.length);const y6=(e,t,n)=>e.getValue(t)===n;y6.autoRemove=e=>To(e);const v6=(e,t,n)=>e.getValue(t)==n;v6.autoRemove=e=>To(e);const $E=(e,t,n)=>{let[r,i]=n;const o=e.getValue(t);return o>=r&&o<=i};$E.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,i=typeof n!="number"?parseFloat(n):n,o=t===null||Number.isNaN(r)?-1/0:r,s=n===null||Number.isNaN(i)?1/0:i;if(o>s){const a=o;o=s,s=a}return[o,s]};$E.autoRemove=e=>To(e)||To(e[0])&&To(e[1]);const Fs={includesString:f6,includesStringSensitive:h6,equalsString:p6,arrIncludes:g6,arrIncludesAll:m6,arrIncludesSome:b6,equals:y6,weakEquals:v6,inNumberRange:$E};function To(e){return e==null||e===""}const vde={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Hi("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?Fs.includesString:typeof r=="number"?Fs.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Fs.equals:Array.isArray(r)?Fs.arrIncludes:Fs.weakEquals},e.getFilterFn=()=>{var n,r;return y0(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:Fs[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,i;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((i=t.options.enableFilters)!=null?i:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(i=>i.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const i=e.getFilterFn(),o=r==null?void 0:r.find(u=>u.id===e.id),s=Fa(n,o?o.value:void 0);if(CA(i,s,e)){var a;return(a=r==null?void 0:r.filter(u=>u.id!==e.id))!=null?a:[]}const l={id:e.id,value:s};if(o){var c;return(c=r==null?void 0:r.map(u=>u.id===e.id?l:u))!=null?c:[]}return r!=null&&r.length?[...r,l]:[l]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=i=>{var o;return(o=Fa(t,i))==null?void 0:o.filter(s=>{const a=n.find(l=>l.id===s.id);if(a){const l=a.getFilterFn();if(CA(l,s.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function CA(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const xde=(e,t,n)=>n.reduce((r,i)=>{const o=i.getValue(e);return r+(typeof o=="number"?o:0)},0),wde=(e,t,n)=>{let r;return n.forEach(i=>{const o=i.getValue(e);o!=null&&(r>o||r===void 0&&o>=o)&&(r=o)}),r},Sde=(e,t,n)=>{let r;return n.forEach(i=>{const o=i.getValue(e);o!=null&&(r<o||r===void 0&&o>=o)&&(r=o)}),r},_de=(e,t,n)=>{let r,i;return n.forEach(o=>{const s=o.getValue(e);s!=null&&(r===void 0?s>=s&&(r=i=s):(r>s&&(r=s),i<s&&(i=s)))}),[r,i]},Cde=(e,t)=>{let n=0,r=0;if(t.forEach(i=>{let o=i.getValue(e);o!=null&&(o=+o)>=o&&(++n,r+=o)}),n)return r/n},Ede=(e,t)=>{if(!t.length)return;const n=t.map(o=>o.getValue(e));if(!fde(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),i=n.sort((o,s)=>o-s);return n.length%2!==0?i[r]:(i[r-1]+i[r])/2},Rde=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),Pde=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,Tde=(e,t)=>t.length,d1={sum:xde,min:wde,max:Sde,extent:_de,mean:Cde,median:Ede,unique:Rde,uniqueCount:Pde,count:Tde},Mde={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Hi("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return d1.sum;if(Object.prototype.toString.call(r)==="[object Date]")return d1.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return y0(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:d1[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var i;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((i=n.subRows)!=null&&i.length)}}};function Ode(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(o=>!t.includes(o.id));return n==="remove"?r:[...t.map(o=>e.find(s=>s.id===o)).filter(Boolean),...r]}const Dde={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Hi("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=Ye(n=>[fh(t,n)],n=>n.findIndex(r=>r.id===e.id),Ke(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var r;return((r=fh(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const i=fh(t,n);return((r=i[i.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=Ye(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>i=>{let o=[];if(!(t!=null&&t.length))o=i;else{const s=[...t],a=[...i];for(;a.length&&s.length;){const l=s.shift(),c=a.findIndex(u=>u.id===l);c>-1&&o.push(a.splice(c,1)[0])}o=[...o,...a]}return Ode(o,n,r)},Ke(e.options,"debugTable","_getOrderColumnsFn"))}},f1=()=>({left:[],right:[]}),Ade={getInitialState:e=>({columnPinning:f1(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Hi("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(i=>i.id).filter(Boolean);t.setColumnPinning(i=>{var o,s;if(n==="right"){var a,l;return{left:((a=i==null?void 0:i.left)!=null?a:[]).filter(d=>!(r!=null&&r.includes(d))),right:[...((l=i==null?void 0:i.right)!=null?l:[]).filter(d=>!(r!=null&&r.includes(d))),...r]}}if(n==="left"){var c,u;return{left:[...((c=i==null?void 0:i.left)!=null?c:[]).filter(d=>!(r!=null&&r.includes(d))),...r],right:((u=i==null?void 0:i.right)!=null?u:[]).filter(d=>!(r!=null&&r.includes(d)))}}return{left:((o=i==null?void 0:i.left)!=null?o:[]).filter(d=>!(r!=null&&r.includes(d))),right:((s=i==null?void 0:i.right)!=null?s:[]).filter(d=>!(r!=null&&r.includes(d)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var i,o,s;return((i=r.columnDef.enablePinning)!=null?i:!0)&&((o=(s=t.options.enableColumnPinning)!=null?s:t.options.enablePinning)!=null?o:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:i}=t.getState().columnPinning,o=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>i==null?void 0:i.includes(a));return o?"left":s?"right":!1},e.getPinnedIndex=()=>{var n,r;const i=e.getIsPinned();return i?(n=(r=t.getState().columnPinning)==null||(r=r[i])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=Ye(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,i)=>{const o=[...r??[],...i??[]];return n.filter(s=>!o.includes(s.column.id))},Ke(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=Ye(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(o=>n.find(s=>s.column.id===o)).filter(Boolean).map(o=>({...o,position:"left"})),Ke(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=Ye(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(o=>n.find(s=>s.column.id===o)).filter(Boolean).map(o=>({...o,position:"right"})),Ke(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?f1():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:f1())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var i,o;return!!((i=r.left)!=null&&i.length||(o=r.right)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=Ye(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(i=>i.id===r)).filter(Boolean),Ke(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=Ye(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(i=>i.id===r)).filter(Boolean),Ke(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=Ye(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const i=[...n??[],...r??[]];return t.filter(o=>!i.includes(o.id))},Ke(e.options,"debugColumns","getCenterLeafColumns"))}},Tm={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},h1=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),kde={getDefaultColumnDef:()=>Tm,getInitialState:e=>({columnSizing:{},columnSizingInfo:h1(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Hi("columnSizing",e),onColumnSizingInfoChange:Hi("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,i;const o=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Tm.minSize,(r=o??e.columnDef.size)!=null?r:Tm.size),(i=e.columnDef.maxSize)!=null?i:Tm.maxSize)},e.getStart=Ye(n=>[n,fh(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((i,o)=>i+o.getSize(),0),Ke(t.options,"debugColumns","getStart")),e.getAfter=Ye(n=>[n,fh(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((i,o)=>i+o.getSize(),0),Ke(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...i}=n;return i})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=i=>{if(i.subHeaders.length)i.subHeaders.forEach(r);else{var o;n+=(o=i.column.getSize())!=null?o:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),i=r==null?void 0:r.getCanResize();return o=>{if(!r||!i||(o.persist==null||o.persist(),p1(o)&&o.touches&&o.touches.length>1))return;const s=e.getSize(),a=e?e.getLeafHeaders().map(x=>[x.column.id,x.column.getSize()]):[[r.id,r.getSize()]],l=p1(o)?Math.round(o.touches[0].clientX):o.clientX,c={},u=(x,S)=>{typeof S=="number"&&(t.setColumnSizingInfo(_=>{var E,C;const M=t.options.columnResizeDirection==="rtl"?-1:1,O=(S-((E=_==null?void 0:_.startOffset)!=null?E:0))*M,k=Math.max(O/((C=_==null?void 0:_.startSize)!=null?C:0),-.999999);return _.columnSizingStart.forEach(N=>{let[F,j]=N;c[F]=Math.round(Math.max(j+j*k,0)*100)/100}),{..._,deltaOffset:O,deltaPercentage:k}}),(t.options.columnResizeMode==="onChange"||x==="end")&&t.setColumnSizing(_=>({..._,...c})))},d=x=>u("move",x),p=x=>{u("end",x),t.setColumnSizingInfo(S=>({...S,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},h=n||typeof document<"u"?document:null,m={moveHandler:x=>d(x.clientX),upHandler:x=>{h==null||h.removeEventListener("mousemove",m.moveHandler),h==null||h.removeEventListener("mouseup",m.upHandler),p(x.clientX)}},b={moveHandler:x=>(x.cancelable&&(x.preventDefault(),x.stopPropagation()),d(x.touches[0].clientX),!1),upHandler:x=>{var S;h==null||h.removeEventListener("touchmove",b.moveHandler),h==null||h.removeEventListener("touchend",b.upHandler),x.cancelable&&(x.preventDefault(),x.stopPropagation()),p((S=x.touches[0])==null?void 0:S.clientX)}},v=Ide()?{passive:!1}:!1;p1(o)?(h==null||h.addEventListener("touchmove",b.moveHandler,v),h==null||h.addEventListener("touchend",b.upHandler,v)):(h==null||h.addEventListener("mousemove",m.moveHandler,v),h==null||h.addEventListener("mouseup",m.upHandler,v)),t.setColumnSizingInfo(x=>({...x,startOffset:l,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?h1():(n=e.initialState.columnSizingInfo)!=null?n:h1())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0}}};let Mm=null;function Ide(){if(typeof Mm=="boolean")return Mm;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Mm=e,Mm}function p1(e){return e.type==="touchstart"}const Nde={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Hi("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const i=e.columns;return(n=i.length?i.some(o=>o.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=Ye(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),Ke(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=Ye(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,i)=>[...n,...r,...i],Ke(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(n,r)=>Ye(()=>[r(),r().filter(i=>i.getIsVisible()).map(i=>i.id).join("_")],i=>i.filter(o=>o.getIsVisible==null?void 0:o.getIsVisible()),Ke(e.options,"debugColumns",n));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((i,o)=>({...i,[o.id]:n||!(o.getCanHide!=null&&o.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function fh(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const Lde={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},Fde={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Hi("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,i,o;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((i=t.options.enableFilters)!=null?i:!0)&&((o=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?o:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Fs.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return y0(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Fs[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},jde={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Hi("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,i;if(!t){e._queue(()=>{t=!0});return}if((r=(i=e.options.autoResetAll)!=null?i:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var i,o;e.setExpanded(r?{}:(i=(o=e.initialState)==null?void 0:o.expanded)!=null?i:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(i=>!i.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(o=>{const s=o.split(".");r=Math.max(r,s.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var i;const o=r===!0?!0:!!(r!=null&&r[e.id]);let s={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{s[a]=!0}):s=r,n=(i=n)!=null?i:!o,!o&&n)return{...s,[e.id]:!0};if(o&&!n){const{[e.id]:a,...l}=s;return l}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},e.getCanExpand=()=>{var n,r,i;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((i=e.subRows)!=null&&i.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},HS=0,VS=10,g1=()=>({pageIndex:HS,pageSize:VS}),$de={getInitialState:e=>({...e,pagination:{...g1(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Hi("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,i;if(!t){e._queue(()=>{t=!0});return}if((r=(i=e.options.autoResetAll)!=null?i:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const i=o=>Fa(r,o);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(i)},e.resetPagination=r=>{var i;e.setPagination(r?g1():(i=e.initialState.pagination)!=null?i:g1())},e.setPageIndex=r=>{e.setPagination(i=>{let o=Fa(r,i.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return o=Math.max(0,Math.min(o,s)),{...i,pageIndex:o}})},e.resetPageIndex=r=>{var i,o;e.setPageIndex(r?HS:(i=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageIndex)!=null?i:HS)},e.resetPageSize=r=>{var i,o;e.setPageSize(r?VS:(i=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageSize)!=null?i:VS)},e.setPageSize=r=>{e.setPagination(i=>{const o=Math.max(1,Fa(r,i.pageSize)),s=i.pageSize*i.pageIndex,a=Math.floor(s/o);return{...i,pageIndex:a,pageSize:o}})},e.setPageCount=r=>e.setPagination(i=>{var o;let s=Fa(r,(o=e.options.pageCount)!=null?o:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...i,pageCount:s}}),e.getPageOptions=Ye(()=>[e.getPageCount()],r=>{let i=[];return r&&r>0&&(i=[...new Array(r)].fill(null).map((o,s)=>s)),i},Ke(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,i=e.getPageCount();return i===-1?!0:i===0?!1:r<i-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},m1=()=>({top:[],bottom:[]}),zde={getInitialState:e=>({rowPinning:m1(),...e}),getDefaultOptions:e=>({onRowPinningChange:Hi("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,i)=>{const o=r?e.getLeafRows().map(l=>{let{id:c}=l;return c}):[],s=i?e.getParentRows().map(l=>{let{id:c}=l;return c}):[],a=new Set([...s,e.id,...o]);t.setRowPinning(l=>{var c,u;if(n==="bottom"){var d,p;return{top:((d=l==null?void 0:l.top)!=null?d:[]).filter(b=>!(a!=null&&a.has(b))),bottom:[...((p=l==null?void 0:l.bottom)!=null?p:[]).filter(b=>!(a!=null&&a.has(b))),...Array.from(a)]}}if(n==="top"){var h,m;return{top:[...((h=l==null?void 0:l.top)!=null?h:[]).filter(b=>!(a!=null&&a.has(b))),...Array.from(a)],bottom:((m=l==null?void 0:l.bottom)!=null?m:[]).filter(b=>!(a!=null&&a.has(b)))}}return{top:((c=l==null?void 0:l.top)!=null?c:[]).filter(b=>!(a!=null&&a.has(b))),bottom:((u=l==null?void 0:l.bottom)!=null?u:[]).filter(b=>!(a!=null&&a.has(b)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:i}=t.options;return typeof r=="function"?r(e):(n=r??i)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:i}=t.getState().rowPinning,o=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>i==null?void 0:i.includes(a));return o?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const i=e.getIsPinned();if(!i)return-1;const o=(n=i==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(s=>{let{id:a}=s;return a});return(r=o==null?void 0:o.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?m1():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:m1())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var i,o;return!!((i=r.top)!=null&&i.length||(o=r.bottom)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var i;return((i=e.options.keepPinnedRows)==null||i?(n??[]).map(s=>{const a=e.getRow(s,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(s=>t.find(a=>a.id===s))).filter(Boolean).map(s=>({...s,position:r}))},e.getTopRows=Ye(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),Ke(e.options,"debugRows","getTopRows")),e.getBottomRows=Ye(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),Ke(e.options,"debugRows","getBottomRows")),e.getCenterRows=Ye(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const i=new Set([...n??[],...r??[]]);return t.filter(o=>!i.has(o.id))},Ke(e.options,"debugRows","getCenterRows"))}},Bde={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Hi("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},i=e.getPreGroupedRowModel().flatRows;return t?i.forEach(o=>{o.getCanSelect()&&(r[o.id]=!0)}):i.forEach(o=>{delete r[o.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),i={...n};return e.getRowModel().rows.forEach(o=>{WS(i,o.id,r,!0,e)}),i}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Ye(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?b1(e,n):{rows:[],flatRows:[],rowsById:{}},Ke(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=Ye(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?b1(e,n):{rows:[],flatRows:[],rowsById:{}},Ke(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=Ye(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?b1(e,n):{rows:[],flatRows:[],rowsById:{}},Ke(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(i=>i.getCanSelect()&&!n[i.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(i=>i.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(i=>!n[i.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const i=e.getIsSelected();t.setRowSelection(o=>{var s;if(n=typeof n<"u"?n:!i,e.getCanSelect()&&i===n)return o;const a={...o};return WS(a,e.id,n,(s=r==null?void 0:r.selectChildren)!=null?s:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return zE(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return US(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return US(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var i;n&&e.toggleSelected((i=r.target)==null?void 0:i.checked)}}}},WS=(e,t,n,r,i)=>{var o;const s=i.getRow(t,!0);n?(s.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),s.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(o=s.subRows)!=null&&o.length&&s.getCanSelectSubRows()&&s.subRows.forEach(a=>WS(e,a.id,n,r,i))};function b1(e,t){const n=e.getState().rowSelection,r=[],i={},o=function(s,a){return s.map(l=>{var c;const u=zE(l,n);if(u&&(r.push(l),i[l.id]=l),(c=l.subRows)!=null&&c.length&&(l={...l,subRows:o(l.subRows)}),u)return l}).filter(Boolean)};return{rows:o(t.rows),flatRows:r,rowsById:i}}function zE(e,t){var n;return(n=t[e.id])!=null?n:!1}function US(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let i=!0,o=!1;return e.subRows.forEach(s=>{if(!(o&&!i)&&(s.getCanSelect()&&(zE(s,t)?o=!0:i=!1),s.subRows&&s.subRows.length)){const a=US(s,t);a==="all"?o=!0:(a==="some"&&(o=!0),i=!1)}}),i?"all":o?"some":!1}const GS=/([0-9]+)/gm,Hde=(e,t,n)=>x6(Ja(e.getValue(n)).toLowerCase(),Ja(t.getValue(n)).toLowerCase()),Vde=(e,t,n)=>x6(Ja(e.getValue(n)),Ja(t.getValue(n))),Wde=(e,t,n)=>BE(Ja(e.getValue(n)).toLowerCase(),Ja(t.getValue(n)).toLowerCase()),Ude=(e,t,n)=>BE(Ja(e.getValue(n)),Ja(t.getValue(n))),Gde=(e,t,n)=>{const r=e.getValue(n),i=t.getValue(n);return r>i?1:r<i?-1:0},qde=(e,t,n)=>BE(e.getValue(n),t.getValue(n));function BE(e,t){return e===t?0:e>t?1:-1}function Ja(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function x6(e,t){const n=e.split(GS).filter(Boolean),r=t.split(GS).filter(Boolean);for(;n.length&&r.length;){const i=n.shift(),o=r.shift(),s=parseInt(i,10),a=parseInt(o,10),l=[s,a].sort();if(isNaN(l[0])){if(i>o)return 1;if(o>i)return-1;continue}if(isNaN(l[1]))return isNaN(s)?-1:1;if(s>a)return 1;if(a>s)return-1}return n.length-r.length}const Ef={alphanumeric:Hde,alphanumericCaseSensitive:Vde,text:Wde,textCaseSensitive:Ude,datetime:Gde,basic:qde},Yde={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Hi("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const i of n){const o=i==null?void 0:i.getValue(e.id);if(Object.prototype.toString.call(o)==="[object Date]")return Ef.datetime;if(typeof o=="string"&&(r=!0,o.split(GS).length>1))return Ef.alphanumeric}return r?Ef.text:Ef.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return y0(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:Ef[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const i=e.getNextSortingOrder(),o=typeof n<"u"&&n!==null;t.setSorting(s=>{const a=s==null?void 0:s.find(h=>h.id===e.id),l=s==null?void 0:s.findIndex(h=>h.id===e.id);let c=[],u,d=o?n:i==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&r?a?u="toggle":u="add":s!=null&&s.length&&l!==s.length-1?u="replace":a?u="toggle":u="replace",u==="toggle"&&(o||i||(u="remove")),u==="add"){var p;c=[...s,{id:e.id,desc:d}],c.splice(0,c.length-((p=t.options.maxMultiSortColCount)!=null?p:Number.MAX_SAFE_INTEGER))}else u==="toggle"?c=s.map(h=>h.id===e.id?{...h,desc:d}:h):u==="remove"?c=s.filter(h=>h.id!==e.id):c=[{id:e.id,desc:d}];return c})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,i;const o=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==o&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(i=t.options.enableMultiRemove)!=null)||i)?!1:s==="desc"?"asc":"desc":o},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(i=>i.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(i=>i.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},Kde=[mde,Nde,Dde,Ade,yde,vde,Lde,Fde,Yde,Mde,jde,$de,zde,Bde,kde];function Xde(e){var t,n;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const r=[...Kde,...(t=e._features)!=null?t:[]];let i={_features:r};const o=i._features.reduce((p,h)=>Object.assign(p,h.getDefaultOptions==null?void 0:h.getDefaultOptions(i)),{}),s=p=>i.options.mergeOptions?i.options.mergeOptions(o,p):{...o,...p};let l={...{},...(n=e.initialState)!=null?n:{}};i._features.forEach(p=>{var h;l=(h=p.getInitialState==null?void 0:p.getInitialState(l))!=null?h:l});const c=[];let u=!1;const d={_features:r,options:{...o,...e},initialState:l,_queue:p=>{c.push(p),u||(u=!0,Promise.resolve().then(()=>{for(;c.length;)c.shift()();u=!1}).catch(h=>setTimeout(()=>{throw h})))},reset:()=>{i.setState(i.initialState)},setOptions:p=>{const h=Fa(p,i.options);i.options=s(h)},getState:()=>i.options.state,setState:p=>{i.options.onStateChange==null||i.options.onStateChange(p)},_getRowId:(p,h,m)=>{var b;return(b=i.options.getRowId==null?void 0:i.options.getRowId(p,h,m))!=null?b:`${m?[m.id,h].join("."):h}`},getCoreRowModel:()=>(i._getCoreRowModel||(i._getCoreRowModel=i.options.getCoreRowModel(i)),i._getCoreRowModel()),getRowModel:()=>i.getPaginationRowModel(),getRow:(p,h)=>{let m=(h?i.getPrePaginationRowModel():i.getRowModel()).rowsById[p];if(!m&&(m=i.getCoreRowModel().rowsById[p],!m))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${p}`):new Error;return m},_getDefaultColumnDef:Ye(()=>[i.options.defaultColumn],p=>{var h;return p=(h=p)!=null?h:{},{header:m=>{const b=m.header.column.columnDef;return b.accessorKey?b.accessorKey:b.accessorFn?b.id:null},cell:m=>{var b,v;return(b=(v=m.renderValue())==null||v.toString==null?void 0:v.toString())!=null?b:null},...i._features.reduce((m,b)=>Object.assign(m,b.getDefaultColumnDef==null?void 0:b.getDefaultColumnDef()),{}),...p}},Ke(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>i.options.columns,getAllColumns:Ye(()=>[i._getColumnDefs()],p=>{const h=function(m,b,v){return v===void 0&&(v=0),m.map(x=>{const S=gde(i,x,v,b),_=x;return S.columns=_.columns?h(_.columns,S,v+1):[],S})};return h(p)},Ke(e,"debugColumns","getAllColumns")),getAllFlatColumns:Ye(()=>[i.getAllColumns()],p=>p.flatMap(h=>h.getFlatColumns()),Ke(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:Ye(()=>[i.getAllFlatColumns()],p=>p.reduce((h,m)=>(h[m.id]=m,h),{}),Ke(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:Ye(()=>[i.getAllColumns(),i._getOrderColumnsFn()],(p,h)=>{let m=p.flatMap(b=>b.getLeafColumns());return h(m)},Ke(e,"debugColumns","getAllLeafColumns")),getColumn:p=>{const h=i._getAllFlatColumnsById()[p];return process.env.NODE_ENV!=="production"&&!h&&console.error(`[Table] Column with id '${p}' does not exist.`),h}};Object.assign(i,d);for(let p=0;p<i._features.length;p++){const h=i._features[p];h==null||h.createTable==null||h.createTable(i)}return i}function w6(){return e=>Ye(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(i,o,s){o===void 0&&(o=0);const a=[];for(let c=0;c<i.length;c++){const u=bde(e,e._getRowId(i[c],c,s),i[c],c,o,void 0,s==null?void 0:s.id);if(n.flatRows.push(u),n.rowsById[u.id]=u,a.push(u),e.options.getSubRows){var l;u.originalSubRows=e.options.getSubRows(i[c],c),(l=u.originalSubRows)!=null&&l.length&&(u.subRows=r(u.originalSubRows,o+1,u))}}return a};return n.rows=r(t),n},Ke(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function Qde(e){const t=[],n=r=>{var i;t.push(r),(i=r.subRows)!=null&&i.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function S6(e){return t=>Ye(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:i,pageIndex:o}=n;let{rows:s,flatRows:a,rowsById:l}=r;const c=i*o,u=c+i;s=s.slice(c,u);let d;t.options.paginateExpandedRows?d={rows:s,flatRows:a,rowsById:l}:d=Qde({rows:s,flatRows:a,rowsById:l}),d.flatRows=[];const p=h=>{d.flatRows.push(h),h.subRows.length&&h.subRows.forEach(p)};return d.rows.forEach(p),d},Ke(t.options,"debugTable","getPaginationRowModel"))}function _6(){return e=>Ye(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,i=[],o=r.filter(l=>{var c;return(c=e.getColumn(l.id))==null?void 0:c.getCanSort()}),s={};o.forEach(l=>{const c=e.getColumn(l.id);c&&(s[l.id]={sortUndefined:c.columnDef.sortUndefined,invertSorting:c.columnDef.invertSorting,sortingFn:c.getSortingFn()})});const a=l=>{const c=l.map(u=>({...u}));return c.sort((u,d)=>{for(let h=0;h<o.length;h+=1){var p;const m=o[h],b=s[m.id],v=b.sortUndefined,x=(p=m==null?void 0:m.desc)!=null?p:!1;let S=0;if(v){const _=u.getValue(m.id),E=d.getValue(m.id),C=_===void 0,M=E===void 0;if(C||M){if(v==="first")return C?-1:1;if(v==="last")return C?1:-1;S=C&&M?0:C?v:-v}}if(S===0&&(S=b.sortingFn(u,d,m.id)),S!==0)return x&&(S*=-1),b.invertSorting&&(S*=-1),S}return u.index-d.index}),c.forEach(u=>{var d;i.push(u),(d=u.subRows)!=null&&d.length&&(u.subRows=a(u.subRows))}),c};return{rows:a(n.rows),flatRows:i,rowsById:n.rowsById}},Ke(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
|
|
314
|
-
* react-table
|
|
315
|
-
*
|
|
316
|
-
* Copyright (c) TanStack
|
|
317
|
-
*
|
|
318
|
-
* This source code is licensed under the MIT license found in the
|
|
319
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
320
|
-
*
|
|
321
|
-
* @license MIT
|
|
322
|
-
*/function qS(e,t){return e?Jde(e)?R.createElement(e,t):e:null}function Jde(e){return Zde(e)||typeof e=="function"||efe(e)}function Zde(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function efe(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function C6(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=R.useState(()=>({current:Xde(t)})),[r,i]=R.useState(()=>n.current.initialState);return n.current.setOptions(o=>({...o,...e,state:{...r,...e.state},onStateChange:s=>{i(s),e.onStateChange==null||e.onStateChange(s)}})),n.current}function YS(e,[t,n]){return Math.min(n,Math.max(t,e))}var y1=0;function v0(){R.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??EA()),document.body.insertAdjacentElement("beforeend",e[1]??EA()),y1++,()=>{y1===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),y1--}},[])}function EA(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var v1="focusScope.autoFocusOnMount",x1="focusScope.autoFocusOnUnmount",RA={bubbles:!1,cancelable:!0},tfe="FocusScope",Ip=R.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[a,l]=R.useState(null),c=er(i),u=er(o),d=R.useRef(null),p=rt(t,b=>l(b)),h=R.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;R.useEffect(()=>{if(r){let b=function(_){if(h.paused||!a)return;const E=_.target;a.contains(E)?d.current=E:Sa(d.current,{select:!0})},v=function(_){if(h.paused||!a)return;const E=_.relatedTarget;E!==null&&(a.contains(E)||Sa(d.current,{select:!0}))},x=function(_){if(document.activeElement===document.body)for(const C of _)C.removedNodes.length>0&&Sa(a)};document.addEventListener("focusin",b),document.addEventListener("focusout",v);const S=new MutationObserver(x);return a&&S.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",v),S.disconnect()}}},[r,a,h.paused]),R.useEffect(()=>{if(a){TA.add(h);const b=document.activeElement;if(!a.contains(b)){const x=new CustomEvent(v1,RA);a.addEventListener(v1,c),a.dispatchEvent(x),x.defaultPrevented||(nfe(afe(E6(a)),{select:!0}),document.activeElement===b&&Sa(a))}return()=>{a.removeEventListener(v1,c),setTimeout(()=>{const x=new CustomEvent(x1,RA);a.addEventListener(x1,u),a.dispatchEvent(x),x.defaultPrevented||Sa(b??document.body,{select:!0}),a.removeEventListener(x1,u),TA.remove(h)},0)}}},[a,c,u,h]);const m=R.useCallback(b=>{if(!n&&!r||h.paused)return;const v=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,x=document.activeElement;if(v&&x){const S=b.currentTarget,[_,E]=rfe(S);_&&E?!b.shiftKey&&x===E?(b.preventDefault(),n&&Sa(_,{select:!0})):b.shiftKey&&x===_&&(b.preventDefault(),n&&Sa(E,{select:!0})):x===S&&b.preventDefault()}},[n,r,h.paused]);return y.jsx(Ne.div,{tabIndex:-1,...s,ref:p,onKeyDown:m})});Ip.displayName=tfe;function nfe(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Sa(r,{select:t}),document.activeElement!==n)return}function rfe(e){const t=E6(e),n=PA(t,e),r=PA(t.reverse(),e);return[n,r]}function E6(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function PA(e,t){for(const n of e)if(!ife(n,{upTo:t}))return n}function ife(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function ofe(e){return e instanceof HTMLInputElement&&"select"in e}function Sa(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ofe(e)&&t&&e.select()}}var TA=sfe();function sfe(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=MA(e,t),e.unshift(t)},remove(t){var n;e=MA(e,t),(n=e[0])==null||n.resume()}}}function MA(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function afe(e){return e.filter(t=>t.tagName!=="A")}function x0(e){const t=R.useRef({value:e,previous:e});return R.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var lfe=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},lu=new WeakMap,Om=new WeakMap,Dm={},w1=0,R6=function(e){return e&&(e.host||R6(e.parentNode))},cfe=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=R6(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},ufe=function(e,t,n,r){var i=cfe(t,Array.isArray(e)?e:[e]);Dm[n]||(Dm[n]=new WeakMap);var o=Dm[n],s=[],a=new Set,l=new Set(i),c=function(d){!d||a.has(d)||(a.add(d),c(d.parentNode))};i.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(p){if(a.has(p))u(p);else try{var h=p.getAttribute(r),m=h!==null&&h!=="false",b=(lu.get(p)||0)+1,v=(o.get(p)||0)+1;lu.set(p,b),o.set(p,v),s.push(p),b===1&&m&&Om.set(p,!0),v===1&&p.setAttribute(n,"true"),m||p.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",p,x)}})};return u(t),a.clear(),w1++,function(){s.forEach(function(d){var p=lu.get(d)-1,h=o.get(d)-1;lu.set(d,p),o.set(d,h),p||(Om.has(d)||d.removeAttribute(r),Om.delete(d)),h||d.removeAttribute(n)}),w1--,w1||(lu=new WeakMap,lu=new WeakMap,Om=new WeakMap,Dm={})}},w0=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=lfe(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),ufe(r,i,n,"aria-hidden")):function(){return null}},Qo=function(){return Qo=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Qo.apply(this,arguments)};function P6(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function dfe(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var db="right-scroll-bar-position",fb="width-before-scroll-bar",ffe="with-scroll-bars-hidden",hfe="--removed-body-scroll-bar-size";function S1(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function pfe(e,t){var n=P.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var gfe=typeof window<"u"?R.useLayoutEffect:R.useEffect,OA=new WeakMap;function mfe(e,t){var n=pfe(null,function(r){return e.forEach(function(i){return S1(i,r)})});return gfe(function(){var r=OA.get(n);if(r){var i=new Set(r),o=new Set(e),s=n.current;i.forEach(function(a){o.has(a)||S1(a,null)}),o.forEach(function(a){i.has(a)||S1(a,s)})}OA.set(n,e)},[e]),n}function bfe(e){return e}function yfe(e,t){t===void 0&&(t=bfe);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var s=t(o,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(o){for(r=!0;n.length;){var s=n;n=[],s.forEach(o)}n={push:function(a){return o(a)},filter:function(){return n}}},assignMedium:function(o){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(o),s=n}var l=function(){var u=s;s=[],u.forEach(o)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){s.push(u),c()},filter:function(u){return s=s.filter(u),n}}}};return i}function vfe(e){e===void 0&&(e={});var t=yfe(null);return t.options=Qo({async:!0,ssr:!1},e),t}var T6=function(e){var t=e.sideCar,n=P6(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return R.createElement(r,Qo({},n))};T6.isSideCarExport=!0;function xfe(e,t){return e.useMedium(t),T6}var M6=vfe(),_1=function(){},S0=R.forwardRef(function(e,t){var n=R.useRef(null),r=R.useState({onScrollCapture:_1,onWheelCapture:_1,onTouchMoveCapture:_1}),i=r[0],o=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,p=e.sideCar,h=e.noIsolation,m=e.inert,b=e.allowPinchZoom,v=e.as,x=v===void 0?"div":v,S=e.gapMode,_=P6(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=p,C=mfe([n,t]),M=Qo(Qo({},_),i);return R.createElement(R.Fragment,null,u&&R.createElement(E,{sideCar:M6,removeScrollBar:c,shards:d,noIsolation:h,inert:m,setCallbacks:o,allowPinchZoom:!!b,lockRef:n,gapMode:S}),s?R.cloneElement(R.Children.only(a),Qo(Qo({},M),{ref:C})):R.createElement(x,Qo({},M,{className:l,ref:C}),a))});S0.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};S0.classNames={fullWidth:fb,zeroRight:db};var wfe=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Sfe(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=wfe();return t&&e.setAttribute("nonce",t),e}function _fe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Cfe(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Efe=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Sfe())&&(_fe(t,n),Cfe(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Rfe=function(){var e=Efe();return function(t,n){R.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},O6=function(){var e=Rfe(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},Pfe={left:0,top:0,right:0,gap:0},C1=function(e){return parseInt(e||"",10)||0},Tfe=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[C1(n),C1(r),C1(i)]},Mfe=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Pfe;var t=Tfe(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Ofe=O6(),Nu="data-scroll-locked",Dfe=function(e,t,n,r){var i=e.left,o=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
323
|
-
.`.concat(ffe,` {
|
|
324
|
-
overflow: hidden `).concat(r,`;
|
|
325
|
-
padding-right: `).concat(a,"px ").concat(r,`;
|
|
326
|
-
}
|
|
327
|
-
body[`).concat(Nu,`] {
|
|
328
|
-
overflow: hidden `).concat(r,`;
|
|
329
|
-
overscroll-behavior: contain;
|
|
330
|
-
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
331
|
-
padding-left: `.concat(i,`px;
|
|
332
|
-
padding-top: `).concat(o,`px;
|
|
333
|
-
padding-right: `).concat(s,`px;
|
|
334
|
-
margin-left:0;
|
|
335
|
-
margin-top:0;
|
|
336
|
-
margin-right: `).concat(a,"px ").concat(r,`;
|
|
337
|
-
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
.`).concat(db,` {
|
|
341
|
-
right: `).concat(a,"px ").concat(r,`;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
.`).concat(fb,` {
|
|
345
|
-
margin-right: `).concat(a,"px ").concat(r,`;
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
.`).concat(db," .").concat(db,` {
|
|
349
|
-
right: 0 `).concat(r,`;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
.`).concat(fb," .").concat(fb,` {
|
|
353
|
-
margin-right: 0 `).concat(r,`;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
body[`).concat(Nu,`] {
|
|
357
|
-
`).concat(hfe,": ").concat(a,`px;
|
|
358
|
-
}
|
|
359
|
-
`)},DA=function(){var e=parseInt(document.body.getAttribute(Nu)||"0",10);return isFinite(e)?e:0},Afe=function(){R.useEffect(function(){return document.body.setAttribute(Nu,(DA()+1).toString()),function(){var e=DA()-1;e<=0?document.body.removeAttribute(Nu):document.body.setAttribute(Nu,e.toString())}},[])},kfe=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;Afe();var o=R.useMemo(function(){return Mfe(i)},[i]);return R.createElement(Ofe,{styles:Dfe(o,!t,i,n?"":"!important")})},KS=!1;if(typeof window<"u")try{var Am=Object.defineProperty({},"passive",{get:function(){return KS=!0,!0}});window.addEventListener("test",Am,Am),window.removeEventListener("test",Am,Am)}catch{KS=!1}var cu=KS?{passive:!1}:!1,Ife=function(e){return e.tagName==="TEXTAREA"},D6=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Ife(e)&&n[t]==="visible")},Nfe=function(e){return D6(e,"overflowY")},Lfe=function(e){return D6(e,"overflowX")},AA=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=A6(e,r);if(i){var o=k6(e,r),s=o[1],a=o[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Ffe=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},jfe=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},A6=function(e,t){return e==="v"?Nfe(t):Lfe(t)},k6=function(e,t){return e==="v"?Ffe(t):jfe(t)},$fe=function(e,t){return e==="h"&&t==="rtl"?-1:1},zfe=function(e,t,n,r,i){var o=$fe(e,window.getComputedStyle(t).direction),s=o*r,a=n.target,l=t.contains(a),c=!1,u=s>0,d=0,p=0;do{var h=k6(e,a),m=h[0],b=h[1],v=h[2],x=b-v-o*m;(m||x)&&A6(e,a)&&(d+=x,p+=m),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&Math.abs(d)<1||!u&&Math.abs(p)<1)&&(c=!0),c},km=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},kA=function(e){return[e.deltaX,e.deltaY]},IA=function(e){return e&&"current"in e?e.current:e},Bfe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Hfe=function(e){return`
|
|
360
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
361
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
362
|
-
`)},Vfe=0,uu=[];function Wfe(e){var t=R.useRef([]),n=R.useRef([0,0]),r=R.useRef(),i=R.useState(Vfe++)[0],o=R.useState(O6)[0],s=R.useRef(e);R.useEffect(function(){s.current=e},[e]),R.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var b=dfe([e.lockRef.current],(e.shards||[]).map(IA),!0).filter(Boolean);return b.forEach(function(v){return v.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),b.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=R.useCallback(function(b,v){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!s.current.allowPinchZoom;var x=km(b),S=n.current,_="deltaX"in b?b.deltaX:S[0]-x[0],E="deltaY"in b?b.deltaY:S[1]-x[1],C,M=b.target,O=Math.abs(_)>Math.abs(E)?"h":"v";if("touches"in b&&O==="h"&&M.type==="range")return!1;var k=AA(O,M);if(!k)return!0;if(k?C=O:(C=O==="v"?"h":"v",k=AA(O,M)),!k)return!1;if(!r.current&&"changedTouches"in b&&(_||E)&&(r.current=C),!C)return!0;var N=r.current||C;return zfe(N,v,b,N==="h"?_:E)},[]),l=R.useCallback(function(b){var v=b;if(!(!uu.length||uu[uu.length-1]!==o)){var x="deltaY"in v?kA(v):km(v),S=t.current.filter(function(C){return C.name===v.type&&(C.target===v.target||v.target===C.shadowParent)&&Bfe(C.delta,x)})[0];if(S&&S.should){v.cancelable&&v.preventDefault();return}if(!S){var _=(s.current.shards||[]).map(IA).filter(Boolean).filter(function(C){return C.contains(v.target)}),E=_.length>0?a(v,_[0]):!s.current.noIsolation;E&&v.cancelable&&v.preventDefault()}}},[]),c=R.useCallback(function(b,v,x,S){var _={name:b,delta:v,target:x,should:S,shadowParent:Ufe(x)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(E){return E!==_})},1)},[]),u=R.useCallback(function(b){n.current=km(b),r.current=void 0},[]),d=R.useCallback(function(b){c(b.type,kA(b),b.target,a(b,e.lockRef.current))},[]),p=R.useCallback(function(b){c(b.type,km(b),b.target,a(b,e.lockRef.current))},[]);R.useEffect(function(){return uu.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",l,cu),document.addEventListener("touchmove",l,cu),document.addEventListener("touchstart",u,cu),function(){uu=uu.filter(function(b){return b!==o}),document.removeEventListener("wheel",l,cu),document.removeEventListener("touchmove",l,cu),document.removeEventListener("touchstart",u,cu)}},[]);var h=e.removeScrollBar,m=e.inert;return R.createElement(R.Fragment,null,m?R.createElement(o,{styles:Hfe(i)}):null,h?R.createElement(kfe,{gapMode:e.gapMode}):null)}function Ufe(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Gfe=xfe(M6,Wfe);var Np=R.forwardRef(function(e,t){return R.createElement(S0,Qo({},e,{ref:t,sideCar:Gfe}))});Np.classNames=S0.classNames;var qfe=[" ","Enter","ArrowUp","ArrowDown"],Yfe=[" ","Enter"],Lp="Select",[_0,C0,Kfe]=Ny(Lp),[$d,sMe]=tr(Lp,[Kfe,ys]),E0=ys(),[Xfe,rl]=$d(Lp),[Qfe,Jfe]=$d(Lp),I6=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:s,defaultValue:a,onValueChange:l,dir:c,name:u,autoComplete:d,disabled:p,required:h,form:m}=e,b=E0(t),[v,x]=R.useState(null),[S,_]=R.useState(null),[E,C]=R.useState(!1),M=Ac(c),[O=!1,k]=Ar({prop:r,defaultProp:i,onChange:o}),[N,F]=Ar({prop:s,defaultProp:a,onChange:l}),j=R.useRef(null),$=v?m||!!v.closest("form"):!0,[X,V]=R.useState(new Set),L=Array.from(X).map(U=>U.props.value).join(";");return y.jsx(Mp,{...b,children:y.jsxs(Xfe,{required:h,scope:t,trigger:v,onTriggerChange:x,valueNode:S,onValueNodeChange:_,valueNodeHasChildren:E,onValueNodeHasChildrenChange:C,contentId:qn(),value:N,onValueChange:F,open:O,onOpenChange:k,dir:M,triggerPointerDownPosRef:j,disabled:p,children:[y.jsx(_0.Provider,{scope:t,children:y.jsx(Qfe,{scope:e.__scopeSelect,onNativeOptionAdd:R.useCallback(U=>{V(B=>new Set(B).add(U))},[]),onNativeOptionRemove:R.useCallback(U=>{V(B=>{const W=new Set(B);return W.delete(U),W})},[]),children:n})}),$?y.jsxs(sF,{"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:d,value:N,onChange:U=>F(U.target.value),disabled:p,form:m,children:[N===void 0?y.jsx("option",{value:""}):null,Array.from(X)]},L):null]})})};I6.displayName=Lp;var N6="SelectTrigger",L6=R.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=E0(n),s=rl(N6,n),a=s.disabled||r,l=rt(t,s.onTriggerChange),c=C0(n),u=R.useRef("touch"),[d,p,h]=aF(b=>{const v=c().filter(_=>!_.disabled),x=v.find(_=>_.value===s.value),S=lF(v,b,x);S!==void 0&&s.onValueChange(S.value)}),m=b=>{a||(s.onOpenChange(!0),h()),b&&(s.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return y.jsx(Ld,{asChild:!0,...o,children:y.jsx(Ne.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":oF(s.value)?"":void 0,...i,ref:l,onClick:Re(i.onClick,b=>{b.currentTarget.focus(),u.current!=="mouse"&&m(b)}),onPointerDown:Re(i.onPointerDown,b=>{u.current=b.pointerType;const v=b.target;v.hasPointerCapture(b.pointerId)&&v.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(m(b),b.preventDefault())}),onKeyDown:Re(i.onKeyDown,b=>{const v=d.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&p(b.key),!(v&&b.key===" ")&&qfe.includes(b.key)&&(m(),b.preventDefault())})})})});L6.displayName=N6;var F6="SelectValue",j6=R.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:s="",...a}=e,l=rl(F6,n),{onValueNodeHasChildrenChange:c}=l,u=o!==void 0,d=rt(t,l.onValueNodeChange);return mr(()=>{c(u)},[c,u]),y.jsx(Ne.span,{...a,ref:d,style:{pointerEvents:"none"},children:oF(l.value)?y.jsx(y.Fragment,{children:s}):o})});j6.displayName=F6;var Zfe="SelectIcon",$6=R.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return y.jsx(Ne.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});$6.displayName=Zfe;var ehe="SelectPortal",z6=e=>y.jsx(Ap,{asChild:!0,...e});z6.displayName=ehe;var _c="SelectContent",B6=R.forwardRef((e,t)=>{const n=rl(_c,e.__scopeSelect),[r,i]=R.useState();if(mr(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?hc.createPortal(y.jsx(H6,{scope:e.__scopeSelect,children:y.jsx(_0.Slot,{scope:e.__scopeSelect,children:y.jsx("div",{children:e.children})})}),o):null}return y.jsx(V6,{...e,ref:t})});B6.displayName=_c;var wo=10,[H6,il]=$d(_c),the="SelectContentImpl",V6=R.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:p,collisionPadding:h,sticky:m,hideWhenDetached:b,avoidCollisions:v,...x}=e,S=rl(_c,n),[_,E]=R.useState(null),[C,M]=R.useState(null),O=rt(t,J=>E(J)),[k,N]=R.useState(null),[F,j]=R.useState(null),$=C0(n),[X,V]=R.useState(!1),L=R.useRef(!1);R.useEffect(()=>{if(_)return w0(_)},[_]),v0();const U=R.useCallback(J=>{const[Z,...ae]=$().map(ie=>ie.ref.current),[ce]=ae.slice(-1),pe=document.activeElement;for(const ie of J)if(ie===pe||(ie==null||ie.scrollIntoView({block:"nearest"}),ie===Z&&C&&(C.scrollTop=0),ie===ce&&C&&(C.scrollTop=C.scrollHeight),ie==null||ie.focus(),document.activeElement!==pe))return},[$,C]),B=R.useCallback(()=>U([k,_]),[U,k,_]);R.useEffect(()=>{X&&B()},[X,B]);const{onOpenChange:W,triggerPointerDownPosRef:q}=S;R.useEffect(()=>{if(_){let J={x:0,y:0};const Z=ce=>{var pe,ie;J={x:Math.abs(Math.round(ce.pageX)-(((pe=q.current)==null?void 0:pe.x)??0)),y:Math.abs(Math.round(ce.pageY)-(((ie=q.current)==null?void 0:ie.y)??0))}},ae=ce=>{J.x<=10&&J.y<=10?ce.preventDefault():_.contains(ce.target)||W(!1),document.removeEventListener("pointermove",Z),q.current=null};return q.current!==null&&(document.addEventListener("pointermove",Z),document.addEventListener("pointerup",ae,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Z),document.removeEventListener("pointerup",ae,{capture:!0})}}},[_,W,q]),R.useEffect(()=>{const J=()=>W(!1);return window.addEventListener("blur",J),window.addEventListener("resize",J),()=>{window.removeEventListener("blur",J),window.removeEventListener("resize",J)}},[W]);const[A,Y]=aF(J=>{const Z=$().filter(pe=>!pe.disabled),ae=Z.find(pe=>pe.ref.current===document.activeElement),ce=lF(Z,J,ae);ce&&setTimeout(()=>ce.ref.current.focus())}),G=R.useCallback((J,Z,ae)=>{const ce=!L.current&&!ae;(S.value!==void 0&&S.value===Z||ce)&&(N(J),ce&&(L.current=!0))},[S.value]),D=R.useCallback(()=>_==null?void 0:_.focus(),[_]),ee=R.useCallback((J,Z,ae)=>{const ce=!L.current&&!ae;(S.value!==void 0&&S.value===Z||ce)&&j(J)},[S.value]),K=r==="popper"?XS:W6,oe=K===XS?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:p,collisionPadding:h,sticky:m,hideWhenDetached:b,avoidCollisions:v}:{};return y.jsx(H6,{scope:n,content:_,viewport:C,onViewportChange:M,itemRefCallback:G,selectedItem:k,onItemLeave:D,itemTextRefCallback:ee,focusSelectedItem:B,selectedItemText:F,position:r,isPositioned:X,searchRef:A,children:y.jsx(Np,{as:Js,allowPinchZoom:!0,children:y.jsx(Ip,{asChild:!0,trapped:S.open,onMountAutoFocus:J=>{J.preventDefault()},onUnmountAutoFocus:Re(i,J=>{var Z;(Z=S.trigger)==null||Z.focus({preventScroll:!0}),J.preventDefault()}),children:y.jsx(Lc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:J=>J.preventDefault(),onDismiss:()=>S.onOpenChange(!1),children:y.jsx(K,{role:"listbox",id:S.contentId,"data-state":S.open?"open":"closed",dir:S.dir,onContextMenu:J=>J.preventDefault(),...x,...oe,onPlaced:()=>V(!0),ref:O,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:Re(x.onKeyDown,J=>{const Z=J.ctrlKey||J.altKey||J.metaKey;if(J.key==="Tab"&&J.preventDefault(),!Z&&J.key.length===1&&Y(J.key),["ArrowUp","ArrowDown","Home","End"].includes(J.key)){let ce=$().filter(pe=>!pe.disabled).map(pe=>pe.ref.current);if(["ArrowUp","End"].includes(J.key)&&(ce=ce.slice().reverse()),["ArrowUp","ArrowDown"].includes(J.key)){const pe=J.target,ie=ce.indexOf(pe);ce=ce.slice(ie+1)}setTimeout(()=>U(ce)),J.preventDefault()}})})})})})})});V6.displayName=the;var nhe="SelectItemAlignedPosition",W6=R.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=rl(_c,n),s=il(_c,n),[a,l]=R.useState(null),[c,u]=R.useState(null),d=rt(t,O=>u(O)),p=C0(n),h=R.useRef(!1),m=R.useRef(!0),{viewport:b,selectedItem:v,selectedItemText:x,focusSelectedItem:S}=s,_=R.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&c&&b&&v&&x){const O=o.trigger.getBoundingClientRect(),k=c.getBoundingClientRect(),N=o.valueNode.getBoundingClientRect(),F=x.getBoundingClientRect();if(o.dir!=="rtl"){const pe=F.left-k.left,ie=N.left-pe,ge=O.left-ie,de=O.width+ge,Ee=Math.max(de,k.width),De=window.innerWidth-wo,$e=YS(ie,[wo,Math.max(wo,De-Ee)]);a.style.minWidth=de+"px",a.style.left=$e+"px"}else{const pe=k.right-F.right,ie=window.innerWidth-N.right-pe,ge=window.innerWidth-O.right-ie,de=O.width+ge,Ee=Math.max(de,k.width),De=window.innerWidth-wo,$e=YS(ie,[wo,Math.max(wo,De-Ee)]);a.style.minWidth=de+"px",a.style.right=$e+"px"}const j=p(),$=window.innerHeight-wo*2,X=b.scrollHeight,V=window.getComputedStyle(c),L=parseInt(V.borderTopWidth,10),U=parseInt(V.paddingTop,10),B=parseInt(V.borderBottomWidth,10),W=parseInt(V.paddingBottom,10),q=L+U+X+W+B,A=Math.min(v.offsetHeight*5,q),Y=window.getComputedStyle(b),G=parseInt(Y.paddingTop,10),D=parseInt(Y.paddingBottom,10),ee=O.top+O.height/2-wo,K=$-ee,oe=v.offsetHeight/2,J=v.offsetTop+oe,Z=L+U+J,ae=q-Z;if(Z<=ee){const pe=j.length>0&&v===j[j.length-1].ref.current;a.style.bottom="0px";const ie=c.clientHeight-b.offsetTop-b.offsetHeight,ge=Math.max(K,oe+(pe?D:0)+ie+B),de=Z+ge;a.style.height=de+"px"}else{const pe=j.length>0&&v===j[0].ref.current;a.style.top="0px";const ge=Math.max(ee,L+b.offsetTop+(pe?G:0)+oe)+ae;a.style.height=ge+"px",b.scrollTop=Z-ee+b.offsetTop}a.style.margin=`${wo}px 0`,a.style.minHeight=A+"px",a.style.maxHeight=$+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[p,o.trigger,o.valueNode,a,c,b,v,x,o.dir,r]);mr(()=>_(),[_]);const[E,C]=R.useState();mr(()=>{c&&C(window.getComputedStyle(c).zIndex)},[c]);const M=R.useCallback(O=>{O&&m.current===!0&&(_(),S==null||S(),m.current=!1)},[_,S]);return y.jsx(ihe,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:M,children:y.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:y.jsx(Ne.div,{...i,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});W6.displayName=nhe;var rhe="SelectPopperPosition",XS=R.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=wo,...o}=e,s=E0(n);return y.jsx(Op,{...s,...o,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});XS.displayName=rhe;var[ihe,HE]=$d(_c,{}),QS="SelectViewport",U6=R.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=il(QS,n),s=HE(QS,n),a=rt(t,o.onViewportChange),l=R.useRef(0);return y.jsxs(y.Fragment,{children:[y.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),y.jsx(_0.Slot,{scope:n,children:y.jsx(Ne.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Re(i.onScroll,c=>{const u=c.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:p}=s;if(p!=null&&p.current&&d){const h=Math.abs(l.current-u.scrollTop);if(h>0){const m=window.innerHeight-wo*2,b=parseFloat(d.style.minHeight),v=parseFloat(d.style.height),x=Math.max(b,v);if(x<m){const S=x+h,_=Math.min(m,S),E=S-_;d.style.height=_+"px",d.style.bottom==="0px"&&(u.scrollTop=E>0?E:0,d.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});U6.displayName=QS;var G6="SelectGroup",[ohe,she]=$d(G6),q6=R.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=qn();return y.jsx(ohe,{scope:n,id:i,children:y.jsx(Ne.div,{role:"group","aria-labelledby":i,...r,ref:t})})});q6.displayName=G6;var Y6="SelectLabel",K6=R.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=she(Y6,n);return y.jsx(Ne.div,{id:i.id,...r,ref:t})});K6.displayName=Y6;var sy="SelectItem",[ahe,X6]=$d(sy),Q6=R.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...s}=e,a=rl(sy,n),l=il(sy,n),c=a.value===r,[u,d]=R.useState(o??""),[p,h]=R.useState(!1),m=rt(t,S=>{var _;return(_=l.itemRefCallback)==null?void 0:_.call(l,S,r,i)}),b=qn(),v=R.useRef("touch"),x=()=>{i||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return y.jsx(ahe,{scope:n,value:r,disabled:i,textId:b,isSelected:c,onItemTextChange:R.useCallback(S=>{d(_=>_||((S==null?void 0:S.textContent)??"").trim())},[]),children:y.jsx(_0.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:y.jsx(Ne.div,{role:"option","aria-labelledby":b,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...s,ref:m,onFocus:Re(s.onFocus,()=>h(!0)),onBlur:Re(s.onBlur,()=>h(!1)),onClick:Re(s.onClick,()=>{v.current!=="mouse"&&x()}),onPointerUp:Re(s.onPointerUp,()=>{v.current==="mouse"&&x()}),onPointerDown:Re(s.onPointerDown,S=>{v.current=S.pointerType}),onPointerMove:Re(s.onPointerMove,S=>{var _;v.current=S.pointerType,i?(_=l.onItemLeave)==null||_.call(l):v.current==="mouse"&&S.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Re(s.onPointerLeave,S=>{var _;S.currentTarget===document.activeElement&&((_=l.onItemLeave)==null||_.call(l))}),onKeyDown:Re(s.onKeyDown,S=>{var E;((E=l.searchRef)==null?void 0:E.current)!==""&&S.key===" "||(Yfe.includes(S.key)&&x(),S.key===" "&&S.preventDefault())})})})})});Q6.displayName=sy;var Kf="SelectItemText",J6=R.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,s=rl(Kf,n),a=il(Kf,n),l=X6(Kf,n),c=Jfe(Kf,n),[u,d]=R.useState(null),p=rt(t,x=>d(x),l.onItemTextChange,x=>{var S;return(S=a.itemTextRefCallback)==null?void 0:S.call(a,x,l.value,l.disabled)}),h=u==null?void 0:u.textContent,m=R.useMemo(()=>y.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:b,onNativeOptionRemove:v}=c;return mr(()=>(b(m),()=>v(m)),[b,v,m]),y.jsxs(y.Fragment,{children:[y.jsx(Ne.span,{id:l.textId,...o,ref:p}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?hc.createPortal(o.children,s.valueNode):null]})});J6.displayName=Kf;var Z6="SelectItemIndicator",eF=R.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return X6(Z6,n).isSelected?y.jsx(Ne.span,{"aria-hidden":!0,...r,ref:t}):null});eF.displayName=Z6;var JS="SelectScrollUpButton",tF=R.forwardRef((e,t)=>{const n=il(JS,e.__scopeSelect),r=HE(JS,e.__scopeSelect),[i,o]=R.useState(!1),s=rt(t,r.onScrollButtonChange);return mr(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollTop>0;o(c)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),i?y.jsx(rF,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});tF.displayName=JS;var ZS="SelectScrollDownButton",nF=R.forwardRef((e,t)=>{const n=il(ZS,e.__scopeSelect),r=HE(ZS,e.__scopeSelect),[i,o]=R.useState(!1),s=rt(t,r.onScrollButtonChange);return mr(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<c;o(u)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),i?y.jsx(rF,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});nF.displayName=ZS;var rF=R.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=il("SelectScrollButton",n),s=R.useRef(null),a=C0(n),l=R.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return R.useEffect(()=>()=>l(),[l]),mr(()=>{var u;const c=a().find(d=>d.ref.current===document.activeElement);(u=c==null?void 0:c.ref.current)==null||u.scrollIntoView({block:"nearest"})},[a]),y.jsx(Ne.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Re(i.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:Re(i.onPointerMove,()=>{var c;(c=o.onItemLeave)==null||c.call(o),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:Re(i.onPointerLeave,()=>{l()})})}),lhe="SelectSeparator",iF=R.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return y.jsx(Ne.div,{"aria-hidden":!0,...r,ref:t})});iF.displayName=lhe;var e_="SelectArrow",che=R.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=E0(n),o=rl(e_,n),s=il(e_,n);return o.open&&s.position==="popper"?y.jsx(Dp,{...i,...r,ref:t}):null});che.displayName=e_;function oF(e){return e===""||e===void 0}var sF=R.forwardRef((e,t)=>{const{value:n,...r}=e,i=R.useRef(null),o=rt(t,i),s=x0(n);return R.useEffect(()=>{const a=i.current,l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==n&&u){const d=new Event("change",{bubbles:!0});u.call(a,n),a.dispatchEvent(d)}},[s,n]),y.jsx(OE,{asChild:!0,children:y.jsx("select",{...r,ref:o,defaultValue:n})})});sF.displayName="BubbleSelect";function aF(e){const t=er(e),n=R.useRef(""),r=R.useRef(0),i=R.useCallback(s=>{const a=n.current+s;t(a),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),o=R.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return R.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function lF(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let s=uhe(e,Math.max(o,0));i.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function uhe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var dhe=I6,cF=L6,fhe=j6,hhe=$6,phe=z6,uF=B6,ghe=U6,mhe=q6,dF=K6,fF=Q6,bhe=J6,yhe=eF,hF=tF,pF=nF,gF=iF;const js=dhe,mu=mhe,$s=fhe,Vo=R.forwardRef(({className:e,children:t,...n},r)=>y.jsxs(cF,{ref:r,className:be("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,y.jsx(hhe,{asChild:!0,children:y.jsx(Jy,{className:"h-4 w-4 opacity-50"})})]}));Vo.displayName=cF.displayName;const mF=R.forwardRef(({className:e,...t},n)=>y.jsx(hF,{ref:n,className:be("flex cursor-default items-center justify-center py-1",e),...t,children:y.jsx(G5,{className:"h-4 w-4"})}));mF.displayName=hF.displayName;const bF=R.forwardRef(({className:e,...t},n)=>y.jsx(pF,{ref:n,className:be("flex cursor-default items-center justify-center py-1",e),...t,children:y.jsx(Jy,{className:"h-4 w-4"})}));bF.displayName=pF.displayName;const Wo=R.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>y.jsx(phe,{children:y.jsx(Dc,{children:y.jsxs(uF,{ref:i,className:be("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[y.jsx(mF,{}),y.jsx(ghe,{className:be("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),y.jsx(bF,{})]})})}));Wo.displayName=uF.displayName;const kl=R.forwardRef(({className:e,...t},n)=>y.jsx(dF,{ref:n,className:be("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));kl.displayName=dF.displayName;const kn=R.forwardRef(({className:e,children:t,...n},r)=>y.jsxs(fF,{ref:r,className:be("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[y.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:y.jsx(yhe,{children:y.jsx(Td,{className:"h-4 w-4"})})}),y.jsx(bhe,{children:t})]}));kn.displayName=fF.displayName;const hh=R.forwardRef(({className:e,...t},n)=>y.jsx(gF,{ref:n,className:be("-mx-1 my-1 h-px bg-muted",e),...t}));hh.displayName=gF.displayName;const lc=R.forwardRef(({className:e,type:t,...n},r)=>y.jsx("input",{type:t,className:be("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));lc.displayName="Input";var vhe="Label",yF=R.forwardRef((e,t)=>y.jsx(Ne.label,{...e,ref:t,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=e.onMouseDown)==null||i.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));yF.displayName=vhe;var vF=yF;const xhe=IE("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),wn=R.forwardRef(({className:e,...t},n)=>y.jsx(vF,{ref:n,className:be(xhe(),e),...t}));wn.displayName=vF.displayName;var VE="Popover",[xF,aMe]=tr(VE,[ys]),Fp=ys(),[whe,ol]=xF(VE),wF=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!1}=e,a=Fp(t),l=R.useRef(null),[c,u]=R.useState(!1),[d=!1,p]=Ar({prop:r,defaultProp:i,onChange:o});return y.jsx(Mp,{...a,children:y.jsx(whe,{scope:t,contentId:qn(),triggerRef:l,open:d,onOpenChange:p,onOpenToggle:R.useCallback(()=>p(h=>!h),[p]),hasCustomAnchor:c,onCustomAnchorAdd:R.useCallback(()=>u(!0),[]),onCustomAnchorRemove:R.useCallback(()=>u(!1),[]),modal:s,children:n})})};wF.displayName=VE;var SF="PopoverAnchor",She=R.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=ol(SF,n),o=Fp(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:a}=i;return R.useEffect(()=>(s(),()=>a()),[s,a]),y.jsx(Ld,{...o,...r,ref:t})});She.displayName=SF;var _F="PopoverTrigger",CF=R.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=ol(_F,n),o=Fp(n),s=rt(t,i.triggerRef),a=y.jsx(Ne.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":MF(i.open),...r,ref:s,onClick:Re(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?a:y.jsx(Ld,{asChild:!0,...o,children:a})});CF.displayName=_F;var WE="PopoverPortal",[_he,Che]=xF(WE,{forceMount:void 0}),EF=e=>{const{__scopePopover:t,forceMount:n,children:r,container:i}=e,o=ol(WE,t);return y.jsx(_he,{scope:t,forceMount:n,children:y.jsx(Yn,{present:n||o.open,children:y.jsx(Ap,{asChild:!0,container:i,children:r})})})};EF.displayName=WE;var vd="PopoverContent",RF=R.forwardRef((e,t)=>{const n=Che(vd,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,o=ol(vd,e.__scopePopover);return y.jsx(Yn,{present:r||o.open,children:o.modal?y.jsx(Ehe,{...i,ref:t}):y.jsx(Rhe,{...i,ref:t})})});RF.displayName=vd;var Ehe=R.forwardRef((e,t)=>{const n=ol(vd,e.__scopePopover),r=R.useRef(null),i=rt(t,r),o=R.useRef(!1);return R.useEffect(()=>{const s=r.current;if(s)return w0(s)},[]),y.jsx(Np,{as:Js,allowPinchZoom:!0,children:y.jsx(PF,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Re(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),o.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Re(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;o.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Re(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),Rhe=R.forwardRef((e,t)=>{const n=ol(vd,e.__scopePopover),r=R.useRef(!1),i=R.useRef(!1);return y.jsx(PF,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,o),o.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=o.target;((c=n.triggerRef.current)==null?void 0:c.contains(s))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),PF=R.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...d}=e,p=ol(vd,n),h=Fp(n);return v0(),y.jsx(Ip,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:y.jsx(Lc,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>p.onOpenChange(!1),children:y.jsx(Op,{"data-state":MF(p.open),role:"dialog",id:p.contentId,...h,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),TF="PopoverClose",Phe=R.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=ol(TF,n);return y.jsx(Ne.button,{type:"button",...r,ref:t,onClick:Re(e.onClick,()=>i.onOpenChange(!1))})});Phe.displayName=TF;var The="PopoverArrow",Mhe=R.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Fp(n);return y.jsx(Dp,{...i,...r,ref:t})});Mhe.displayName=The;function MF(e){return e?"open":"closed"}var Ohe=wF,Dhe=CF,Ahe=EF,OF=RF;const R0=Ohe,P0=Dhe,jp=R.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},i)=>y.jsx(Ahe,{children:y.jsx(Dc,{children:y.jsx(OF,{ref:i,align:t,sideOffset:n,className:be("z-49 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})})}));jp.displayName=OF.displayName;function khe(e,t){switch(t){case"full-date-time":return{locale:e,format:"full-date-time",options:{weekday:"short",year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0}};case"short-date-time":return{locale:e,format:"short-date-time",options:{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!0}};case"hours-date-time":return{locale:e,format:"hours-date-time",options:{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}};case"short-date":return{format:"short-date",locale:e,options:{}};case"long-date":return{format:"long-date",locale:e,options:{year:"numeric",month:"long",day:"numeric"}};default:return{format:"short-date-time",locale:e,options:{}}}}function DF({colorRanges:e,setColorRanges:t}){const n={start:-1/0,end:100,color:""};function r(s,a,l){const c=[...e];c[s]={...c[s],[a]:l},t(c)}function i(s){const a=[...e];a.splice(s,1),t(a)}function o(){t([...e,n])}return y.jsxs("div",{className:"space-y-3",children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx(wn,{children:"Color Range"}),y.jsx(pi,{onClick:o,variant:"secondary",className:"h-5 p-1 text-muted-foreground",children:y.jsx(jC,{className:"size-3"})})]}),e.map((s,a)=>y.jsxs("div",{className:"flex items-center gap-2 px-2",children:[y.jsx(lc,{onChange:l=>r(a,"start",l.target.value),value:s.start,className:be(`h-7 ${eh}`)}),y.jsx("span",{children:"-"}),y.jsx(lc,{value:s.end,onChange:l=>r(a,"end",l.target.value),className:be(`h-7 ${eh}`)}),y.jsx(lc,{onChange:l=>r(a,"color",l.target.value),value:s.color,className:be(`h-7 min-w-14 p-0 ${eh}`),type:"color",list:"presetColors"}),y.jsxs("datalist",{id:"presetColors",children:[y.jsx("option",{children:Ft.green[600]}),y.jsx("option",{children:Ft.red[500]}),y.jsx("option",{children:Ft.yellow[400]}),y.jsx("option",{children:Ft.orange[500]})]}),y.jsx(pi,{onClick:()=>i(a),variant:"secondary",className:"h-5 p-1 text-muted-foreground",children:y.jsx(Md,{className:"size-3"})})]},a))]})}var Ihe="Toggle",AF=R.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:i,...o}=e,[s=!1,a]=Ar({prop:n,onChange:i,defaultProp:r});return y.jsx(Ne.button,{type:"button","aria-pressed":s,"data-state":s?"on":"off","data-disabled":e.disabled?"":void 0,...o,ref:t,onClick:Re(e.onClick,()=>{e.disabled||a(!s)})})});AF.displayName=Ihe;var kF=AF;const Nhe=IE("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}}),T0=R.forwardRef(({className:e,variant:t,size:n,...r},i)=>y.jsx(kF,{ref:i,className:be(Nhe({variant:t,size:n,className:e})),...r}));T0.displayName=kF.displayName;function Lhe(e,t){var r;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t);return n==null?void 0:n.type}function Fhe(e,t){var r,i;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(o=>o.columnIdx===t);return((i=n==null?void 0:n.options)==null?void 0:i.locale)||"en-US"}function jhe(e,t){var r,i;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(o=>o.columnIdx===t&&o.type==="date");return((i=n==null?void 0:n.options)==null?void 0:i.format)||"short-date-time"}function $he(e,t){var r,i;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(o=>o.columnIdx===t);return(i=n==null?void 0:n.options)==null?void 0:i.currency}function zhe(e,t){var r,i,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(s=>s.columnIdx===t);return((o=(i=n==null?void 0:n.options)==null?void 0:i.options)==null?void 0:o.minimumFractionDigits)||0}function Bhe(e,t){var r,i;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(o=>o.columnIdx===t);return((i=n==null?void 0:n.options)==null?void 0:i.colorRanges)||[]}function Hhe(e,t){var r,i,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(s=>s.columnIdx===t);return((o=(i=n==null?void 0:n.options)==null?void 0:i.options)==null?void 0:o.style)==="percent"}function Vhe(e,t){var r;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t);return n==null?void 0:n.textAlign}function Whe(e,t){var r;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t);return n==null?void 0:n.width}function Uhe({columnIndex:e,columnName:t}){const[n,r]=P.useState(!1),i=Ur(V=>{var L;return(L=V.card)==null?void 0:L.preferences}),[o,s]=P.useState(Lhe(i,e)),[a,l]=P.useState(Vhe(i,e)),[c,u]=P.useState(Whe(i,e)),[d,p]=P.useState(Bhe(i,e)),[h,m]=P.useState(Fhe(i,e)),[b,v]=P.useState(jhe(i,e)),[x,S]=P.useState($he(i,e)),[_,E]=P.useState(zhe(i,e).toString()),[C,M]=P.useState(Hhe(i,e));P.useState("");const O=Ur(V=>V.actions.setCardPreferences);function k(){return y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[y.jsx(wn,{className:"col-span-3",htmlFor:"format",children:"Text Align"}),y.jsxs(js,{value:a||"left",onValueChange:V=>l(V),children:[y.jsx(Vo,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:y.jsx($s,{})}),y.jsxs(Wo,{children:[y.jsx(kn,{value:"left",children:"Left"}),y.jsx(kn,{value:"center",children:"Center"}),y.jsx(kn,{value:"right",children:"Right"})]})]})]}),y.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[y.jsx(wn,{className:"col-span-3",htmlFor:"format",children:"Width (px)"}),y.jsx(lc,{placeholder:"Auto",value:c?c.toString():"",className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",onChange:V=>{V.target.value===""?u(void 0):u(Number(V.target.value))}})]})]})}function N(){const V=[...new Set(_w.map(L=>L.currency))];return y.jsx(y.Fragment,{children:y.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[y.jsx(wn,{className:"col-span-3",htmlFor:"format",children:"Locale"}),y.jsxs(js,{value:h,onValueChange:L=>m(L),children:[y.jsx(Vo,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:y.jsx($s,{})}),y.jsx(Wo,{children:y.jsxs(mu,{children:[y.jsx(kl,{children:"Locale"}),_w.map(L=>y.jsx(kn,{value:L.locale,children:L.locale},L.locale))]})})]}),y.jsx(wn,{className:"col-span-3",htmlFor:"format",children:"Currency"}),y.jsxs(js,{value:x||"none",onValueChange:L=>S(L==="none"?void 0:L),children:[y.jsx(Vo,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:y.jsx($s,{})}),y.jsx(Wo,{children:y.jsxs(mu,{children:[y.jsx(kl,{children:"Currency"}),y.jsx(kn,{value:"none",children:"None"}),V.map(L=>y.jsx(kn,{value:L,children:L},L))]})})]}),y.jsx(wn,{className:"col-span-3",htmlFor:"format",children:"Decimals"}),y.jsxs(js,{value:_,onValueChange:L=>E(L),children:[y.jsx(Vo,{className:"col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0",children:y.jsx($s,{})}),y.jsx(Wo,{children:["0","1","2","3","4"].map(L=>y.jsx(kn,{value:L,children:L},L))})]}),!x&&y.jsx(T0,{onPressedChange:L=>M(L),variant:"outline",size:"sm",className:"col-span-3 h-8","aria-label":"Toggle italic",children:y.jsx(i4,{className:"size-3"})})]})})}function F(){return y.jsx(y.Fragment,{children:y.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[y.jsx(wn,{className:"col-span-3",htmlFor:"format",children:"Locale"}),y.jsxs(js,{defaultValue:"en-US",value:h,onValueChange:V=>m(V),children:[y.jsx(Vo,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:y.jsx($s,{})}),y.jsx(Wo,{children:PK.map(V=>y.jsxs(mu,{children:[y.jsx(kl,{children:V.label}),V.locales.map(L=>y.jsx(kn,{value:L.code,children:L.name},L.code))]},V.label))})]}),y.jsx(wn,{className:"col-span-3",htmlFor:"format",children:"Format"}),y.jsxs(js,{defaultValue:"short-date-time",value:b,onValueChange:V=>{console.log("format",V),v(V)},children:[y.jsx(Vo,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:y.jsx($s,{})}),y.jsx(Wo,{className:"",id:"type",children:y.jsxs(mu,{children:[y.jsx(kl,{children:"Option"}),y.jsx(kn,{value:"full-date-time",children:"Full Date-Time"}),y.jsx(kn,{value:"short-date-time",children:"Short Date-Time"}),y.jsx(kn,{value:"hours-date-time",children:"24-Hour Date-Time"}),y.jsx(kn,{value:"short-date",children:"Short Date"}),y.jsx(kn,{value:"long-date",children:"Long Date"})]})})]})]})})}function j(){O({...i,columnSettings:[]})}function $(){var V;O({...i,columnSettings:[...((V=i==null?void 0:i.columnSettings)==null?void 0:V.filter(L=>L.columnIdx!==e))||[]]})}function X(){var V,L,U,B;if(o==="date"){const W=khe(h,b),q={columnIdx:e,type:o,options:W};O({...i,columnSettings:[...((V=i==null?void 0:i.columnSettings)==null?void 0:V.filter(A=>A.columnIdx!==e))||[],q]})}else if(o==="number"){let W;x?W={locale:h,currency:x,options:{style:"currency",currency:x,minimumFractionDigits:Number(_)},colorRanges:d.length>0?d:void 0}:W={locale:h,currency:void 0,options:{style:C?"percent":"decimal",minimumFractionDigits:Number(_)},colorRanges:d.length>0?d:void 0};const q={columnIdx:e,type:o,textAlign:a,width:c,options:W};O({...i,columnSettings:[...((L=i==null?void 0:i.columnSettings)==null?void 0:L.filter(A=>A.columnIdx!==e))||[],q]})}else if(o==="html"){const W={columnIdx:e,type:o,options:{html:""}};O({...i,columnSettings:[...((U=i==null?void 0:i.columnSettings)==null?void 0:U.filter(q=>q.columnIdx!==e))||[],W]})}else{const W={columnIdx:e,type:"none",textAlign:a,width:c,options:{}};O({...i,columnSettings:[...((B=i==null?void 0:i.columnSettings)==null?void 0:B.filter(q=>q.columnIdx!==e))||[],W]})}}return y.jsxs(R0,{onOpenChange:V=>r(V),children:[y.jsx(P0,{asChild:!0,children:y.jsx(r4,{className:"size-3 cursor-pointer text-muted"})}),y.jsx(jp,{align:"center",className:"max-w-70 z-20",children:y.jsxs("div",{className:"grid gap-4",children:[y.jsxs("div",{className:"space-y-2",children:[y.jsx("h4",{className:"font-medium leading-none",children:"Display Settings"}),y.jsx("p",{className:"text-sm text-muted-foreground",children:`Display setting for '${t}'`})]}),y.jsxs("div",{className:"grid gap-2",children:[y.jsxs("div",{className:"grid grid-cols-3 items-center gap-2",children:[y.jsx(wn,{htmlFor:"scale",children:"Type"}),y.jsxs(js,{value:o||"none",onValueChange:V=>s(V),children:[y.jsx(Vo,{className:"col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0",children:y.jsx($s,{})}),y.jsx(Wo,{id:"type",children:y.jsxs(mu,{children:[y.jsx(kl,{children:"Option"}),y.jsx(kn,{value:"number",children:"Number"}),y.jsx(kn,{value:"date",children:"Date"}),y.jsx(kn,{value:"html",children:"HTML"}),y.jsx(kn,{value:"none",children:"None"})]})})]})]}),k(),y.jsx(hh,{}),o==="number"&&N(),o==="date"&&F(),o==="number"&&y.jsxs(y.Fragment,{children:[y.jsx(hh,{}),y.jsx(DF,{colorRanges:d,setColorRanges:p})]}),y.jsx(hh,{}),y.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[y.jsx(pi,{onClick:j,variant:"secondary",className:"col-span-1 col-start-1 h-8 w-full text-destructive",children:"Reset All"}),y.jsx(pi,{onClick:$,variant:"secondary",className:"col-span-1 col-start-2 h-8 w-full",children:"Reset"}),y.jsx(pi,{onClick:X,variant:"secondary",className:"col-span-1 col-start-3 h-8 w-full",children:"Apply"})]})]})]})})]})}function Ghe(e){const t=new Date(e);return!isNaN(t.getTime())}function IF({data:e,card:t}){var E,C,M,O;const[n,r]=P.useState([]),{keys:i}=sr(e),o=ye(k=>k.filteringCards),s=ye(k=>k.themeStyle),a=ye(k=>k.isVisualEditing),l=o==null?void 0:o.find(k=>k.id===t.id),c=(E=t==null?void 0:t.preferences)==null?void 0:E.onClickFilter,{addOrUpdateFilterValues:u,addFilteringCard:d,removeFilterValues:p,removeFilteringCard:h}=Hn(),m=t==null?void 0:t.preferences;function b(k,N){if((N==null?void 0:N.type)==="date"&&Ghe(k)){const{locale:F,options:j}=N.options,$=new Date(k);return new Date($.getTime()).toLocaleDateString(F,j)}if((N==null?void 0:N.type)==="number"){const{locale:F,currency:j,options:$}=N.options;return j?new Intl.NumberFormat(F,{style:"currency",currency:j,...$}).format(k):new Intl.NumberFormat(F,$).format(k)}if((N==null?void 0:N.type)==="html"){const F=BS.sanitize(k);return y.jsx("div",{className:"hover:underline",dangerouslySetInnerHTML:{__html:F}})}return k}const v=i.map((k,N)=>({accessorKey:k,header:({column:F})=>{var B;const j=F.getIsSorted(),$=N,X=(B=m==null?void 0:m.columnSettings)==null?void 0:B.find(W=>W.columnIdx===$),V=X==null?void 0:X.textAlign,L=X==null?void 0:X.width,U=L?{width:L}:{};return y.jsxs("div",{className:"flex w-full items-center justify-between gap-2",children:[y.jsxs("div",{className:be("flex grow cursor-pointer items-center",{"justify-center":V==="center","justify-end":V==="right","justify-start":V==="left"}),style:U,onClick:()=>F.toggleSorting(F.getIsSorted()==="asc"),children:[k,j==="asc"?y.jsx(H5,{className:"ml-2 h-5 w-5"}):j==="desc"?y.jsx(B5,{className:"ml-2 h-5 w-5"}):null]}),y.jsx("div",{className:"opacity-0 group-hover:opacity-100",children:a&&y.jsx(Uhe,{columnName:F.id,columnIndex:N})})]})},cell:({cell:F})=>{var U,B;const j=F.getValue(),$=(U=m==null?void 0:m.columnSettings)==null?void 0:U.find(W=>W.columnIdx===N),X=b(j,$),V=zC(j,(B=$==null?void 0:$.options)==null?void 0:B.colorRanges),L=$==null?void 0:$.textAlign;return $!=null&&$.width&&$.width,y.jsx("p",{title:X,className:be("overflow-auto px-2 py-1",{"text-center":L==="center","text-right":L==="right","text-left":L==="left"}),style:{backgroundColor:V},children:X})}})),x=C6({data:e,columns:v,getCoreRowModel:w6(),getPaginationRowModel:S6(),onSortingChange:r,getSortedRowModel:_6(),manualPagination:!0,state:{sorting:n}}),S=x.getSelectedRowModel().rows;P.useEffect(()=>{if(S.length===0){if(l){const k=t.id;p(k),h(t)}return}if(c){const{dimensionKeys:k}=sr(e),N=c.map(F=>{const j=k==null?void 0:k[F.columnIndex],$=S.map(V=>V.getValue(j));return{filterId:t.id+"-"+j,connectionId:t==null?void 0:t.connectionId,tableName:t.lastSelectedTable,name:j,expression:F.expression,valueType:Oy($[0]===void 0?"":$[0]),operation:"in",values:$}});u(N),d(t)}},[d,u,t,e,l,c,p,h,S]);function _(k){k.toggleSelected()}return y.jsx("div",{className:"rounded-md text-sm text-foreground/80",style:{borderTopRightRadius:(C=s==null?void 0:s.chart)==null?void 0:C.options.borderRadius,borderTopLeftRadius:(M=s==null?void 0:s.chart)==null?void 0:M.options.borderRadius},children:y.jsxs("table",{className:"w-full",onMouseDown:k=>k.stopPropagation(),children:[y.jsx(NE,{className:"group",children:x.getHeaderGroups().map(k=>y.jsx(dh,{children:k.headers.map((N,F)=>{var j,$,X,V,L,U,B;return y.jsx(FE,{style:{backgroundColor:(X=($=(j=s==null?void 0:s.chart)==null?void 0:j.dataset)==null?void 0:$.backgroundColor)==null?void 0:X[0],color:nd((U=(L=(V=s==null?void 0:s.chart)==null?void 0:V.dataset)==null?void 0:L.backgroundColor)==null?void 0:U[0])},className:be("sticky -top-[1px] h-9 bg-muted-foreground px-2 text-background",{"border-x":F>0&&F<k.headers.length-1,"border-l":F===1&&k.headers.length==2},(B=s==null?void 0:s.table)==null?void 0:B.tableHeaderColor),children:N.isPlaceholder?null:qS(N.column.columnDef.header,N.getContext())},N.id)})},k.id))}),y.jsx(LE,{children:(O=x.getRowModel().rows)!=null&&O.length?x.getRowModel().rows.map((k,N)=>y.jsx(dh,{onClick:()=>_(k),className:be("whitespace-nowrap p-1",{"cursor-pointer data-[state=selected]:border-2 data-[state=selected]:border-dashed":c&&(c==null?void 0:c.length)>0}),"data-state":k.getIsSelected()&&"selected",children:k.getVisibleCells().map((F,j)=>{var L,U;const $=(L=m==null?void 0:m.columnSettings)==null?void 0:L.find(B=>B.columnIdx===j),X=$==null?void 0:$.width,V=X?{width:X,maxWidth:X}:{};return y.jsx("td",{style:V,onClick:B=>{var q;const W=((q=window==null?void 0:window.getSelection())==null?void 0:q.toString())||"";(W==null?void 0:W.length)>0&&B.stopPropagation()},className:be("",{"border-x":j>0&&j<v.length-1||j===1&&v.length==2,"border-l":j==0,"border-r":j===v.length-1,"border-b":N===((U=x.getRowModel().rows)==null?void 0:U.length)-1}),children:qS(F.column.columnDef.cell,F.getContext())},F.id)})},k.id)):y.jsx(dh,{children:y.jsx(jE,{colSpan:v.length,className:"p-1 text-center",children:"No results."})})})]})})}async function qhe(e,t){const n=`${e}/index.js`,r=`${e}/style.css`;return document.querySelector(`link[href="${r}"]`)||await new Promise((o,s)=>{const a=document.createElement("link");a.rel="stylesheet",a.href=r,a.onload=()=>o(void 0),a.onerror=()=>s(new Error("Failed to load CSS")),document.head.appendChild(a)}),{default:(await import(n))[t]}}async function Yhe(e){try{const t=await import(e),n=Object.keys(t),r=[];return n.forEach(i=>{typeof t[i]=="function"&&(i==null?void 0:i[0])===(i==null?void 0:i[0].toUpperCase())&&r.push({name:i,component:i})}),r}catch(t){return console.error("Error loading the library:",t),[]}}async function NF(e){try{const t=await fetch(`${e}/manifest.json`);if(!t.ok)throw new Error(`Failed to fetch manifest: ${t.statusText}`);return await t.json()}catch(t){throw console.error("Error loading manifest:",t),t}}const LF=e=>{const[t,n]=P.useState([]),[r,i]=P.useState(!1),[o,s]=P.useState(null);P.useEffect(()=>{window.React=P,window.ReactDOM=Tr,i(!0)},[]),P.useEffect(()=>{e&&r&&NF(e).then(c=>{n(c.visuals),s(c)}).catch(()=>{Yhe(e).then(c=>{console.log("componentNames",c),n(c)}).catch(c=>{console.error("Error loading manifest:",c)})})},[e,r]);const a=P.useMemo(()=>(t==null?void 0:t.map(c=>{const{name:u,component:d,dataInputs:p}=c;return{name:u,componentName:d,Component:P.lazy(()=>qhe(e,d)),type:p&&p.length>1?"multiple":"single"}}))||[],[t,e]);function l(c){const u=a==null?void 0:a.find(d=>d.name===c);return u?u.Component:null}return{getCard:l,components:a,manifest:o}};function FF({onLoadingStatus:e,onDataChange:t,card:n}){const{isFetching:r,isLoading:i,data:o,queryKey:s}=Wa(n),a=JSON.stringify(s);return P.useEffect(()=>{e==null||e(i)},[r,i,e]),P.useEffect(()=>{t(n.id,(o==null?void 0:o.records)||[])},[o==null?void 0:o.records,n.id,a,t]),y.jsx(y.Fragment,{})}function Khe({card:e,frame:t}){var S,_,E,C,M,O,k,N;const[n,r]=P.useState([]),{authToken:i}=Vi(),o=fN(i==null?void 0:i.accessToken),s=ye(F=>F.themeStyle),a={colors:((_=(S=s==null?void 0:s.chart)==null?void 0:S.dataset)==null?void 0:_.backgroundColor)||[]},[l,c]=P.useState(!1),{getCard:u}=LF(((E=e.customCardPreferences)==null?void 0:E.url)||""),d=((C=e.customCardPreferences)==null?void 0:C.visualType)||"single",p=(M=e.customCardPreferences)==null?void 0:M.componentName,{data:h}=Wa(e),m=P.useCallback((F,j)=>{r($=>({...$,[F]:j}))},[]);if(!p)return null;const b=u(p),v=Object.keys(((O=e.customCardPreferences)==null?void 0:O.dataInputCardIds)||{}).map(F=>{var X,V,L;const j=(V=(X=e.customCardPreferences)==null?void 0:X.dataInputCardIds)==null?void 0:V[F].cardId,$=(L=t==null?void 0:t.cards)==null?void 0:L.find(U=>U.id===j);return $||null});function x(F){c(F)}return y.jsx("div",{className:"semaphor-custom mb-3 flex grow basis-0 flex-col space-y-2 overflow-y-auto",children:y.jsxs(P.Suspense,{fallback:y.jsx(y.Fragment,{}),children:[b&&d==="single"&&y.jsx(b,{params:o,theme:a,settings:(k=e.customCardPreferences)==null?void 0:k.settings,onDataChange:m,data:(h==null?void 0:h.records)||[]}),b&&d==="multiple"&&y.jsxs("div",{children:[Object.keys(((N=e.customCardPreferences)==null?void 0:N.dataInputCardIds)||{}).map(F=>{var X,V,L;const j=(V=(X=e.customCardPreferences)==null?void 0:X.dataInputCardIds)==null?void 0:V[F].cardId,$=(L=t==null?void 0:t.cards)==null?void 0:L.find(U=>U.id===j);if($)return y.jsx(FF,{onLoadingStatus:x,onDataChange:m,dataInputIndex:F,card:$},$.id+F)}),d==="multiple"&&y.jsx("div",{className:be("flex flex-col gap-2",{"opacity-50":l}),children:y.jsx(b,{params:o,theme:a,onDataChange:m,settings:v.map(F=>{var j;return(j=F==null?void 0:F.customCardPreferences)==null?void 0:j.settings}),data:v.map(F=>F!=null&&F.id?n==null?void 0:n[F.id]:[])})})]})]},e.id)})}/*!
|
|
363
|
-
* chartjs-plugin-datalabels v2.2.0
|
|
364
|
-
* https://chartjs-plugin-datalabels.netlify.app
|
|
365
|
-
* (c) 2017-2022 chartjs-plugin-datalabels contributors
|
|
366
|
-
* Released under the MIT license
|
|
367
|
-
*/var NA=function(){if(typeof window<"u"){if(window.devicePixelRatio)return window.devicePixelRatio;var e=window.screen;if(e)return(e.deviceXDPI||1)/(e.logicalXDPI||1)}return 1}(),ph={toTextLines:function(e){var t=[],n;for(e=[].concat(e);e.length;)n=e.pop(),typeof n=="string"?t.unshift.apply(t,n.split(`
|
|
368
|
-
`)):Array.isArray(n)?e.push.apply(e,n):_t(e)||t.unshift(""+n);return t},textSize:function(e,t,n){var r=[].concat(t),i=r.length,o=e.font,s=0,a;for(e.font=n.string,a=0;a<i;++a)s=Math.max(e.measureText(r[a]).width,s);return e.font=o,{height:i*n.lineHeight,width:s}},bound:function(e,t,n){return Math.max(e,Math.min(t,n))},arrayDiff:function(e,t){var n=e.slice(),r=[],i,o,s,a;for(i=0,s=t.length;i<s;++i)a=t[i],o=n.indexOf(a),o===-1?r.push([a,1]):n.splice(o,1);for(i=0,s=n.length;i<s;++i)r.push([n[i],-1]);return r},rasterize:function(e){return Math.round(e*NA)/NA}};function E1(e,t){var n=t.x,r=t.y;if(n===null)return{x:0,y:-1};if(r===null)return{x:1,y:0};var i=e.x-n,o=e.y-r,s=Math.sqrt(i*i+o*o);return{x:s?i/s:0,y:s?o/s:-1}}function Xhe(e,t,n,r,i){switch(i){case"center":n=r=0;break;case"bottom":n=0,r=1;break;case"right":n=1,r=0;break;case"left":n=-1,r=0;break;case"top":n=0,r=-1;break;case"start":n=-n,r=-r;break;case"end":break;default:i*=Math.PI/180,n=Math.cos(i),r=Math.sin(i);break}return{x:e,y:t,vx:n,vy:r}}var Qhe=0,jF=1,$F=2,zF=4,BF=8;function Im(e,t,n){var r=Qhe;return e<n.left?r|=jF:e>n.right&&(r|=$F),t<n.top?r|=BF:t>n.bottom&&(r|=zF),r}function Jhe(e,t){for(var n=e.x0,r=e.y0,i=e.x1,o=e.y1,s=Im(n,r,t),a=Im(i,o,t),l,c,u;!(!(s|a)||s&a);)l=s||a,l&BF?(c=n+(i-n)*(t.top-r)/(o-r),u=t.top):l&zF?(c=n+(i-n)*(t.bottom-r)/(o-r),u=t.bottom):l&$F?(u=r+(o-r)*(t.right-n)/(i-n),c=t.right):l&jF&&(u=r+(o-r)*(t.left-n)/(i-n),c=t.left),l===s?(n=c,r=u,s=Im(n,r,t)):(i=c,o=u,a=Im(i,o,t));return{x0:n,x1:i,y0:r,y1:o}}function Nm(e,t){var n=t.anchor,r=e,i,o;return t.clamp&&(r=Jhe(r,t.area)),n==="start"?(i=r.x0,o=r.y0):n==="end"?(i=r.x1,o=r.y1):(i=(r.x0+r.x1)/2,o=(r.y0+r.y1)/2),Xhe(i,o,e.vx,e.vy,t.align)}var Lm={arc:function(e,t){var n=(e.startAngle+e.endAngle)/2,r=Math.cos(n),i=Math.sin(n),o=e.innerRadius,s=e.outerRadius;return Nm({x0:e.x+r*o,y0:e.y+i*o,x1:e.x+r*s,y1:e.y+i*s,vx:r,vy:i},t)},point:function(e,t){var n=E1(e,t.origin),r=n.x*e.options.radius,i=n.y*e.options.radius;return Nm({x0:e.x-r,y0:e.y-i,x1:e.x+r,y1:e.y+i,vx:n.x,vy:n.y},t)},bar:function(e,t){var n=E1(e,t.origin),r=e.x,i=e.y,o=0,s=0;return e.horizontal?(r=Math.min(e.x,e.base),o=Math.abs(e.base-e.x)):(i=Math.min(e.y,e.base),s=Math.abs(e.base-e.y)),Nm({x0:r,y0:i+s,x1:r+o,y1:i,vx:n.x,vy:n.y},t)},fallback:function(e,t){var n=E1(e,t.origin);return Nm({x0:e.x,y0:e.y,x1:e.x+(e.width||0),y1:e.y+(e.height||0),vx:n.x,vy:n.y},t)}},Ks=ph.rasterize;function Zhe(e){var t=e.borderWidth||0,n=e.padding,r=e.size.height,i=e.size.width,o=-i/2,s=-r/2;return{frame:{x:o-n.left-t,y:s-n.top-t,w:i+n.width+t*2,h:r+n.height+t*2},text:{x:o,y:s,w:i,h:r}}}function epe(e,t){var n=t.chart.getDatasetMeta(t.datasetIndex).vScale;if(!n)return null;if(n.xCenter!==void 0&&n.yCenter!==void 0)return{x:n.xCenter,y:n.yCenter};var r=n.getBasePixel();return e.horizontal?{x:r,y:null}:{x:null,y:r}}function tpe(e){return e instanceof xu?Lm.arc:e instanceof ic?Lm.point:e instanceof oc?Lm.bar:Lm.fallback}function npe(e,t,n,r,i,o){var s=Math.PI/2;if(o){var a=Math.min(o,i/2,r/2),l=t+a,c=n+a,u=t+r-a,d=n+i-a;e.moveTo(t,c),l<u&&c<d?(e.arc(l,c,a,-Math.PI,-s),e.arc(u,c,a,-s,0),e.arc(u,d,a,0,s),e.arc(l,d,a,s,Math.PI)):l<u?(e.moveTo(l,n),e.arc(u,c,a,-s,s),e.arc(l,c,a,s,Math.PI+s)):c<d?(e.arc(l,c,a,-Math.PI,0),e.arc(l,d,a,0,Math.PI)):e.arc(l,c,a,-Math.PI,Math.PI),e.closePath(),e.moveTo(t,n)}else e.rect(t,n,r,i)}function rpe(e,t,n){var r=n.backgroundColor,i=n.borderColor,o=n.borderWidth;!r&&(!i||!o)||(e.beginPath(),npe(e,Ks(t.x)+o/2,Ks(t.y)+o/2,Ks(t.w)-o,Ks(t.h)-o,n.borderRadius),e.closePath(),r&&(e.fillStyle=r,e.fill()),i&&o&&(e.strokeStyle=i,e.lineWidth=o,e.lineJoin="miter",e.stroke()))}function ipe(e,t,n){var r=n.lineHeight,i=e.w,o=e.x,s=e.y+r/2;return t==="center"?o+=i/2:(t==="end"||t==="right")&&(o+=i),{h:r,w:i,x:o,y:s}}function ope(e,t,n){var r=e.shadowBlur,i=n.stroked,o=Ks(n.x),s=Ks(n.y),a=Ks(n.w);i&&e.strokeText(t,o,s,a),n.filled&&(r&&i&&(e.shadowBlur=0),e.fillText(t,o,s,a),r&&i&&(e.shadowBlur=r))}function spe(e,t,n,r){var i=r.textAlign,o=r.color,s=!!o,a=r.font,l=t.length,c=r.textStrokeColor,u=r.textStrokeWidth,d=c&&u,p;if(!(!l||!s&&!d))for(n=ipe(n,i,a),e.font=a.string,e.textAlign=i,e.textBaseline="middle",e.shadowBlur=r.textShadowBlur,e.shadowColor=r.textShadowColor,s&&(e.fillStyle=o),d&&(e.lineJoin="round",e.lineWidth=u,e.strokeStyle=c),p=0,l=t.length;p<l;++p)ope(e,t[p],{stroked:d,filled:s,w:n.w,x:n.x,y:n.y+n.h*p})}var HF=function(e,t,n,r){var i=this;i._config=e,i._index=r,i._model=null,i._rects=null,i._ctx=t,i._el=n};cr(HF.prototype,{_modelize:function(e,t,n,r){var i=this,o=i._index,s=Gn(xn([n.font,{}],r,o)),a=xn([n.color,Cn.color],r,o);return{align:xn([n.align,"center"],r,o),anchor:xn([n.anchor,"center"],r,o),area:r.chart.chartArea,backgroundColor:xn([n.backgroundColor,null],r,o),borderColor:xn([n.borderColor,null],r,o),borderRadius:xn([n.borderRadius,0],r,o),borderWidth:xn([n.borderWidth,0],r,o),clamp:xn([n.clamp,!1],r,o),clip:xn([n.clip,!1],r,o),color:a,display:e,font:s,lines:t,offset:xn([n.offset,4],r,o),opacity:xn([n.opacity,1],r,o),origin:epe(i._el,r),padding:br(xn([n.padding,4],r,o)),positioner:tpe(i._el),rotation:xn([n.rotation,0],r,o)*(Math.PI/180),size:ph.textSize(i._ctx,t,s),textAlign:xn([n.textAlign,"start"],r,o),textShadowBlur:xn([n.textShadowBlur,0],r,o),textShadowColor:xn([n.textShadowColor,a],r,o),textStrokeColor:xn([n.textStrokeColor,a],r,o),textStrokeWidth:xn([n.textStrokeWidth,0],r,o)}},update:function(e){var t=this,n=null,r=null,i=t._index,o=t._config,s,a,l,c=xn([o.display,!0],e,i);c&&(s=e.dataset.data[i],a=nt(sn(o.formatter,[s,e]),s),l=_t(a)?[]:ph.toTextLines(a),l.length&&(n=t._modelize(c,l,o,e),r=Zhe(n))),t._model=n,t._rects=r},geometry:function(){return this._rects?this._rects.frame:{}},rotation:function(){return this._model?this._model.rotation:0},visible:function(){return this._model&&this._model.opacity},model:function(){return this._model},draw:function(e,t){var n=this,r=e.ctx,i=n._model,o=n._rects,s;this.visible()&&(r.save(),i.clip&&(s=i.area,r.beginPath(),r.rect(s.left,s.top,s.right-s.left,s.bottom-s.top),r.clip()),r.globalAlpha=ph.bound(0,i.opacity,1),r.translate(Ks(t.x),Ks(t.y)),r.rotate(i.rotation),rpe(r,o.frame,i),spe(r,i.lines,o.text,i),r.restore())}});var ape=Number.MIN_SAFE_INTEGER||-9007199254740991,lpe=Number.MAX_SAFE_INTEGER||9007199254740991;function Rf(e,t,n){var r=Math.cos(n),i=Math.sin(n),o=t.x,s=t.y;return{x:o+r*(e.x-o)-i*(e.y-s),y:s+i*(e.x-o)+r*(e.y-s)}}function LA(e,t){var n=lpe,r=ape,i=t.origin,o,s,a,l,c;for(o=0;o<e.length;++o)s=e[o],a=s.x-i.x,l=s.y-i.y,c=t.vx*a+t.vy*l,n=Math.min(n,c),r=Math.max(r,c);return{min:n,max:r}}function Fm(e,t){var n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r);return{vx:(t.x-e.x)/i,vy:(t.y-e.y)/i,origin:e,ln:i}}var VF=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};cr(VF.prototype,{center:function(){var e=this._rect;return{x:e.x+e.w/2,y:e.y+e.h/2}},update:function(e,t,n){this._rotation=n,this._rect={x:t.x+e.x,y:t.y+e.y,w:t.w,h:t.h}},contains:function(e){var t=this,n=1,r=t._rect;return e=Rf(e,t.center(),-t._rotation),!(e.x<r.x-n||e.y<r.y-n||e.x>r.x+r.w+n*2||e.y>r.y+r.h+n*2)},intersects:function(e){var t=this._points(),n=e._points(),r=[Fm(t[0],t[1]),Fm(t[0],t[3])],i,o,s;for(this._rotation!==e._rotation&&r.push(Fm(n[0],n[1]),Fm(n[0],n[3])),i=0;i<r.length;++i)if(o=LA(t,r[i]),s=LA(n,r[i]),o.max<s.min||s.max<o.min)return!1;return!0},_points:function(){var e=this,t=e._rect,n=e._rotation,r=e.center();return[Rf({x:t.x,y:t.y},r,n),Rf({x:t.x+t.w,y:t.y},r,n),Rf({x:t.x+t.w,y:t.y+t.h},r,n),Rf({x:t.x,y:t.y+t.h},r,n)]}});function WF(e,t,n){var r=t.positioner(e,t),i=r.vx,o=r.vy;if(!i&&!o)return{x:r.x,y:r.y};var s=n.w,a=n.h,l=t.rotation,c=Math.abs(s/2*Math.cos(l))+Math.abs(a/2*Math.sin(l)),u=Math.abs(s/2*Math.sin(l))+Math.abs(a/2*Math.cos(l)),d=1/Math.max(Math.abs(i),Math.abs(o));return c*=i*d,u*=o*d,c+=t.offset*i,u+=t.offset*o,{x:r.x+c,y:r.y+u}}function cpe(e,t){var n,r,i,o;for(n=e.length-1;n>=0;--n)for(i=e[n].$layout,r=n-1;r>=0&&i._visible;--r)o=e[r].$layout,o._visible&&i._box.intersects(o._box)&&t(i,o);return e}function upe(e){var t,n,r,i,o,s,a;for(t=0,n=e.length;t<n;++t)r=e[t],i=r.$layout,i._visible&&(a=new Proxy(r._el,{get:(l,c)=>l.getProps([c],!0)[c]}),o=r.geometry(),s=WF(a,r.model(),o),i._box.update(s,o,r.rotation()));return cpe(e,function(l,c){var u=l._hidable,d=c._hidable;u&&d||d?c._visible=!1:u&&(l._visible=!1)})}var gh={prepare:function(e){var t=[],n,r,i,o,s;for(n=0,i=e.length;n<i;++n)for(r=0,o=e[n].length;r<o;++r)s=e[n][r],t.push(s),s.$layout={_box:new VF,_hidable:!1,_visible:!0,_set:n,_idx:s._index};return t.sort(function(a,l){var c=a.$layout,u=l.$layout;return c._idx===u._idx?u._set-c._set:u._idx-c._idx}),this.update(t),t},update:function(e){var t=!1,n,r,i,o,s;for(n=0,r=e.length;n<r;++n)i=e[n],o=i.model(),s=i.$layout,s._hidable=o&&o.display==="auto",s._visible=i.visible(),t|=s._hidable;t&&upe(e)},lookup:function(e,t){var n,r;for(n=e.length-1;n>=0;--n)if(r=e[n].$layout,r&&r._visible&&r._box.contains(t))return e[n];return null},draw:function(e,t){var n,r,i,o,s,a;for(n=0,r=t.length;n<r;++n)i=t[n],o=i.$layout,o._visible&&(s=i.geometry(),a=WF(i._el,i.model(),s),o._box.update(a,s,i.rotation()),i.draw(e,a))}},dpe=function(e){if(_t(e))return null;var t=e,n,r,i;if(Tt(e))if(!_t(e.label))t=e.label;else if(!_t(e.r))t=e.r;else for(t="",n=Object.keys(e),i=0,r=n.length;i<r;++i)t+=(i!==0?", ":"")+n[i]+": "+e[n[i]];return""+t},fpe={align:"center",anchor:"center",backgroundColor:null,borderColor:null,borderRadius:0,borderWidth:0,clamp:!1,clip:!1,color:void 0,display:!0,font:{family:void 0,lineHeight:1.2,size:void 0,style:void 0,weight:null},formatter:dpe,labels:void 0,listeners:{},offset:4,opacity:1,padding:{top:4,right:4,bottom:4,left:4},rotation:0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,textShadowBlur:0,textShadowColor:void 0},li="$datalabels",UF="$default";function hpe(e,t){var n=e.datalabels,r={},i=[],o,s;return n===!1?null:(n===!0&&(n={}),t=cr({},[t,n]),o=t.labels||{},s=Object.keys(o),delete t.labels,s.length?s.forEach(function(a){o[a]&&i.push(cr({},[t,o[a],{_key:a}]))}):i.push(t),r=i.reduce(function(a,l){return Qt(l.listeners||{},function(c,u){a[u]=a[u]||{},a[u][l._key||UF]=c}),delete l.listeners,a},{}),{labels:i,listeners:r})}function t_(e,t,n,r){if(t){var i=n.$context,o=n.$groups,s;t[o._set]&&(s=t[o._set][o._key],s&&sn(s,[i,r])===!0&&(e[li]._dirty=!0,n.update(i)))}}function ppe(e,t,n,r,i){var o,s;!n&&!r||(n?r?n!==r&&(s=o=!0):s=!0:o=!0,s&&t_(e,t.leave,n,i),o&&t_(e,t.enter,r,i))}function gpe(e,t){var n=e[li],r=n._listeners,i,o;if(!(!r.enter&&!r.leave)){if(t.type==="mousemove")o=gh.lookup(n._labels,t);else if(t.type!=="mouseout")return;i=n._hovered,n._hovered=o,ppe(e,r,i,o,t)}}function mpe(e,t){var n=e[li],r=n._listeners.click,i=r&&gh.lookup(n._labels,t);i&&t_(e,r,i,t)}var bpe={id:"datalabels",defaults:fpe,beforeInit:function(e){e[li]={_actives:[]}},beforeUpdate:function(e){var t=e[li];t._listened=!1,t._listeners={},t._datasets=[],t._labels=[]},afterDatasetUpdate:function(e,t,n){var r=t.index,i=e[li],o=i._datasets[r]=[],s=e.isDatasetVisible(r),a=e.data.datasets[r],l=hpe(a,n),c=t.meta.data||[],u=e.ctx,d,p,h,m,b,v,x,S;for(u.save(),d=0,h=c.length;d<h;++d)if(x=c[d],x[li]=[],s&&x&&e.getDataVisibility(d)&&!x.skip)for(p=0,m=l.labels.length;p<m;++p)b=l.labels[p],v=b._key,S=new HF(b,u,x,d),S.$groups={_set:r,_key:v||UF},S.$context={active:!1,chart:e,dataIndex:d,dataset:a,datasetIndex:r},S.update(S.$context),x[li].push(S),o.push(S);u.restore(),cr(i._listeners,l.listeners,{merger:function(_,E,C){E[_]=E[_]||{},E[_][t.index]=C[_],i._listened=!0}})},afterUpdate:function(e){e[li]._labels=gh.prepare(e[li]._datasets)},afterDatasetsDraw:function(e){gh.draw(e,e[li]._labels)},beforeEvent:function(e,t){if(e[li]._listened){var n=t.event;switch(n.type){case"mousemove":case"mouseout":gpe(e,n);break;case"click":mpe(e,n);break}}},afterEvent:function(e){var t=e[li],n=t._actives,r=t._actives=e.getActiveElements(),i=ph.arrayDiff(n,r),o,s,a,l,c,u,d;for(o=0,s=i.length;o<s;++o)if(c=i[o],c[1])for(d=c[0].element[li]||[],a=0,l=d.length;a<l;++a)u=d[a],u.$context.active=c[1]===1,u.update(u.$context);(t._dirty||i.length)&&(gh.update(t._labels),e.render()),delete t._dirty}};Mn.register(...qoe);Mn.register(bpe);Mn.register(ic);Mn.register(Ad);Mn.register(kd);Mn.register(Zs);Mn.register(Nc);Mn.register(Ya);Mn.register(Ka);Mn.register(Fb);Mn.register(h3);function UE({cfg:e,onDatapointClick:t}){var d;const[n,r]=P.useState(""),i=ye(p=>p.selectedLensId),o=P.useRef(null),[s,a]=P.useState(),l=ye(p=>p.themeStyle);P.useEffect(()=>{if(o.current){const p=window.getComputedStyle(o.current);r(p.fontFamily)}},[]),P.useEffect(()=>{var b,v,x,S;if(!n)return;(v=(b=l==null?void 0:l.chart)==null?void 0:b.font)!=null&&v.family&&(Mn.defaults.font={...Mn.defaults.font,...(x=l==null?void 0:l.chart)==null?void 0:x.font,family:n});const p={...e,options:{...e.options,responsive:!0,maintainAspectRatio:!1}},h=(S=o==null?void 0:o.current)==null?void 0:S.getContext("2d");if(!h)return;let m;try{const _=Zle(p,h);m=new Mn(h,_),a(m)}catch(_){console.log("error creating chart",_)}return()=>{m&&m.destroy()}},[(d=l==null?void 0:l.chart)==null?void 0:d.font,i,n]);function c(p){var m,b;if(!s)return;const h=s==null?void 0:s.getElementsAtEventForMode(p,"nearest",{intersect:!0},!0);if(h&&h.length>0){const v=h[0].datasetIndex,x=h[0].index,S=(b=(m=h[0].element)==null?void 0:m.$context)==null?void 0:b.raw;t==null||t(s,v,x,S)}}const u=e.type==="doughnut"||e.type==="pie";return y.jsx("div",{onClick:c,className:be("relative h-[99%]",{"mx-14":u}),children:y.jsx("canvas",{ref:o})})}function ype(e,t){return R.useReducer((n,r)=>t[n][r]??n,e)}var GE="ScrollArea",[GF,lMe]=tr(GE),[vpe,fo]=GF(GE),qF=R.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:o=600,...s}=e,[a,l]=R.useState(null),[c,u]=R.useState(null),[d,p]=R.useState(null),[h,m]=R.useState(null),[b,v]=R.useState(null),[x,S]=R.useState(0),[_,E]=R.useState(0),[C,M]=R.useState(!1),[O,k]=R.useState(!1),N=rt(t,j=>l(j)),F=Ac(i);return y.jsx(vpe,{scope:n,type:r,dir:F,scrollHideDelay:o,scrollArea:a,viewport:c,onViewportChange:u,content:d,onContentChange:p,scrollbarX:h,onScrollbarXChange:m,scrollbarXEnabled:C,onScrollbarXEnabledChange:M,scrollbarY:b,onScrollbarYChange:v,scrollbarYEnabled:O,onScrollbarYEnabledChange:k,onCornerWidthChange:S,onCornerHeightChange:E,children:y.jsx(Ne.div,{dir:F,...s,ref:N,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":_+"px",...e.style}})})});qF.displayName=GE;var YF="ScrollAreaViewport",KF=R.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...o}=e,s=fo(YF,n),a=R.useRef(null),l=rt(t,a,s.onViewportChange);return y.jsxs(y.Fragment,{children:[y.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),y.jsx(Ne.div,{"data-radix-scroll-area-viewport":"",...o,ref:l,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:y.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});KF.displayName=YF;var vs="ScrollAreaScrollbar",qE=R.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=fo(vs,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:s}=i,a=e.orientation==="horizontal";return R.useEffect(()=>(a?o(!0):s(!0),()=>{a?o(!1):s(!1)}),[a,o,s]),i.type==="hover"?y.jsx(xpe,{...r,ref:t,forceMount:n}):i.type==="scroll"?y.jsx(wpe,{...r,ref:t,forceMount:n}):i.type==="auto"?y.jsx(XF,{...r,ref:t,forceMount:n}):i.type==="always"?y.jsx(YE,{...r,ref:t}):null});qE.displayName=vs;var xpe=R.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=fo(vs,e.__scopeScrollArea),[o,s]=R.useState(!1);return R.useEffect(()=>{const a=i.scrollArea;let l=0;if(a){const c=()=>{window.clearTimeout(l),s(!0)},u=()=>{l=window.setTimeout(()=>s(!1),i.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",u),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",u)}}},[i.scrollArea,i.scrollHideDelay]),y.jsx(Yn,{present:n||o,children:y.jsx(XF,{"data-state":o?"visible":"hidden",...r,ref:t})})}),wpe=R.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=fo(vs,e.__scopeScrollArea),o=e.orientation==="horizontal",s=O0(()=>l("SCROLL_END"),100),[a,l]=ype("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return R.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,i.scrollHideDelay,l]),R.useEffect(()=>{const c=i.viewport,u=o?"scrollLeft":"scrollTop";if(c){let d=c[u];const p=()=>{const h=c[u];d!==h&&(l("SCROLL"),s()),d=h};return c.addEventListener("scroll",p),()=>c.removeEventListener("scroll",p)}},[i.viewport,o,l,s]),y.jsx(Yn,{present:n||a!=="hidden",children:y.jsx(YE,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Re(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:Re(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),XF=R.forwardRef((e,t)=>{const n=fo(vs,e.__scopeScrollArea),{forceMount:r,...i}=e,[o,s]=R.useState(!1),a=e.orientation==="horizontal",l=O0(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?c:u)}},10);return xd(n.viewport,l),xd(n.content,l),y.jsx(Yn,{present:r||o,children:y.jsx(YE,{"data-state":o?"visible":"hidden",...i,ref:t})})}),YE=R.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,i=fo(vs,e.__scopeScrollArea),o=R.useRef(null),s=R.useRef(0),[a,l]=R.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=t8(a.viewport,a.content),u={...r,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:p=>o.current=p,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:p=>s.current=p};function d(p,h){return Ppe(p,s.current,a,h)}return n==="horizontal"?y.jsx(Spe,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const p=i.viewport.scrollLeft,h=FA(p,a,i.dir);o.current.style.transform=`translate3d(${h}px, 0, 0)`}},onWheelScroll:p=>{i.viewport&&(i.viewport.scrollLeft=p)},onDragScroll:p=>{i.viewport&&(i.viewport.scrollLeft=d(p,i.dir))}}):n==="vertical"?y.jsx(_pe,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const p=i.viewport.scrollTop,h=FA(p,a);o.current.style.transform=`translate3d(0, ${h}px, 0)`}},onWheelScroll:p=>{i.viewport&&(i.viewport.scrollTop=p)},onDragScroll:p=>{i.viewport&&(i.viewport.scrollTop=d(p))}}):null}),Spe=R.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=fo(vs,e.__scopeScrollArea),[s,a]=R.useState(),l=R.useRef(null),c=rt(t,l,o.onScrollbarXChange);return R.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),y.jsx(JF,{"data-orientation":"horizontal",...i,ref:c,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":M0(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,d)=>{if(o.viewport){const p=o.viewport.scrollLeft+u.deltaX;e.onWheelScroll(p),r8(p,d)&&u.preventDefault()}},onResize:()=>{l.current&&o.viewport&&s&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:ly(s.paddingLeft),paddingEnd:ly(s.paddingRight)}})}})}),_pe=R.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=fo(vs,e.__scopeScrollArea),[s,a]=R.useState(),l=R.useRef(null),c=rt(t,l,o.onScrollbarYChange);return R.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),y.jsx(JF,{"data-orientation":"vertical",...i,ref:c,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":M0(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,d)=>{if(o.viewport){const p=o.viewport.scrollTop+u.deltaY;e.onWheelScroll(p),r8(p,d)&&u.preventDefault()}},onResize:()=>{l.current&&o.viewport&&s&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:ly(s.paddingTop),paddingEnd:ly(s.paddingBottom)}})}})}),[Cpe,QF]=GF(vs),JF=R.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:d,...p}=e,h=fo(vs,n),[m,b]=R.useState(null),v=rt(t,N=>b(N)),x=R.useRef(null),S=R.useRef(""),_=h.viewport,E=r.content-r.viewport,C=er(u),M=er(l),O=O0(d,10);function k(N){if(x.current){const F=N.clientX-x.current.left,j=N.clientY-x.current.top;c({x:F,y:j})}}return R.useEffect(()=>{const N=F=>{const j=F.target;(m==null?void 0:m.contains(j))&&C(F,E)};return document.addEventListener("wheel",N,{passive:!1}),()=>document.removeEventListener("wheel",N,{passive:!1})},[_,m,E,C]),R.useEffect(M,[r,M]),xd(m,O),xd(h.content,O),y.jsx(Cpe,{scope:n,scrollbar:m,hasThumb:i,onThumbChange:er(o),onThumbPointerUp:er(s),onThumbPositionChange:M,onThumbPointerDown:er(a),children:y.jsx(Ne.div,{...p,ref:v,style:{position:"absolute",...p.style},onPointerDown:Re(e.onPointerDown,N=>{N.button===0&&(N.target.setPointerCapture(N.pointerId),x.current=m.getBoundingClientRect(),S.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),k(N))}),onPointerMove:Re(e.onPointerMove,k),onPointerUp:Re(e.onPointerUp,N=>{const F=N.target;F.hasPointerCapture(N.pointerId)&&F.releasePointerCapture(N.pointerId),document.body.style.webkitUserSelect=S.current,h.viewport&&(h.viewport.style.scrollBehavior=""),x.current=null})})})}),ay="ScrollAreaThumb",ZF=R.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=QF(ay,e.__scopeScrollArea);return y.jsx(Yn,{present:n||i.hasThumb,children:y.jsx(Epe,{ref:t,...r})})}),Epe=R.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,o=fo(ay,n),s=QF(ay,n),{onThumbPositionChange:a}=s,l=rt(t,d=>s.onThumbChange(d)),c=R.useRef(void 0),u=O0(()=>{c.current&&(c.current(),c.current=void 0)},100);return R.useEffect(()=>{const d=o.viewport;if(d){const p=()=>{if(u(),!c.current){const h=Tpe(d,a);c.current=h,a()}};return a(),d.addEventListener("scroll",p),()=>d.removeEventListener("scroll",p)}},[o.viewport,u,a]),y.jsx(Ne.div,{"data-state":s.hasThumb?"visible":"hidden",...i,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Re(e.onPointerDownCapture,d=>{const h=d.target.getBoundingClientRect(),m=d.clientX-h.left,b=d.clientY-h.top;s.onThumbPointerDown({x:m,y:b})}),onPointerUp:Re(e.onPointerUp,s.onThumbPointerUp)})});ZF.displayName=ay;var KE="ScrollAreaCorner",e8=R.forwardRef((e,t)=>{const n=fo(KE,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?y.jsx(Rpe,{...e,ref:t}):null});e8.displayName=KE;var Rpe=R.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=fo(KE,n),[o,s]=R.useState(0),[a,l]=R.useState(0),c=!!(o&&a);return xd(i.scrollbarX,()=>{var d;const u=((d=i.scrollbarX)==null?void 0:d.offsetHeight)||0;i.onCornerHeightChange(u),l(u)}),xd(i.scrollbarY,()=>{var d;const u=((d=i.scrollbarY)==null?void 0:d.offsetWidth)||0;i.onCornerWidthChange(u),s(u)}),c?y.jsx(Ne.div,{...r,ref:t,style:{width:o,height:a,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function ly(e){return e?parseInt(e,10):0}function t8(e,t){const n=e/t;return isNaN(n)?0:n}function M0(e){const t=t8(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Ppe(e,t,n,r="ltr"){const i=M0(n),o=i/2,s=t||o,a=i-s,l=n.scrollbar.paddingStart+s,c=n.scrollbar.size-n.scrollbar.paddingEnd-a,u=n.content-n.viewport,d=r==="ltr"?[0,u]:[u*-1,0];return n8([l,c],d)(e)}function FA(e,t,n="ltr"){const r=M0(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,s=t.content-t.viewport,a=o-r,l=n==="ltr"?[0,s]:[s*-1,0],c=YS(e,l);return n8([0,s],[0,a])(c)}function n8(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function r8(e,t){return e>0&&e<t}var Tpe=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function i(){const o={left:e.scrollLeft,top:e.scrollTop},s=n.left!==o.left,a=n.top!==o.top;(s||a)&&t(),n=o,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function O0(e,t){const n=er(e),r=R.useRef(0);return R.useEffect(()=>()=>window.clearTimeout(r.current),[]),R.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function xd(e,t){const n=er(t);mr(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}var i8=qF,Mpe=KF,Ope=e8;const cc=R.forwardRef(({className:e,children:t,...n},r)=>y.jsxs(i8,{ref:r,className:be("relative overflow-hidden",e),...n,children:[y.jsx(Mpe,{className:"h-full w-full rounded-[inherit]",children:t}),y.jsx($p,{}),y.jsx(Ope,{})]}));cc.displayName=i8.displayName;const $p=R.forwardRef(({className:e,orientation:t="vertical",...n},r)=>y.jsx(qE,{ref:r,orientation:t,className:be("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:y.jsx(ZF,{className:"relative flex-1 rounded-full bg-border"})}));$p.displayName=qE.displayName;function jt(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function bi(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function qr(e,t){const n=jt(e);return isNaN(t)?bi(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function Ao(e,t){const n=jt(e);if(isNaN(t))return bi(e,NaN);if(!t)return n;const r=n.getDate(),i=bi(e,n.getTime());i.setMonth(n.getMonth()+t+1,0);const o=i.getDate();return r>=o?i:(n.setFullYear(i.getFullYear(),i.getMonth(),r),n)}function Dpe(e,t){const n=+jt(e);return bi(e,n+t)}const XE=6048e5,Ape=864e5,kpe=36e5;function jA(e,t){return Dpe(e,t*kpe)}let Ipe={};function zp(){return Ipe}function us(e,t){var a,l,c,u;const n=zp(),r=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,i=jt(e),o=i.getDay(),s=(o<r?7:0)+o-r;return i.setDate(i.getDate()-s),i.setHours(0,0,0,0),i}function Cc(e){return us(e,{weekStartsOn:1})}function o8(e){const t=jt(e),n=t.getFullYear(),r=bi(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const i=Cc(r),o=bi(e,0);o.setFullYear(n,0,4),o.setHours(0,0,0,0);const s=Cc(o);return t.getTime()>=i.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function wd(e){const t=jt(e);return t.setHours(0,0,0,0),t}function cy(e){const t=jt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function es(e,t){const n=wd(e),r=wd(t),i=+n-cy(n),o=+r-cy(r);return Math.round((i-o)/Ape)}function Npe(e){const t=o8(e),n=bi(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Cc(n)}function n_(e,t){const n=t*7;return qr(e,n)}function Lpe(e,t){return Ao(e,t*12)}function Fpe(e){let t;return e.forEach(function(n){const r=jt(n);(t===void 0||t<r||isNaN(Number(r)))&&(t=r)}),t||new Date(NaN)}function jpe(e){let t;return e.forEach(n=>{const r=jt(n);(!t||t>r||isNaN(+r))&&(t=r)}),t||new Date(NaN)}function hi(e,t){const n=wd(e),r=wd(t);return+n==+r}function QE(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function $pe(e){if(!QE(e)&&typeof e!="number")return!1;const t=jt(e);return!isNaN(Number(t))}function zh(e,t){const n=jt(e),r=jt(t),i=n.getFullYear()-r.getFullYear(),o=n.getMonth()-r.getMonth();return i*12+o}function zpe(e,t,n){const r=us(e,n),i=us(t,n),o=+r-cy(r),s=+i-cy(i);return Math.round((o-s)/XE)}function JE(e){const t=jt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function gi(e){const t=jt(e);return t.setDate(1),t.setHours(0,0,0,0),t}function s8(e){const t=jt(e),n=bi(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function ZE(e,t){var a,l,c,u;const n=zp(),r=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,i=jt(e),o=i.getDay(),s=(o<r?-7:0)+6-(o-r);return i.setDate(i.getDate()+s),i.setHours(23,59,59,999),i}function a8(e){return ZE(e,{weekStartsOn:1})}const Bpe={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Hpe=(e,t,n)=>{let r;const i=Bpe[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function R1(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Vpe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Wpe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Upe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Gpe={date:R1({formats:Vpe,defaultWidth:"full"}),time:R1({formats:Wpe,defaultWidth:"full"}),dateTime:R1({formats:Upe,defaultWidth:"full"})},qpe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Ype=(e,t,n,r)=>qpe[e];function Pf(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):s;i=e.formattingValues[a]||e.formattingValues[s]}else{const s=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[a]||e.values[s]}const o=e.argumentCallback?e.argumentCallback(t):t;return i[o]}}const Kpe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Xpe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Qpe={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Jpe={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Zpe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},ege={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},tge=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},nge={ordinalNumber:tge,era:Pf({values:Kpe,defaultWidth:"wide"}),quarter:Pf({values:Xpe,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Pf({values:Qpe,defaultWidth:"wide"}),day:Pf({values:Jpe,defaultWidth:"wide"}),dayPeriod:Pf({values:Zpe,defaultWidth:"wide",formattingValues:ege,defaultFormattingWidth:"wide"})};function Tf(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;const s=o[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?ige(a,d=>d.test(s)):rge(a,d=>d.test(s));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(s.length);return{value:c,rest:u}}}function rge(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function ige(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function oge(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],o=t.match(e.parsePattern);if(!o)return null;let s=e.valueCallback?e.valueCallback(o[0]):o[0];s=n.valueCallback?n.valueCallback(s):s;const a=t.slice(i.length);return{value:s,rest:a}}}const sge=/^(\d+)(th|st|nd|rd)?/i,age=/\d+/i,lge={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},cge={any:[/^b/i,/^(a|c)/i]},uge={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},dge={any:[/1/i,/2/i,/3/i,/4/i]},fge={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},hge={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},pge={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},gge={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},mge={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},bge={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},yge={ordinalNumber:oge({matchPattern:sge,parsePattern:age,valueCallback:e=>parseInt(e,10)}),era:Tf({matchPatterns:lge,defaultMatchWidth:"wide",parsePatterns:cge,defaultParseWidth:"any"}),quarter:Tf({matchPatterns:uge,defaultMatchWidth:"wide",parsePatterns:dge,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Tf({matchPatterns:fge,defaultMatchWidth:"wide",parsePatterns:hge,defaultParseWidth:"any"}),day:Tf({matchPatterns:pge,defaultMatchWidth:"wide",parsePatterns:gge,defaultParseWidth:"any"}),dayPeriod:Tf({matchPatterns:mge,defaultMatchWidth:"any",parsePatterns:bge,defaultParseWidth:"any"})},l8={code:"en-US",formatDistance:Hpe,formatLong:Gpe,formatRelative:Ype,localize:nge,match:yge,options:{weekStartsOn:0,firstWeekContainsDate:1}};function vge(e){const t=jt(e);return es(t,s8(t))+1}function c8(e){const t=jt(e),n=+Cc(t)-+Npe(t);return Math.round(n/XE)+1}function u8(e,t){var u,d,p,h;const n=jt(e),r=n.getFullYear(),i=zp(),o=(t==null?void 0:t.firstWeekContainsDate)??((d=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??i.firstWeekContainsDate??((h=(p=i.locale)==null?void 0:p.options)==null?void 0:h.firstWeekContainsDate)??1,s=bi(e,0);s.setFullYear(r+1,0,o),s.setHours(0,0,0,0);const a=us(s,t),l=bi(e,0);l.setFullYear(r,0,o),l.setHours(0,0,0,0);const c=us(l,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function xge(e,t){var a,l,c,u;const n=zp(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,i=u8(e,t),o=bi(e,0);return o.setFullYear(i,0,r),o.setHours(0,0,0,0),us(o,t)}function d8(e,t){const n=jt(e),r=+us(n,t)-+xge(n,t);return Math.round(r/XE)+1}function nn(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const va={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return nn(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):nn(n+1,2)},d(e,t){return nn(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return nn(e.getHours()%12||12,t.length)},H(e,t){return nn(e.getHours(),t.length)},m(e,t){return nn(e.getMinutes(),t.length)},s(e,t){return nn(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return nn(i,t.length)}},du={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},$A={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return va.y(e,t)},Y:function(e,t,n,r){const i=u8(e,r),o=i>0?i:1-i;if(t==="YY"){const s=o%100;return nn(s,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):nn(o,t.length)},R:function(e,t){const n=o8(e);return nn(n,t.length)},u:function(e,t){const n=e.getFullYear();return nn(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return nn(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return nn(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return va.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return nn(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=d8(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):nn(i,t.length)},I:function(e,t,n){const r=c8(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):nn(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):va.d(e,t)},D:function(e,t,n){const r=vge(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):nn(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return nn(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return nn(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return nn(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=du.noon:r===0?i=du.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=du.evening:r>=12?i=du.afternoon:r>=4?i=du.morning:i=du.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return va.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):va.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):nn(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):nn(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):va.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):va.s(e,t)},S:function(e,t){return va.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return BA(r);case"XXXX":case"XX":return Dl(r);case"XXXXX":case"XXX":default:return Dl(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return BA(r);case"xxxx":case"xx":return Dl(r);case"xxxxx":case"xxx":default:return Dl(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+zA(r,":");case"OOOO":default:return"GMT"+Dl(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+zA(r,":");case"zzzz":default:return"GMT"+Dl(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return nn(r,t.length)},T:function(e,t,n){const r=e.getTime();return nn(r,t.length)}};function zA(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),o=r%60;return o===0?n+String(i):n+String(i)+t+nn(o,2)}function BA(e,t){return e%60===0?(e>0?"-":"+")+nn(Math.abs(e)/60,2):Dl(e,t)}function Dl(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=nn(Math.trunc(r/60),2),o=nn(r%60,2);return n+i+t+o}const HA=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},f8=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},wge=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return HA(e,t);let o;switch(r){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",HA(r,t)).replace("{{time}}",f8(i,t))},Sge={p:f8,P:wge},_ge=/^D+$/,Cge=/^Y+$/,Ege=["D","DD","YY","YYYY"];function Rge(e){return _ge.test(e)}function Pge(e){return Cge.test(e)}function Tge(e,t,n){const r=Mge(e,t,n);if(console.warn(r),Ege.includes(e))throw new RangeError(r)}function Mge(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Oge=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Dge=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Age=/^'([^]*?)'?$/,kge=/''/g,Ige=/[a-zA-Z]/;function os(e,t,n){var u,d,p,h,m,b,v,x;const r=zp(),i=(n==null?void 0:n.locale)??r.locale??l8,o=(n==null?void 0:n.firstWeekContainsDate)??((d=(u=n==null?void 0:n.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??r.firstWeekContainsDate??((h=(p=r.locale)==null?void 0:p.options)==null?void 0:h.firstWeekContainsDate)??1,s=(n==null?void 0:n.weekStartsOn)??((b=(m=n==null?void 0:n.locale)==null?void 0:m.options)==null?void 0:b.weekStartsOn)??r.weekStartsOn??((x=(v=r.locale)==null?void 0:v.options)==null?void 0:x.weekStartsOn)??0,a=jt(e);if(!$pe(a))throw new RangeError("Invalid time value");let l=t.match(Dge).map(S=>{const _=S[0];if(_==="p"||_==="P"){const E=Sge[_];return E(S,i.formatLong)}return S}).join("").match(Oge).map(S=>{if(S==="''")return{isToken:!1,value:"'"};const _=S[0];if(_==="'")return{isToken:!1,value:Nge(S)};if($A[_])return{isToken:!0,value:S};if(_.match(Ige))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");return{isToken:!1,value:S}});i.localize.preprocessor&&(l=i.localize.preprocessor(a,l));const c={firstWeekContainsDate:o,weekStartsOn:s,locale:i};return l.map(S=>{if(!S.isToken)return S.value;const _=S.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&Pge(_)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&Rge(_))&&Tge(_,t,String(e));const E=$A[_[0]];return E(a,_,i.localize,c)}).join("")}function Nge(e){const t=e.match(Age);return t?t[1].replace(kge,"'"):e}function Lge(e){const t=jt(e),n=t.getFullYear(),r=t.getMonth(),i=bi(e,0);return i.setFullYear(n,r+1,0),i.setHours(0,0,0,0),i.getDate()}function Fge(e){return Math.trunc(+jt(e)/1e3)}function jge(e){const t=jt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function $ge(e,t){return zpe(jge(e),gi(e),t)+1}function r_(e,t){const n=jt(e),r=jt(t);return n.getTime()>r.getTime()}function h8(e,t){const n=jt(e),r=jt(t);return+n<+r}function eR(e,t){const n=jt(e),r=jt(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function zge(e,t){const n=jt(e),r=jt(t);return n.getFullYear()===r.getFullYear()}function P1(e,t){return qr(e,-t)}function T1(e,t){const n=jt(e),r=n.getFullYear(),i=n.getDate(),o=bi(e,0);o.setFullYear(r,t,15),o.setHours(0,0,0,0);const s=Lge(o);return n.setMonth(t,Math.min(i,s)),n}function VA(e,t){const n=jt(e);return isNaN(+n)?bi(e,NaN):(n.setFullYear(t),n)}var Qe=function(){return Qe=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Qe.apply(this,arguments)};function Bge(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function p8(e,t,n){for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}function Bp(e){return e.mode==="multiple"}function Hp(e){return e.mode==="range"}function D0(e){return e.mode==="single"}var Hge={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function Vge(e,t){return os(e,"LLLL y",t)}function Wge(e,t){return os(e,"d",t)}function Uge(e,t){return os(e,"LLLL",t)}function Gge(e){return"".concat(e)}function qge(e,t){return os(e,"cccccc",t)}function Yge(e,t){return os(e,"yyyy",t)}var Kge=Object.freeze({__proto__:null,formatCaption:Vge,formatDay:Wge,formatMonthCaption:Uge,formatWeekNumber:Gge,formatWeekdayName:qge,formatYearCaption:Yge}),Xge=function(e,t,n){return os(e,"do MMMM (EEEE)",n)},Qge=function(){return"Month: "},Jge=function(){return"Go to next month"},Zge=function(){return"Go to previous month"},eme=function(e,t){return os(e,"cccc",t)},tme=function(e){return"Week n. ".concat(e)},nme=function(){return"Year: "},rme=Object.freeze({__proto__:null,labelDay:Xge,labelMonthDropdown:Qge,labelNext:Jge,labelPrevious:Zge,labelWeekNumber:tme,labelWeekday:eme,labelYearDropdown:nme});function ime(){var e="buttons",t=Hge,n=l8,r={},i={},o=1,s={},a=new Date;return{captionLayout:e,classNames:t,formatters:Kge,labels:rme,locale:n,modifiersClassNames:r,modifiers:i,numberOfMonths:o,styles:s,today:a,mode:"default"}}function ome(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,i=e.toMonth,o=e.fromDate,s=e.toDate;return r?o=gi(r):t&&(o=new Date(t,0,1)),i?s=JE(i):n&&(s=new Date(n,11,31)),{fromDate:o?wd(o):void 0,toDate:s?wd(s):void 0}}var g8=P.createContext(void 0);function sme(e){var t,n=e.initialProps,r=ime(),i=ome(n),o=i.fromDate,s=i.toDate,a=(t=n.captionLayout)!==null&&t!==void 0?t:r.captionLayout;a!=="buttons"&&(!o||!s)&&(a="buttons");var l;(D0(n)||Bp(n)||Hp(n))&&(l=n.onSelect);var c=Qe(Qe(Qe({},r),n),{captionLayout:a,classNames:Qe(Qe({},r.classNames),n.classNames),components:Qe({},n.components),formatters:Qe(Qe({},r.formatters),n.formatters),fromDate:o,labels:Qe(Qe({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:Qe(Qe({},r.modifiers),n.modifiers),modifiersClassNames:Qe(Qe({},r.modifiersClassNames),n.modifiersClassNames),onSelect:l,styles:Qe(Qe({},r.styles),n.styles),toDate:s});return y.jsx(g8.Provider,{value:c,children:e.children})}function gn(){var e=P.useContext(g8);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function m8(e){var t=gn(),n=t.locale,r=t.classNames,i=t.styles,o=t.formatters.formatCaption;return y.jsx("div",{className:r.caption_label,style:i.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:o(e.displayMonth,{locale:n})})}function ame(e){return y.jsx("svg",Qe({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:y.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function b8(e){var t,n,r=e.onChange,i=e.value,o=e.children,s=e.caption,a=e.className,l=e.style,c=gn(),u=(n=(t=c.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:ame;return y.jsxs("div",{className:a,style:l,children:[y.jsx("span",{className:c.classNames.vhidden,children:e["aria-label"]}),y.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:c.classNames.dropdown,style:c.styles.dropdown,value:i,onChange:r,children:o}),y.jsxs("div",{className:c.classNames.caption_label,style:c.styles.caption_label,"aria-hidden":"true",children:[s,y.jsx(u,{className:c.classNames.dropdown_icon,style:c.styles.dropdown_icon})]})]})}function lme(e){var t,n=gn(),r=n.fromDate,i=n.toDate,o=n.styles,s=n.locale,a=n.formatters.formatMonthCaption,l=n.classNames,c=n.components,u=n.labels.labelMonthDropdown;if(!r)return y.jsx(y.Fragment,{});if(!i)return y.jsx(y.Fragment,{});var d=[];if(zge(r,i))for(var p=gi(r),h=r.getMonth();h<=i.getMonth();h++)d.push(T1(p,h));else for(var p=gi(new Date),h=0;h<=11;h++)d.push(T1(p,h));var m=function(v){var x=Number(v.target.value),S=T1(gi(e.displayMonth),x);e.onChange(S)},b=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:b8;return y.jsx(b,{name:"months","aria-label":u(),className:l.dropdown_month,style:o.dropdown_month,onChange:m,value:e.displayMonth.getMonth(),caption:a(e.displayMonth,{locale:s}),children:d.map(function(v){return y.jsx("option",{value:v.getMonth(),children:a(v,{locale:s})},v.getMonth())})})}function cme(e){var t,n=e.displayMonth,r=gn(),i=r.fromDate,o=r.toDate,s=r.locale,a=r.styles,l=r.classNames,c=r.components,u=r.formatters.formatYearCaption,d=r.labels.labelYearDropdown,p=[];if(!i)return y.jsx(y.Fragment,{});if(!o)return y.jsx(y.Fragment,{});for(var h=i.getFullYear(),m=o.getFullYear(),b=h;b<=m;b++)p.push(VA(s8(new Date),b));var v=function(S){var _=VA(gi(n),Number(S.target.value));e.onChange(_)},x=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:b8;return y.jsx(x,{name:"years","aria-label":d(),className:l.dropdown_year,style:a.dropdown_year,onChange:v,value:n.getFullYear(),caption:u(n,{locale:s}),children:p.map(function(S){return y.jsx("option",{value:S.getFullYear(),children:u(S,{locale:s})},S.getFullYear())})})}function ume(e,t){var n=P.useState(e),r=n[0],i=n[1],o=t===void 0?r:t;return[o,i]}function dme(e){var t=e.month,n=e.defaultMonth,r=e.today,i=t||n||r||new Date,o=e.toDate,s=e.fromDate,a=e.numberOfMonths,l=a===void 0?1:a;if(o&&zh(o,i)<0){var c=-1*(l-1);i=Ao(o,c)}return s&&zh(i,s)<0&&(i=s),gi(i)}function fme(){var e=gn(),t=dme(e),n=ume(t,e.month),r=n[0],i=n[1],o=function(s){var a;if(!e.disableNavigation){var l=gi(s);i(l),(a=e.onMonthChange)===null||a===void 0||a.call(e,l)}};return[r,o]}function hme(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,i=gi(e),o=gi(Ao(i,r)),s=zh(o,i),a=[],l=0;l<s;l++){var c=Ao(i,l);a.push(c)}return n&&(a=a.reverse()),a}function pme(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.pagedNavigation,i=t.numberOfMonths,o=i===void 0?1:i,s=r?o:1,a=gi(e);if(!n)return Ao(a,s);var l=zh(n,e);if(!(l<o))return Ao(a,s)}}function gme(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.pagedNavigation,i=t.numberOfMonths,o=i===void 0?1:i,s=r?o:1,a=gi(e);if(!n)return Ao(a,-s);var l=zh(a,n);if(!(l<=0))return Ao(a,-s)}}var y8=P.createContext(void 0);function mme(e){var t=gn(),n=fme(),r=n[0],i=n[1],o=hme(r,t),s=pme(r,t),a=gme(r,t),l=function(d){return o.some(function(p){return eR(d,p)})},c=function(d,p){l(d)||(p&&h8(d,p)?i(Ao(d,1+t.numberOfMonths*-1)):i(d))},u={currentMonth:r,displayMonths:o,goToMonth:i,goToDate:c,previousMonth:a,nextMonth:s,isDateDisplayed:l};return y.jsx(y8.Provider,{value:u,children:e.children})}function Vp(){var e=P.useContext(y8);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function WA(e){var t,n=gn(),r=n.classNames,i=n.styles,o=n.components,s=Vp().goToMonth,a=function(u){s(Ao(u,e.displayIndex?-e.displayIndex:0))},l=(t=o==null?void 0:o.CaptionLabel)!==null&&t!==void 0?t:m8,c=y.jsx(l,{id:e.id,displayMonth:e.displayMonth});return y.jsxs("div",{className:r.caption_dropdowns,style:i.caption_dropdowns,children:[y.jsx("div",{className:r.vhidden,children:c}),y.jsx(lme,{onChange:a,displayMonth:e.displayMonth}),y.jsx(cme,{onChange:a,displayMonth:e.displayMonth})]})}function bme(e){return y.jsx("svg",Qe({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:y.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function yme(e){return y.jsx("svg",Qe({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:y.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var uy=P.forwardRef(function(e,t){var n=gn(),r=n.classNames,i=n.styles,o=[r.button_reset,r.button];e.className&&o.push(e.className);var s=o.join(" "),a=Qe(Qe({},i.button_reset),i.button);return e.style&&Object.assign(a,e.style),y.jsx("button",Qe({},e,{ref:t,type:"button",className:s,style:a}))});function vme(e){var t,n,r=gn(),i=r.dir,o=r.locale,s=r.classNames,a=r.styles,l=r.labels,c=l.labelPrevious,u=l.labelNext,d=r.components;if(!e.nextMonth&&!e.previousMonth)return y.jsx(y.Fragment,{});var p=c(e.previousMonth,{locale:o}),h=[s.nav_button,s.nav_button_previous].join(" "),m=u(e.nextMonth,{locale:o}),b=[s.nav_button,s.nav_button_next].join(" "),v=(t=d==null?void 0:d.IconRight)!==null&&t!==void 0?t:yme,x=(n=d==null?void 0:d.IconLeft)!==null&&n!==void 0?n:bme;return y.jsxs("div",{className:s.nav,style:a.nav,children:[!e.hidePrevious&&y.jsx(uy,{name:"previous-month","aria-label":p,className:h,style:a.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:i==="rtl"?y.jsx(v,{className:s.nav_icon,style:a.nav_icon}):y.jsx(x,{className:s.nav_icon,style:a.nav_icon})}),!e.hideNext&&y.jsx(uy,{name:"next-month","aria-label":m,className:b,style:a.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:i==="rtl"?y.jsx(x,{className:s.nav_icon,style:a.nav_icon}):y.jsx(v,{className:s.nav_icon,style:a.nav_icon})})]})}function UA(e){var t=gn().numberOfMonths,n=Vp(),r=n.previousMonth,i=n.nextMonth,o=n.goToMonth,s=n.displayMonths,a=s.findIndex(function(m){return eR(e.displayMonth,m)}),l=a===0,c=a===s.length-1,u=t>1&&(l||!c),d=t>1&&(c||!l),p=function(){r&&o(r)},h=function(){i&&o(i)};return y.jsx(vme,{displayMonth:e.displayMonth,hideNext:u,hidePrevious:d,nextMonth:i,previousMonth:r,onPreviousClick:p,onNextClick:h})}function xme(e){var t,n=gn(),r=n.classNames,i=n.disableNavigation,o=n.styles,s=n.captionLayout,a=n.components,l=(t=a==null?void 0:a.CaptionLabel)!==null&&t!==void 0?t:m8,c;return i?c=y.jsx(l,{id:e.id,displayMonth:e.displayMonth}):s==="dropdown"?c=y.jsx(WA,{displayMonth:e.displayMonth,id:e.id}):s==="dropdown-buttons"?c=y.jsxs(y.Fragment,{children:[y.jsx(WA,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),y.jsx(UA,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):c=y.jsxs(y.Fragment,{children:[y.jsx(l,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),y.jsx(UA,{displayMonth:e.displayMonth,id:e.id})]}),y.jsx("div",{className:r.caption,style:o.caption,children:c})}function wme(e){var t=gn(),n=t.footer,r=t.styles,i=t.classNames.tfoot;return n?y.jsx("tfoot",{className:i,style:r.tfoot,children:y.jsx("tr",{children:y.jsx("td",{colSpan:8,children:n})})}):y.jsx(y.Fragment,{})}function Sme(e,t,n){for(var r=n?Cc(new Date):us(new Date,{locale:e,weekStartsOn:t}),i=[],o=0;o<7;o++){var s=qr(r,o);i.push(s)}return i}function _me(){var e=gn(),t=e.classNames,n=e.styles,r=e.showWeekNumber,i=e.locale,o=e.weekStartsOn,s=e.ISOWeek,a=e.formatters.formatWeekdayName,l=e.labels.labelWeekday,c=Sme(i,o,s);return y.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&y.jsx("td",{style:n.head_cell,className:t.head_cell}),c.map(function(u,d){return y.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":l(u,{locale:i}),children:a(u,{locale:i})},d)})]})}function Cme(){var e,t=gn(),n=t.classNames,r=t.styles,i=t.components,o=(e=i==null?void 0:i.HeadRow)!==null&&e!==void 0?e:_me;return y.jsx("thead",{style:r.head,className:n.head,children:y.jsx(o,{})})}function Eme(e){var t=gn(),n=t.locale,r=t.formatters.formatDay;return y.jsx(y.Fragment,{children:r(e.date,{locale:n})})}var tR=P.createContext(void 0);function Rme(e){if(!Bp(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return y.jsx(tR.Provider,{value:t,children:e.children})}return y.jsx(Pme,{initialProps:e.initialProps,children:e.children})}function Pme(e){var t=e.initialProps,n=e.children,r=t.selected,i=t.min,o=t.max,s=function(c,u,d){var p,h;(p=t.onDayClick)===null||p===void 0||p.call(t,c,u,d);var m=!!(u.selected&&i&&(r==null?void 0:r.length)===i);if(!m){var b=!!(!u.selected&&o&&(r==null?void 0:r.length)===o);if(!b){var v=r?p8([],r):[];if(u.selected){var x=v.findIndex(function(S){return hi(c,S)});v.splice(x,1)}else v.push(c);(h=t.onSelect)===null||h===void 0||h.call(t,v,c,u,d)}}},a={disabled:[]};r&&a.disabled.push(function(c){var u=o&&r.length>o-1,d=r.some(function(p){return hi(p,c)});return!!(u&&!d)});var l={selected:r,onDayClick:s,modifiers:a};return y.jsx(tR.Provider,{value:l,children:n})}function nR(){var e=P.useContext(tR);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function Tme(e,t){var n=t||{},r=n.from,i=n.to;return r&&i?hi(i,e)&&hi(r,e)?void 0:hi(i,e)?{from:i,to:void 0}:hi(r,e)?void 0:r_(r,e)?{from:e,to:i}:{from:r,to:e}:i?r_(e,i)?{from:i,to:e}:{from:e,to:i}:r?h8(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var rR=P.createContext(void 0);function Mme(e){if(!Hp(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return y.jsx(rR.Provider,{value:t,children:e.children})}return y.jsx(Ome,{initialProps:e.initialProps,children:e.children})}function Ome(e){var t=e.initialProps,n=e.children,r=t.selected,i=r||{},o=i.from,s=i.to,a=t.min,l=t.max,c=function(h,m,b){var v,x;(v=t.onDayClick)===null||v===void 0||v.call(t,h,m,b);var S=Tme(h,r);(x=t.onSelect)===null||x===void 0||x.call(t,S,h,m,b)},u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(o?(u.range_start=[o],s?(u.range_end=[s],hi(o,s)||(u.range_middle=[{after:o,before:s}])):u.range_end=[o]):s&&(u.range_start=[s],u.range_end=[s]),a&&(o&&!s&&u.disabled.push({after:P1(o,a-1),before:qr(o,a-1)}),o&&s&&u.disabled.push({after:o,before:qr(o,a-1)}),!o&&s&&u.disabled.push({after:P1(s,a-1),before:qr(s,a-1)})),l){if(o&&!s&&(u.disabled.push({before:qr(o,-l+1)}),u.disabled.push({after:qr(o,l-1)})),o&&s){var d=es(s,o)+1,p=l-d;u.disabled.push({before:P1(o,p)}),u.disabled.push({after:qr(s,p)})}!o&&s&&(u.disabled.push({before:qr(s,-l+1)}),u.disabled.push({after:qr(s,l-1)}))}return y.jsx(rR.Provider,{value:{selected:r,onDayClick:c,modifiers:u},children:n})}function iR(){var e=P.useContext(rR);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function hb(e){return Array.isArray(e)?p8([],e):e!==void 0?[e]:[]}function Dme(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],i=n[1];t[r]=hb(i)}),t}var ko;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(ko||(ko={}));var Ame=ko.Selected,As=ko.Disabled,kme=ko.Hidden,Ime=ko.Today,M1=ko.RangeEnd,O1=ko.RangeMiddle,D1=ko.RangeStart,Nme=ko.Outside;function Lme(e,t,n){var r,i=(r={},r[Ame]=hb(e.selected),r[As]=hb(e.disabled),r[kme]=hb(e.hidden),r[Ime]=[e.today],r[M1]=[],r[O1]=[],r[D1]=[],r[Nme]=[],r);return e.fromDate&&i[As].push({before:e.fromDate}),e.toDate&&i[As].push({after:e.toDate}),Bp(e)?i[As]=i[As].concat(t.modifiers[As]):Hp(e)&&(i[As]=i[As].concat(n.modifiers[As]),i[D1]=n.modifiers[D1],i[O1]=n.modifiers[O1],i[M1]=n.modifiers[M1]),i}var v8=P.createContext(void 0);function Fme(e){var t=gn(),n=nR(),r=iR(),i=Lme(t,n,r),o=Dme(t.modifiers),s=Qe(Qe({},i),o);return y.jsx(v8.Provider,{value:s,children:e.children})}function x8(){var e=P.useContext(v8);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function jme(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function $me(e){return!!(e&&typeof e=="object"&&"from"in e)}function zme(e){return!!(e&&typeof e=="object"&&"after"in e)}function Bme(e){return!!(e&&typeof e=="object"&&"before"in e)}function Hme(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function Vme(e,t){var n,r=t.from,i=t.to;if(r&&i){var o=es(i,r)<0;o&&(n=[i,r],r=n[0],i=n[1]);var s=es(e,r)>=0&&es(i,e)>=0;return s}return i?hi(i,e):r?hi(r,e):!1}function Wme(e){return QE(e)}function Ume(e){return Array.isArray(e)&&e.every(QE)}function Gme(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(Wme(n))return hi(e,n);if(Ume(n))return n.includes(e);if($me(n))return Vme(e,n);if(Hme(n))return n.dayOfWeek.includes(e.getDay());if(jme(n)){var r=es(n.before,e),i=es(n.after,e),o=r>0,s=i<0,a=r_(n.before,n.after);return a?s&&o:o||s}return zme(n)?es(e,n.after)>0:Bme(n)?es(n.before,e)>0:typeof n=="function"?n(e):!1})}function oR(e,t,n){var r=Object.keys(t).reduce(function(o,s){var a=t[s];return Gme(e,a)&&o.push(s),o},[]),i={};return r.forEach(function(o){return i[o]=!0}),n&&!eR(e,n)&&(i.outside=!0),i}function qme(e,t){for(var n=gi(e[0]),r=JE(e[e.length-1]),i,o,s=n;s<=r;){var a=oR(s,t),l=!a.disabled&&!a.hidden;if(!l){s=qr(s,1);continue}if(a.selected)return s;a.today&&!o&&(o=s),i||(i=s),s=qr(s,1)}return o||i}var Yme=365;function w8(e,t){var n=t.moveBy,r=t.direction,i=t.context,o=t.modifiers,s=t.retry,a=s===void 0?{count:0,lastFocused:e}:s,l=i.weekStartsOn,c=i.fromDate,u=i.toDate,d=i.locale,p={day:qr,week:n_,month:Ao,year:Lpe,startOfWeek:function(v){return i.ISOWeek?Cc(v):us(v,{locale:d,weekStartsOn:l})},endOfWeek:function(v){return i.ISOWeek?a8(v):ZE(v,{locale:d,weekStartsOn:l})}},h=p[n](e,r==="after"?1:-1);r==="before"&&c?h=Fpe([c,h]):r==="after"&&u&&(h=jpe([u,h]));var m=!0;if(o){var b=oR(h,o);m=!b.disabled&&!b.hidden}return m?h:a.count>Yme?a.lastFocused:w8(h,{moveBy:n,direction:r,context:i,modifiers:o,retry:Qe(Qe({},a),{count:a.count+1})})}var S8=P.createContext(void 0);function Kme(e){var t=Vp(),n=x8(),r=P.useState(),i=r[0],o=r[1],s=P.useState(),a=s[0],l=s[1],c=qme(t.displayMonths,n),u=i??(a&&t.isDateDisplayed(a))?a:c,d=function(){l(i),o(void 0)},p=function(v){o(v)},h=gn(),m=function(v,x){if(i){var S=w8(i,{moveBy:v,direction:x,context:h,modifiers:n});hi(i,S)||(t.goToDate(S,i),p(S))}},b={focusedDay:i,focusTarget:u,blur:d,focus:p,focusDayAfter:function(){return m("day","after")},focusDayBefore:function(){return m("day","before")},focusWeekAfter:function(){return m("week","after")},focusWeekBefore:function(){return m("week","before")},focusMonthBefore:function(){return m("month","before")},focusMonthAfter:function(){return m("month","after")},focusYearBefore:function(){return m("year","before")},focusYearAfter:function(){return m("year","after")},focusStartOfWeek:function(){return m("startOfWeek","before")},focusEndOfWeek:function(){return m("endOfWeek","after")}};return y.jsx(S8.Provider,{value:b,children:e.children})}function sR(){var e=P.useContext(S8);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function Xme(e,t){var n=x8(),r=oR(e,n,t);return r}var aR=P.createContext(void 0);function Qme(e){if(!D0(e.initialProps)){var t={selected:void 0};return y.jsx(aR.Provider,{value:t,children:e.children})}return y.jsx(Jme,{initialProps:e.initialProps,children:e.children})}function Jme(e){var t=e.initialProps,n=e.children,r=function(o,s,a){var l,c,u;if((l=t.onDayClick)===null||l===void 0||l.call(t,o,s,a),s.selected&&!t.required){(c=t.onSelect)===null||c===void 0||c.call(t,void 0,o,s,a);return}(u=t.onSelect)===null||u===void 0||u.call(t,o,o,s,a)},i={selected:t.selected,onDayClick:r};return y.jsx(aR.Provider,{value:i,children:n})}function _8(){var e=P.useContext(aR);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function Zme(e,t){var n=gn(),r=_8(),i=nR(),o=iR(),s=sR(),a=s.focusDayAfter,l=s.focusDayBefore,c=s.focusWeekAfter,u=s.focusWeekBefore,d=s.blur,p=s.focus,h=s.focusMonthBefore,m=s.focusMonthAfter,b=s.focusYearBefore,v=s.focusYearAfter,x=s.focusStartOfWeek,S=s.focusEndOfWeek,_=function(B){var W,q,A,Y;D0(n)?(W=r.onDayClick)===null||W===void 0||W.call(r,e,t,B):Bp(n)?(q=i.onDayClick)===null||q===void 0||q.call(i,e,t,B):Hp(n)?(A=o.onDayClick)===null||A===void 0||A.call(o,e,t,B):(Y=n.onDayClick)===null||Y===void 0||Y.call(n,e,t,B)},E=function(B){var W;p(e),(W=n.onDayFocus)===null||W===void 0||W.call(n,e,t,B)},C=function(B){var W;d(),(W=n.onDayBlur)===null||W===void 0||W.call(n,e,t,B)},M=function(B){var W;(W=n.onDayMouseEnter)===null||W===void 0||W.call(n,e,t,B)},O=function(B){var W;(W=n.onDayMouseLeave)===null||W===void 0||W.call(n,e,t,B)},k=function(B){var W;(W=n.onDayPointerEnter)===null||W===void 0||W.call(n,e,t,B)},N=function(B){var W;(W=n.onDayPointerLeave)===null||W===void 0||W.call(n,e,t,B)},F=function(B){var W;(W=n.onDayTouchCancel)===null||W===void 0||W.call(n,e,t,B)},j=function(B){var W;(W=n.onDayTouchEnd)===null||W===void 0||W.call(n,e,t,B)},$=function(B){var W;(W=n.onDayTouchMove)===null||W===void 0||W.call(n,e,t,B)},X=function(B){var W;(W=n.onDayTouchStart)===null||W===void 0||W.call(n,e,t,B)},V=function(B){var W;(W=n.onDayKeyUp)===null||W===void 0||W.call(n,e,t,B)},L=function(B){var W;switch(B.key){case"ArrowLeft":B.preventDefault(),B.stopPropagation(),n.dir==="rtl"?a():l();break;case"ArrowRight":B.preventDefault(),B.stopPropagation(),n.dir==="rtl"?l():a();break;case"ArrowDown":B.preventDefault(),B.stopPropagation(),c();break;case"ArrowUp":B.preventDefault(),B.stopPropagation(),u();break;case"PageUp":B.preventDefault(),B.stopPropagation(),B.shiftKey?b():h();break;case"PageDown":B.preventDefault(),B.stopPropagation(),B.shiftKey?v():m();break;case"Home":B.preventDefault(),B.stopPropagation(),x();break;case"End":B.preventDefault(),B.stopPropagation(),S();break}(W=n.onDayKeyDown)===null||W===void 0||W.call(n,e,t,B)},U={onClick:_,onFocus:E,onBlur:C,onKeyDown:L,onKeyUp:V,onMouseEnter:M,onMouseLeave:O,onPointerEnter:k,onPointerLeave:N,onTouchCancel:F,onTouchEnd:j,onTouchMove:$,onTouchStart:X};return U}function ebe(){var e=gn(),t=_8(),n=nR(),r=iR(),i=D0(e)?t.selected:Bp(e)?n.selected:Hp(e)?r.selected:void 0;return i}function tbe(e){return Object.values(ko).includes(e)}function nbe(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(r){var i=e.modifiersClassNames[r];if(i)n.push(i);else if(tbe(r)){var o=e.classNames["day_".concat(r)];o&&n.push(o)}}),n}function rbe(e,t){var n=Qe({},e.styles.day);return Object.keys(t).forEach(function(r){var i;n=Qe(Qe({},n),(i=e.modifiersStyles)===null||i===void 0?void 0:i[r])}),n}function ibe(e,t,n){var r,i,o,s=gn(),a=sR(),l=Xme(e,t),c=Zme(e,l),u=ebe(),d=!!(s.onDayClick||s.mode!=="default");P.useEffect(function(){var M;l.outside||a.focusedDay&&d&&hi(a.focusedDay,e)&&((M=n.current)===null||M===void 0||M.focus())},[a.focusedDay,e,n,d,l.outside]);var p=nbe(s,l).join(" "),h=rbe(s,l),m=!!(l.outside&&!s.showOutsideDays||l.hidden),b=(o=(i=s.components)===null||i===void 0?void 0:i.DayContent)!==null&&o!==void 0?o:Eme,v=y.jsx(b,{date:e,displayMonth:t,activeModifiers:l}),x={style:h,className:p,children:v,role:"gridcell"},S=a.focusTarget&&hi(a.focusTarget,e)&&!l.outside,_=a.focusedDay&&hi(a.focusedDay,e),E=Qe(Qe(Qe({},x),(r={disabled:l.disabled,role:"gridcell"},r["aria-selected"]=l.selected,r.tabIndex=_||S?0:-1,r)),c),C={isButton:d,isHidden:m,activeModifiers:l,selectedDays:u,buttonProps:E,divProps:x};return C}function obe(e){var t=P.useRef(null),n=ibe(e.date,e.displayMonth,t);return n.isHidden?y.jsx("div",{role:"gridcell"}):n.isButton?y.jsx(uy,Qe({name:"day",ref:t},n.buttonProps)):y.jsx("div",Qe({},n.divProps))}function sbe(e){var t=e.number,n=e.dates,r=gn(),i=r.onWeekNumberClick,o=r.styles,s=r.classNames,a=r.locale,l=r.labels.labelWeekNumber,c=r.formatters.formatWeekNumber,u=c(Number(t),{locale:a});if(!i)return y.jsx("span",{className:s.weeknumber,style:o.weeknumber,children:u});var d=l(Number(t),{locale:a}),p=function(h){i(t,n,h)};return y.jsx(uy,{name:"week-number","aria-label":d,className:s.weeknumber,style:o.weeknumber,onClick:p,children:u})}function abe(e){var t,n,r=gn(),i=r.styles,o=r.classNames,s=r.showWeekNumber,a=r.components,l=(t=a==null?void 0:a.Day)!==null&&t!==void 0?t:obe,c=(n=a==null?void 0:a.WeekNumber)!==null&&n!==void 0?n:sbe,u;return s&&(u=y.jsx("td",{className:o.cell,style:i.cell,children:y.jsx(c,{number:e.weekNumber,dates:e.dates})})),y.jsxs("tr",{className:o.row,style:i.row,children:[u,e.dates.map(function(d){return y.jsx("td",{className:o.cell,style:i.cell,role:"presentation",children:y.jsx(l,{displayMonth:e.displayMonth,date:d})},Fge(d))})]})}function GA(e,t,n){for(var r=n!=null&&n.ISOWeek?a8(t):ZE(t,n),i=n!=null&&n.ISOWeek?Cc(e):us(e,n),o=es(r,i),s=[],a=0;a<=o;a++)s.push(qr(i,a));var l=s.reduce(function(c,u){var d=n!=null&&n.ISOWeek?c8(u):d8(u,n),p=c.find(function(h){return h.weekNumber===d});return p?(p.dates.push(u),c):(c.push({weekNumber:d,dates:[u]}),c)},[]);return l}function lbe(e,t){var n=GA(gi(e),JE(e),t);if(t!=null&&t.useFixedWeeks){var r=$ge(e,t);if(r<6){var i=n[n.length-1],o=i.dates[i.dates.length-1],s=n_(o,6-r),a=GA(n_(o,1),s,t);n.push.apply(n,a)}}return n}function cbe(e){var t,n,r,i=gn(),o=i.locale,s=i.classNames,a=i.styles,l=i.hideHead,c=i.fixedWeeks,u=i.components,d=i.weekStartsOn,p=i.firstWeekContainsDate,h=i.ISOWeek,m=lbe(e.displayMonth,{useFixedWeeks:!!c,ISOWeek:h,locale:o,weekStartsOn:d,firstWeekContainsDate:p}),b=(t=u==null?void 0:u.Head)!==null&&t!==void 0?t:Cme,v=(n=u==null?void 0:u.Row)!==null&&n!==void 0?n:abe,x=(r=u==null?void 0:u.Footer)!==null&&r!==void 0?r:wme;return y.jsxs("table",{id:e.id,className:s.table,style:a.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!l&&y.jsx(b,{}),y.jsx("tbody",{className:s.tbody,style:a.tbody,children:m.map(function(S){return y.jsx(v,{displayMonth:e.displayMonth,dates:S.dates,weekNumber:S.weekNumber},S.weekNumber)})}),y.jsx(x,{displayMonth:e.displayMonth})]})}function ube(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var dbe=ube()?P.useLayoutEffect:P.useEffect,A1=!1,fbe=0;function qA(){return"react-day-picker-".concat(++fbe)}function hbe(e){var t,n=e??(A1?qA():null),r=P.useState(n),i=r[0],o=r[1];return dbe(function(){i===null&&o(qA())},[]),P.useEffect(function(){A1===!1&&(A1=!0)},[]),(t=e??i)!==null&&t!==void 0?t:void 0}function pbe(e){var t,n,r=gn(),i=r.dir,o=r.classNames,s=r.styles,a=r.components,l=Vp().displayMonths,c=hbe(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),u=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,d=[o.month],p=s.month,h=e.displayIndex===0,m=e.displayIndex===l.length-1,b=!h&&!m;i==="rtl"&&(t=[h,m],m=t[0],h=t[1]),h&&(d.push(o.caption_start),p=Qe(Qe({},p),s.caption_start)),m&&(d.push(o.caption_end),p=Qe(Qe({},p),s.caption_end)),b&&(d.push(o.caption_between),p=Qe(Qe({},p),s.caption_between));var v=(n=a==null?void 0:a.Caption)!==null&&n!==void 0?n:xme;return y.jsxs("div",{className:d.join(" "),style:p,children:[y.jsx(v,{id:c,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),y.jsx(cbe,{id:u,"aria-labelledby":c,displayMonth:e.displayMonth})]},e.displayIndex)}function gbe(e){var t=gn(),n=t.classNames,r=t.styles;return y.jsx("div",{className:n.months,style:r.months,children:e.children})}function mbe(e){var t,n,r=e.initialProps,i=gn(),o=sR(),s=Vp(),a=P.useState(!1),l=a[0],c=a[1];P.useEffect(function(){i.initialFocus&&o.focusTarget&&(l||(o.focus(o.focusTarget),c(!0)))},[i.initialFocus,l,o.focus,o.focusTarget,o]);var u=[i.classNames.root,i.className];i.numberOfMonths>1&&u.push(i.classNames.multiple_months),i.showWeekNumber&&u.push(i.classNames.with_weeknumber);var d=Qe(Qe({},i.styles.root),i.style),p=Object.keys(r).filter(function(m){return m.startsWith("data-")}).reduce(function(m,b){var v;return Qe(Qe({},m),(v={},v[b]=r[b],v))},{}),h=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:gbe;return y.jsx("div",Qe({className:u.join(" "),style:d,dir:i.dir,id:i.id,nonce:r.nonce,title:r.title,lang:r.lang},p,{children:y.jsx(h,{children:s.displayMonths.map(function(m,b){return y.jsx(pbe,{displayIndex:b,displayMonth:m},b)})})}))}function bbe(e){var t=e.children,n=Bge(e,["children"]);return y.jsx(sme,{initialProps:n,children:y.jsx(mme,{children:y.jsx(Qme,{initialProps:n,children:y.jsx(Rme,{initialProps:n,children:y.jsx(Mme,{initialProps:n,children:y.jsx(Fme,{children:y.jsx(Kme,{children:t})})})})})})})}function ybe(e){return y.jsx(bbe,Qe({},e,{children:y.jsx(mbe,{initialProps:e})}))}function C8({className:e,classNames:t,showOutsideDays:n=!0,...r}){return y.jsx(ybe,{showOutsideDays:n,className:be("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:be($h({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:be($h({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:({...i})=>y.jsx(NC,{...i,className:"h-4 w-4"}),IconRight:({...i})=>y.jsx(Zy,{...i,className:"h-4 w-4"})},...r})}C8.displayName="Calendar";function E8(e){const{authToken:t}=Vi(),n=ye(E=>E.authToken),r=t||n,i=ye(E=>E.dashboard.filters),o=ye(E=>E.selectedSheetId),s=ye(E=>E.filterValues),[a,l]=P.useState(!0),c=i==null?void 0:i.filter(E=>E.sheetId===o||!E.sheetId),u=s==null?void 0:s.filter(E=>(c==null?void 0:c.some(C=>C.id===E.filterId))||E.filterId.endsWith(o));function d(E){return a?{allowQuery:!0,filterValues:E.filter(O=>O.filterId!==e.id)}:(E==null?void 0:E.find(M=>M.filterId===e.id))?{allowQuery:!1,filterValues:E}:{allowQuery:!0,filterValues:E}}const{allowQuery:p,filterValues:h}=d(u||[]),{data:m,isLoading:b,isFetching:v,isError:x,refetch:S,isSuccess:_}=xp({queryKey:["filter",e.id,e.sql,JSON.stringify(h)],queryFn:()=>Dy("https://semaphor.cloud/api/v1/query",(r==null?void 0:r.accessToken)||"",{connection_id:e.connectionId,sql:e.sql,active_filters:h,cache_config:Q_()}),enabled:!!e.sql&&!!e.connectionId&&p&&!!(r!=null&&r.accessToken),placeholderData:E=>E});return P.useEffect(()=>{_&&a&&l(!1)},[_,a]),{data:m,isLoading:b,isFetching:v,isError:x,refetch:S}}function vbe(e){const t=ye(i=>{var o,s;return(s=(o=i.dashboard)==null?void 0:o.filters)==null?void 0:s.find(a=>a.id===e)}),{setDateRange:n,...r}=R8(t||{});return r}function R8(e){const[t,n]=P.useState(),[r,i]=P.useState(),o=ye(m=>m.filterValues),s=ye(m=>m.actions.addOrUpdateFilterValue),{removeFilterValues:a}=Hn(),{data:l,isLoading:c,isFetching:u,isError:d}=E8(e);P.useEffect(()=>{var m;if(((m=l==null?void 0:l.records)==null?void 0:m.length)>0){const b=l.records[0];if(!b.min||!b.max)return;n({from:new Date(b.min),to:new Date(b.max)}),i({from:new Date(b.min),to:new Date(b.max)})}},[l]),P.useEffect(()=>{var m;if(o){const b=o.find(v=>v.filterId===e.id);if(!b)n(r);else if(((m=b.values)==null?void 0:m.length)===2){const[v,x]=b.values;n({from:v?new Date(v):void 0,to:x?new Date(x):void 0})}}},[o,e.id,r]);function p(){a(e.id),n(r)}function h(m){if(!m)return;let b=[m==null?void 0:m.from,m==null?void 0:m.to];m.from&&m.to===void 0?b=[m.from,jA(m.from,24)]:m.from&&m.to&&m.from.getTime()===m.to.getTime()?b=[m.from,jA(m.to,24)]:b=[m.from,m.to],n({from:b[0],to:b[1]});const v={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:Pu(e),name:e.column,operation:"between",values:b};s(v)}return{records:l==null?void 0:l.records,isLoading:c,isFetching:u,isError:d,initialDateRange:r,dateRange:t,setDateRange:n,handleClear:p,handleChange:h}}function xbe({filter:e,className:t}){var h,m,b,v,x,S,_,E;const n=ye(C=>C.themeStyle),[r,i]=P.useState(!1),{records:o,dateRange:s,isLoading:a,isFetching:l,isError:c,setDateRange:u,handleClear:d,handleChange:p}=R8(e);return a||l?y.jsx("div",{children:y.jsx(Mu,{className:"h-8 w-full bg-foreground/10"})}):c?y.jsx("div",{className:"h-8 w-full bg-muted px-2",children:"Error"}):o?y.jsx("div",{className:be("grid gap-2",t),children:y.jsxs(R0,{open:r,onOpenChange:i,children:[y.jsx(P0,{style:{borderRadius:(m=(h=n==null?void 0:n.chart)==null?void 0:h.options)==null?void 0:m.borderRadius},asChild:!0,children:y.jsxs(pi,{size:"sm",id:"date",variant:"outline",className:be("h-[34px] w-full justify-start rounded-sm text-left font-normal",!s&&"text-muted-foreground"),children:[y.jsx(U5,{className:"mr-2 h-4 w-4"}),s!=null&&s.from?s.to?y.jsxs(y.Fragment,{children:[os(s.from,"LLL dd, y")," -"," ",os(s.to,"LLL dd, y")]}):os(s.from,"LLL dd, y"):y.jsx("span",{children:"Pick a date"})]})}),y.jsxs(jp,{style:{borderRadius:(v=(b=n==null?void 0:n.chart)==null?void 0:b.options)==null?void 0:v.borderRadius},className:"w-auto p-0",align:"start",children:[y.jsx("div",{className:"px-4 pt-3",children:y.jsx(wn,{children:e.title})}),y.jsx(C8,{initialFocus:!0,mode:"range",defaultMonth:s==null?void 0:s.from,selected:s,onSelect:u,numberOfMonths:2}),y.jsxs("div",{className:"flex justify-end gap-2 px-4 py-3",children:[y.jsx(pi,{style:{borderRadius:(S=(x=n==null?void 0:n.chart)==null?void 0:x.options)==null?void 0:S.borderRadius},size:"sm",variant:"outline",onClick:()=>{p(s),i(!1)},children:"Apply"}),y.jsx(pi,{style:{borderRadius:(E=(_=n==null?void 0:n.chart)==null?void 0:_.options)==null?void 0:E.borderRadius},size:"sm",variant:"outline",onClick:d,children:"Clear"})]})]})]})}):y.jsxs(wn,{className:"w-fulll flex h-8 items-center bg-muted px-2",children:[" ","No Data"]})}const P8=typeof document<"u"?P.useLayoutEffect:()=>{};function wbe(e){const t=P.useRef(null);return P8(()=>{t.current=e},[e]),P.useCallback((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const Wp=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},Bl=e=>e&&"window"in e&&e.window===e?e:Wp(e).defaultView||window;function Sbe(e){var t;return typeof window>"u"||window.navigator==null?!1:((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands.some(n=>e.test(n.brand)))||e.test(window.navigator.userAgent)}function _be(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function T8(e){let t=null;return()=>(t==null&&(t=e()),t)}const Cbe=T8(function(){return _be(/^Mac/i)}),Ebe=T8(function(){return Sbe(/Android/i)});function Rbe(e){return e.mozInputSource===0&&e.isTrusted?!0:Ebe()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}class Pbe{isDefaultPrevented(){return this.nativeEvent.defaultPrevented}preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPropagationStopped=()=>!0}isPropagationStopped(){return!1}persist(){}constructor(t,n){this.nativeEvent=n,this.target=n.target,this.currentTarget=n.currentTarget,this.relatedTarget=n.relatedTarget,this.bubbles=n.bubbles,this.cancelable=n.cancelable,this.defaultPrevented=n.defaultPrevented,this.eventPhase=n.eventPhase,this.isTrusted=n.isTrusted,this.timeStamp=n.timeStamp,this.type=t}}function M8(e){let t=P.useRef({isFocused:!1,observer:null});P8(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=wbe(r=>{e==null||e(r)});return P.useCallback(r=>{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){t.current.isFocused=!0;let i=r.target,o=s=>{t.current.isFocused=!1,i.disabled&&n(new Pbe("blur",s)),t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};i.addEventListener("focusout",o,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&i.disabled){var s;(s=t.current.observer)===null||s===void 0||s.disconnect();let a=i===document.activeElement?null:document.activeElement;i.dispatchEvent(new FocusEvent("blur",{relatedTarget:a})),i.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:a}))}}),t.current.observer.observe(i,{attributes:!0,attributeFilter:["disabled"]})}},[n])}function Tbe(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:i}=e;const o=P.useCallback(l=>{if(l.target===l.currentTarget)return r&&r(l),i&&i(!1),!0},[r,i]),s=M8(o),a=P.useCallback(l=>{const c=Wp(l.target);l.target===l.currentTarget&&c.activeElement===l.target&&(n&&n(l),i&&i(!0),s(l))},[i,n,s]);return{focusProps:{onFocus:!t&&(n||i||r)?a:void 0,onBlur:!t&&(r||i)?o:void 0}}}let Up=null,i_=new Set,mh=new Map,Ec=!1,o_=!1;const Mbe={Tab:!0,Escape:!0};function lR(e,t){for(let n of i_)n(e,t)}function Obe(e){return!(e.metaKey||!Cbe()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function dy(e){Ec=!0,Obe(e)&&(Up="keyboard",lR("keyboard",e))}function ro(e){Up="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(Ec=!0,lR("pointer",e))}function O8(e){Rbe(e)&&(Ec=!0,Up="virtual")}function D8(e){e.target===window||e.target===document||(!Ec&&!o_&&(Up="virtual",lR("virtual",e)),Ec=!1,o_=!1)}function A8(){Ec=!1,o_=!0}function s_(e){if(typeof window>"u"||mh.get(Bl(e)))return;const t=Bl(e),n=Wp(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){Ec=!0,r.apply(this,arguments)},n.addEventListener("keydown",dy,!0),n.addEventListener("keyup",dy,!0),n.addEventListener("click",O8,!0),t.addEventListener("focus",D8,!0),t.addEventListener("blur",A8,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",ro,!0),n.addEventListener("pointermove",ro,!0),n.addEventListener("pointerup",ro,!0)):(n.addEventListener("mousedown",ro,!0),n.addEventListener("mousemove",ro,!0),n.addEventListener("mouseup",ro,!0)),t.addEventListener("beforeunload",()=>{k8(e)},{once:!0}),mh.set(t,{focus:r})}const k8=(e,t)=>{const n=Bl(e),r=Wp(e);t&&r.removeEventListener("DOMContentLoaded",t),mh.has(n)&&(n.HTMLElement.prototype.focus=mh.get(n).focus,r.removeEventListener("keydown",dy,!0),r.removeEventListener("keyup",dy,!0),r.removeEventListener("click",O8,!0),n.removeEventListener("focus",D8,!0),n.removeEventListener("blur",A8,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",ro,!0),r.removeEventListener("pointermove",ro,!0),r.removeEventListener("pointerup",ro,!0)):(r.removeEventListener("mousedown",ro,!0),r.removeEventListener("mousemove",ro,!0),r.removeEventListener("mouseup",ro,!0)),mh.delete(n))};function Dbe(e){const t=Wp(e);let n;return t.readyState!=="loading"?s_(e):(n=()=>{s_(e)},t.addEventListener("DOMContentLoaded",n)),()=>k8(e,n)}typeof document<"u"&&Dbe();function I8(){return Up!=="pointer"}const Abe=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function kbe(e,t,n){var r;const i=typeof window<"u"?Bl(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,o=typeof window<"u"?Bl(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,s=typeof window<"u"?Bl(n==null?void 0:n.target).HTMLElement:HTMLElement,a=typeof window<"u"?Bl(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||(n==null?void 0:n.target)instanceof i&&!Abe.has(n==null||(r=n.target)===null||r===void 0?void 0:r.type)||(n==null?void 0:n.target)instanceof o||(n==null?void 0:n.target)instanceof s&&(n==null?void 0:n.target.isContentEditable),!(e&&t==="keyboard"&&n instanceof a&&!Mbe[n.key])}function Ibe(e,t,n){s_(),P.useEffect(()=>{let r=(i,o)=>{kbe(!!(n!=null&&n.isTextInput),i,o)&&e(I8())};return i_.add(r),()=>{i_.delete(r)}},t)}function Nbe(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:i}=e,o=P.useRef({isFocusWithin:!1}),s=P.useCallback(c=>{o.current.isFocusWithin&&!c.currentTarget.contains(c.relatedTarget)&&(o.current.isFocusWithin=!1,n&&n(c),i&&i(!1))},[n,i,o]),a=M8(s),l=P.useCallback(c=>{!o.current.isFocusWithin&&document.activeElement===c.target&&(r&&r(c),i&&i(!0),o.current.isFocusWithin=!0,a(c))},[r,i,a]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:l,onBlur:s}}}let fy=!1,k1=0;function a_(){fy=!0,setTimeout(()=>{fy=!1},50)}function YA(e){e.pointerType==="touch"&&a_()}function Lbe(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",YA):document.addEventListener("touchend",a_),k1++,()=>{k1--,!(k1>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",YA):document.removeEventListener("touchend",a_))}}function N8(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:i}=e,[o,s]=P.useState(!1),a=P.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;P.useEffect(Lbe,[]);let{hoverProps:l,triggerHoverEnd:c}=P.useMemo(()=>{let u=(h,m)=>{if(a.pointerType=m,i||m==="touch"||a.isHovered||!h.currentTarget.contains(h.target))return;a.isHovered=!0;let b=h.currentTarget;a.target=b,t&&t({type:"hoverstart",target:b,pointerType:m}),n&&n(!0),s(!0)},d=(h,m)=>{if(a.pointerType="",a.target=null,m==="touch"||!a.isHovered)return;a.isHovered=!1;let b=h.currentTarget;r&&r({type:"hoverend",target:b,pointerType:m}),n&&n(!1),s(!1)},p={};return typeof PointerEvent<"u"?(p.onPointerEnter=h=>{fy&&h.pointerType==="mouse"||u(h,h.pointerType)},p.onPointerLeave=h=>{!i&&h.currentTarget.contains(h.target)&&d(h,h.pointerType)}):(p.onTouchStart=()=>{a.ignoreEmulatedMouseEvents=!0},p.onMouseEnter=h=>{!a.ignoreEmulatedMouseEvents&&!fy&&u(h,"mouse"),a.ignoreEmulatedMouseEvents=!1},p.onMouseLeave=h=>{!i&&h.currentTarget.contains(h.target)&&d(h,"mouse")}),{hoverProps:p,triggerHoverEnd:d}},[t,n,r,i,a]);return P.useEffect(()=>{i&&c({currentTarget:a.target},a.pointerType)},[i]),{hoverProps:l,isHovered:o}}function L8(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,i=P.useRef({isFocused:!1,isFocusVisible:t||I8()}),[o,s]=P.useState(!1),[a,l]=P.useState(()=>i.current.isFocused&&i.current.isFocusVisible),c=P.useCallback(()=>l(i.current.isFocused&&i.current.isFocusVisible),[]),u=P.useCallback(h=>{i.current.isFocused=h,s(h),c()},[c]);Ibe(h=>{i.current.isFocusVisible=h,c()},[],{isTextInput:n});let{focusProps:d}=Tbe({isDisabled:r,onFocusChange:u}),{focusWithinProps:p}=Nbe({isDisabled:!r,onFocusWithinChange:u});return{isFocused:o,isFocusVisible:a,focusProps:r?p:d}}var Fbe=Object.defineProperty,jbe=(e,t,n)=>t in e?Fbe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,I1=(e,t,n)=>(jbe(e,typeof t!="symbol"?t+"":t,n),n);let $be=class{constructor(){I1(this,"current",this.detect()),I1(this,"handoffState","pending"),I1(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},uc=new $be;function Gp(e){return uc.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}function F8(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function ds(){let e=[],t={addEventListener(n,r,i,o){return n.addEventListener(r,i,o),t.add(()=>n.removeEventListener(r,i,o))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return F8(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,i){let o=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:i}),this.add(()=>{Object.assign(n.style,{[r]:o})})},group(n){let r=ds();return n(r),this.add(()=>r.dispose())},add(n){return e.includes(n)||e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let i of e.splice(r,1))i()}},dispose(){for(let n of e.splice(0))n()}};return t}function zd(){let[e]=P.useState(ds);return P.useEffect(()=>()=>e.dispose(),[e]),e}let rn=(e,t)=>{uc.isServer?P.useEffect(e,t):P.useLayoutEffect(e,t)};function sl(e){let t=P.useRef(e);return rn(()=>{t.current=e},[e]),t}let qe=function(e){let t=sl(e);return P.useCallback((...n)=>t.current(...n),[t])};function zbe(e){let t=e.width/2,n=e.height/2;return{top:e.clientY-n,right:e.clientX+t,bottom:e.clientY+n,left:e.clientX-t}}function Bbe(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function Hbe({disabled:e=!1}={}){let t=P.useRef(null),[n,r]=P.useState(!1),i=zd(),o=qe(()=>{t.current=null,r(!1),i.dispose()}),s=qe(a=>{if(i.dispose(),t.current===null){t.current=a.currentTarget,r(!0);{let l=Gp(a.currentTarget);i.addEventListener(l,"pointerup",o,!1),i.addEventListener(l,"pointermove",c=>{if(t.current){let u=zbe(c);r(Bbe(u,t.current.getBoundingClientRect()))}},!1),i.addEventListener(l,"pointercancel",o,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:s,onPointerUp:o,onClick:o}}}let Vbe=P.createContext(void 0);function cR(){return P.useContext(Vbe)}function l_(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function Mo(e,t,...n){if(e in t){let i=t[e];return typeof i=="function"?i(...n):i}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(i=>`"${i}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Mo),r}var hy=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(hy||{}),ja=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(ja||{});function Wi(){let e=Ube();return P.useCallback(t=>Wbe({mergeRefs:e,...t}),[e])}function Wbe({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:i,visible:o=!0,name:s,mergeRefs:a}){a=a??Gbe;let l=j8(t,e);if(o)return jm(l,n,r,s,a);let c=i??0;if(c&2){let{static:u=!1,...d}=l;if(u)return jm(d,n,r,s,a)}if(c&1){let{unmount:u=!0,...d}=l;return Mo(u?0:1,{0(){return null},1(){return jm({...d,hidden:!0,style:{display:"none"}},n,r,s,a)}})}return jm(l,n,r,s,a)}function jm(e,t={},n,r,i){let{as:o=n,children:s,refName:a="ref",...l}=N1(e,["unmount","static"]),c=e.ref!==void 0?{[a]:e.ref}:{},u=typeof s=="function"?s(t):s;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(t)),l["aria-labelledby"]&&l["aria-labelledby"]===l.id&&(l["aria-labelledby"]=void 0);let d={};if(t){let p=!1,h=[];for(let[m,b]of Object.entries(t))typeof b=="boolean"&&(p=!0),b===!0&&h.push(m.replace(/([A-Z])/g,v=>`-${v.toLowerCase()}`));if(p){d["data-headlessui-state"]=h.join(" ");for(let m of h)d[`data-${m}`]=""}}if(o===P.Fragment&&(Object.keys(_a(l)).length>0||Object.keys(_a(d)).length>0))if(!P.isValidElement(u)||Array.isArray(u)&&u.length>1){if(Object.keys(_a(l)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(_a(l)).concat(Object.keys(_a(d))).map(p=>` - ${p}`).join(`
|
|
369
|
-
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(p=>` - ${p}`).join(`
|
|
370
|
-
`)].join(`
|
|
371
|
-
`))}else{let p=u.props,h=p==null?void 0:p.className,m=typeof h=="function"?(...x)=>l_(h(...x),l.className):l_(h,l.className),b=m?{className:m}:{},v=j8(u.props,_a(N1(l,["ref"])));for(let x in d)x in v&&delete d[x];return P.cloneElement(u,Object.assign({},v,d,c,{ref:i(qbe(u),c.ref)},b))}return P.createElement(o,Object.assign({},N1(l,["ref"]),o!==P.Fragment&&c,o!==P.Fragment&&d),u)}function Ube(){let e=P.useRef([]),t=P.useCallback(n=>{for(let r of e.current)r!=null&&(typeof r=="function"?r(n):r.current=n)},[]);return(...n)=>{if(!n.every(r=>r==null))return e.current=n,t}}function Gbe(...e){return e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function j8(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let i in r)i.startsWith("on")&&typeof r[i]=="function"?(n[i]!=null||(n[i]=[]),n[i].push(r[i])):t[i]=r[i];if(t.disabled||t["aria-disabled"])for(let r in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r)&&(n[r]=[i=>{var o;return(o=i==null?void 0:i.preventDefault)==null?void 0:o.call(i)}]);for(let r in n)Object.assign(t,{[r](i,...o){let s=n[r];for(let a of s){if((i instanceof Event||(i==null?void 0:i.nativeEvent)instanceof Event)&&i.defaultPrevented)return;a(i,...o)}}});return t}function uR(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let i in r)i.startsWith("on")&&typeof r[i]=="function"?(n[i]!=null||(n[i]=[]),n[i].push(r[i])):t[i]=r[i];for(let r in n)Object.assign(t,{[r](...i){let o=n[r];for(let s of o)s==null||s(...i)}});return t}function vi(e){var t;return Object.assign(P.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function _a(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function N1(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function qbe(e){return P.version.split(".")[0]>="19"?e.props.ref:e.ref}function Ybe(e,t,n){let[r,i]=P.useState(n),o=e!==void 0,s=P.useRef(o),a=P.useRef(!1),l=P.useRef(!1);return o&&!s.current&&!a.current?(a.current=!0,s.current=o,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!o&&s.current&&!l.current&&(l.current=!0,s.current=o,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[o?e:r,qe(c=>(o||i(c),t==null?void 0:t(c)))]}function Kbe(e){let[t]=P.useState(e);return t}function $8(e={},t=null,n=[]){for(let[r,i]of Object.entries(e))B8(n,z8(t,r),i);return n}function z8(e,t){return e?e+"["+t+"]":t}function B8(e,t,n){if(Array.isArray(n))for(let[r,i]of n.entries())B8(e,z8(t,r.toString()),i);else n instanceof Date?e.push([t,n.toISOString()]):typeof n=="boolean"?e.push([t,n?"1":"0"]):typeof n=="string"?e.push([t,n]):typeof n=="number"?e.push([t,`${n}`]):n==null?e.push([t,""]):$8(n,t,e)}let Xbe="span";var dR=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(dR||{});function Qbe(e,t){var n;let{features:r=1,...i}=e,o={ref:t,"aria-hidden":(r&2)===2?!0:(n=i["aria-hidden"])!=null?n:void 0,hidden:(r&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return Wi()({ourProps:o,theirProps:i,slot:{},defaultTag:Xbe,name:"Hidden"})}let H8=vi(Qbe),Jbe=P.createContext(null);function Zbe({children:e}){let t=P.useContext(Jbe);if(!t)return P.createElement(P.Fragment,null,e);let{target:n}=t;return n?Tr.createPortal(P.createElement(P.Fragment,null,e),n):null}function eye({data:e,form:t,disabled:n,onReset:r,overrides:i}){let[o,s]=P.useState(null),a=zd();return P.useEffect(()=>{if(r&&o)return a.addEventListener(o,"reset",r)},[o,t,r]),P.createElement(Zbe,null,P.createElement(tye,{setForm:s,formId:t}),$8(e).map(([l,c])=>P.createElement(H8,{features:dR.Hidden,..._a({key:l,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:l,value:c,...i})})))}function tye({setForm:e,formId:t}){return P.useEffect(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:P.createElement(H8,{features:dR.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let nye=P.createContext(void 0);function V8(){return P.useContext(nye)}function rye(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&iye(n)?!1:r}function iye(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}let W8=Symbol();function oye(e,t=!0){return Object.assign(e,{[W8]:t})}function Io(...e){let t=P.useRef(e);P.useEffect(()=>{t.current=e},[e]);let n=qe(r=>{for(let i of t.current)i!=null&&(typeof i=="function"?i(r):i.current=r)});return e.every(r=>r==null||(r==null?void 0:r[W8]))?void 0:n}let fR=P.createContext(null);fR.displayName="DescriptionContext";function U8(){let e=P.useContext(fR);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,U8),t}return e}function sye(){var e,t;return(t=(e=P.useContext(fR))==null?void 0:e.value)!=null?t:void 0}let aye="p";function lye(e,t){let n=P.useId(),r=cR(),{id:i=`headlessui-description-${n}`,...o}=e,s=U8(),a=Io(t);rn(()=>s.register(i),[i,s.register]);let l=r||!1,c=P.useMemo(()=>({...s.slot,disabled:l}),[s.slot,l]),u={ref:a,...s.props,id:i};return Wi()({ourProps:u,theirProps:o,slot:c,defaultTag:aye,name:s.name||"Description"})}let cye=vi(lye);Object.assign(cye,{});var Wr=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(Wr||{});let A0=P.createContext(null);A0.displayName="LabelContext";function G8(){let e=P.useContext(A0);if(e===null){let t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,G8),t}return e}function k0(e){var t,n,r;let i=(n=(t=P.useContext(A0))==null?void 0:t.value)!=null?n:void 0;return((r=e==null?void 0:e.length)!=null?r:0)>0?[i,...e].filter(Boolean).join(" "):i}function uye({inherit:e=!1}={}){let t=k0(),[n,r]=P.useState([]),i=e?[t,...n].filter(Boolean):n;return[i.length>0?i.join(" "):void 0,P.useMemo(()=>function(o){let s=qe(l=>(r(c=>[...c,l]),()=>r(c=>{let u=c.slice(),d=u.indexOf(l);return d!==-1&&u.splice(d,1),u}))),a=P.useMemo(()=>({register:s,slot:o.slot,name:o.name,props:o.props,value:o.value}),[s,o.slot,o.name,o.props,o.value]);return P.createElement(A0.Provider,{value:a},o.children)},[r])]}let dye="label";function fye(e,t){var n;let r=P.useId(),i=G8(),o=V8(),s=cR(),{id:a=`headlessui-label-${r}`,htmlFor:l=o??((n=i.props)==null?void 0:n.htmlFor),passive:c=!1,...u}=e,d=Io(t);rn(()=>i.register(a),[a,i.register]);let p=qe(v=>{let x=v.currentTarget;if(x instanceof HTMLLabelElement&&v.preventDefault(),i.props&&"onClick"in i.props&&typeof i.props.onClick=="function"&&i.props.onClick(v),x instanceof HTMLLabelElement){let S=document.getElementById(x.htmlFor);if(S){let _=S.getAttribute("disabled");if(_==="true"||_==="")return;let E=S.getAttribute("aria-disabled");if(E==="true"||E==="")return;(S instanceof HTMLInputElement&&(S.type==="radio"||S.type==="checkbox")||S.role==="radio"||S.role==="checkbox"||S.role==="switch")&&S.click(),S.focus({preventScroll:!0})}}}),h=s||!1,m=P.useMemo(()=>({...i.slot,disabled:h}),[i.slot,h]),b={ref:d,...i.props,id:a,htmlFor:l,onClick:p};return c&&("onClick"in b&&(delete b.htmlFor,delete b.onClick),"onClick"in u&&delete u.onClick),Wi()({ourProps:b,theirProps:u,slot:m,defaultTag:l?dye:"div",name:i.name||"Label"})}let hye=vi(fye),pye=Object.assign(hye,{});function fu(e,t,n){let r=n.initialDeps??[],i;return()=>{var o,s,a,l;let c;n.key&&((o=n.debug)!=null&&o.call(n))&&(c=Date.now());const u=e();if(!(u.length!==r.length||u.some((h,m)=>r[m]!==h)))return i;r=u;let p;if(n.key&&((s=n.debug)!=null&&s.call(n))&&(p=Date.now()),i=t(...u),n.key&&((a=n.debug)!=null&&a.call(n))){const h=Math.round((Date.now()-c)*100)/100,m=Math.round((Date.now()-p)*100)/100,b=m/16,v=(x,S)=>{for(x=String(x);x.length<S;)x=" "+x;return x};console.info(`%c⏱ ${v(m,5)} /${v(h,5)} ms`,`
|
|
372
|
-
font-size: .6rem;
|
|
373
|
-
font-weight: bold;
|
|
374
|
-
color: hsl(${Math.max(0,Math.min(120-120*b,120))}deg 100% 31%);`,n==null?void 0:n.key)}return(l=n==null?void 0:n.onChange)==null||l.call(n,i),i}}function L1(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const gye=(e,t)=>Math.abs(e-t)<1,mye=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},bye=e=>e,yye=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let i=t;i<=n;i++)r.push(i);return r},vye=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const i=s=>{const{width:a,height:l}=s;t({width:Math.round(a),height:Math.round(l)})};if(i(n.getBoundingClientRect()),!r.ResizeObserver)return()=>{};const o=new r.ResizeObserver(s=>{const a=s[0];if(a!=null&&a.borderBoxSize){const l=a.borderBoxSize[0];if(l){i({width:l.inlineSize,height:l.blockSize});return}}i(n.getBoundingClientRect())});return o.observe(n,{box:"border-box"}),()=>{o.unobserve(n)}},KA={passive:!0},xye=typeof window>"u"?!0:"onscrollend"in window,wye=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let i=0;const o=e.options.useScrollendEvent&&xye?()=>{}:mye(r,()=>{t(i,!1)},e.options.isScrollingResetDelay),s=c=>()=>{const{horizontal:u,isRtl:d}=e.options;i=u?n.scrollLeft*(d&&-1||1):n.scrollTop,o(),t(i,c)},a=s(!0),l=s(!1);return l(),n.addEventListener("scroll",a,KA),n.addEventListener("scrollend",l,KA),()=>{n.removeEventListener("scroll",a),n.removeEventListener("scrollend",l)}},Sye=(e,t,n)=>{if(t!=null&&t.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return Math.round(e.getBoundingClientRect()[n.options.horizontal?"width":"height"])},_ye=(e,{adjustments:t=0,behavior:n},r)=>{var i,o;const s=e+t;(o=(i=r.scrollElement)==null?void 0:i.scrollTo)==null||o.call(i,{[r.options.horizontal?"left":"top"]:s,behavior:n})};class Cye{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(i=>{i.forEach(o=>{this._measureElement(o.target,o)})}));return{disconnect:()=>{var i;(i=r())==null||i.disconnect(),n=null},observe:i=>{var o;return(o=r())==null?void 0:o.observe(i,{box:"border-box"})},unobserve:i=>{var o;return(o=r())==null?void 0:o.unobserve(i)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,i])=>{typeof i>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:bye,rangeExtractor:yye,onChange:()=>{},measureElement:Sye,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!0,...n}},this.notify=n=>{var r,i;(i=(r=this.options).onChange)==null||i.call(r,this,n)},this.maybeNotify=fu(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<i?"forward":"backward":null,this.scrollOffset=i,this.isScrolling=o,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const i=new Map,o=new Map;for(let s=r-1;s>=0;s--){const a=n[s];if(i.has(a.lane))continue;const l=o.get(a.lane);if(l==null||a.end>l.end?o.set(a.lane,a):a.end<l.end&&i.set(a.lane,!0),i.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((s,a)=>s.end===a.end?s.index-a.index:s.end-a.end)[0]:void 0},this.getMeasurementOptions=fu(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,r,i,o,s)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:i,getItemKey:o,enabled:s}),{key:!1}),this.getMeasurements=fu(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:i,getItemKey:o,enabled:s},a)=>{if(!s)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(u=>{this.itemSizeCache.set(u.key,u.size)}));const l=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const c=this.measurementsCache.slice(0,l);for(let u=l;u<n;u++){const d=o(u),p=this.options.lanes===1?c[u-1]:this.getFurthestMeasurement(c,u),h=p?p.end+this.options.gap:r+i,m=a.get(d),b=typeof m=="number"?m:this.options.estimateSize(u),v=h+b,x=p?p.lane:u%this.options.lanes;c[u]={index:u,start:h,size:b,end:v,key:d,lane:x}}return this.measurementsCache=c,c},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=fu(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()],(n,r,i)=>this.range=n.length>0&&r>0?Eye({measurements:n,outerSize:r,scrollOffset:i}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getIndexes=fu(()=>[this.options.rangeExtractor,this.calculateRange(),this.options.overscan,this.options.count],(n,r,i,o)=>r===null?[]:n({startIndex:r.startIndex,endIndex:r.endIndex,overscan:i,count:o}),{key:process.env.NODE_ENV!=="production"&&"getIndexes",debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,i=n.getAttribute(r);return i?parseInt(i,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const i=this.indexFromElement(n),o=this.measurementsCache[i];if(!o)return;const s=o.key,a=this.elementsCache.get(s);a!==n&&(a&&this.observer.unobserve(a),this.observer.observe(n),this.elementsCache.set(s,n)),n.isConnected&&this.resizeItem(i,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const i=this.measurementsCache[n];if(!i)return;const o=this.itemSizeCache.get(i.key)??i.size,s=r-o;s!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(i,s,this):i.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",s),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=s,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(i.index),this.itemSizeCache=new Map(this.itemSizeCache.set(i.key,r)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((r,i)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(i))});return}this._measureElement(n,void 0)},this.getVirtualItems=fu(()=>[this.getIndexes(),this.getMeasurements()],(n,r)=>{const i=[];for(let o=0,s=n.length;o<s;o++){const a=n[o],l=r[a];i.push(l)}return i},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return L1(r[q8(0,r.length-1,i=>L1(r[i]).start,n)])},this.getOffsetForAlignment=(n,r)=>{const i=this.getSize(),o=this.getScrollOffset();r==="auto"&&n>=o+i&&(r="end"),r==="end"&&(n-=i);const s=this.options.horizontal?"scrollWidth":"scrollHeight",l=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[s]:this.scrollElement[s]:0)-i;return Math.max(Math.min(l,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const i=this.measurementsCache[n];if(!i)return;const o=this.getSize(),s=this.getScrollOffset();if(r==="auto")if(i.end>=s+o-this.options.scrollPaddingEnd)r="end";else if(i.start<=s+this.options.scrollPaddingStart)r="start";else return[s,r];const a=i.start-this.options.scrollPaddingStart+(i.size-o)/2;switch(r){case"center":return[this.getOffsetForAlignment(a,r),r];case"end":return[this.getOffsetForAlignment(i.end+this.options.scrollPaddingEnd,r),r];default:return[this.getOffsetForAlignment(i.start-this.options.scrollPaddingStart,r),r]}},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(n,{align:r="start",behavior:i}={})=>{this.cancelScrollToIndex(),i==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,r),{adjustments:void 0,behavior:i})},this.scrollToIndex=(n,{align:r="auto",behavior:i}={})=>{n=Math.max(0,Math.min(n,this.options.count-1)),this.cancelScrollToIndex(),i==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const o=this.getOffsetForIndex(n,r);if(!o)return;const[s,a]=o;this._scrollToOffset(s,{adjustments:void 0,behavior:i}),i!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(n))){const[c]=L1(this.getOffsetForIndex(n,a));gye(c,this.getScrollOffset())||this.scrollToIndex(n,{align:a,behavior:i})}else this.scrollToIndex(n,{align:a,behavior:i})}))},this.scrollBy=(n,{behavior:r}={})=>{this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let i;return r.length===0?i=this.options.paddingStart:i=this.options.lanes===1?((n=r[r.length-1])==null?void 0:n.end)??0:Math.max(...r.slice(-this.options.lanes).map(o=>o.end)),Math.max(i-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:i})=>{this.options.scrollToFn(n,{behavior:i,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(t)}}const q8=(e,t,n,r)=>{for(;e<=t;){const i=(e+t)/2|0,o=n(i);if(o<r)e=i+1;else if(o>r)t=i-1;else return i}return e>0?e-1:0};function Eye({measurements:e,outerSize:t,scrollOffset:n}){const r=e.length-1,o=q8(0,r,a=>e[a].start,n);let s=o;for(;s<r&&e[s].end<n+t;)s++;return{startIndex:o,endIndex:s}}const XA=typeof document<"u"?R.useLayoutEffect:R.useEffect;function Rye(e){const t=R.useReducer(()=>({}),{})[1],n={...e,onChange:(i,o)=>{var s;o?Tr.flushSync(t):t(),(s=e.onChange)==null||s.call(e,i,o)}},[r]=R.useState(()=>new Cye(n));return r.setOptions(n),XA(()=>r._didMount(),[]),XA(()=>r._willUpdate()),r}function Pye(e){return Rye({observeElementRect:vye,observeElementOffset:wye,scrollToFn:_ye,...e})}function Tye(e,t){return e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"&&"id"in e&&"id"in t?e.id===t.id:e===t}function Mye(e=Tye){return P.useCallback((t,n)=>{if(typeof e=="string"){let r=e;return(t==null?void 0:t[r])===(n==null?void 0:n[r])}return e(t,n)},[e])}function Oye(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function QA(e,t=!1){let[n,r]=P.useReducer(()=>({}),{}),i=P.useMemo(()=>Oye(e),[e,n]);return rn(()=>{if(!e)return;let o=new ResizeObserver(r);return o.observe(e),()=>{o.disconnect()}},[e]),t?{width:`${i.width}px`,height:`${i.height}px`}:i}let Dye=class extends Map{constructor(t){super(),this.factory=t}get(t){let n=super.get(t);return n===void 0&&(n=this.factory(t),this.set(t,n)),n}};function Y8(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(i){return r.add(i),()=>r.delete(i)},dispatch(i,...o){let s=t[i].call(n,...o);s&&(n=s,r.forEach(a=>a()))}}}function K8(e){return P.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}let Aye=new Dye(()=>Y8(()=>[],{ADD(e){return this.includes(e)?this:[...this,e]},REMOVE(e){let t=this.indexOf(e);if(t===-1)return this;let n=this.slice();return n.splice(t,1),n}}));function hR(e,t){let n=Aye.get(t),r=P.useId(),i=K8(n);if(rn(()=>{if(e)return n.dispatch("ADD",r),()=>n.dispatch("REMOVE",r)},[n,e]),!e)return!1;let o=i.indexOf(r),s=i.length;return o===-1&&(o=s,s+=1),o===s-1}let c_=new Map,bh=new Map;function JA(e){var t;let n=(t=bh.get(e))!=null?t:0;return bh.set(e,n+1),n!==0?()=>ZA(e):(c_.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>ZA(e))}function ZA(e){var t;let n=(t=bh.get(e))!=null?t:1;if(n===1?bh.delete(e):bh.set(e,n-1),n!==1)return;let r=c_.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,c_.delete(e))}function kye(e,{allowed:t,disallowed:n}={}){let r=hR(e,"inert-others");rn(()=>{var i,o;if(!r)return;let s=ds();for(let l of(i=n==null?void 0:n())!=null?i:[])l&&s.add(JA(l));let a=(o=t==null?void 0:t())!=null?o:[];for(let l of a){if(!l)continue;let c=Gp(l);if(!c)continue;let u=l.parentElement;for(;u&&u!==c.body;){for(let d of u.children)a.some(p=>d.contains(p))||s.add(JA(d));u=u.parentElement}}return s.dispose},[r,t,n])}function Iye(e,t,n){let r=sl(i=>{let o=i.getBoundingClientRect();o.x===0&&o.y===0&&o.width===0&&o.height===0&&n()});P.useEffect(()=>{if(!e)return;let i=t===null?null:t instanceof HTMLElement?t:t.current;if(!i)return;let o=ds();if(typeof ResizeObserver<"u"){let s=new ResizeObserver(()=>r.current(i));s.observe(i),o.add(()=>s.disconnect())}if(typeof IntersectionObserver<"u"){let s=new IntersectionObserver(()=>r.current(i));s.observe(i),o.add(()=>s.disconnect())}return()=>o.dispose()},[t,r,e])}let u_=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var Nye=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(Nye||{}),Lye=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Lye||{}),Fye=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Fye||{}),X8=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(X8||{});function jye(e,t=0){var n;return e===((n=Gp(e))==null?void 0:n.body)?!1:Mo(t,{0(){return e.matches(u_)},1(){let r=e;for(;r!==null;){if(r.matches(u_))return!0;r=r.parentElement}return!1}})}var $ye=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))($ye||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function zye(e,t=n=>n){return e.slice().sort((n,r)=>{let i=t(n),o=t(r);if(i===null||o===null)return 0;let s=i.compareDocumentPosition(o);return s&Node.DOCUMENT_POSITION_FOLLOWING?-1:s&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Q8(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Bye(){return/Android/gi.test(window.navigator.userAgent)}function J8(){return Q8()||Bye()}function Mf(e,t,n,r){let i=sl(n);P.useEffect(()=>{if(!e)return;function o(s){i.current(s)}return document.addEventListener(t,o,r),()=>document.removeEventListener(t,o,r)},[e,t,r])}function Hye(e,t,n,r){let i=sl(n);P.useEffect(()=>{if(!e)return;function o(s){i.current(s)}return window.addEventListener(t,o,r),()=>window.removeEventListener(t,o,r)},[e,t,r])}const ek=30;function Vye(e,t,n){let r=hR(e,"outside-click"),i=sl(n),o=P.useCallback(function(l,c){if(l.defaultPrevented)return;let u=c(l);if(u===null||!u.getRootNode().contains(u)||!u.isConnected)return;let d=function p(h){return typeof h=="function"?p(h()):Array.isArray(h)||h instanceof Set?h:[h]}(t);for(let p of d)if(p!==null&&(p.contains(u)||l.composed&&l.composedPath().includes(p)))return;return!jye(u,X8.Loose)&&u.tabIndex!==-1&&l.preventDefault(),i.current(l,u)},[i,t]),s=P.useRef(null);Mf(r,"pointerdown",l=>{var c,u;s.current=((u=(c=l.composedPath)==null?void 0:c.call(l))==null?void 0:u[0])||l.target},!0),Mf(r,"mousedown",l=>{var c,u;s.current=((u=(c=l.composedPath)==null?void 0:c.call(l))==null?void 0:u[0])||l.target},!0),Mf(r,"click",l=>{J8()||s.current&&(o(l,()=>s.current),s.current=null)},!0);let a=P.useRef({x:0,y:0});Mf(r,"touchstart",l=>{a.current.x=l.touches[0].clientX,a.current.y=l.touches[0].clientY},!0),Mf(r,"touchend",l=>{let c={x:l.changedTouches[0].clientX,y:l.changedTouches[0].clientY};if(!(Math.abs(c.x-a.current.x)>=ek||Math.abs(c.y-a.current.y)>=ek))return o(l,()=>l.target instanceof HTMLElement?l.target:null)},!0),Hye(r,"blur",l=>o(l,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function I0(...e){return P.useMemo(()=>Gp(...e),[...e])}function Wye(e,t,n,r){let i=sl(n);P.useEffect(()=>{e=e??window;function o(s){i.current(s)}return e.addEventListener(t,o,r),()=>e.removeEventListener(t,o,r)},[e,t,r])}function Z8(e){let t=P.useRef({value:"",selectionStart:null,selectionEnd:null});return Wye(e,"blur",n=>{let r=n.target;r instanceof HTMLInputElement&&(t.current={value:r.value,selectionStart:r.selectionStart,selectionEnd:r.selectionEnd})}),qe(()=>{if(document.activeElement!==e&&e instanceof HTMLInputElement&&e.isConnected){if(e.focus({preventScroll:!0}),e.value!==t.current.value)e.setSelectionRange(e.value.length,e.value.length);else{let{selectionStart:n,selectionEnd:r}=t.current;n!==null&&r!==null&&e.setSelectionRange(n,r)}t.current={value:"",selectionStart:null,selectionEnd:null}}})}function Uye(e,t){return P.useMemo(()=>{var n;if(e.type)return e.type;let r=(n=e.as)!=null?n:"button";if(typeof r=="string"&&r.toLowerCase()==="button"||(t==null?void 0:t.tagName)==="BUTTON"&&!t.hasAttribute("type"))return"button"},[e.type,e.as,t])}function Gye(){let e;return{before({doc:t}){var n;let r=t.documentElement,i=(n=t.defaultView)!=null?n:window;e=Math.max(0,i.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,i=Math.max(0,r.clientWidth-r.offsetWidth),o=Math.max(0,e-i);n.style(r,"paddingRight",`${o}px`)}}}function qye(){return Q8()?{before({doc:e,d:t,meta:n}){function r(i){return n.containers.flatMap(o=>o()).some(o=>o.contains(i))}t.microTask(()=>{var i;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let a=ds();a.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>a.dispose()))}let o=(i=window.scrollY)!=null?i:window.pageYOffset,s=null;t.addEventListener(e,"click",a=>{if(a.target instanceof HTMLElement)try{let l=a.target.closest("a");if(!l)return;let{hash:c}=new URL(l.href),u=e.querySelector(c);u&&!r(u)&&(s=u)}catch{}},!0),t.addEventListener(e,"touchstart",a=>{if(a.target instanceof HTMLElement)if(r(a.target)){let l=a.target;for(;l.parentElement&&r(l.parentElement);)l=l.parentElement;t.style(l,"overscrollBehavior","contain")}else t.style(a.target,"touchAction","none")}),t.addEventListener(e,"touchmove",a=>{if(a.target instanceof HTMLElement){if(a.target.tagName==="INPUT")return;if(r(a.target)){let l=a.target;for(;l.parentElement&&l.dataset.headlessuiPortal!==""&&!(l.scrollHeight>l.clientHeight||l.scrollWidth>l.clientWidth);)l=l.parentElement;l.dataset.headlessuiPortal===""&&a.preventDefault()}else a.preventDefault()}},{passive:!1}),t.add(()=>{var a;let l=(a=window.scrollY)!=null?a:window.pageYOffset;o!==l&&window.scrollTo(0,o),s&&s.isConnected&&(s.scrollIntoView({block:"nearest"}),s=null)})})}}:{}}function Yye(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function Kye(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Hl=Y8(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:ds(),meta:new Set};return r.count++,r.meta.add(t),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:n}){let r={doc:e,d:t,meta:Kye(n)},i=[qye(),Gye(),Yye()];i.forEach(({before:o})=>o==null?void 0:o(r)),i.forEach(({after:o})=>o==null?void 0:o(r))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Hl.subscribe(()=>{let e=Hl.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let r=t.get(n.doc)==="hidden",i=n.count!==0;(i&&!r||!i&&r)&&Hl.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&Hl.dispatch("TEARDOWN",n)}});function Xye(e,t,n=()=>({containers:[]})){let r=K8(Hl),i=t?r.get(t):void 0,o=i?i.count>0:!1;return rn(()=>{if(!(!t||!e))return Hl.dispatch("PUSH",t,n),()=>Hl.dispatch("POP",t,n)},[e,t]),o}function Qye(e,t,n=()=>[document.body]){let r=hR(e,"scroll-lock");Xye(r,t,i=>{var o;return{containers:[...(o=i.containers)!=null?o:[],n]}})}function tk(e){return[e.screenX,e.screenY]}function Jye(){let e=P.useRef([-1,-1]);return{wasMoved(t){let n=tk(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=tk(t)}}}function Zye(e=0){let[t,n]=P.useState(e),r=P.useCallback(l=>n(l),[t]),i=P.useCallback(l=>n(c=>c|l),[t]),o=P.useCallback(l=>(t&l)===l,[t]),s=P.useCallback(l=>n(c=>c&~l),[n]),a=P.useCallback(l=>n(c=>c^l),[n]);return{flags:t,setFlag:r,addFlag:i,hasFlag:o,removeFlag:s,toggleFlag:a}}var nk,rk;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((nk=process==null?void 0:process.env)==null?void 0:nk.NODE_ENV)==="test"&&typeof((rk=Element==null?void 0:Element.prototype)==null?void 0:rk.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(`
|
|
375
|
-
`)),[]});var e0e=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(e0e||{});function e7(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function t7(e,t,n,r){let[i,o]=P.useState(n),{hasFlag:s,addFlag:a,removeFlag:l}=Zye(e&&i?3:0),c=P.useRef(!1),u=P.useRef(!1),d=zd();return rn(()=>{var p;if(e){if(n&&o(!0),!t){n&&a(3);return}return(p=r==null?void 0:r.start)==null||p.call(r,n),t0e(t,{inFlight:c,prepare(){u.current?u.current=!1:u.current=c.current,c.current=!0,!u.current&&(n?(a(3),l(4)):(a(4),l(2)))},run(){u.current?n?(l(3),a(4)):(l(4),a(3)):n?l(1):a(1)},done(){var h;u.current&&typeof t.getAnimations=="function"&&t.getAnimations().length>0||(c.current=!1,l(7),n||o(!1),(h=r==null?void 0:r.end)==null||h.call(r,n))}})}},[e,n,t,d]),e?[i,{closed:s(1),enter:s(2),leave:s(4),transition:s(2)||s(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function t0e(e,{prepare:t,run:n,done:r,inFlight:i}){let o=ds();return r0e(e,{prepare:t,inFlight:i}),o.nextFrame(()=>{n(),o.requestAnimationFrame(()=>{o.add(n0e(e,r))})}),o.dispose}function n0e(e,t){var n,r;let i=ds();if(!e)return i.dispose;let o=!1;i.add(()=>{o=!0});let s=(r=(n=e.getAnimations)==null?void 0:n.call(e).filter(a=>a instanceof CSSTransition))!=null?r:[];return s.length===0?(t(),i.dispose):(Promise.allSettled(s.map(a=>a.finished)).then(()=>{o||t()}),i.dispose)}function r0e(e,{inFlight:t,prepare:n}){if(t!=null&&t.current){n();return}let r=e.style.transition;e.style.transition="none",n(),e.offsetHeight,e.style.transition=r}function i0e(e,{container:t,accept:n,walk:r}){let i=P.useRef(n),o=P.useRef(r);P.useEffect(()=>{i.current=n,o.current=r},[n,r]),rn(()=>{if(!t||!e)return;let s=Gp(t);if(!s)return;let a=i.current,l=o.current,c=Object.assign(d=>a(d),{acceptNode:a}),u=s.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,c,!1);for(;u.nextNode();)l(u.currentNode)},[t,e,i,o])}function ik(e,t){let n=P.useRef([]),r=qe(e);P.useEffect(()=>{let i=[...n.current];for(let[o,s]of t.entries())if(n.current[o]!==s){let a=r(t,i);return n.current=t,a}},[r,...t])}function o0e(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}const n7={...R},s0e=n7.useInsertionEffect,a0e=s0e||(e=>e());function r7(e){const t=R.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return a0e(()=>{t.current=e}),R.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}var d_=typeof document<"u"?P.useLayoutEffect:P.useEffect;let ok=!1,l0e=0;const sk=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+l0e++;function c0e(){const[e,t]=R.useState(()=>ok?sk():void 0);return d_(()=>{e==null&&t(sk())},[]),R.useEffect(()=>{ok=!0},[]),e}const u0e=n7.useId,d0e=u0e||c0e;let Bh;process.env.NODE_ENV!=="production"&&(Bh=new Set);function f0e(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const i="Floating UI: "+n.join(" ");if(!((e=Bh)!=null&&e.has(i))){var o;(o=Bh)==null||o.add(i),console.warn(i)}}function h0e(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const i="Floating UI: "+n.join(" ");if(!((e=Bh)!=null&&e.has(i))){var o;(o=Bh)==null||o.add(i),console.error(i)}}function p0e(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(i=>i!==n))||[])}}}const g0e=R.createContext(null),m0e=R.createContext(null),b0e=()=>{var e;return((e=R.useContext(g0e))==null?void 0:e.id)||null},y0e=()=>R.useContext(m0e),v0e="data-floating-ui-focusable";function x0e(e){const{open:t=!1,onOpenChange:n,elements:r}=e,i=d0e(),o=R.useRef({}),[s]=R.useState(()=>p0e()),a=b0e()!=null;if(process.env.NODE_ENV!=="production"){const h=r.reference;h&&!Dr(h)&&h0e("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,c]=R.useState(r.reference),u=r7((h,m,b)=>{o.current.openEvent=h?m:void 0,s.emit("openchange",{open:h,event:m,reason:b,nested:a}),n==null||n(h,m,b)}),d=R.useMemo(()=>({setPositionReference:c}),[]),p=R.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return R.useMemo(()=>({dataRef:o,open:t,onOpenChange:u,elements:p,events:s,floatingId:i,refs:d}),[t,u,p,s,i,d])}function w0e(e){e===void 0&&(e={});const{nodeId:t}=e,n=x0e({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[o,s]=R.useState(null),[a,l]=R.useState(null),u=(i==null?void 0:i.domReference)||o,d=R.useRef(null),p=y0e();d_(()=>{u&&(d.current=u)},[u]);const h=PL({...e,elements:{...i,...a&&{reference:a}}}),m=R.useCallback(_=>{const E=Dr(_)?{getBoundingClientRect:()=>_.getBoundingClientRect(),contextElement:_}:_;l(E),h.refs.setReference(E)},[h.refs]),b=R.useCallback(_=>{(Dr(_)||_===null)&&(d.current=_,s(_)),(Dr(h.refs.reference.current)||h.refs.reference.current===null||_!==null&&!Dr(_))&&h.refs.setReference(_)},[h.refs]),v=R.useMemo(()=>({...h.refs,setReference:b,setPositionReference:m,domReference:d}),[h.refs,b,m]),x=R.useMemo(()=>({...h.elements,domReference:u}),[h.elements,u]),S=R.useMemo(()=>({...h,...r,refs:v,elements:x,nodeId:t}),[h,v,x,t,r]);return d_(()=>{r.dataRef.current.floatingContext=S;const _=p==null?void 0:p.nodesRef.current.find(E=>E.id===t);_&&(_.context=S)}),R.useMemo(()=>({...h,context:S,refs:v,elements:x}),[h,v,x,S])}const ak="active",lk="selected";function F1(e,t,n){const r=new Map,i=n==="item";let o=e;if(i&&e){const{[ak]:s,[lk]:a,...l}=e;o=l}return{...n==="floating"&&{tabIndex:-1,[v0e]:""},...o,...t.map(s=>{const a=s?s[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((s,a)=>(a&&Object.entries(a).forEach(l=>{let[c,u]=l;if(!(i&&[ak,lk].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof u=="function"){var d;(d=r.get(c))==null||d.push(u),s[c]=function(){for(var p,h=arguments.length,m=new Array(h),b=0;b<h;b++)m[b]=arguments[b];return(p=r.get(c))==null?void 0:p.map(v=>v(...m)).find(v=>v!==void 0)}}}else s[c]=u}),s),{})}}function S0e(e){e===void 0&&(e=[]);const t=e.map(a=>a==null?void 0:a.reference),n=e.map(a=>a==null?void 0:a.floating),r=e.map(a=>a==null?void 0:a.item),i=R.useCallback(a=>F1(a,e,"reference"),t),o=R.useCallback(a=>F1(a,e,"floating"),n),s=R.useCallback(a=>F1(a,e,"item"),r);return R.useMemo(()=>({getReferenceProps:i,getFloatingProps:o,getItemProps:s}),[i,o,s])}function ck(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const _0e=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:r,onFallbackChange:i,offset:o=0,index:s=0,minItemsVisible:a=4,referenceOverflowThreshold:l=0,scrollRef:c,...u}=ls(e,t),{rects:d,elements:{floating:p}}=t,h=n.current[s],m=(c==null?void 0:c.current)||p,b=p.clientTop||m.clientTop,v=p.clientTop!==0,x=m.clientTop!==0,S=p===m;if(process.env.NODE_ENV!=="production"&&(t.placement.startsWith("bottom")||f0e('`placement` side must be "bottom" when using the `inner`',"middleware.")),!h)return{};const _={...t,...await EE(-h.offsetTop-p.clientTop-d.reference.height/2-h.offsetHeight/2-o).fn(t)},E=await r1(ck(_,m.scrollHeight+b+p.clientTop),u),C=await r1(_,{...u,elementContext:"reference"}),M=Pr(0,E.top),O=_.y+M,F=(m.scrollHeight>m.clientHeight?j=>j:Fh)(Pr(0,m.scrollHeight+(v&&S||x?b*2:0)-M-Pr(0,E.bottom)));if(m.style.maxHeight=F+"px",m.scrollTop=M,i){const j=m.offsetHeight<h.offsetHeight*ea(a,n.current.length)-1||C.top>=-l||C.bottom>=-l;hc.flushSync(()=>i(j))}return r&&(r.current=await r1(ck({..._,y:O},m.offsetHeight+b+p.clientTop),u)),{y:O}}});function C0e(e,t){const{open:n,elements:r}=e,{enabled:i=!0,overflowRef:o,scrollRef:s,onChange:a}=t,l=r7(a),c=R.useRef(!1),u=R.useRef(null),d=R.useRef(null);R.useEffect(()=>{if(!i)return;function h(b){if(b.ctrlKey||!m||o.current==null)return;const v=b.deltaY,x=o.current.top>=-.5,S=o.current.bottom>=-.5,_=m.scrollHeight-m.clientHeight,E=v<0?-1:1,C=v<0?"max":"min";m.scrollHeight<=m.clientHeight||(!x&&v>0||!S&&v<0?(b.preventDefault(),hc.flushSync(()=>{l(M=>M+Math[C](v,_*E))})):/firefox/i.test(o0e())&&(m.scrollTop+=v))}const m=(s==null?void 0:s.current)||r.floating;if(n&&m)return m.addEventListener("wheel",h),requestAnimationFrame(()=>{u.current=m.scrollTop,o.current!=null&&(d.current={...o.current})}),()=>{u.current=null,d.current=null,m.removeEventListener("wheel",h)}},[i,n,r.floating,o,s,l]);const p=R.useMemo(()=>({onKeyDown(){c.current=!0},onWheel(){c.current=!1},onPointerMove(){c.current=!1},onScroll(){const h=(s==null?void 0:s.current)||r.floating;if(!(!o.current||!h||!c.current)){if(u.current!==null){const m=h.scrollTop-u.current;(o.current.bottom<-.5&&m<-1||o.current.top<-.5&&m>1)&&hc.flushSync(()=>l(b=>b+m))}requestAnimationFrame(()=>{u.current=h.scrollTop})}}}),[r.floating,l,o,s]);return R.useMemo(()=>i?{floating:p}:{},[i,p])}let qp=P.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});qp.displayName="FloatingContext";let pR=P.createContext(null);pR.displayName="PlacementContext";function E0e(e){return P.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function R0e(){return P.useContext(qp).setReference}function P0e(){let{getFloatingProps:e,slot:t}=P.useContext(qp);return P.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function T0e(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=P.useContext(pR),n=P.useMemo(()=>e,[JSON.stringify(e,(i,o)=>{var s;return(s=o==null?void 0:o.outerHTML)!=null?s:o})]);rn(()=>{t==null||t(n??null)},[t,n]);let r=P.useContext(qp);return P.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let uk=4;function M0e({children:e,enabled:t=!0}){let[n,r]=P.useState(null),[i,o]=P.useState(0),s=P.useRef(null),[a,l]=P.useState(null);O0e(a);let c=t&&n!==null&&a!==null,{to:u="bottom",gap:d=0,offset:p=0,padding:h=0,inner:m}=D0e(n,a),[b,v="center"]=u.split(" ");rn(()=>{c&&o(0)},[c]);let{refs:x,floatingStyles:S,context:_}=w0e({open:c,placement:b==="selection"?v==="center"?"bottom":`bottom-${v}`:v==="center"?`${b}`:`${b}-${v}`,strategy:"absolute",transform:!1,middleware:[EE({mainAxis:b==="selection"?0:d,crossAxis:p}),TL({padding:h}),b!=="selection"&&ML({padding:h}),b==="selection"&&m?_0e({...m,padding:h,overflowRef:s,offset:i,minItemsVisible:uk,referenceOverflowThreshold:h,onFallbackChange(j){var $,X;if(!j)return;let V=_.elements.floating;if(!V)return;let L=parseFloat(getComputedStyle(V).scrollPaddingBottom)||0,U=Math.min(uk,V.childElementCount),B=0,W=0;for(let q of(X=($=_.elements.floating)==null?void 0:$.childNodes)!=null?X:[])if(q instanceof HTMLElement){let A=q.offsetTop,Y=A+q.clientHeight+L,G=V.scrollTop,D=G+V.clientHeight;if(A>=G&&Y<=D)U--;else{W=Math.max(0,Math.min(Y,D)-Math.max(A,G)),B=q.clientHeight;break}}U>=1&&o(q=>{let A=B*U-W+L;return q>=A?q:A})}}):null,OL({padding:h,apply({availableWidth:j,availableHeight:$,elements:X}){Object.assign(X.floating.style,{overflow:"auto",maxWidth:`${j}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${$}px)`})}})].filter(Boolean),whileElementsMounted:EL}),[E=b,C=v]=_.placement.split("-");b==="selection"&&(E="selection");let M=P.useMemo(()=>({anchor:[E,C].filter(Boolean).join(" ")}),[E,C]),O=C0e(_,{overflowRef:s,onChange:o}),{getReferenceProps:k,getFloatingProps:N}=S0e([O]),F=qe(j=>{l(j),x.setFloating(j)});return R.createElement(pR.Provider,{value:r},R.createElement(qp.Provider,{value:{setFloating:F,setReference:x.setReference,styles:S,getReferenceProps:k,getFloatingProps:N,slot:M}},e))}function O0e(e){rn(()=>{if(!e)return;let t=new MutationObserver(()=>{let n=window.getComputedStyle(e).maxHeight,r=parseFloat(n);if(isNaN(r))return;let i=parseInt(n);isNaN(i)||r!==i&&(e.style.maxHeight=`${Math.ceil(r)}px`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>{t.disconnect()}},[e])}function D0e(e,t){var n,r,i;let o=j1((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),s=j1((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),a=j1((i=e==null?void 0:e.padding)!=null?i:"var(--anchor-padding, 0)",t);return{...e,gap:o,offset:s,padding:a}}function j1(e,t,n=void 0){let r=zd(),i=qe((l,c)=>{if(l==null)return[n,null];if(typeof l=="number")return[l,null];if(typeof l=="string"){if(!c)return[n,null];let u=dk(l,c);return[u,d=>{let p=i7(l);{let h=p.map(m=>window.getComputedStyle(c).getPropertyValue(m));r.requestAnimationFrame(function m(){r.nextFrame(m);let b=!1;for(let[x,S]of p.entries()){let _=window.getComputedStyle(c).getPropertyValue(S);if(h[x]!==_){h[x]=_,b=!0;break}}if(!b)return;let v=dk(l,c);u!==v&&(d(v),u=v)})}return r.dispose}]}return[n,null]}),o=P.useMemo(()=>i(e,t)[0],[e,t]),[s=o,a]=P.useState();return rn(()=>{let[l,c]=i(e,t);if(a(l),!!c)return c(a)},[e,t]),s}function i7(e){let t=/var\((.*)\)/.exec(e);if(t){let n=t[1].indexOf(",");if(n===-1)return[t[1]];let r=t[1].slice(0,n).trim(),i=t[1].slice(n+1).trim();return i?[r,...i7(i)]:[r]}return[]}function dk(e,t){let n=document.createElement("div");t.appendChild(n),n.style.setProperty("margin-top","0px","important"),n.style.setProperty("margin-top",e,"important");let r=parseFloat(window.getComputedStyle(n).marginTop)||0;return t.removeChild(n),r}function A0e({children:e,freeze:t}){let n=f_(t,e);return P.createElement(P.Fragment,null,n)}function f_(e,t){let[n,r]=P.useState(t);return!e&&n!==t&&r(t),e?n:t}let gR=P.createContext(null);gR.displayName="OpenClosedContext";var Po=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(Po||{});function mR(){return P.useContext(gR)}function o7({value:e,children:t}){return P.createElement(gR.Provider,{value:e},t)}function k0e(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let Il=[];k0e(()=>{function e(t){if(!(t.target instanceof HTMLElement)||t.target===document.body||Il[0]===t.target)return;let n=t.target;n=n.closest(u_),Il.unshift(n??t.target),Il=Il.filter(r=>r!=null&&r.isConnected),Il.splice(10)}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function I0e(e){throw new Error("Unexpected object: "+e)}var Un=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(Un||{});function fk(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),i=r??-1;switch(e.focus){case 0:{for(let o=0;o<n.length;++o)if(!t.resolveDisabled(n[o],o,n))return o;return r}case 1:{i===-1&&(i=n.length);for(let o=i-1;o>=0;--o)if(!t.resolveDisabled(n[o],o,n))return o;return r}case 2:{for(let o=i+1;o<n.length;++o)if(!t.resolveDisabled(n[o],o,n))return o;return r}case 3:{for(let o=n.length-1;o>=0;--o)if(!t.resolveDisabled(n[o],o,n))return o;return r}case 4:{for(let o=0;o<n.length;++o)if(t.resolveId(n[o],o,n)===e.id)return o;return r}case 5:return null;default:I0e(e)}}var bR=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(bR||{});function N0e(e){let t=qe(e),n=P.useRef(!1);P.useEffect(()=>(n.current=!1,()=>{n.current=!0,F8(()=>{n.current&&t()})}),[t])}function L0e(){let e=typeof document>"u";return"useSyncExternalStore"in R?(t=>t.useSyncExternalStore)(R)(()=>()=>{},()=>!1,()=>!e):!1}function yR(){let e=L0e(),[t,n]=R.useState(uc.isHandoffComplete);return t&&uc.isHandoffComplete===!1&&n(!1),R.useEffect(()=>{t!==!0&&n(!0)},[t]),R.useEffect(()=>uc.handoff(),[]),e?!1:t}let F0e=P.createContext(!1);function j0e(){return P.useContext(F0e)}function $0e(e){let t=j0e(),n=P.useContext(a7),r=I0(e),[i,o]=P.useState(()=>{var s;if(!t&&n!==null)return(s=n.current)!=null?s:null;if(uc.isServer)return null;let a=r==null?void 0:r.getElementById("headlessui-portal-root");if(a)return a;if(r===null)return null;let l=r.createElement("div");return l.setAttribute("id","headlessui-portal-root"),r.body.appendChild(l)});return P.useEffect(()=>{i!==null&&(r!=null&&r.body.contains(i)||r==null||r.body.appendChild(i))},[i,r]),P.useEffect(()=>{t||n!==null&&o(n.current)},[n,o,t]),i}let s7=P.Fragment,z0e=vi(function(e,t){let n=e,r=P.useRef(null),i=Io(oye(d=>{r.current=d}),t),o=I0(r),s=$0e(r),[a]=P.useState(()=>{var d;return uc.isServer?null:(d=o==null?void 0:o.createElement("div"))!=null?d:null}),l=P.useContext(W0e),c=yR();rn(()=>{!s||!a||s.contains(a)||(a.setAttribute("data-headlessui-portal",""),s.appendChild(a))},[s,a]),rn(()=>{if(a&&l)return l.register(a)},[l,a]),N0e(()=>{var d;!s||!a||(a instanceof Node&&s.contains(a)&&s.removeChild(a),s.childNodes.length<=0&&((d=s.parentElement)==null||d.removeChild(s)))});let u=Wi();return c?!s||!a?null:Tr.createPortal(u({ourProps:{ref:i},theirProps:n,slot:{},defaultTag:s7,name:"Portal"}),a):null});function B0e(e,t){let n=Io(t),{enabled:r=!0,...i}=e,o=Wi();return r?P.createElement(z0e,{...i,ref:n}):o({ourProps:{ref:n},theirProps:i,slot:{},defaultTag:s7,name:"Portal"})}let H0e=P.Fragment,a7=P.createContext(null);function V0e(e,t){let{target:n,...r}=e,i={ref:Io(t)},o=Wi();return P.createElement(a7.Provider,{value:n},o({ourProps:i,theirProps:r,defaultTag:H0e,name:"Popover.Group"}))}let W0e=P.createContext(null),U0e=vi(B0e),G0e=vi(V0e),q0e=Object.assign(U0e,{Group:G0e});var Y0e=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Y0e||{}),K0e=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(K0e||{}),X0e=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(X0e||{}),Q0e=(e=>(e[e.OpenCombobox=0]="OpenCombobox",e[e.CloseCombobox=1]="CloseCombobox",e[e.GoToOption=2]="GoToOption",e[e.SetTyping=3]="SetTyping",e[e.RegisterOption=4]="RegisterOption",e[e.UnregisterOption=5]="UnregisterOption",e[e.SetActivationTrigger=6]="SetActivationTrigger",e[e.UpdateVirtualConfiguration=7]="UpdateVirtualConfiguration",e[e.SetInputElement=8]="SetInputElement",e[e.SetButtonElement=9]="SetButtonElement",e[e.SetOptionsElement=10]="SetOptionsElement",e))(Q0e||{});function $1(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=t(e.options.slice()),i=r.length>0&&r[0].dataRef.current.order!==null?r.sort((s,a)=>s.dataRef.current.order-a.dataRef.current.order):zye(r,s=>s.dataRef.current.domRef.current),o=n?i.indexOf(n):null;return o===-1&&(o=null),{options:i,activeOptionIndex:o}}let J0e={1(e){var t;return(t=e.dataRef.current)!=null&&t.disabled||e.comboboxState===1?e:{...e,activeOptionIndex:null,comboboxState:1,isTyping:!1,activationTrigger:2,__demoMode:!1}},0(e){var t,n;if((t=e.dataRef.current)!=null&&t.disabled||e.comboboxState===0)return e;if((n=e.dataRef.current)!=null&&n.value){let r=e.dataRef.current.calculateIndex(e.dataRef.current.value);if(r!==-1)return{...e,activeOptionIndex:r,comboboxState:0,__demoMode:!1}}return{...e,comboboxState:0,__demoMode:!1}},3(e,t){return e.isTyping===t.isTyping?e:{...e,isTyping:t.isTyping}},2(e,t){var n,r,i,o;if((n=e.dataRef.current)!=null&&n.disabled||e.optionsElement&&!((r=e.dataRef.current)!=null&&r.optionsPropsRef.current.static)&&e.comboboxState===1)return e;if(e.virtual){let{options:c,disabled:u}=e.virtual,d=t.focus===Un.Specific?t.idx:fk(t,{resolveItems:()=>c,resolveActiveIndex:()=>{var h,m;return(m=(h=e.activeOptionIndex)!=null?h:c.findIndex(b=>!u(b)))!=null?m:null},resolveDisabled:u,resolveId(){throw new Error("Function not implemented.")}}),p=(i=t.trigger)!=null?i:2;return e.activeOptionIndex===d&&e.activationTrigger===p?e:{...e,activeOptionIndex:d,activationTrigger:p,isTyping:!1,__demoMode:!1}}let s=$1(e);if(s.activeOptionIndex===null){let c=s.options.findIndex(u=>!u.dataRef.current.disabled);c!==-1&&(s.activeOptionIndex=c)}let a=t.focus===Un.Specific?t.idx:fk(t,{resolveItems:()=>s.options,resolveActiveIndex:()=>s.activeOptionIndex,resolveId:c=>c.id,resolveDisabled:c=>c.dataRef.current.disabled}),l=(o=t.trigger)!=null?o:2;return e.activeOptionIndex===a&&e.activationTrigger===l?e:{...e,...s,isTyping:!1,activeOptionIndex:a,activationTrigger:l,__demoMode:!1}},4:(e,t)=>{var n,r,i;if((n=e.dataRef.current)!=null&&n.virtual)return{...e,options:[...e.options,t.payload]};let o=t.payload,s=$1(e,l=>(l.push(o),l));e.activeOptionIndex===null&&(r=e.dataRef.current)!=null&&r.isSelected(t.payload.dataRef.current.value)&&(s.activeOptionIndex=s.options.indexOf(o));let a={...e,...s,activationTrigger:2};return(i=e.dataRef.current)!=null&&i.__demoMode&&e.dataRef.current.value===void 0&&(a.activeOptionIndex=0),a},5:(e,t)=>{var n;if((n=e.dataRef.current)!=null&&n.virtual)return{...e,options:e.options.filter(i=>i.id!==t.id)};let r=$1(e,i=>{let o=i.findIndex(s=>s.id===t.id);return o!==-1&&i.splice(o,1),i});return{...e,...r,activationTrigger:2}},6:(e,t)=>e.activationTrigger===t.trigger?e:{...e,activationTrigger:t.trigger},7:(e,t)=>{var n,r;if(e.virtual===null)return{...e,virtual:{options:t.options,disabled:(n=t.disabled)!=null?n:()=>!1}};if(e.virtual.options===t.options&&e.virtual.disabled===t.disabled)return e;let i=e.activeOptionIndex;if(e.activeOptionIndex!==null){let o=t.options.indexOf(e.virtual.options[e.activeOptionIndex]);o!==-1?i=o:i=null}return{...e,activeOptionIndex:i,virtual:{options:t.options,disabled:(r=t.disabled)!=null?r:()=>!1}}},8:(e,t)=>e.inputElement===t.element?e:{...e,inputElement:t.element},9:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},10:(e,t)=>e.optionsElement===t.element?e:{...e,optionsElement:t.element}},vR=P.createContext(null);vR.displayName="ComboboxActionsContext";function Yp(e){let t=P.useContext(vR);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Yp),n}return t}let l7=P.createContext(null);function Z0e(e){let t=Bd("VirtualProvider"),{options:n}=t.virtual,[r,i]=P.useMemo(()=>{let c=t.optionsElement;if(!c)return[0,0];let u=window.getComputedStyle(c);return[parseFloat(u.paddingBlockStart||u.paddingTop),parseFloat(u.paddingBlockEnd||u.paddingBottom)]},[t.optionsElement]),o=Pye({enabled:n.length!==0,scrollPaddingStart:r,scrollPaddingEnd:i,count:n.length,estimateSize(){return 40},getScrollElement(){return t.optionsElement},overscan:12}),[s,a]=P.useState(0);rn(()=>{a(c=>c+1)},[n]);let l=o.getVirtualItems();return l.length===0?null:P.createElement(l7.Provider,{value:o},P.createElement("div",{style:{position:"relative",width:"100%",height:`${o.getTotalSize()}px`},ref:c=>{c&&t.activationTrigger!==0&&t.activeOptionIndex!==null&&n.length>t.activeOptionIndex&&o.scrollToIndex(t.activeOptionIndex)}},l.map(c=>{var u;return P.createElement(P.Fragment,{key:c.key},P.cloneElement((u=e.children)==null?void 0:u.call(e,{...e.slot,option:n[c.index]}),{key:`${s}-${c.key}`,"data-index":c.index,"aria-setsize":n.length,"aria-posinset":c.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${c.start}px)`,overflowAnchor:"none"}}))})))}let Hh=P.createContext(null);Hh.displayName="ComboboxDataContext";function Bd(e){let t=P.useContext(Hh);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Bd),n}return t}function eve(e,t){return Mo(t.type,J0e,e,t)}let tve=P.Fragment;function nve(e,t){var n,r;let i=cR(),{value:o,defaultValue:s,onChange:a,form:l,name:c,by:u,disabled:d=i||!1,onClose:p,__demoMode:h=!1,multiple:m=!1,immediate:b=!1,virtual:v=null,nullable:x,...S}=e,_=Kbe(s),[E=m?[]:void 0,C]=Ybe(o,a,_),[M,O]=P.useReducer(eve,{dataRef:P.createRef(),comboboxState:h?0:1,isTyping:!1,options:[],virtual:v?{options:v.options,disabled:(n=v.disabled)!=null?n:()=>!1}:null,activeOptionIndex:null,activationTrigger:2,inputElement:null,buttonElement:null,optionsElement:null,__demoMode:h}),k=P.useRef(!1),N=P.useRef({static:!1,hold:!1}),F=Mye(u),j=qe(de=>v?u===null?v.options.indexOf(de):v.options.findIndex(Ee=>F(Ee,de)):M.options.findIndex(Ee=>F(Ee.dataRef.current.value,de))),$=P.useCallback(de=>Mo(V.mode,{1:()=>E.some(Ee=>F(Ee,de)),0:()=>F(E,de)}),[E]),X=qe(de=>M.activeOptionIndex===j(de)),V=P.useMemo(()=>({...M,immediate:b,optionsPropsRef:N,value:E,defaultValue:_,disabled:d,mode:m?1:0,virtual:v?M.virtual:null,get activeOptionIndex(){if(k.current&&M.activeOptionIndex===null&&(v?v.options.length>0:M.options.length>0)){if(v){let Ee=v.options.findIndex(De=>{var $e,Te;return!((Te=($e=v.disabled)==null?void 0:$e.call(v,De))!=null&&Te)});if(Ee!==-1)return Ee}let de=M.options.findIndex(Ee=>!Ee.dataRef.current.disabled);if(de!==-1)return de}return M.activeOptionIndex},calculateIndex:j,compare:F,isSelected:$,isActive:X}),[E,_,d,m,h,M,v]);rn(()=>{var de;v&&O({type:7,options:v.options,disabled:(de=v.disabled)!=null?de:null})},[v,v==null?void 0:v.options,v==null?void 0:v.disabled]),rn(()=>{M.dataRef.current=V},[V]);let L=V.comboboxState===0;Vye(L,[V.buttonElement,V.inputElement,V.optionsElement],()=>Z.closeCombobox());let U=P.useMemo(()=>{var de,Ee,De;return{open:V.comboboxState===0,disabled:d,activeIndex:V.activeOptionIndex,activeOption:V.activeOptionIndex===null?null:V.virtual?V.virtual.options[(de=V.activeOptionIndex)!=null?de:0]:(De=(Ee=V.options[V.activeOptionIndex])==null?void 0:Ee.dataRef.current.value)!=null?De:null,value:E}},[V,d,E]),B=qe(()=>{if(V.activeOptionIndex!==null){if(Z.setIsTyping(!1),V.virtual)D(V.virtual.options[V.activeOptionIndex]);else{let{dataRef:de}=V.options[V.activeOptionIndex];D(de.current.value)}Z.goToOption(Un.Specific,V.activeOptionIndex)}}),W=qe(()=>{O({type:0}),k.current=!0}),q=qe(()=>{O({type:1}),k.current=!1,p==null||p()}),A=qe(de=>{O({type:3,isTyping:de})}),Y=qe((de,Ee,De)=>(k.current=!1,de===Un.Specific?O({type:2,focus:Un.Specific,idx:Ee,trigger:De}):O({type:2,focus:de,trigger:De}))),G=qe((de,Ee)=>(O({type:4,payload:{id:de,dataRef:Ee}}),()=>{V.isActive(Ee.current.value)&&(k.current=!0),O({type:5,id:de})})),D=qe(de=>Mo(V.mode,{0(){return C==null?void 0:C(de)},1(){let Ee=V.value.slice(),De=Ee.findIndex($e=>F($e,de));return De===-1?Ee.push(de):Ee.splice(De,1),C==null?void 0:C(Ee)}})),ee=qe(de=>{O({type:6,trigger:de})}),K=qe(de=>{O({type:8,element:de})}),oe=qe(de=>{O({type:9,element:de})}),J=qe(de=>{O({type:10,element:de})}),Z=P.useMemo(()=>({onChange:D,registerOption:G,goToOption:Y,setIsTyping:A,closeCombobox:q,openCombobox:W,setActivationTrigger:ee,selectActiveOption:B,setInputElement:K,setButtonElement:oe,setOptionsElement:J}),[]),[ae,ce]=uye(),pe=t===null?{}:{ref:t},ie=P.useCallback(()=>{if(_!==void 0)return C==null?void 0:C(_)},[C,_]),ge=Wi();return P.createElement(ce,{value:ae,props:{htmlFor:(r=V.inputElement)==null?void 0:r.id},slot:{open:V.comboboxState===0,disabled:d}},P.createElement(M0e,null,P.createElement(vR.Provider,{value:Z},P.createElement(Hh.Provider,{value:V},P.createElement(o7,{value:Mo(V.comboboxState,{0:Po.Open,1:Po.Closed})},c!=null&&P.createElement(eye,{disabled:d,data:E!=null?{[c]:E}:{},form:l,onReset:ie}),ge({ourProps:pe,theirProps:S,slot:U,defaultTag:tve,name:"Combobox"}))))))}let rve="input";function ive(e,t){var n,r,i,o,s;let a=Bd("Combobox.Input"),l=Yp("Combobox.Input"),c=P.useId(),u=V8(),{id:d=u||`headlessui-combobox-input-${c}`,onChange:p,displayValue:h,disabled:m=a.disabled||!1,autoFocus:b=!1,type:v="text",...x}=e,S=P.useRef(null),_=Io(S,t,R0e(),l.setInputElement),E=I0(a.inputElement),C=zd(),M=qe(()=>{l.onChange(null),a.optionsElement&&(a.optionsElement.scrollTop=0),l.goToOption(Un.Nothing)}),O=P.useMemo(()=>{var D;return typeof h=="function"&&a.value!==void 0?(D=h(a.value))!=null?D:"":typeof a.value=="string"?a.value:""},[a.value,h]);ik(([D,ee],[K,oe])=>{if(a.isTyping)return;let J=S.current;J&&((oe===0&&ee===1||D!==K)&&(J.value=D),requestAnimationFrame(()=>{if(a.isTyping||!J||(E==null?void 0:E.activeElement)!==J)return;let{selectionStart:Z,selectionEnd:ae}=J;Math.abs((ae??0)-(Z??0))===0&&Z===0&&J.setSelectionRange(J.value.length,J.value.length)}))},[O,a.comboboxState,E,a.isTyping]),ik(([D],[ee])=>{if(D===0&&ee===1){if(a.isTyping)return;let K=S.current;if(!K)return;let oe=K.value,{selectionStart:J,selectionEnd:Z,selectionDirection:ae}=K;K.value="",K.value=oe,ae!==null?K.setSelectionRange(J,Z,ae):K.setSelectionRange(J,Z)}},[a.comboboxState]);let k=P.useRef(!1),N=qe(()=>{k.current=!0}),F=qe(()=>{C.nextFrame(()=>{k.current=!1})}),j=qe(D=>{switch(l.setIsTyping(!0),D.key){case Wr.Enter:if(a.comboboxState!==0||k.current)return;if(D.preventDefault(),D.stopPropagation(),a.activeOptionIndex===null){l.closeCombobox();return}l.selectActiveOption(),a.mode===0&&l.closeCombobox();break;case Wr.ArrowDown:return D.preventDefault(),D.stopPropagation(),Mo(a.comboboxState,{0:()=>l.goToOption(Un.Next),1:()=>l.openCombobox()});case Wr.ArrowUp:return D.preventDefault(),D.stopPropagation(),Mo(a.comboboxState,{0:()=>l.goToOption(Un.Previous),1:()=>{Tr.flushSync(()=>l.openCombobox()),a.value||l.goToOption(Un.Last)}});case Wr.Home:if(D.shiftKey)break;return D.preventDefault(),D.stopPropagation(),l.goToOption(Un.First);case Wr.PageUp:return D.preventDefault(),D.stopPropagation(),l.goToOption(Un.First);case Wr.End:if(D.shiftKey)break;return D.preventDefault(),D.stopPropagation(),l.goToOption(Un.Last);case Wr.PageDown:return D.preventDefault(),D.stopPropagation(),l.goToOption(Un.Last);case Wr.Escape:return a.comboboxState!==0?void 0:(D.preventDefault(),a.optionsElement&&!a.optionsPropsRef.current.static&&D.stopPropagation(),a.mode===0&&a.value===null&&M(),l.closeCombobox());case Wr.Tab:if(a.comboboxState!==0)return;a.mode===0&&a.activationTrigger!==1&&l.selectActiveOption(),l.closeCombobox();break}}),$=qe(D=>{p==null||p(D),a.mode===0&&D.target.value===""&&M(),l.openCombobox()}),X=qe(D=>{var ee,K,oe;let J=(ee=D.relatedTarget)!=null?ee:Il.find(Z=>Z!==D.currentTarget);if(!((K=a.optionsElement)!=null&&K.contains(J))&&!((oe=a.buttonElement)!=null&&oe.contains(J))&&a.comboboxState===0)return D.preventDefault(),a.mode===0&&a.value===null&&M(),l.closeCombobox()}),V=qe(D=>{var ee,K,oe;let J=(ee=D.relatedTarget)!=null?ee:Il.find(Z=>Z!==D.currentTarget);(K=a.buttonElement)!=null&&K.contains(J)||(oe=a.optionsElement)!=null&&oe.contains(J)||a.disabled||a.immediate&&a.comboboxState!==0&&C.microTask(()=>{Tr.flushSync(()=>l.openCombobox()),l.setActivationTrigger(1)})}),L=k0(),U=sye(),{isFocused:B,focusProps:W}=L8({autoFocus:b}),{isHovered:q,hoverProps:A}=N8({isDisabled:m}),Y=P.useMemo(()=>({open:a.comboboxState===0,disabled:m,hover:q,focus:B,autofocus:b}),[a,q,B,b,m]),G=uR({ref:_,id:d,role:"combobox",type:v,"aria-controls":(n=a.optionsElement)==null?void 0:n.id,"aria-expanded":a.comboboxState===0,"aria-activedescendant":a.activeOptionIndex===null?void 0:a.virtual?(r=a.options.find(D=>!D.dataRef.current.disabled&&a.compare(D.dataRef.current.value,a.virtual.options[a.activeOptionIndex])))==null?void 0:r.id:(i=a.options[a.activeOptionIndex])==null?void 0:i.id,"aria-labelledby":L,"aria-describedby":U,"aria-autocomplete":"list",defaultValue:(s=(o=e.defaultValue)!=null?o:a.defaultValue!==void 0?h==null?void 0:h(a.defaultValue):null)!=null?s:a.defaultValue,disabled:m||void 0,autoFocus:b,onCompositionStart:N,onCompositionEnd:F,onKeyDown:j,onChange:$,onFocus:V,onBlur:X},W,A);return Wi()({ourProps:G,theirProps:x,slot:Y,defaultTag:rve,name:"Combobox.Input"})}let ove="button";function sve(e,t){var n;let r=Bd("Combobox.Button"),i=Yp("Combobox.Button"),o=Io(t,i.setButtonElement),s=P.useId(),{id:a=`headlessui-combobox-button-${s}`,disabled:l=r.disabled||!1,autoFocus:c=!1,...u}=e,d=Z8(r.inputElement),p=qe(O=>{switch(O.key){case Wr.Space:case Wr.Enter:O.preventDefault(),O.stopPropagation(),r.comboboxState===1&&Tr.flushSync(()=>i.openCombobox()),d();return;case Wr.ArrowDown:O.preventDefault(),O.stopPropagation(),r.comboboxState===1&&(Tr.flushSync(()=>i.openCombobox()),r.value||i.goToOption(Un.First)),d();return;case Wr.ArrowUp:O.preventDefault(),O.stopPropagation(),r.comboboxState===1&&(Tr.flushSync(()=>i.openCombobox()),r.value||i.goToOption(Un.Last)),d();return;case Wr.Escape:if(r.comboboxState!==0)return;O.preventDefault(),r.optionsElement&&!r.optionsPropsRef.current.static&&O.stopPropagation(),Tr.flushSync(()=>i.closeCombobox()),d();return;default:return}}),h=qe(O=>{O.preventDefault(),!rye(O.currentTarget)&&(O.button===bR.Left&&(r.comboboxState===0?i.closeCombobox():i.openCombobox()),d())}),m=k0([a]),{isFocusVisible:b,focusProps:v}=L8({autoFocus:c}),{isHovered:x,hoverProps:S}=N8({isDisabled:l}),{pressed:_,pressProps:E}=Hbe({disabled:l}),C=P.useMemo(()=>({open:r.comboboxState===0,active:_||r.comboboxState===0,disabled:l,value:r.value,hover:x,focus:b}),[r,x,b,_,l]),M=uR({ref:o,id:a,type:Uye(e,r.buttonElement),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":(n=r.optionsElement)==null?void 0:n.id,"aria-expanded":r.comboboxState===0,"aria-labelledby":m,disabled:l||void 0,autoFocus:c,onMouseDown:h,onKeyDown:p},v,S,E);return Wi()({ourProps:M,theirProps:u,slot:C,defaultTag:ove,name:"Combobox.Button"})}let ave="div",lve=hy.RenderStrategy|hy.Static;function cve(e,t){var n,r,i;let o=P.useId(),{id:s=`headlessui-combobox-options-${o}`,hold:a=!1,anchor:l,portal:c=!1,modal:u=!0,transition:d=!1,...p}=e,h=Bd("Combobox.Options"),m=Yp("Combobox.Options"),b=E0e(l);b&&(c=!0);let[v,x]=T0e(b),[S,_]=P.useState(null),E=P0e(),C=Io(t,b?v:null,m.setOptionsElement,_),M=I0(h.optionsElement),O=mR(),[k,N]=t7(d,S,O!==null?(O&Po.Open)===Po.Open:h.comboboxState===0);Iye(k,h.inputElement,m.closeCombobox);let F=h.__demoMode?!1:u&&h.comboboxState===0;Qye(F,M);let j=h.__demoMode?!1:u&&h.comboboxState===0;kye(j,{allowed:P.useCallback(()=>[h.inputElement,h.buttonElement,h.optionsElement],[h.inputElement,h.buttonElement,h.optionsElement])}),rn(()=>{var G;h.optionsPropsRef.current.static=(G=e.static)!=null?G:!1},[h.optionsPropsRef,e.static]),rn(()=>{h.optionsPropsRef.current.hold=a},[h.optionsPropsRef,a]),i0e(h.comboboxState===0,{container:h.optionsElement,accept(G){return G.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:G.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(G){G.setAttribute("role","none")}});let $=k0([(n=h.buttonElement)==null?void 0:n.id]),X=P.useMemo(()=>({open:h.comboboxState===0,option:void 0}),[h.comboboxState]),V=qe(()=>{m.setActivationTrigger(0)}),L=qe(G=>{G.preventDefault(),m.setActivationTrigger(0)}),U=uR(b?E():{},{"aria-labelledby":$,role:"listbox","aria-multiselectable":h.mode===1?!0:void 0,id:s,ref:C,style:{...p.style,...x,"--input-width":QA(h.inputElement,!0).width,"--button-width":QA(h.buttonElement,!0).width},onWheel:h.activationTrigger===0?void 0:V,onMouseDown:L,...e7(N)}),B=k&&h.comboboxState===1,W=f_(B,(r=h.virtual)==null?void 0:r.options),q=f_(B,h.value),A=qe(G=>h.compare(q,G));if(h.virtual){if(W===void 0)throw new Error("Missing `options` in virtual mode");Object.assign(p,{children:P.createElement(Hh.Provider,{value:W!==h.virtual.options?{...h,virtual:{...h.virtual,options:W}}:h},P.createElement(Z0e,{slot:X},p.children))})}let Y=Wi();return P.createElement(q0e,{enabled:c?e.static||k:!1},P.createElement(Hh.Provider,{value:h.mode===1?h:{...h,isSelected:A}},Y({ourProps:U,theirProps:{...p,children:P.createElement(A0e,{freeze:B},typeof p.children=="function"?(i=p.children)==null?void 0:i.call(p,X):p.children)},slot:X,defaultTag:ave,features:lve,visible:k,name:"Combobox.Options"})))}let uve="div";function dve(e,t){var n,r,i,o;let s=Bd("Combobox.Option"),a=Yp("Combobox.Option"),l=P.useId(),{id:c=`headlessui-combobox-option-${l}`,value:u,disabled:d=(i=(r=(n=s.virtual)==null?void 0:n.disabled)==null?void 0:r.call(n,u))!=null?i:!1,order:p=null,...h}=e,m=Z8(s.inputElement),b=s.virtual?s.activeOptionIndex===s.calculateIndex(u):s.activeOptionIndex===null?!1:((o=s.options[s.activeOptionIndex])==null?void 0:o.id)===c,v=s.isSelected(u),x=P.useRef(null),S=sl({disabled:d,value:u,domRef:x,order:p}),_=P.useContext(l7),E=Io(t,x,_?_.measureElement:null),C=qe(()=>{a.setIsTyping(!1),a.onChange(u)});rn(()=>a.registerOption(c,S),[S,c]);let M=P.useRef(!(s.virtual||s.__demoMode));rn(()=>{if(!s.virtual&&!s.__demoMode)return ds().requestAnimationFrame(()=>{M.current=!0})},[s.virtual,s.__demoMode]),rn(()=>{if(M.current&&s.comboboxState===0&&b&&s.activationTrigger!==0)return ds().requestAnimationFrame(()=>{var L,U;(U=(L=x.current)==null?void 0:L.scrollIntoView)==null||U.call(L,{block:"nearest"})})},[x,b,s.comboboxState,s.activationTrigger,s.activeOptionIndex]);let O=qe(L=>{L.preventDefault(),L.button===bR.Left&&(d||(C(),J8()||requestAnimationFrame(()=>m()),s.mode===0&&a.closeCombobox()))}),k=qe(()=>{if(d)return a.goToOption(Un.Nothing);let L=s.calculateIndex(u);a.goToOption(Un.Specific,L)}),N=Jye(),F=qe(L=>N.update(L)),j=qe(L=>{if(!N.wasMoved(L)||d||b)return;let U=s.calculateIndex(u);a.goToOption(Un.Specific,U,0)}),$=qe(L=>{N.wasMoved(L)&&(d||b&&(s.optionsPropsRef.current.hold||a.goToOption(Un.Nothing)))}),X=P.useMemo(()=>({active:b,focus:b,selected:v,disabled:d}),[b,v,d]),V={id:c,ref:E,role:"option",tabIndex:d===!0?void 0:-1,"aria-disabled":d===!0?!0:void 0,"aria-selected":v,disabled:void 0,onMouseDown:O,onFocus:k,onPointerEnter:F,onMouseEnter:F,onPointerMove:j,onMouseMove:j,onPointerLeave:$,onMouseLeave:$};return Wi()({ourProps:V,theirProps:h,slot:X,defaultTag:uve,name:"Combobox.Option"})}let fve=vi(nve),c7=vi(sve),u7=vi(ive),hve=pye,d7=vi(cve),f7=vi(dve),pve=Object.assign(fve,{Input:u7,Button:c7,Label:hve,Options:d7,Option:f7});function gve(){let e=P.useRef(!1);return rn(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function h7(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||((t=e.as)!=null?t:g7)!==P.Fragment||P.Children.count(e.children)===1}let N0=P.createContext(null);N0.displayName="TransitionContext";var mve=(e=>(e.Visible="visible",e.Hidden="hidden",e))(mve||{});function bve(){let e=P.useContext(N0);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function yve(){let e=P.useContext(L0);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let L0=P.createContext(null);L0.displayName="NestingContext";function F0(e){return"children"in e?F0(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function p7(e,t){let n=sl(e),r=P.useRef([]),i=gve(),o=zd(),s=qe((h,m=ja.Hidden)=>{let b=r.current.findIndex(({el:v})=>v===h);b!==-1&&(Mo(m,{[ja.Unmount](){r.current.splice(b,1)},[ja.Hidden](){r.current[b].state="hidden"}}),o.microTask(()=>{var v;!F0(r)&&i.current&&((v=n.current)==null||v.call(n))}))}),a=qe(h=>{let m=r.current.find(({el:b})=>b===h);return m?m.state!=="visible"&&(m.state="visible"):r.current.push({el:h,state:"visible"}),()=>s(h,ja.Unmount)}),l=P.useRef([]),c=P.useRef(Promise.resolve()),u=P.useRef({enter:[],leave:[]}),d=qe((h,m,b)=>{l.current.splice(0),t&&(t.chains.current[m]=t.chains.current[m].filter(([v])=>v!==h)),t==null||t.chains.current[m].push([h,new Promise(v=>{l.current.push(v)})]),t==null||t.chains.current[m].push([h,new Promise(v=>{Promise.all(u.current[m].map(([x,S])=>S)).then(()=>v())})]),m==="enter"?c.current=c.current.then(()=>t==null?void 0:t.wait.current).then(()=>b(m)):b(m)}),p=qe((h,m,b)=>{Promise.all(u.current[m].splice(0).map(([v,x])=>x)).then(()=>{var v;(v=l.current.shift())==null||v()}).then(()=>b(m))});return P.useMemo(()=>({children:r,register:a,unregister:s,onStart:d,onStop:p,wait:c,chains:u}),[a,s,r,d,p,u,c])}let g7=P.Fragment,m7=hy.RenderStrategy;function vve(e,t){var n,r;let{transition:i=!0,beforeEnter:o,afterEnter:s,beforeLeave:a,afterLeave:l,enter:c,enterFrom:u,enterTo:d,entered:p,leave:h,leaveFrom:m,leaveTo:b,...v}=e,[x,S]=P.useState(null),_=P.useRef(null),E=h7(e),C=Io(...E?[_,t,S]:t===null?[]:[t]),M=(n=v.unmount)==null||n?ja.Unmount:ja.Hidden,{show:O,appear:k,initial:N}=bve(),[F,j]=P.useState(O?"visible":"hidden"),$=yve(),{register:X,unregister:V}=$;rn(()=>X(_),[X,_]),rn(()=>{if(M===ja.Hidden&&_.current){if(O&&F!=="visible"){j("visible");return}return Mo(F,{hidden:()=>V(_),visible:()=>X(_)})}},[F,_,X,V,O,M]);let L=yR();rn(()=>{if(E&&L&&F==="visible"&&_.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[_,F,L,E]);let U=N&&!k,B=k&&O&&N,W=P.useRef(!1),q=p7(()=>{W.current||(j("hidden"),V(_))},$),A=qe(J=>{W.current=!0;let Z=J?"enter":"leave";q.onStart(_,Z,ae=>{ae==="enter"?o==null||o():ae==="leave"&&(a==null||a())})}),Y=qe(J=>{let Z=J?"enter":"leave";W.current=!1,q.onStop(_,Z,ae=>{ae==="enter"?s==null||s():ae==="leave"&&(l==null||l())}),Z==="leave"&&!F0(q)&&(j("hidden"),V(_))});P.useEffect(()=>{E&&i||(A(O),Y(O))},[O,E,i]);let G=!(!i||!E||!L||U),[,D]=t7(G,x,O,{start:A,end:Y}),ee=_a({ref:C,className:((r=l_(v.className,B&&c,B&&u,D.enter&&c,D.enter&&D.closed&&u,D.enter&&!D.closed&&d,D.leave&&h,D.leave&&!D.closed&&m,D.leave&&D.closed&&b,!D.transition&&O&&p))==null?void 0:r.trim())||void 0,...e7(D)}),K=0;F==="visible"&&(K|=Po.Open),F==="hidden"&&(K|=Po.Closed),D.enter&&(K|=Po.Opening),D.leave&&(K|=Po.Closing);let oe=Wi();return P.createElement(L0.Provider,{value:q},P.createElement(o7,{value:K},oe({ourProps:ee,theirProps:v,defaultTag:g7,features:m7,visible:F==="visible",name:"Transition.Child"})))}function xve(e,t){let{show:n,appear:r=!1,unmount:i=!0,...o}=e,s=P.useRef(null),a=h7(e),l=Io(...a?[s,t]:t===null?[]:[t]);yR();let c=mR();if(n===void 0&&c!==null&&(n=(c&Po.Open)===Po.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[u,d]=P.useState(n?"visible":"hidden"),p=p7(()=>{n||d("hidden")}),[h,m]=P.useState(!0),b=P.useRef([n]);rn(()=>{h!==!1&&b.current[b.current.length-1]!==n&&(b.current.push(n),m(!1))},[b,n]);let v=P.useMemo(()=>({show:n,appear:r,initial:h}),[n,r,h]);rn(()=>{n?d("visible"):!F0(p)&&s.current!==null&&d("hidden")},[n,p]);let x={unmount:i},S=qe(()=>{var C;h&&m(!1),(C=e.beforeEnter)==null||C.call(e)}),_=qe(()=>{var C;h&&m(!1),(C=e.beforeLeave)==null||C.call(e)}),E=Wi();return P.createElement(L0.Provider,{value:p},P.createElement(N0.Provider,{value:v},E({ourProps:{...x,as:P.Fragment,children:P.createElement(b7,{ref:l,...x,...o,beforeEnter:S,beforeLeave:_})},theirProps:{},defaultTag:P.Fragment,features:m7,visible:u==="visible",name:"Transition"})))}function wve(e,t){let n=P.useContext(N0)!==null,r=mR()!==null;return P.createElement(P.Fragment,null,!n&&r?P.createElement(h_,{ref:t,...e}):P.createElement(b7,{ref:t,...e}))}let h_=vi(xve),b7=vi(vve),Sve=vi(wve),_ve=Object.assign(h_,{Child:Sve,Root:h_});var xR="Checkbox",[Cve,dMe]=tr(xR),[Eve,Rve]=Cve(xR),y7=R.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:o,required:s,disabled:a,value:l="on",onCheckedChange:c,form:u,...d}=e,[p,h]=R.useState(null),m=rt(t,E=>h(E)),b=R.useRef(!1),v=p?u||!!p.closest("form"):!0,[x=!1,S]=Ar({prop:i,defaultProp:o,onChange:c}),_=R.useRef(x);return R.useEffect(()=>{const E=p==null?void 0:p.form;if(E){const C=()=>S(_.current);return E.addEventListener("reset",C),()=>E.removeEventListener("reset",C)}},[p,S]),y.jsxs(Eve,{scope:n,state:x,disabled:a,children:[y.jsx(Ne.button,{type:"button",role:"checkbox","aria-checked":Ba(x)?"mixed":x,"aria-required":s,"data-state":w7(x),"data-disabled":a?"":void 0,disabled:a,value:l,...d,ref:m,onKeyDown:Re(e.onKeyDown,E=>{E.key==="Enter"&&E.preventDefault()}),onClick:Re(e.onClick,E=>{S(C=>Ba(C)?!0:!C),v&&(b.current=E.isPropagationStopped(),b.current||E.stopPropagation())})}),v&&y.jsx(Pve,{control:p,bubbles:!b.current,name:r,value:l,checked:x,required:s,disabled:a,form:u,style:{transform:"translateX(-100%)"},defaultChecked:Ba(o)?!1:o})]})});y7.displayName=xR;var v7="CheckboxIndicator",x7=R.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,o=Rve(v7,n);return y.jsx(Yn,{present:r||Ba(o.state)||o.state===!0,children:y.jsx(Ne.span,{"data-state":w7(o.state),"data-disabled":o.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});x7.displayName=v7;var Pve=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:i,...o}=e,s=R.useRef(null),a=x0(n),l=f0(t);R.useEffect(()=>{const u=s.current,d=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(d,"checked").set;if(a!==n&&h){const m=new Event("click",{bubbles:r});u.indeterminate=Ba(n),h.call(u,Ba(n)?!1:n),u.dispatchEvent(m)}},[a,n,r]);const c=R.useRef(Ba(n)?!1:n);return y.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:i??c.current,...o,tabIndex:-1,ref:s,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Ba(e){return e==="indeterminate"}function w7(e){return Ba(e)?"indeterminate":e?"checked":"unchecked"}var S7=y7,Tve=x7;const j0=R.forwardRef(({className:e,...t},n)=>y.jsx(S7,{ref:n,className:be("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:y.jsx(Tve,{className:be("flex items-center justify-center text-current"),children:y.jsx(Td,{className:"h-4 w-4"})})}));j0.displayName=S7.displayName;function Mve(e){const t=/(>=|<=|>|<|=)/,n=e.match(t);if(n){const r=n[0],[i,o]=e.split(r);return{operation:r,value:o.trim()}}else return null}function Ove(e,t,n){const r=`SELECT ${n}, COUNT(*) FROM ${t} {{ filters | where }} GROUP BY ${n} ORDER BY ${n} ASC LIMIT 50`,i=`SELECT min(${n}) as min, max(${n}) as max FROM ${t} {{ filters | where }}`;return Ed(e)?i:r}function Dve(e){const t=ye(o=>{var s,a;return(a=(s=o==null?void 0:o.dashboard)==null?void 0:s.filters)==null?void 0:a.find(l=>l.id===e)}),{query:n,setQuery:r,...i}=wR(t||{});return i}function wR(e){const[t,n]=P.useState([]),[r,i]=P.useState(""),o=ye(M=>M.filterValues),s=ye(M=>M.selectedSheetId),{addOrUpdateFilterValue:a,removeFilterValues:l}=Hn(),{data:c,isLoading:u,isFetching:d,isError:p}=E8(e),h=P.useMemo(()=>{var O;return e.column?(O=c==null?void 0:c.records)==null?void 0:O.map(k=>{let N=e.column.split(".").slice(-1)[0].replace(/"/g,"");return k[N]===void 0&&(N=N.toLowerCase()),{id:k[N],value:k[N]}}):[]},[c,e.column]);P.useEffect(()=>{if(o){const M=o.find(O=>O.filterId===e.id);if(!M){n([]);return}if(M.operation==="in"){const O=h==null?void 0:h.filter(k=>M.values.includes(k.value));O&&n(O)}}},[c,s,o,e.id,h]),P.useEffect(()=>{if(o&&!o.find(O=>O.filterId===e.id)){n([]);return}},[o,e.id]);function m(M){const O=Mve(M[0].toString());if(!(O!=null&&O.value)||!(O!=null&&O.operation))return;const k={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:Pu(e),name:e.column,operation:O.operation,values:[Number(O.value)]};a(k)}function b(M){if(Array.isArray(M)||(M=[M]),M.length===1&&h.find(k=>k.value===M[0].value)===void 0){m(M);return}if(n(M),M.length===0){l(e.id);return}const O={filterId:e.id,connectionType:e.database==="NA"?"api":"database",name:e.column,valueType:Pu(e),operation:e.operation,values:M.map(k=>k.value)};a(O)}function v(){n([]),l(e.id)}function x(M){if(M){n(h);const O={filterId:e.id,connectionType:e.database==="NA"?"api":"database",name:e.column,valueType:Pu(e),operation:e.operation,values:h.map(k=>k.value)};a(O)}else v()}function S(){if(yp(e.dataType))return h;const M=r.toLowerCase().replace(/\s+/g,"");return r===""?h:h.filter(O=>O.value.toLowerCase().replace(/\s+/g,"").includes(M))}const _=S(),E=e.type==="single",C=t.length===(h==null?void 0:h.length);return{isLoading:u,isFetching:d,isError:p,records:h,selectedRecords:t,handleChange:b,handleClear:v,handleSelectAll:x,query:r,setQuery:i,filteredRecords:_,isSingleSelect:E,allSelected:C}}function Ave({filter:e}){var h,m,b,v,x,S;const t=ye(_=>_.themeStyle),{filteredRecords:n,isSingleSelect:r,allSelected:i,handleChange:o,handleSelectAll:s,query:a,setQuery:l,isLoading:c,isFetching:u,isError:d,selectedRecords:p}=wR(e);return c||u?y.jsx(Mu,{style:{borderRadius:(m=(h=t==null?void 0:t.chart)==null?void 0:h.options)==null?void 0:m.borderRadius},className:"h-8 w-full bg-foreground/10"}):d?y.jsx("div",{className:"flex h-8 w-full items-center bg-muted px-2 text-sm",children:"Error"}):y.jsx("div",{className:"w-full",children:y.jsx(pve,{value:p,multiple:!r,onChange:o,children:y.jsxs("div",{className:"relative",children:[y.jsxs("div",{style:{borderRadius:(v=(b=t==null?void 0:t.chart)==null?void 0:b.options)==null?void 0:v.borderRadius},className:"relative w-full cursor-default overflow-hidden rounded-sm border bg-background text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-background/75 focus-visible:ring-offset-2 sm:text-sm",children:[y.jsx(u7,{className:"flex h-8 w-full rounded border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50",displayValue:_=>_.map(C=>C.value).join(", "),onChange:_=>{l(_.target.value)}}),y.jsx(c7,{className:"absolute inset-y-0 right-0 flex items-center bg-background pl-1 pr-2",children:y.jsx(qZ,{className:"h-5 w-5 text-gray-400","aria-hidden":"true"})})]}),y.jsx(_ve,{as:P.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",afterLeave:()=>l(""),children:y.jsxs(d7,{style:{borderRadius:(S=(x=t==null?void 0:t.chart)==null?void 0:x.options)==null?void 0:S.borderRadius},className:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-sm border bg-background py-1 text-base shadow-lg focus:outline-none sm:text-sm",children:[e.type==="multiple"||e.type===void 0&&y.jsxs("div",{className:"flex items-center justify-between gap-2 border-b px-4 py-2",children:[y.jsx("span",{children:"Select All"}),y.jsx(j0,{checked:i,onCheckedChange:s})]}),(n==null?void 0:n.length)===0&&a!==""?y.jsx("div",{className:"relative cursor-default select-none px-4 py-2 text-gray-700",children:"Nothing found."}):n==null?void 0:n.map(_=>{var E,C;return y.jsx(f7,{style:{borderRadius:(C=(E=t==null?void 0:t.chart)==null?void 0:E.options)==null?void 0:C.borderRadius},className:({active:M})=>`relative m-1 cursor-default select-none py-2 pl-10 pr-4 ${M?"bg-muted":"text-foreground-900"}`,value:_,children:({selected:M,active:O})=>y.jsxs("div",{className:"",children:[y.jsx("span",{className:`block ${M?"font-medium":"font-normal"}`,children:typeof _.value=="boolean"?_.value?"True":"False":_.value}),M?y.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 text-foreground",children:y.jsx(j5,{className:"h-5 w-5","aria-hidden":"true"})}):null]})},_.value)})]})})]})})})}var SR="Radio",[kve,_7]=tr(SR),[Ive,Nve]=kve(SR),C7=R.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:i=!1,required:o,disabled:s,value:a="on",onCheck:l,form:c,...u}=e,[d,p]=R.useState(null),h=rt(t,v=>p(v)),m=R.useRef(!1),b=d?c||!!d.closest("form"):!0;return y.jsxs(Ive,{scope:n,checked:i,disabled:s,children:[y.jsx(Ne.button,{type:"button",role:"radio","aria-checked":i,"data-state":P7(i),"data-disabled":s?"":void 0,disabled:s,value:a,...u,ref:h,onClick:Re(e.onClick,v=>{i||l==null||l(),b&&(m.current=v.isPropagationStopped(),m.current||v.stopPropagation())})}),b&&y.jsx(Lve,{control:d,bubbles:!m.current,name:r,value:a,checked:i,required:o,disabled:s,form:c,style:{transform:"translateX(-100%)"}})]})});C7.displayName=SR;var E7="RadioIndicator",R7=R.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...i}=e,o=Nve(E7,n);return y.jsx(Yn,{present:r||o.checked,children:y.jsx(Ne.span,{"data-state":P7(o.checked),"data-disabled":o.disabled?"":void 0,...i,ref:t})})});R7.displayName=E7;var Lve=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,o=R.useRef(null),s=x0(n),a=f0(t);return R.useEffect(()=>{const l=o.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&d){const p=new Event("click",{bubbles:r});d.call(l,n),l.dispatchEvent(p)}},[s,n,r]),y.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:o,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function P7(e){return e?"checked":"unchecked"}var Fve=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],_R="RadioGroup",[jve,fMe]=tr(_R,[Pd,_7]),T7=Pd(),M7=_7(),[$ve,zve]=jve(_R),O7=R.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:i,value:o,required:s=!1,disabled:a=!1,orientation:l,dir:c,loop:u=!0,onValueChange:d,...p}=e,h=T7(n),m=Ac(c),[b,v]=Ar({prop:o,defaultProp:i,onChange:d});return y.jsx($ve,{scope:n,name:r,required:s,disabled:a,value:b,onValueChange:v,children:y.jsx(oC,{asChild:!0,...h,orientation:l,dir:m,loop:u,children:y.jsx(Ne.div,{role:"radiogroup","aria-required":s,"aria-orientation":l,"data-disabled":a?"":void 0,dir:m,...p,ref:t})})})});O7.displayName=_R;var D7="RadioGroupItem",A7=R.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...i}=e,o=zve(D7,n),s=o.disabled||r,a=T7(n),l=M7(n),c=R.useRef(null),u=rt(t,c),d=o.value===i.value,p=R.useRef(!1);return R.useEffect(()=>{const h=b=>{Fve.includes(b.key)&&(p.current=!0)},m=()=>p.current=!1;return document.addEventListener("keydown",h),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",m)}},[]),y.jsx(sC,{asChild:!0,...a,focusable:!s,active:d,children:y.jsx(C7,{disabled:s,required:o.required,checked:d,...l,...i,name:o.name,ref:u,onCheck:()=>o.onValueChange(i.value),onKeyDown:Re(h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:Re(i.onFocus,()=>{var h;p.current&&((h=c.current)==null||h.click())})})})});A7.displayName=D7;var Bve="RadioGroupIndicator",k7=R.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,i=M7(n);return y.jsx(R7,{...i,...r,ref:t})});k7.displayName=Bve;var I7=O7,N7=A7,Hve=k7;const Vh=R.forwardRef(({className:e,...t},n)=>y.jsx(I7,{className:be("grid gap-2",e),...t,ref:n}));Vh.displayName=I7.displayName;const Vl=R.forwardRef(({className:e,...t},n)=>y.jsx(N7,{ref:n,className:be("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:y.jsx(Hve,{className:"flex items-center justify-center",children:y.jsx(LC,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Vl.displayName=N7.displayName;function Vve({filter:e}){var o;const{filteredRecords:t,handleChange:n,selectedRecords:r}=wR(e);function i(s){n([{value:s,id:s}])}return y.jsx(Vh,{onValueChange:i,value:((o=r==null?void 0:r[0])==null?void 0:o.value)||"",className:"mt-2 flex gap-3 overflow-x-auto",children:t==null?void 0:t.map(s=>y.jsxs("div",{className:"flex gap-2",children:[y.jsx(Vl,{value:s.value,id:"r1"}),y.jsx(wn,{className:"text-muted-foreground",htmlFor:"r1",children:s.value})]},s.value))})}function CR({filter:e}){return Ed(e.dataType)?y.jsx(xbe,{filter:e}):e.uiType==="radio"&&e.type==="single"?y.jsx(Vve,{filter:e}):y.jsx(Ave,{filter:e})}function Wve({frame:e}){const[t,n]=P.useState(!1),r=e==null?void 0:e.cards[0],{data:i}=Wa(r),o=e==null?void 0:e.cards[1],{data:s,isLoading:a,isFetching:l}=Wa(o);return(o==null?void 0:o.type)!=="text"?y.jsx(Zb,{card:r,data:(i==null?void 0:i.records)||[]}):y.jsxs(cc,{className:be("group relative overflow-y-auto",t?"m-4":"mx-0"),children:[t?y.jsx("div",{className:"overflow-y-auto break-words p-1",children:y.jsx(oy,{card:o,data:(s==null?void 0:s.records)||[],isLoading:!1})}):y.jsx(Zb,{card:r,data:(i==null?void 0:i.records)||[]}),y.jsx("div",{className:be("fixed z-10",{"invisible bottom-4 right-4 group-hover:visible":t,"right-6 top-6":!t}),children:y.jsx(T0,{disabled:a||l,className:be("h-7 p-1"),pressed:t,onPressedChange:n,"aria-label":"Toggle bold",children:t?y.jsx(t4,{className:"size-4 text-muted-foreground/70"}):y.jsx(n4,{className:"size-4 text-muted-foreground/70"})})})]})}function Uve({card:e,frame:t}){var V,L,U;const{customCards:n,placeholders:r}=Vi(),i=ye(B=>B.themeStyle),o=ye(B=>B.selectedSheetId),s=ye(B=>B.isDashboardEditing),a=ye(B=>B.selectedLensId),l=ye(B=>B.dashboard.filters),c=l==null?void 0:l.find(B=>B.id===t.filterId&&!B.hide),{setCardTitle:u,setCardDescription:d,setSelectedFrameId:p,updateFilter:h}=Hn(),{updateFrame:m}=Hn(),b=((V=e.customCardPreferences)==null?void 0:V.showCardHeader)??!0,{isError:v,isLoading:x,isFetching:S,cfg:_,visualKey:E,data:C,handleDatapointClick:M}=hL(e);function O(){var B,W,q;if(n&&n.length>0){const A=n.find(Y=>Y.cardId===e.id);if(A&&A.replaceDefault){const Y=A.content;if(Y)return y.jsx(Y,{card:e})}}if(e.type==="kpi"){if(((B=t==null?void 0:t.cards)==null?void 0:B.length)===1)return y.jsx(Zb,{card:e,data:(C==null?void 0:C.records)||[]});if(((W=t==null?void 0:t.cards)==null?void 0:W.length)>1)return y.jsx(Wve,{frame:t})}return e.type==="text"&&((q=t==null?void 0:t.cards)==null?void 0:q.length)===1?y.jsx(cc,{className:"mx-3 my-6 overflow-y-auto break-words px-3",children:y.jsx(oy,{isLoading:x||S,card:e,data:(C==null?void 0:C.records)||[]})}):X}function k(){return["{{ filters | where }}","{{ filters | and }}"].some(W=>{var q;return(q=e.sql)==null?void 0:q.includes(W)})?y.jsx(lde,{}):null}function N(){if(v)return y.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:[y.jsx(s4,{className:"size-8 text-destructive"}),y.jsx("p",{className:"text-sm text-muted-foreground",children:"Error fetching data. Check your card settings."})]});if(C!=null&&C.records&&(C==null?void 0:C.records.length)===0)return r!=null&&r.NoRecords?y.jsx("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:r.NoRecords}):y.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:[y.jsx(u4,{className:"size-8 text-muted-foreground"}),y.jsx("p",{className:"text-sm text-muted-foreground",children:"No records to display"})]});if(e.type==="table"&&(C!=null&&C.records)&&(C==null?void 0:C.records.length)>0)return y.jsxs(cc,{className:"relative flex h-full min-h-0 w-full flex-1 grow basis-0",children:[y.jsx(IF,{card:e,data:(C==null?void 0:C.records)||[]}),y.jsx($p,{orientation:"horizontal"})]});if(e.type==="text")return y.jsx(cc,{className:"overflow-y-auto break-words pr-2",children:y.jsx(oy,{isLoading:x||S,card:e,data:(C==null?void 0:C.records)||[]})});if(e.type==="custom")return y.jsx(Khe,{frame:t,card:e});if(n&&n.length>0){const B=n.find(W=>W.cardId===e.id);if(B&&B.content){const W=B.content;return y.jsx(W,{card:e})}}if(_)return y.jsx(UE,{cfg:_,onDatapointClick:M},`${E}-${a}`)}function F(){if(n&&n.length>0){const B=n.find(W=>W.cardId===e.id);if(B&&B.footer){const W=B.footer;if(W)return y.jsx(W,{card:e})}}return null}function j(){var B,W,q;return y.jsx(cC,{value:t.activeCardId,className:"flex items-center justify-end gap-3",onValueChange:A=>{const Y={...t,activeCardId:A};m(o,Y)},children:y.jsx(Fy,{style:{borderRadius:(W=(B=i==null?void 0:i.chart)==null?void 0:B.options)==null?void 0:W.borderRadius},className:"flex-end flex-wrap items-center",children:(q=t.cards.filter(A=>{var Y;return!((Y=A.tabTitle)!=null&&Y.endsWith("__Header"))&&(A.displayTab===!0||A.displayTab===void 0)}))==null?void 0:q.map(A=>{var Y,G;return y.jsx(jy,{style:{borderRadius:(G=(Y=i==null?void 0:i.chart)==null?void 0:Y.options)==null?void 0:G.borderRadius},value:A.id,children:A.tabTitle||A.title},A.id)})})})}function $(){let B=t.cards.find(W=>W.type==="kpi"&&W.tabTitle===`${e.tabTitle}__Header`);return B||(B=t.cards.find(W=>W.type==="kpi"&&W.tabTitle==="All__Header")),B?y.jsx("div",{className:"flex items-end gap-2",children:y.jsx(yue,{renderFilterInfo:k,card:B})}):y.jsxs(y.Fragment,{children:[y.jsxs("div",{role:"card-title-container",className:"flex items-center gap-2",children:[y.jsx(rs,{text:e.title,onSave:W=>u(o,e.id,W),children:y.jsx(Rd,{className:be("text-base",{}),children:e.title})}),(s||e.info)&&y.jsx(KL,{card:e}),e.refreshInterval&&y.jsxs(r6,{children:[y.jsx(i6,{className:"pr-1",children:y.jsx("div",{className:be("h-2 w-2 rounded-full bg-green-500 transition-opacity",{"opacity-10":x||S})})}),y.jsx(kE,{side:"right",align:"center",children:y.jsx("p",{className:"text-xs",children:`Realtime (${e==null?void 0:e.refreshInterval})`})})]}),k()]}),y.jsx("div",{role:"card-description-container",children:y.jsx(rs,{text:(e==null?void 0:e.description)||"",onSave:W=>d(o,e.id,W),children:y.jsxs(rC,{className:be("",{}),children:[" ",e.description]})})})]})}if(!e.id)return null;const X=y.jsxs(y.Fragment,{children:[b?y.jsx(Ay,{children:y.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[y.jsx("div",{className:"grow",role:"header-container",children:$()}),y.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.cards.length>1&&j(),y.jsx("div",{children:c&&y.jsxs("div",{style:{borderRadius:(U=(L=i==null?void 0:i.chart)==null?void 0:L.options)==null?void 0:U.borderRadius},role:"frame-filter-container",className:"flex h-10 shrink-0 items-center bg-muted p-1",children:[!Ed(c.dataType)&&y.jsx(rs,{className:"my-1",containerClassName:"shrink-0",text:c.title||c.column,onSave:B=>h({...c,title:B}),children:y.jsx(wn,{className:"px-3",children:c.title})}),y.jsx(CR,{filter:c})]})})]})]})}):y.jsx("div",{className:"h-8"}),y.jsx(ky,{className:"relative flex min-h-0 grow flex-col",children:N()}),y.jsx(ON,{children:F()})]});return y.jsx("div",{className:be("flex h-full flex-col",{"animate-pulse":x||S}),children:O()})}function Gve({frame:e,footer:t,className:n,...r}){var b,v;const i=P.useRef(null),o=ye(x=>x.themeStyle),s=ye(x=>x.selectedFrameId),a=ye(x=>x.isDashboardEditing),{setSelectedFrameId:l}=Hn(),{setSelectedConnectionId:c,setSelectedDatabaseName:u,setSelectedSchemaName:d,setSelectedTableName:p}=Qy(),h=e.cards.find(x=>x.id===e.activeCardId);Fee(e,i);function m(x){x.stopPropagation(),l(e.id),h!=null&&h.connectionId&&c(h==null?void 0:h.connectionId),h!=null&&h.lastSelectedDatabase&&u(h==null?void 0:h.lastSelectedDatabase),h!=null&&h.lastSelectedSchema&&d(h==null?void 0:h.lastSelectedSchema),h!=null&&h.lastSelectedTable&&p(h==null?void 0:h.lastSelectedTable)}return y.jsx(e0,{FallbackComponent:$C,children:y.jsxs("div",{tabIndex:-1,ref:i,role:"card-frame",onClick:m,style:{borderRadius:(v=(b=o==null?void 0:o.chart)==null?void 0:b.options)==null?void 0:v.borderRadius},className:be("relative flex h-full flex-col rounded-sm border bg-background shadow-sm",{"border-dashed border-foreground/50":s===e.id&&a},o==null?void 0:o.dashboardCard,n,"semaphor-card-frame"),...r,children:[y.jsx(f4,{frame:e}),y.jsx(Uve,{card:h,frame:e},h.id)]})})}const ER=R.forwardRef(({className:e,...t},n)=>y.jsx("textarea",{className:be("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));ER.displayName="Textarea";function qve({label:e,onCheckedChange:t,checked:n}){return y.jsxs("div",{className:"flex items-center space-x-2",children:[y.jsx(j0,{onCheckedChange:t,id:"terms",checked:n}),y.jsx("label",{htmlFor:"terms",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:e})]})}function Yve({text:e}){const[t,n]=P.useState(!1);return y.jsx("button",{onClick:()=>{navigator.clipboard.writeText(e),n(!0),setTimeout(()=>{n(!1)},1e3)},className:"h-7 px-1",children:t?y.jsxs(Fd,{openDelay:0,children:[y.jsx(jd,{children:y.jsx(Td,{className:"size-3.5"})}),y.jsx(Fc,{side:"top",className:"w-fit p-2 text-xs",children:"Copied to clipboard"})]}):y.jsx(q5,{className:"size-3.5 text-muted-foreground hover:text-foreground"})})}function Kve({filter:e}){const[t,n]=P.useState(e.sql),[r,i]=P.useState(!1),o=ye(h=>h.selectedSheetId),{updateFilter:s,updateFilterId:a}=Hn();function l(){const h={...e,sql:t};s(h),i(!1)}function c(h){console.log("operation",h);const m={...e,operation:h};s(m)}function u(h){const m={...e,type:h};s(m)}function d(h){const m={...e,uiType:h};s(m)}function p(h){if(!o)return;const m={...e,sheetId:h?o:void 0};s(m)}return y.jsxs(R0,{open:r,onOpenChange:i,children:[y.jsx(P0,{children:y.jsx(l4,{className:"invisible h-3 w-3 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"})}),y.jsxs(jp,{onMouseDown:h=>h.stopPropagation(),onDoubleClick:h=>h.stopPropagation(),className:"z-50 m-2 w-full min-w-[350px] space-y-4",children:[y.jsxs("div",{className:"space-y-2",children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("p",{className:"font-semibold text-foreground",children:e.column}),y.jsx("div",{className:"flex items-center gap-2",children:y.jsxs(Fd,{children:[y.jsx(jd,{children:y.jsx(Z5,{className:"size-5 cursor-pointer text-muted-foreground hover:text-foreground/80"})}),y.jsxs(Fc,{align:"start",className:"flex w-auto items-center gap-2 px-3 py-2",children:[y.jsx("p",{className:"font-mono text-xs text-muted-foreground",children:e.id}),y.jsx(Yve,{text:e.id})]})]})})]}),y.jsx("p",{className:"text-sm text-muted-foreground",children:"Customize filter operation and SQL"})]}),y.jsx(kp,{}),y.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[y.jsxs("div",{className:"space-y-2",children:[y.jsx(wn,{children:"Type"}),y.jsxs(Vh,{onValueChange:u,value:e.type||"multiple",className:"flex gap-3",defaultValue:"x",children:[y.jsxs("div",{className:"flex items-center space-x-2",children:[y.jsx(Vl,{value:"multiple",id:"r1"}),y.jsx("label",{className:"text-sm",htmlFor:"r1",children:"Multiple"})]}),y.jsxs("div",{className:"flex items-center space-x-2",children:[y.jsx(Vl,{value:"single",id:"r2"}),y.jsx("label",{className:"text-sm",htmlFor:"r2",children:"Single"})]})]})]}),e.type==="single"&&y.jsxs("div",{className:"space-y-2",children:[y.jsx(wn,{children:"Filter Element"}),y.jsxs(Vh,{onValueChange:d,value:e.uiType||"dropdown",className:"flex gap-3",defaultValue:"x",children:[y.jsxs("div",{className:"flex items-center space-x-2",children:[y.jsx(Vl,{value:"dropdown",id:"r2"}),y.jsx("label",{className:"text-sm",htmlFor:"r2",children:"Dropdown"})]}),y.jsxs("div",{className:"flex items-center space-x-2",children:[y.jsx(Vl,{value:"radio",id:"r1"}),y.jsx("label",{className:"text-sm",htmlFor:"r1",children:"Radio"})]})]})]})]}),y.jsxs("div",{className:"grid grid-cols-6 gap-4 text-sm",children:[y.jsxs("div",{className:"col-span-2 space-y-1",children:[y.jsx(wn,{children:"Table Column"}),y.jsx(wn,{className:"block rounded-md bg-muted p-2 font-mono text-xs",children:e.column})]}),y.jsxs("div",{className:"col-span-2 space-y-1",children:[y.jsx(wn,{children:"Data Type"}),y.jsx(wn,{className:"block rounded-md bg-muted p-2 font-mono text-xs",children:e.dataType})]}),y.jsxs("div",{className:"col-span-2 space-y-1",children:[y.jsx(wn,{className:"text-sm",children:"Filter Operation"}),y.jsx(Xve,{updateFilterOperation:c,value:e.operation})]})]}),y.jsxs("div",{className:"flex grow flex-col space-y-1",role:"container",children:[y.jsx(wn,{className:"text-sm",children:"Values SQL"}),y.jsx(ER,{onKeyDown:h=>{h.stopPropagation()},value:t,onChange:h=>n(h.target.value),className:`min-w-full grow resize font-mono text-xs ${eh}`})]}),y.jsx("div",{children:y.jsx(qve,{label:"Local to sheet",onCheckedChange:p,checked:!!e.sheetId})}),y.jsx("div",{className:"flex justify-end gap-2",children:y.jsxs(pi,{onClick:l,size:"sm",variant:"outline",children:[y.jsx(Td,{className:"mr-2 size-4"}),"Accept"]})})]})]})}function Xve({value:e,updateFilterOperation:t}){return y.jsxs(js,{defaultValue:"in",value:e,onValueChange:n=>t(n),children:[y.jsx(Vo,{className:"h-8 w-[180px] focus:ring-0 focus:ring-offset-0",children:y.jsx($s,{placeholder:"Operation"})}),y.jsxs(Wo,{children:[y.jsx(kn,{value:"=",children:"Equals"}),y.jsx(kn,{value:"in",children:"Contains"}),y.jsx(kn,{value:"like",children:"Like"})]})]})}function L7({filter:e}){const t=ye(a=>a.isDashboardEditing),n=ye(a=>a.filterValues),r=n==null?void 0:n.some(a=>a.filterId===e.id),{removeFilterValues:i,removeFilter:o,updateFilter:s}=Hn();return y.jsx(rs,{className:"my-1",text:e.title||e.column,onSave:a=>s({...e,title:a}),children:y.jsxs("div",{className:"group mb-1 flex grow items-center justify-between",children:[y.jsxs("div",{className:"flex grow items-center gap-2",children:[y.jsx(wn,{className:"inline-block text-sm",children:e.title}),r&&y.jsx("button",{onClick:()=>i(e.id),className:"text-foreground/30 hover:text-foreground/50",children:y.jsx(FC,{className:"size-3.5"})}),t&&y.jsx("button",{className:"invisible group-hover:visible",onClick:()=>{s({...e,hide:!e.hide})},children:e.hide?y.jsx(X5,{className:"size-3.5 text-foreground/50 hover:text-foreground/70"}):y.jsx(K5,{className:"size-3.5 text-foreground/50 hover:text-foreground/70"})}),t&&y.jsx(Kve,{filter:e})]}),y.jsx("div",{className:"flex items-center gap-2",children:t&&y.jsx(Md,{onClick:()=>{i(e.id),o(e.id)},className:"size-3.5 cursor-pointer text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})})]})})}var Qve=e=>{switch(e){case"success":return exe;case"info":return nxe;case"warning":return txe;case"error":return rxe;default:return null}},Jve=Array(12).fill(0),Zve=({visible:e,className:t})=>P.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},P.createElement("div",{className:"sonner-spinner"},Jve.map((n,r)=>P.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),exe=P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},P.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),txe=P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},P.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),nxe=P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},P.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),rxe=P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},P.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),ixe=P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},P.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),P.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),oxe=()=>{let[e,t]=P.useState(document.hidden);return P.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},p_=1,sxe=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,i=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:p_++,o=this.toasts.find(a=>a.id===i),s=e.dismissible===void 0?!0:e.dismissible;return o?this.toasts=this.toasts.map(a=>a.id===i?(this.publish({...a,...e,id:i,title:n}),{...a,...e,id:i,dismissible:s,title:n}):a):this.addToast({title:n,...r,dismissible:s,id:i}),i},this.dismiss=e=>(e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),i=n!==void 0,o,s=r.then(async l=>{if(o=["resolve",l],P.isValidElement(l))i=!1,this.create({id:n,type:"default",message:l});else if(lxe(l)&&!l.ok){i=!1;let c=typeof t.error=="function"?await t.error(`HTTP error! status: ${l.status}`):t.error,u=typeof t.description=="function"?await t.description(`HTTP error! status: ${l.status}`):t.description;this.create({id:n,type:"error",message:c,description:u})}else if(t.success!==void 0){i=!1;let c=typeof t.success=="function"?await t.success(l):t.success,u=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"success",message:c,description:u})}}).catch(async l=>{if(o=["reject",l],t.error!==void 0){i=!1;let c=typeof t.error=="function"?await t.error(l):t.error,u=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"error",message:c,description:u})}}).finally(()=>{var l;i&&(this.dismiss(n),n=void 0),(l=t.finally)==null||l.call(t)}),a=()=>new Promise((l,c)=>s.then(()=>o[0]==="reject"?c(o[1]):l(o[1])).catch(c));return typeof n!="string"&&typeof n!="number"?{unwrap:a}:Object.assign(n,{unwrap:a})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||p_++;return this.create({jsx:e(n),id:n,...t}),n},this.subscribers=[],this.toasts=[]}},Di=new sxe,axe=(e,t)=>{let n=(t==null?void 0:t.id)||p_++;return Di.addToast({title:e,...t,id:n}),n},lxe=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",cxe=axe,uxe=()=>Di.toasts,F7=Object.assign(cxe,{success:Di.success,info:Di.info,warning:Di.warning,error:Di.error,custom:Di.custom,message:Di.message,promise:Di.promise,dismiss:Di.dismiss,loading:Di.loading},{getHistory:uxe});function dxe(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}dxe(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
|
376
|
-
`);function $m(e){return e.label!==void 0}var fxe=3,hxe="32px",pxe="16px",hk=4e3,gxe=356,mxe=14,bxe=20,yxe=200;function yo(...e){return e.filter(Boolean).join(" ")}function vxe(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var xxe=e=>{var t,n,r,i,o,s,a,l,c,u,d;let{invert:p,toast:h,unstyled:m,interacting:b,setHeights:v,visibleToasts:x,heights:S,index:_,toasts:E,expanded:C,removeToast:M,defaultRichColors:O,closeButton:k,style:N,cancelButtonStyle:F,actionButtonStyle:j,className:$="",descriptionClassName:X="",duration:V,position:L,gap:U,loadingIcon:B,expandByDefault:W,classNames:q,icons:A,closeButtonAriaLabel:Y="Close toast",pauseWhenPageIsHidden:G}=e,[D,ee]=P.useState(null),[K,oe]=P.useState(null),[J,Z]=P.useState(!1),[ae,ce]=P.useState(!1),[pe,ie]=P.useState(!1),[ge,de]=P.useState(!1),[Ee,De]=P.useState(!1),[$e,Te]=P.useState(0),[ze,yt]=P.useState(0),Mt=P.useRef(h.duration||V||hk),mn=P.useRef(null),Ot=P.useRef(null),un=_===0,Zt=_+1<=x,fe=h.type,_e=h.dismissible!==!1,Be=h.className||"",Je=h.descriptionClassName||"",st=P.useMemo(()=>S.findIndex(Le=>Le.toastId===h.id)||0,[S,h.id]),On=P.useMemo(()=>{var Le;return(Le=h.closeButton)!=null?Le:k},[h.closeButton,k]),Fn=P.useMemo(()=>h.duration||V||hk,[h.duration,V]),Rn=P.useRef(0),on=P.useRef(0),jn=P.useRef(0),en=P.useRef(null),[nr,Kn]=L.split("-"),Ui=P.useMemo(()=>S.reduce((Le,vt,Bt)=>Bt>=st?Le:Le+vt.height,0),[S,st]),yr=oxe(),Lo=h.invert||p,vr=fe==="loading";on.current=P.useMemo(()=>st*U+Ui,[st,Ui]),P.useEffect(()=>{Mt.current=Fn},[Fn]),P.useEffect(()=>{Z(!0)},[]),P.useEffect(()=>{let Le=Ot.current;if(Le){let vt=Le.getBoundingClientRect().height;return yt(vt),v(Bt=>[{toastId:h.id,height:vt,position:h.position},...Bt]),()=>v(Bt=>Bt.filter(Xn=>Xn.toastId!==h.id))}},[v,h.id]),P.useLayoutEffect(()=>{if(!J)return;let Le=Ot.current,vt=Le.style.height;Le.style.height="auto";let Bt=Le.getBoundingClientRect().height;Le.style.height=vt,yt(Bt),v(Xn=>Xn.find(Qn=>Qn.toastId===h.id)?Xn.map(Qn=>Qn.toastId===h.id?{...Qn,height:Bt}:Qn):[{toastId:h.id,height:Bt,position:h.position},...Xn])},[J,h.title,h.description,v,h.id]);let Ir=P.useCallback(()=>{ce(!0),Te(on.current),v(Le=>Le.filter(vt=>vt.toastId!==h.id)),setTimeout(()=>{M(h)},yxe)},[h,M,v,on]);P.useEffect(()=>{if(h.promise&&fe==="loading"||h.duration===1/0||h.type==="loading")return;let Le;return C||b||G&&yr?(()=>{if(jn.current<Rn.current){let vt=new Date().getTime()-Rn.current;Mt.current=Mt.current-vt}jn.current=new Date().getTime()})():Mt.current!==1/0&&(Rn.current=new Date().getTime(),Le=setTimeout(()=>{var vt;(vt=h.onAutoClose)==null||vt.call(h,h),Ir()},Mt.current)),()=>clearTimeout(Le)},[C,b,h,fe,G,yr,Ir]),P.useEffect(()=>{h.delete&&Ir()},[Ir,h.delete]);function ll(){var Le,vt,Bt;return A!=null&&A.loading?P.createElement("div",{className:yo(q==null?void 0:q.loader,(Le=h==null?void 0:h.classNames)==null?void 0:Le.loader,"sonner-loader"),"data-visible":fe==="loading"},A.loading):B?P.createElement("div",{className:yo(q==null?void 0:q.loader,(vt=h==null?void 0:h.classNames)==null?void 0:vt.loader,"sonner-loader"),"data-visible":fe==="loading"},B):P.createElement(Zve,{className:yo(q==null?void 0:q.loader,(Bt=h==null?void 0:h.classNames)==null?void 0:Bt.loader),visible:fe==="loading"})}return P.createElement("li",{tabIndex:0,ref:Ot,className:yo($,Be,q==null?void 0:q.toast,(t=h==null?void 0:h.classNames)==null?void 0:t.toast,q==null?void 0:q.default,q==null?void 0:q[fe],(n=h==null?void 0:h.classNames)==null?void 0:n[fe]),"data-sonner-toast":"","data-rich-colors":(r=h.richColors)!=null?r:O,"data-styled":!(h.jsx||h.unstyled||m),"data-mounted":J,"data-promise":!!h.promise,"data-swiped":Ee,"data-removed":ae,"data-visible":Zt,"data-y-position":nr,"data-x-position":Kn,"data-index":_,"data-front":un,"data-swiping":pe,"data-dismissible":_e,"data-type":fe,"data-invert":Lo,"data-swipe-out":ge,"data-swipe-direction":K,"data-expanded":!!(C||W&&J),style:{"--index":_,"--toasts-before":_,"--z-index":E.length-_,"--offset":`${ae?$e:on.current}px`,"--initial-height":W?"auto":`${ze}px`,...N,...h.style},onPointerDown:Le=>{vr||!_e||(mn.current=new Date,Te(on.current),Le.target.setPointerCapture(Le.pointerId),Le.target.tagName!=="BUTTON"&&(ie(!0),en.current={x:Le.clientX,y:Le.clientY}))},onPointerUp:()=>{var Le,vt,Bt,Xn;if(ge||!_e)return;en.current=null;let Qn=Number(((Le=Ot.current)==null?void 0:Le.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Nr=Number(((vt=Ot.current)==null?void 0:vt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ur=new Date().getTime()-((Bt=mn.current)==null?void 0:Bt.getTime()),rr=D==="x"?Qn:Nr,bn=Math.abs(rr)/ur;if(Math.abs(rr)>=bxe||bn>.11){Te(on.current),(Xn=h.onDismiss)==null||Xn.call(h,h),oe(D==="x"?Qn>0?"right":"left":Nr>0?"down":"up"),Ir(),de(!0),De(!1);return}ie(!1),ee(null)},onPointerMove:Le=>{var vt,Bt,Xn,Qn;if(!en.current||!_e||((vt=window.getSelection())==null?void 0:vt.toString().length)>0)return;let Nr=Le.clientY-en.current.y,ur=Le.clientX-en.current.x,rr=(Bt=e.swipeDirections)!=null?Bt:vxe(L);!D&&(Math.abs(ur)>1||Math.abs(Nr)>1)&&ee(Math.abs(ur)>Math.abs(Nr)?"x":"y");let bn={x:0,y:0};D==="y"?(rr.includes("top")||rr.includes("bottom"))&&(rr.includes("top")&&Nr<0||rr.includes("bottom")&&Nr>0)&&(bn.y=Nr):D==="x"&&(rr.includes("left")||rr.includes("right"))&&(rr.includes("left")&&ur<0||rr.includes("right")&&ur>0)&&(bn.x=ur),(Math.abs(bn.x)>0||Math.abs(bn.y)>0)&&De(!0),(Xn=Ot.current)==null||Xn.style.setProperty("--swipe-amount-x",`${bn.x}px`),(Qn=Ot.current)==null||Qn.style.setProperty("--swipe-amount-y",`${bn.y}px`)}},On&&!h.jsx?P.createElement("button",{"aria-label":Y,"data-disabled":vr,"data-close-button":!0,onClick:vr||!_e?()=>{}:()=>{var Le;Ir(),(Le=h.onDismiss)==null||Le.call(h,h)},className:yo(q==null?void 0:q.closeButton,(i=h==null?void 0:h.classNames)==null?void 0:i.closeButton)},(o=A==null?void 0:A.close)!=null?o:ixe):null,h.jsx||P.isValidElement(h.title)?h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title:P.createElement(P.Fragment,null,fe||h.icon||h.promise?P.createElement("div",{"data-icon":"",className:yo(q==null?void 0:q.icon,(s=h==null?void 0:h.classNames)==null?void 0:s.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||ll():null,h.type!=="loading"?h.icon||(A==null?void 0:A[fe])||Qve(fe):null):null,P.createElement("div",{"data-content":"",className:yo(q==null?void 0:q.content,(a=h==null?void 0:h.classNames)==null?void 0:a.content)},P.createElement("div",{"data-title":"",className:yo(q==null?void 0:q.title,(l=h==null?void 0:h.classNames)==null?void 0:l.title)},typeof h.title=="function"?h.title():h.title),h.description?P.createElement("div",{"data-description":"",className:yo(X,Je,q==null?void 0:q.description,(c=h==null?void 0:h.classNames)==null?void 0:c.description)},typeof h.description=="function"?h.description():h.description):null),P.isValidElement(h.cancel)?h.cancel:h.cancel&&$m(h.cancel)?P.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||F,onClick:Le=>{var vt,Bt;$m(h.cancel)&&_e&&((Bt=(vt=h.cancel).onClick)==null||Bt.call(vt,Le),Ir())},className:yo(q==null?void 0:q.cancelButton,(u=h==null?void 0:h.classNames)==null?void 0:u.cancelButton)},h.cancel.label):null,P.isValidElement(h.action)?h.action:h.action&&$m(h.action)?P.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||j,onClick:Le=>{var vt,Bt;$m(h.action)&&((Bt=(vt=h.action).onClick)==null||Bt.call(vt,Le),!Le.defaultPrevented&&Ir())},className:yo(q==null?void 0:q.actionButton,(d=h==null?void 0:h.classNames)==null?void 0:d.actionButton)},h.action.label):null))};function pk(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function wxe(e,t){let n={};return[e,t].forEach((r,i)=>{let o=i===1,s=o?"--mobile-offset":"--offset",a=o?pxe:hxe;function l(c){["top","right","bottom","left"].forEach(u=>{n[`${s}-${u}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${s}-${c}`]=a:n[`${s}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):l(a)}),n}var Sxe=P.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:i=["altKey","KeyT"],expand:o,closeButton:s,className:a,offset:l,mobileOffset:c,theme:u="light",richColors:d,duration:p,style:h,visibleToasts:m=fxe,toastOptions:b,dir:v=pk(),gap:x=mxe,loadingIcon:S,icons:_,containerAriaLabel:E="Notifications",pauseWhenPageIsHidden:C}=e,[M,O]=P.useState([]),k=P.useMemo(()=>Array.from(new Set([r].concat(M.filter(G=>G.position).map(G=>G.position)))),[M,r]),[N,F]=P.useState([]),[j,$]=P.useState(!1),[X,V]=P.useState(!1),[L,U]=P.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),B=P.useRef(null),W=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),q=P.useRef(null),A=P.useRef(!1),Y=P.useCallback(G=>{O(D=>{var ee;return(ee=D.find(K=>K.id===G.id))!=null&&ee.delete||Di.dismiss(G.id),D.filter(({id:K})=>K!==G.id)})},[]);return P.useEffect(()=>Di.subscribe(G=>{if(G.dismiss){O(D=>D.map(ee=>ee.id===G.id?{...ee,delete:!0}:ee));return}setTimeout(()=>{Tr.flushSync(()=>{O(D=>{let ee=D.findIndex(K=>K.id===G.id);return ee!==-1?[...D.slice(0,ee),{...D[ee],...G},...D.slice(ee+1)]:[G,...D]})})})}),[]),P.useEffect(()=>{if(u!=="system"){U(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?U("dark"):U("light")),typeof window>"u")return;let G=window.matchMedia("(prefers-color-scheme: dark)");try{G.addEventListener("change",({matches:D})=>{U(D?"dark":"light")})}catch{G.addListener(({matches:ee})=>{try{U(ee?"dark":"light")}catch(K){console.error(K)}})}},[u]),P.useEffect(()=>{M.length<=1&&$(!1)},[M]),P.useEffect(()=>{let G=D=>{var ee,K;i.every(oe=>D[oe]||D.code===oe)&&($(!0),(ee=B.current)==null||ee.focus()),D.code==="Escape"&&(document.activeElement===B.current||(K=B.current)!=null&&K.contains(document.activeElement))&&$(!1)};return document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G)},[i]),P.useEffect(()=>{if(B.current)return()=>{q.current&&(q.current.focus({preventScroll:!0}),q.current=null,A.current=!1)}},[B.current]),P.createElement("section",{ref:t,"aria-label":`${E} ${W}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},k.map((G,D)=>{var ee;let[K,oe]=G.split("-");return M.length?P.createElement("ol",{key:G,dir:v==="auto"?pk():v,tabIndex:-1,ref:B,className:a,"data-sonner-toaster":!0,"data-theme":L,"data-y-position":K,"data-lifted":j&&M.length>1&&!o,"data-x-position":oe,style:{"--front-toast-height":`${((ee=N[0])==null?void 0:ee.height)||0}px`,"--width":`${gxe}px`,"--gap":`${x}px`,...h,...wxe(l,c)},onBlur:J=>{A.current&&!J.currentTarget.contains(J.relatedTarget)&&(A.current=!1,q.current&&(q.current.focus({preventScroll:!0}),q.current=null))},onFocus:J=>{J.target instanceof HTMLElement&&J.target.dataset.dismissible==="false"||A.current||(A.current=!0,q.current=J.relatedTarget)},onMouseEnter:()=>$(!0),onMouseMove:()=>$(!0),onMouseLeave:()=>{X||$(!1)},onPointerDown:J=>{J.target instanceof HTMLElement&&J.target.dataset.dismissible==="false"||V(!0)},onPointerUp:()=>V(!1)},M.filter(J=>!J.position&&D===0||J.position===G).map((J,Z)=>{var ae,ce;return P.createElement(xxe,{key:J.id,icons:_,index:Z,toast:J,defaultRichColors:d,duration:(ae=b==null?void 0:b.duration)!=null?ae:p,className:b==null?void 0:b.className,descriptionClassName:b==null?void 0:b.descriptionClassName,invert:n,visibleToasts:m,closeButton:(ce=b==null?void 0:b.closeButton)!=null?ce:s,interacting:X,position:G,style:b==null?void 0:b.style,unstyled:b==null?void 0:b.unstyled,classNames:b==null?void 0:b.classNames,cancelButtonStyle:b==null?void 0:b.cancelButtonStyle,actionButtonStyle:b==null?void 0:b.actionButtonStyle,removeToast:Y,toasts:M.filter(pe=>pe.position==J.position),heights:N.filter(pe=>pe.position==J.position),setHeights:F,expandByDefault:o,gap:x,loadingIcon:S,expanded:j,pauseWhenPageIsHidden:C,swipeDirections:e.swipeDirections})})):null}))});function _xe(){const{getSelectedFrame:e,addFrame:t,setSelectedFrameId:n}=Hn(),r=ye(l=>l.dashboard.sheets),o=ye(l=>l.selectedSheetId)??(r==null?void 0:r[0].id),s=ye(l=>l.isDashboardEditing),a=ye(l=>l.isVisualEditing);P.useEffect(()=>{if(!s||a)return;async function l(d){const p=d.ctrlKey||d.metaKey;p&&d.key==="c"?(await c(),F7.success("Card copied to clipboard"),d.preventDefault()):p&&d.key==="v"&&(await u(),d.preventDefault())}async function c(){try{const d=e();d&&await navigator.clipboard.writeText(JSON.stringify(d))}catch(d){console.error("Failed to copy text:",d)}}async function u(){if(!o)return null;try{const d=await navigator.clipboard.readText();try{const p=JSON.parse(d);if(p&&p.id){p.id=Va();const h=p.activeCardId;p.cards.forEach(m=>{const b=m.id;m.id=Va(),b===h&&(p.activeCardId=m.id,m.title=`${m.title} (Copy)`)}),t(o,p),n(p.id)}}catch(p){console.error("Failed to parse clipboard contents: ",p)}return d}catch(d){return console.error("Failed to paste text:",d),null}}return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[t,e,n,o,s,a])}const Cxe=WM.WidthProvider(WM.Responsive);function Exe({sheet:e}){var v,x,S;const t=ye(_=>_.isDashboardEditing),n=ye(_=>_.currentBreakpoint),r=ye(_=>_.themeStyle);P.useState([]);const i=ye(_=>_.selectedSheetId);ye(_=>_.selectedLensId);const o=e.layouts,s=ye(_=>_.dashboard.filters),a=e.frames,{setSheetLayouts:l,setCurrentBreakpoint:c}=ye(_=>_.actions);P.useEffect(()=>{var _,E;document.documentElement.style.setProperty("--placeholder-border-radius",`${(E=(_=r==null?void 0:r.chart)==null?void 0:_.options)==null?void 0:E.borderRadius}px`)},[(x=(v=r==null?void 0:r.chart)==null?void 0:v.options)==null?void 0:x.borderRadius]),_xe();function u(_){c(_)}function d(_,E){i===e.id&&l(i,E)}if(!i)return null;const p=(_,E)=>y.jsx(j7,{className:"after:content-none",ref:E,handleAxis:_}),h=_=>_&&(_==null?void 0:_.h)===1&&(_==null?void 0:_.w)===1?{..._,h:8,minH:7,w:7}:null;function m(){const _=s==null?void 0:s.filter(E=>(E.sheetId===i||!E.sheetId)&&!E.hide);return _==null?void 0:_.map(E=>{var O,k,N;const C=(O=o==null?void 0:o[n])==null?void 0:O.find(F=>F.i===E.id);if(E.location==="frame")return null;const M=h(C);return y.jsxs("div",{style:{borderRadius:(N=(k=r==null?void 0:r.chart)==null?void 0:k.options)==null?void 0:N.borderRadius},className:be("z-50 flex flex-col rounded-md border bg-background px-3 py-2"),...M?{"data-grid":M}:{},children:[y.jsx(L7,{filter:E}),y.jsx(CR,{filter:E})]},E.id)})}function b(){return a==null?void 0:a.map(_=>y.jsx("div",{role:"dashboard-frame-container",className:be("group isolate overflow-hidden",r==null?void 0:r.dashboardCardContainer),children:y.jsx(e0,{FallbackComponent:({error:E,resetErrorBoundary:C})=>y.jsx(zee,{error:E,resetErrorBoundary:C,frame:_}),children:y.jsx(Gve,{frame:_})})},_.id))}return y.jsx(y.Fragment,{children:y.jsxs(Cxe,{margin:[10,10],isDraggable:t,resizeHandles:t?["sw","nw","ne","se","e","w"]:[],className:be((S=r==null?void 0:r.gridLayout)==null?void 0:S.className),layouts:o,cols:{lg:48,md:36,sm:24,xs:12,xxs:6},rowHeight:1,onBreakpointChange:u,onLayoutChange:d,resizeHandle:p,children:[m(),b()]})})}const j7=P.forwardRef(({className:e,handleAxis:t,...n},r)=>{var s,a;const i=ye(l=>l.themeStyle),o=(a=(s=i==null?void 0:i.chart)==null?void 0:s.options)==null?void 0:a.borderRadius;return y.jsx("div",{ref:r,className:be(`react-resizable-handle z-10 react-resizable-handle-${t} absolute border-foreground/40`,{"border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-r-0":t==="nw"&&o<11,"border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-l-0":t==="ne"&&o<11,"border-foreground/40 group-hover:border-2 group-hover:border-r-0 group-hover:border-t-0":t==="sw"&&o<11,"border-foreground/40 group-hover:border-2 group-hover:border-l-0 group-hover:border-t-0":t==="se"&&o<11,"border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-l-0 group-hover:border-t-0":t==="e","border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-r-0 group-hover:border-t-0":t==="w"},e),...n})});j7.displayName="ResizeHandle";var $7="vercel.ai.error",Rxe=Symbol.for($7),z7,Pxe=class B7 extends Error{constructor({name:t,message:n,cause:r}){super(n),this[z7]=!0,this.name=t,this.cause=r}static isInstance(t){return B7.hasMarker(t,$7)}static hasMarker(t,n){const r=Symbol.for(n);return t!=null&&typeof t=="object"&&r in t&&typeof t[r]=="boolean"&&t[r]===!0}};z7=Rxe;var Sd=Pxe;function H7(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var V7="AI_InvalidArgumentError",W7=`vercel.ai.error.${V7}`,Txe=Symbol.for(W7),U7,Mxe=class extends Sd{constructor({message:e,cause:t,argument:n}){super({name:V7,message:e,cause:t}),this[U7]=!0,this.argument=n}static isInstance(e){return Sd.hasMarker(e,W7)}};U7=Txe;var G7="AI_JSONParseError",q7=`vercel.ai.error.${G7}`,Oxe=Symbol.for(q7),Y7,gk=class extends Sd{constructor({text:e,cause:t}){super({name:G7,message:`JSON parsing failed: Text: ${e}.
|
|
377
|
-
Error message: ${H7(t)}`,cause:t}),this[Y7]=!0,this.text=e}static isInstance(e){return Sd.hasMarker(e,q7)}};Y7=Oxe;var K7="AI_TypeValidationError",X7=`vercel.ai.error.${K7}`,Dxe=Symbol.for(X7),Q7,Axe=class g_ extends Sd{constructor({value:t,cause:n}){super({name:K7,message:`Type validation failed: Value: ${JSON.stringify(t)}.
|
|
378
|
-
Error message: ${H7(n)}`,cause:n}),this[Q7]=!0,this.value=t}static isInstance(t){return Sd.hasMarker(t,X7)}static wrap({value:t,cause:n}){return g_.isInstance(n)&&n.value===t?n:new g_({value:t,cause:n})}};Q7=Dxe;var mk=Axe;let kxe=(e,t=21)=>(n=t)=>{let r="",i=n|0;for(;i--;)r+=e[Math.random()*e.length|0];return r};var Hd={exports:{}};const Ixe=typeof Buffer<"u",bk=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,yk=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function J7(e,t,n){n==null&&t!==null&&typeof t=="object"&&(n=t,t=void 0),Ixe&&Buffer.isBuffer(e)&&(e=e.toString()),e&&e.charCodeAt(0)===65279&&(e=e.slice(1));const r=JSON.parse(e,t);if(r===null||typeof r!="object")return r;const i=n&&n.protoAction||"error",o=n&&n.constructorAction||"error";if(i==="ignore"&&o==="ignore")return r;if(i!=="ignore"&&o!=="ignore"){if(bk.test(e)===!1&&yk.test(e)===!1)return r}else if(i!=="ignore"&&o==="ignore"){if(bk.test(e)===!1)return r}else if(yk.test(e)===!1)return r;return Z7(r,{protoAction:i,constructorAction:o,safe:n&&n.safe})}function Z7(e,{protoAction:t="error",constructorAction:n="error",safe:r}={}){let i=[e];for(;i.length;){const o=i;i=[];for(const s of o){if(t!=="ignore"&&Object.prototype.hasOwnProperty.call(s,"__proto__")){if(r===!0)return null;if(t==="error")throw new SyntaxError("Object contains forbidden prototype property");delete s.__proto__}if(n!=="ignore"&&Object.prototype.hasOwnProperty.call(s,"constructor")&&Object.prototype.hasOwnProperty.call(s.constructor,"prototype")){if(r===!0)return null;if(n==="error")throw new SyntaxError("Object contains forbidden prototype property");delete s.constructor}for(const a in s){const l=s[a];l&&typeof l=="object"&&i.push(l)}}}return e}function RR(e,t,n){const r=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return J7(e,t,n)}finally{Error.stackTraceLimit=r}}function Nxe(e,t){const n=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return J7(e,t,{safe:!0})}catch{return null}finally{Error.stackTraceLimit=n}}Hd.exports=RR;Hd.exports.default=RR;Hd.exports.parse=RR;Hd.exports.safeParse=Nxe;Hd.exports.scan=Z7;var Lxe=Hd.exports;const Fxe=Oc(Lxe);var jxe=({prefix:e,size:t=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const i=kxe(n,t);if(e==null)return i;if(n.includes(r))throw new Mxe({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return o=>`${e}${r}${i(o)}`},ej=jxe(),m_=Symbol.for("vercel.ai.validator");function $xe(e){return{[m_]:!0,validate:e}}function zxe(e){return typeof e=="object"&&e!==null&&m_ in e&&e[m_]===!0&&"validate"in e}function Bxe(e){return zxe(e)?e:Hxe(e)}function Hxe(e){return $xe(t=>{const n=e.safeParse(t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}})}function Vxe({value:e,schema:t}){const n=Bxe(t);try{if(n.validate==null)return{success:!0,value:e};const r=n.validate(e);return r.success?r:{success:!1,error:mk.wrap({value:e,cause:r.error})}}catch(r){return{success:!1,error:mk.wrap({value:e,cause:r})}}}function vk({text:e,schema:t}){try{const n=Fxe.parse(e);return t==null?{success:!0,value:n}:Vxe({value:n,schema:t})}catch(n){return{success:!1,error:gk.isInstance(n)?n:new gk({text:e,cause:n})}}}new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");var Wh={code:"0",name:"text",parse:e=>{if(typeof e!="string")throw new Error('"text" parts expect a string value.');return{type:"text",value:e}}},Uh={code:"3",name:"error",parse:e=>{if(typeof e!="string")throw new Error('"error" parts expect a string value.');return{type:"error",value:e}}},Gh={code:"4",name:"assistant_message",parse:e=>{if(e==null||typeof e!="object"||!("id"in e)||!("role"in e)||!("content"in e)||typeof e.id!="string"||typeof e.role!="string"||e.role!=="assistant"||!Array.isArray(e.content)||!e.content.every(t=>t!=null&&typeof t=="object"&&"type"in t&&t.type==="text"&&"text"in t&&t.text!=null&&typeof t.text=="object"&&"value"in t.text&&typeof t.text.value=="string"))throw new Error('"assistant_message" parts expect an object with an "id", "role", and "content" property.');return{type:"assistant_message",value:e}}},qh={code:"5",name:"assistant_control_data",parse:e=>{if(e==null||typeof e!="object"||!("threadId"in e)||!("messageId"in e)||typeof e.threadId!="string"||typeof e.messageId!="string")throw new Error('"assistant_control_data" parts expect an object with a "threadId" and "messageId" property.');return{type:"assistant_control_data",value:{threadId:e.threadId,messageId:e.messageId}}}},Yh={code:"6",name:"data_message",parse:e=>{if(e==null||typeof e!="object"||!("role"in e)||!("data"in e)||typeof e.role!="string"||e.role!=="data")throw new Error('"data_message" parts expect an object with a "role" and "data" property.');return{type:"data_message",value:e}}},Wxe=[Wh,Uh,Gh,qh,Yh];Wh.code+"",Uh.code+"",Gh.code+"",qh.code+"",Yh.code+"";Wh.name+"",Wh.code,Uh.name+"",Uh.code,Gh.name+"",Gh.code,qh.name+"",qh.code,Yh.name+"",Yh.code;Wxe.map(e=>e.code);function Uxe(e){const t=["ROOT"];let n=-1,r=null;function i(l,c,u){switch(l){case'"':{n=c,t.pop(),t.push(u),t.push("INSIDE_STRING");break}case"f":case"t":case"n":{n=c,r=c,t.pop(),t.push(u),t.push("INSIDE_LITERAL");break}case"-":{t.pop(),t.push(u),t.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=c,t.pop(),t.push(u),t.push("INSIDE_NUMBER");break}case"{":{n=c,t.pop(),t.push(u),t.push("INSIDE_OBJECT_START");break}case"[":{n=c,t.pop(),t.push(u),t.push("INSIDE_ARRAY_START");break}}}function o(l,c){switch(l){case",":{t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{n=c,t.pop();break}}}function s(l,c){switch(l){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=c,t.pop();break}}}for(let l=0;l<e.length;l++){const c=e[l];switch(t[t.length-1]){case"ROOT":i(c,l,"FINISH");break;case"INSIDE_OBJECT_START":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}case"}":{n=l,t.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}}break}case"INSIDE_OBJECT_KEY":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY");break}}break}case"INSIDE_OBJECT_AFTER_KEY":{switch(c){case":":{t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE");break}}break}case"INSIDE_OBJECT_BEFORE_VALUE":{i(c,l,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{o(c,l);break}case"INSIDE_STRING":{switch(c){case'"':{t.pop(),n=l;break}case"\\":{t.push("INSIDE_STRING_ESCAPE");break}default:n=l}break}case"INSIDE_ARRAY_START":{switch(c){case"]":{n=l,t.pop();break}default:{n=l,i(c,l,"INSIDE_ARRAY_AFTER_VALUE");break}}break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(c){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=l,t.pop();break}default:{n=l;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{i(c,l,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{t.pop(),n=l;break}case"INSIDE_NUMBER":{switch(c){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=l;break}case"e":case"E":case"-":case".":break;case",":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(c,l),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&o(c,l);break}case"}":{t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&o(c,l);break}case"]":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(c,l);break}default:{t.pop();break}}break}case"INSIDE_LITERAL":{const d=e.substring(r,l+1);!"false".startsWith(d)&&!"true".startsWith(d)&&!"null".startsWith(d)?(t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?o(c,l):t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(c,l)):n=l;break}}}let a=e.slice(0,n+1);for(let l=t.length-1;l>=0;l--)switch(t[l]){case"INSIDE_STRING":{a+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{a+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{a+="]";break}case"INSIDE_LITERAL":{const u=e.substring(r,e.length);"true".startsWith(u)?a+="true".slice(u.length):"false".startsWith(u)?a+="false".slice(u.length):"null".startsWith(u)&&(a+="null".slice(u.length))}}return a}function Gxe(e){if(e===void 0)return{value:void 0,state:"undefined-input"};let t=vk({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=vk({text:Uxe(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var Kh={code:"0",name:"text",parse:e=>{if(typeof e!="string")throw new Error('"text" parts expect a string value.');return{type:"text",value:e}}},Xh={code:"2",name:"data",parse:e=>{if(!Array.isArray(e))throw new Error('"data" parts expect an array value.');return{type:"data",value:e}}},Qh={code:"3",name:"error",parse:e=>{if(typeof e!="string")throw new Error('"error" parts expect a string value.');return{type:"error",value:e}}},Jh={code:"8",name:"message_annotations",parse:e=>{if(!Array.isArray(e))throw new Error('"message_annotations" parts expect an array value.');return{type:"message_annotations",value:e}}},Zh={code:"9",name:"tool_call",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("toolName"in e)||typeof e.toolName!="string"||!("args"in e)||typeof e.args!="object")throw new Error('"tool_call" parts expect an object with a "toolCallId", "toolName", and "args" property.');return{type:"tool_call",value:e}}},ep={code:"a",name:"tool_result",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("result"in e))throw new Error('"tool_result" parts expect an object with a "toolCallId" and a "result" property.');return{type:"tool_result",value:e}}},tp={code:"b",name:"tool_call_streaming_start",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("toolName"in e)||typeof e.toolName!="string")throw new Error('"tool_call_streaming_start" parts expect an object with a "toolCallId" and "toolName" property.');return{type:"tool_call_streaming_start",value:e}}},np={code:"c",name:"tool_call_delta",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("argsTextDelta"in e)||typeof e.argsTextDelta!="string")throw new Error('"tool_call_delta" parts expect an object with a "toolCallId" and "argsTextDelta" property.');return{type:"tool_call_delta",value:e}}},rp={code:"d",name:"finish_message",parse:e=>{if(e==null||typeof e!="object"||!("finishReason"in e)||typeof e.finishReason!="string")throw new Error('"finish_message" parts expect an object with a "finishReason" property.');const t={finishReason:e.finishReason};return"usage"in e&&e.usage!=null&&typeof e.usage=="object"&&"promptTokens"in e.usage&&"completionTokens"in e.usage&&(t.usage={promptTokens:typeof e.usage.promptTokens=="number"?e.usage.promptTokens:Number.NaN,completionTokens:typeof e.usage.completionTokens=="number"?e.usage.completionTokens:Number.NaN}),{type:"finish_message",value:t}}},ip={code:"e",name:"finish_step",parse:e=>{if(e==null||typeof e!="object"||!("finishReason"in e)||typeof e.finishReason!="string")throw new Error('"finish_step" parts expect an object with a "finishReason" property.');const t={finishReason:e.finishReason,isContinued:!1};return"usage"in e&&e.usage!=null&&typeof e.usage=="object"&&"promptTokens"in e.usage&&"completionTokens"in e.usage&&(t.usage={promptTokens:typeof e.usage.promptTokens=="number"?e.usage.promptTokens:Number.NaN,completionTokens:typeof e.usage.completionTokens=="number"?e.usage.completionTokens:Number.NaN}),"isContinued"in e&&typeof e.isContinued=="boolean"&&(t.isContinued=e.isContinued),{type:"finish_step",value:t}}},op={code:"f",name:"start_step",parse:e=>{if(e==null||typeof e!="object"||!("messageId"in e)||typeof e.messageId!="string")throw new Error('"start_step" parts expect an object with an "id" property.');return{type:"start_step",value:{messageId:e.messageId}}}},qxe=[Kh,Xh,Qh,Jh,Zh,ep,tp,np,rp,ip,op],Yxe={[Kh.code]:Kh,[Xh.code]:Xh,[Qh.code]:Qh,[Jh.code]:Jh,[Zh.code]:Zh,[ep.code]:ep,[tp.code]:tp,[np.code]:np,[rp.code]:rp,[ip.code]:ip,[op.code]:op};Kh.name+"",Kh.code,Xh.name+"",Xh.code,Qh.name+"",Qh.code,Jh.name+"",Jh.code,Zh.name+"",Zh.code,ep.name+"",ep.code,tp.name+"",tp.code,np.name+"",np.code,rp.name+"",rp.code,ip.name+"",ip.code,op.name+"",op.code;var Kxe=qxe.map(e=>e.code),Xxe=e=>{const t=e.indexOf(":");if(t===-1)throw new Error("Failed to parse stream string. No separator found.");const n=e.slice(0,t);if(!Kxe.includes(n))throw new Error(`Failed to parse stream string. Invalid code ${n}.`);const r=n,i=e.slice(t+1),o=JSON.parse(i);return Yxe[r].parse(o)},Qxe=10;function Jxe(e,t){const n=new Uint8Array(t);let r=0;for(const i of e)n.set(i,r),r+=i.length;return e.length=0,n}async function Zxe({stream:e,onTextPart:t,onDataPart:n,onErrorPart:r,onToolCallStreamingStartPart:i,onToolCallDeltaPart:o,onToolCallPart:s,onToolResultPart:a,onMessageAnnotationsPart:l,onFinishMessagePart:c,onFinishStepPart:u,onStartStepPart:d}){const p=e.getReader(),h=new TextDecoder,m=[];let b=0;for(;;){const{value:v}=await p.read();if(v&&(m.push(v),b+=v.length,v[v.length-1]!==Qxe))continue;if(m.length===0)break;const x=Jxe(m,b);b=0;const S=h.decode(x,{stream:!0}).split(`
|
|
379
|
-
`).filter(_=>_!=="").map(Xxe);for(const{type:_,value:E}of S)switch(_){case"text":await(t==null?void 0:t(E));break;case"data":await(n==null?void 0:n(E));break;case"error":await(r==null?void 0:r(E));break;case"message_annotations":await(l==null?void 0:l(E));break;case"tool_call_streaming_start":await(i==null?void 0:i(E));break;case"tool_call_delta":await(o==null?void 0:o(E));break;case"tool_call":await(s==null?void 0:s(E));break;case"tool_result":await(a==null?void 0:a(E));break;case"finish_message":await(c==null?void 0:c(E));break;case"finish_step":await(u==null?void 0:u(E));break;case"start_step":await(d==null?void 0:d(E));break;default:{const C=_;throw new Error(`Unknown stream part type: ${C}`)}}}}function e1e({promptTokens:e,completionTokens:t}){return{promptTokens:e,completionTokens:t,totalTokens:e+t}}async function t1e({stream:e,update:t,onToolCall:n,onFinish:r,generateId:i=ej,getCurrentDate:o=()=>new Date}){const s=o();let a,l=!0,c;const u=[],d=[];let p;const h={};let m={completionTokens:NaN,promptTokens:NaN,totalTokens:NaN},b="unknown";function v(){const S=[...d];if(a==null){t(u,S);return}p!=null&&p.length&&(a.annotations=p);const _={...JSON.parse(JSON.stringify(a)),revisionId:i(),createdAt:a.createdAt};t([...u,_],S)}function x(){return(l||a==null)&&(a!=null&&u.push(a),a={id:c??i(),role:"assistant",content:"",createdAt:s},l=!1,c=void 0),a}await Zxe({stream:e,onTextPart(S){const _=x();a={..._,content:_.content+S},v()},onToolCallStreamingStartPart(S){const _=x();_.toolInvocations==null&&(_.toolInvocations=[]),h[S.toolCallId]={text:"",toolName:S.toolName,index:_.toolInvocations.length},_.toolInvocations.push({state:"partial-call",toolCallId:S.toolCallId,toolName:S.toolName,args:void 0}),v()},onToolCallDeltaPart(S){const _=x(),E=h[S.toolCallId];E.text+=S.argsTextDelta;const{value:C}=Gxe(E.text);_.toolInvocations[E.index]={state:"partial-call",toolCallId:S.toolCallId,toolName:E.toolName,args:C},v()},async onToolCallPart(S){const _=x();if(h[S.toolCallId]!=null?_.toolInvocations[h[S.toolCallId].index]={state:"call",...S}:(_.toolInvocations==null&&(_.toolInvocations=[]),_.toolInvocations.push({state:"call",...S})),n){const E=await n({toolCall:S});E!=null&&(_.toolInvocations[_.toolInvocations.length-1]={state:"result",...S,result:E})}v()},onToolResultPart(S){const E=x().toolInvocations;if(E==null)throw new Error("tool_result must be preceded by a tool_call");const C=E.findIndex(M=>M.toolCallId===S.toolCallId);if(C===-1)throw new Error("tool_result must be preceded by a tool_call with the same toolCallId");E[C]={...E[C],state:"result",...S},v()},onDataPart(S){d.push(...S),v()},onMessageAnnotationsPart(S){p==null?p=[...S]:p.push(...S),v()},onFinishStepPart(S){l=!S.isContinued},onStartStepPart(S){c=S.messageId},onFinishMessagePart(S){b=S.finishReason,S.usage!=null&&(m=e1e(S.usage))},onErrorPart(S){throw new Error(S)}}),r==null||r({message:a,finishReason:b,usage:m})}async function n1e({stream:e,onTextPart:t}){const n=e.pipeThrough(new TextDecoderStream).getReader();for(;;){const{done:r,value:i}=await n.read();if(r)break;await t(i)}}var r1e=()=>fetch;async function i1e({api:e,body:t,streamProtocol:n="data",credentials:r,headers:i,abortController:o,restoreMessagesOnFailure:s,onResponse:a,onUpdate:l,onFinish:c,onToolCall:u,generateId:d,fetch:p=r1e()}){var h,m;const b=await p(e,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",...i},signal:(h=o==null?void 0:o())==null?void 0:h.signal,credentials:r}).catch(v=>{throw s(),v});if(a)try{await a(b)}catch(v){throw v}if(!b.ok)throw s(),new Error((m=await b.text())!=null?m:"Failed to fetch the chat response.");if(!b.body)throw new Error("The response body is empty.");switch(n){case"text":{const v={id:d(),createdAt:new Date,role:"assistant",content:""};await n1e({stream:b.body,onTextPart:x=>{v.content+=x,l([{...v}],[])}}),c==null||c(v,{usage:{completionTokens:NaN,promptTokens:NaN,totalTokens:NaN},finishReason:"unknown"});return}case"data":{await t1e({stream:b.body,update:l,onToolCall:u,onFinish({message:v,finishReason:x,usage:S}){c&&v!=null&&c(v,{usage:S,finishReason:x})},generateId:d});return}default:{const v=n;throw new Error(`Unknown stream protocol: ${v}`)}}}async function xk(e){if(!e)return[];if(e instanceof FileList)return Promise.all(Array.from(e).map(async t=>{const{name:n,type:r}=t,i=await new Promise((o,s)=>{const a=new FileReader;a.onload=l=>{var c;o((c=l.target)==null?void 0:c.result)},a.onerror=l=>s(l),a.readAsDataURL(t)});return{name:n,contentType:r,url:i}}));if(Array.isArray(e))return e;throw new Error("Invalid attachments type")}var tj=V_(),wk=Object.prototype.hasOwnProperty;function b_(e,t){var n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&b_(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(wk.call(e,n)&&++r&&!wk.call(t,n)||!(n in t)||!b_(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const Ws=new WeakMap,$a=()=>{},Yr=$a(),y_=Object,Ht=e=>e===Yr,Jo=e=>typeof e=="function",Za=(e,t)=>({...e,...t}),nj=e=>Jo(e.then),z1={},zm={},PR="undefined",$0=typeof window!=PR,v_=typeof document!=PR,o1e=()=>$0&&typeof window.requestAnimationFrame!=PR,rj=(e,t)=>{const n=Ws.get(e);return[()=>!Ht(t)&&e.get(t)||z1,r=>{if(!Ht(t)){const i=e.get(t);t in zm||(zm[t]=i),n[5](t,Za(i,r),i||z1)}},n[6],()=>!Ht(t)&&t in zm?zm[t]:!Ht(t)&&e.get(t)||z1]};let x_=!0;const s1e=()=>x_,[w_,S_]=$0&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[$a,$a],a1e=()=>{const e=v_&&document.visibilityState;return Ht(e)||e!=="hidden"},l1e=e=>(v_&&document.addEventListener("visibilitychange",e),w_("focus",e),()=>{v_&&document.removeEventListener("visibilitychange",e),S_("focus",e)}),c1e=e=>{const t=()=>{x_=!0,e()},n=()=>{x_=!1};return w_("online",t),w_("offline",n),()=>{S_("online",t),S_("offline",n)}},u1e={isOnline:s1e,isVisible:a1e},d1e={initFocus:l1e,initReconnect:c1e},Sk=!P.useId,sp=!$0||"Deno"in globalThis,f1e=e=>o1e()?window.requestAnimationFrame(e):setTimeout(e,1),B1=sp?P.useEffect:P.useLayoutEffect,H1=typeof navigator<"u"&&navigator.connection,_k=!sp&&H1&&(["slow-2g","2g"].includes(H1.effectiveType)||H1.saveData),Bm=new WeakMap,V1=(e,t)=>y_.prototype.toString.call(e)===`[object ${t}]`;let h1e=0;const __=e=>{const t=typeof e,n=V1(e,"Date"),r=V1(e,"RegExp"),i=V1(e,"Object");let o,s;if(y_(e)===e&&!n&&!r){if(o=Bm.get(e),o)return o;if(o=++h1e+"~",Bm.set(e,o),Array.isArray(e)){for(o="@",s=0;s<e.length;s++)o+=__(e[s])+",";Bm.set(e,o)}if(i){o="#";const a=y_.keys(e).sort();for(;!Ht(s=a.pop());)Ht(e[s])||(o+=s+":"+__(e[s])+",");Bm.set(e,o)}}else o=n?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return o},TR=e=>{if(Jo(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?__(e):"",[e,t]};let p1e=0;const C_=()=>++p1e,ij=0,oj=1,sj=2,g1e=3;var Of={__proto__:null,ERROR_REVALIDATE_EVENT:g1e,FOCUS_EVENT:ij,MUTATE_EVENT:sj,RECONNECT_EVENT:oj};async function aj(...e){const[t,n,r,i]=e,o=Za({populateCache:!0,throwOnError:!0},typeof i=="boolean"?{revalidate:i}:i||{});let s=o.populateCache;const a=o.rollbackOnError;let l=o.optimisticData;const c=p=>typeof a=="function"?a(p):a!==!1,u=o.throwOnError;if(Jo(n)){const p=n,h=[],m=t.keys();for(const b of m)!/^\$(inf|sub)\$/.test(b)&&p(t.get(b)._k)&&h.push(b);return Promise.all(h.map(d))}return d(n);async function d(p){const[h]=TR(p);if(!h)return;const[m,b]=rj(t,h),[v,x,S,_]=Ws.get(t),E=()=>{const X=v[h];return(Jo(o.revalidate)?o.revalidate(m().data,p):o.revalidate!==!1)&&(delete S[h],delete _[h],X&&X[0])?X[0](sj).then(()=>m().data):m().data};if(e.length<3)return E();let C=r,M;const O=C_();x[h]=[O,0];const k=!Ht(l),N=m(),F=N.data,j=N._c,$=Ht(j)?F:j;if(k&&(l=Jo(l)?l($,F):l,b({data:l,_c:$})),Jo(C))try{C=C($)}catch(X){M=X}if(C&&nj(C))if(C=await C.catch(X=>{M=X}),O!==x[h][0]){if(M)throw M;return C}else M&&k&&c(M)&&(s=!0,b({data:$,_c:Yr}));if(s&&!M)if(Jo(s)){const X=s(C,$);b({data:X,error:Yr,_c:Yr})}else b({data:C,error:Yr,_c:Yr});if(x[h][1]=C_(),Promise.resolve(E()).then(()=>{b({_c:Yr})}),M){if(u)throw M;return}return C}}const Ck=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},m1e=(e,t)=>{if(!Ws.has(e)){const n=Za(d1e,t),r={},i=aj.bind(Yr,e);let o=$a;const s={},a=(u,d)=>{const p=s[u]||[];return s[u]=p,p.push(d),()=>p.splice(p.indexOf(d),1)},l=(u,d,p)=>{e.set(u,d);const h=s[u];if(h)for(const m of h)m(d,p)},c=()=>{if(!Ws.has(e)&&(Ws.set(e,[r,{},{},{},i,l,a]),!sp)){const u=n.initFocus(setTimeout.bind(Yr,Ck.bind(Yr,r,ij))),d=n.initReconnect(setTimeout.bind(Yr,Ck.bind(Yr,r,oj)));o=()=>{u&&u(),d&&d(),Ws.delete(e)}}};return c(),[e,i,c,o]}return[e,Ws.get(e)[4]]},b1e=(e,t,n,r,i)=>{const o=n.errorRetryCount,s=i.retryCount,a=~~((Math.random()+.5)*(1<<(s<8?s:8)))*n.errorRetryInterval;!Ht(o)&&s>o||setTimeout(r,a,i)},y1e=b_,[lj,v1e]=m1e(new Map),x1e=Za({onLoadingSlow:$a,onSuccess:$a,onError:$a,onErrorRetry:b1e,onDiscarded:$a,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:_k?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:_k?5e3:3e3,compare:y1e,isPaused:()=>!1,cache:lj,mutate:v1e,fallback:{}},u1e),w1e=(e,t)=>{const n=Za(e,t);if(t){const{use:r,fallback:i}=e,{use:o,fallback:s}=t;r&&o&&(n.use=r.concat(o)),i&&s&&(n.fallback=Za(i,s))}return n},S1e=P.createContext({}),_1e="$inf$",cj=$0&&window.__SWR_DEVTOOLS_USE__,C1e=cj?window.__SWR_DEVTOOLS_USE__:[],E1e=()=>{cj&&(window.__SWR_DEVTOOLS_REACT__=P)},R1e=e=>Jo(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],P1e=()=>Za(x1e,P.useContext(S1e)),T1e=e=>(t,n,r)=>e(t,n&&((...o)=>{const[s]=TR(t),[,,,a]=Ws.get(lj);if(s.startsWith(_1e))return n(...o);const l=a[s];return Ht(l)?n(...o):(delete a[s],l)}),r),M1e=C1e.concat(T1e),O1e=e=>function(...n){const r=P1e(),[i,o,s]=R1e(n),a=w1e(r,s);let l=e;const{use:c}=a,u=(c||[]).concat(M1e);for(let d=u.length;d--;)l=u[d](l);return l(i,o||a.fetcher||null,a)},D1e=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const i=r.indexOf(n);i>=0&&(r[i]=r[r.length-1],r.pop())}};E1e();const W1=P.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),U1={dedupe:!0},A1e=(e,t,n)=>{const{cache:r,compare:i,suspense:o,fallbackData:s,revalidateOnMount:a,revalidateIfStale:l,refreshInterval:c,refreshWhenHidden:u,refreshWhenOffline:d,keepPreviousData:p}=n,[h,m,b,v]=Ws.get(r),[x,S]=TR(e),_=P.useRef(!1),E=P.useRef(!1),C=P.useRef(x),M=P.useRef(t),O=P.useRef(n),k=()=>O.current,N=()=>k().isVisible()&&k().isOnline(),[F,j,$,X]=rj(r,x),V=P.useRef({}).current,L=Ht(s)?Ht(n.fallback)?Yr:n.fallback[x]:s,U=(ie,ge)=>{for(const de in V){const Ee=de;if(Ee==="data"){if(!i(ie[Ee],ge[Ee])&&(!Ht(ie[Ee])||!i(K,ge[Ee])))return!1}else if(ge[Ee]!==ie[Ee])return!1}return!0},B=P.useMemo(()=>{const ie=!x||!t?!1:Ht(a)?k().isPaused()||o?!1:l!==!1:a,ge=ze=>{const yt=Za(ze);return delete yt._k,ie?{isValidating:!0,isLoading:!0,...yt}:yt},de=F(),Ee=X(),De=ge(de),$e=de===Ee?De:ge(Ee);let Te=De;return[()=>{const ze=ge(F());return U(ze,Te)?(Te.data=ze.data,Te.isLoading=ze.isLoading,Te.isValidating=ze.isValidating,Te.error=ze.error,Te):(Te=ze,ze)},()=>$e]},[r,x]),W=tj.useSyncExternalStore(P.useCallback(ie=>$(x,(ge,de)=>{U(de,ge)||ie()}),[r,x]),B[0],B[1]),q=!_.current,A=h[x]&&h[x].length>0,Y=W.data,G=Ht(Y)?L&&nj(L)?W1(L):L:Y,D=W.error,ee=P.useRef(G),K=p?Ht(Y)?ee.current:Y:G,oe=A&&!Ht(D)?!1:q&&!Ht(a)?a:k().isPaused()?!1:o?Ht(G)?!1:l:Ht(G)||l,J=!!(x&&t&&q&&oe),Z=Ht(W.isValidating)?J:W.isValidating,ae=Ht(W.isLoading)?J:W.isLoading,ce=P.useCallback(async ie=>{const ge=M.current;if(!x||!ge||E.current||k().isPaused())return!1;let de,Ee,De=!0;const $e=ie||{},Te=!b[x]||!$e.dedupe,ze=()=>Sk?!E.current&&x===C.current&&_.current:x===C.current,yt={isValidating:!1,isLoading:!1},Mt=()=>{j(yt)},mn=()=>{const un=b[x];un&&un[1]===Ee&&delete b[x]},Ot={isValidating:!0};Ht(F().data)&&(Ot.isLoading=!0);try{if(Te&&(j(Ot),n.loadingTimeout&&Ht(F().data)&&setTimeout(()=>{De&&ze()&&k().onLoadingSlow(x,n)},n.loadingTimeout),b[x]=[ge(S),C_()]),[de,Ee]=b[x],de=await de,Te&&setTimeout(mn,n.dedupingInterval),!b[x]||b[x][1]!==Ee)return Te&&ze()&&k().onDiscarded(x),!1;yt.error=Yr;const un=m[x];if(!Ht(un)&&(Ee<=un[0]||Ee<=un[1]||un[1]===0))return Mt(),Te&&ze()&&k().onDiscarded(x),!1;const Zt=F().data;yt.data=i(Zt,de)?Zt:de,Te&&ze()&&k().onSuccess(de,x,n)}catch(un){mn();const Zt=k(),{shouldRetryOnError:fe}=Zt;Zt.isPaused()||(yt.error=un,Te&&ze()&&(Zt.onError(un,x,Zt),(fe===!0||Jo(fe)&&fe(un))&&(!k().revalidateOnFocus||!k().revalidateOnReconnect||N())&&Zt.onErrorRetry(un,x,Zt,_e=>{const Be=h[x];Be&&Be[0]&&Be[0](Of.ERROR_REVALIDATE_EVENT,_e)},{retryCount:($e.retryCount||0)+1,dedupe:!0})))}return De=!1,Mt(),!0},[x,r]),pe=P.useCallback((...ie)=>aj(r,C.current,...ie),[]);if(B1(()=>{M.current=t,O.current=n,Ht(Y)||(ee.current=Y)}),B1(()=>{if(!x)return;const ie=ce.bind(Yr,U1);let ge=0;const Ee=D1e(x,h,(De,$e={})=>{if(De==Of.FOCUS_EVENT){const Te=Date.now();k().revalidateOnFocus&&Te>ge&&N()&&(ge=Te+k().focusThrottleInterval,ie())}else if(De==Of.RECONNECT_EVENT)k().revalidateOnReconnect&&N()&&ie();else{if(De==Of.MUTATE_EVENT)return ce();if(De==Of.ERROR_REVALIDATE_EVENT)return ce($e)}});return E.current=!1,C.current=x,_.current=!0,j({_k:S}),oe&&(Ht(G)||sp?ie():f1e(ie)),()=>{E.current=!0,Ee()}},[x]),B1(()=>{let ie;function ge(){const Ee=Jo(c)?c(F().data):c;Ee&&ie!==-1&&(ie=setTimeout(de,Ee))}function de(){!F().error&&(u||k().isVisible())&&(d||k().isOnline())?ce(U1).then(ge):ge()}return ge(),()=>{ie&&(clearTimeout(ie),ie=-1)}},[c,u,d,x]),P.useDebugValue(K),o&&Ht(G)&&x){if(!Sk&&sp)throw new Error("Fallback data is required when using Suspense in SSR.");M.current=t,O.current=n,E.current=!1;const ie=v[x];if(!Ht(ie)){const ge=pe(ie);W1(ge)}if(Ht(D)){const ge=ce(U1);Ht(K)||(ge.status="fulfilled",ge.value=!0),W1(ge)}else throw D}return{mutate:pe,get data(){return V.data=!0,K},get error(){return V.error=!0,D},get isValidating(){return V.isValidating=!0,Z},get isLoading(){return V.isLoading=!0,ae}}},Hm=O1e(A1e);function k1e(e,t){if(typeof e!="function")throw new TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);let n,r=0;return function(...o){clearTimeout(n);const s=Date.now(),a=s-r,l=t-a;l<=0?(r=s,e.apply(this,o)):n=setTimeout(()=>{r=Date.now(),e.apply(this,o)},l)}}var I1e=k1e;const N1e=Oc(I1e);function Ek(e,t){return t!=null?N1e(e,t):e}var L1e=async(e,t,n,r,i,o,s,a,l,c,u,d,p,h,m,b,v,x)=>{var S;const _=s.current;n(t.messages,!1);const E=h?t.messages:t.messages.map(({role:M,content:O,experimental_attachments:k,data:N,annotations:F,toolInvocations:j})=>({role:M,content:O,...k!==void 0&&{experimental_attachments:k},...N!==void 0&&{data:N},...F!==void 0&&{annotations:F},...j!==void 0&&{toolInvocations:j}})),C=i.current;return await i1e({api:e,body:(S=m==null?void 0:m({id:x,messages:t.messages,requestData:t.data,requestBody:t.body}))!=null?S:{id:x,messages:E,data:t.data,...o.current.body,...t.body},streamProtocol:c,credentials:o.current.credentials,headers:{...o.current.headers,...t.headers},abortController:()=>a.current,restoreMessagesOnFailure(){v||n(_,!1)},onResponse:d,onUpdate(M,O){n([...t.messages,...M],!1),O!=null&&O.length&&r([...C??[],...O],!1)},onToolCall:p,onFinish:u,generateId:l,fetch:b})};function F1e({api:e="/api/chat",id:t,initialMessages:n,initialInput:r="",sendExtraMessageFields:i,onToolCall:o,experimental_prepareRequestBody:s,maxSteps:a=1,streamProtocol:l="data",onResponse:c,onFinish:u,onError:d,credentials:p,headers:h,body:m,generateId:b=ej,fetch:v,keepLastMessageOnError:x=!0,experimental_throttle:S}={}){const[_]=P.useState(b),E=t??_,C=typeof e=="string"?[e,E]:E,[M]=P.useState([]),{data:O,mutate:k}=Hm([C,"messages"],null,{fallbackData:n??M}),N=P.useRef(O||[]);P.useEffect(()=>{N.current=O||[]},[O]);const{data:F,mutate:j}=Hm([C,"streamData"],null),$=P.useRef(F);P.useEffect(()=>{$.current=F},[F]);const{data:X=!1,mutate:V}=Hm([C,"loading"],null),{data:L=void 0,mutate:U}=Hm([C,"error"],null),B=P.useRef(null),W=P.useRef({credentials:p,headers:h,body:m});P.useEffect(()=>{W.current={credentials:p,headers:h,body:m}},[p,h,m]);const q=P.useCallback(async ce=>{const pe=N.current.length;try{V(!0),U(void 0);const de=new AbortController;B.current=de,await L1e(e,ce,Ek(k,S),Ek(j,S),$,W,N,B,b,l,u,c,o,i,s,v,x,E),B.current=null}catch(de){if(de.name==="AbortError")return B.current=null,null;d&&de instanceof Error&&d(de),U(de)}finally{V(!1)}const ie=N.current,ge=ie[ie.length-1];ie.length>pe&&ge!=null&&a>1&&Rk(ge)&&j1e(ie)<a&&await q({messages:ie})},[k,V,e,W,c,u,d,U,j,$,l,i,s,o,a,N,B,b,v,x,S,E]),A=P.useCallback(async(ce,{data:pe,headers:ie,body:ge,experimental_attachments:de}={})=>{var Ee,De;const $e=await xk(de),Te=N.current.concat({...ce,id:(Ee=ce.id)!=null?Ee:b(),createdAt:(De=ce.createdAt)!=null?De:new Date,experimental_attachments:$e.length>0?$e:void 0});return q({messages:Te,headers:ie,body:ge,data:pe})},[q,b]),Y=P.useCallback(async({data:ce,headers:pe,body:ie}={})=>{const ge=N.current;if(ge.length===0)return null;const de=ge[ge.length-1];return q({messages:de.role==="assistant"?ge.slice(0,-1):ge,headers:pe,body:ie,data:ce})},[q]),G=P.useCallback(()=>{B.current&&(B.current.abort(),B.current=null)},[]),D=P.useCallback(ce=>{typeof ce=="function"&&(ce=ce(N.current)),k(ce,!1),N.current=ce},[k]),ee=P.useCallback(ce=>{typeof ce=="function"&&(ce=ce($.current)),j(ce,!1),$.current=ce},[j]),[K,oe]=P.useState(r),J=P.useCallback(async(ce,pe={},ie)=>{var ge;if((ge=ce==null?void 0:ce.preventDefault)==null||ge.call(ce),!K&&!pe.allowEmptySubmit)return;ie&&(W.current={...W.current,...ie});const de=await xk(pe.experimental_attachments),De={messages:!K&&!de.length&&pe.allowEmptySubmit?N.current:N.current.concat({id:b(),createdAt:new Date,role:"user",content:K,experimental_attachments:de.length>0?de:void 0}),headers:pe.headers,body:pe.body,data:pe.data};q(De),oe("")},[K,b,q]);return{messages:O||[],id:E,setMessages:D,data:F,setData:ee,error:L,append:A,reload:Y,stop:G,input:K,setInput:oe,handleInputChange:ce=>{oe(ce.target.value)},handleSubmit:J,isLoading:X,addToolResult:({toolCallId:ce,result:pe})=>{const ie=N.current.map((de,Ee,De)=>Ee===De.length-1&&de.role==="assistant"&&de.toolInvocations?{...de,toolInvocations:de.toolInvocations.map($e=>$e.toolCallId===ce?{...$e,result:pe,state:"result"}:$e)}:de);k(ie,!1);const ge=ie[ie.length-1];Rk(ge)&&q({messages:ie})}}}function Rk(e){return e.role==="assistant"&&e.toolInvocations&&e.toolInvocations.length>0&&e.toolInvocations.every(t=>"result"in t)}function j1e(e){let t=0;for(let n=e.length-1;n>=0&&e[n].role==="assistant";n--)t++;return t}var MR="Switch",[$1e,hMe]=tr(MR),[z1e,B1e]=$1e(MR),uj=R.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:o,required:s,disabled:a,value:l="on",onCheckedChange:c,form:u,...d}=e,[p,h]=R.useState(null),m=rt(t,_=>h(_)),b=R.useRef(!1),v=p?u||!!p.closest("form"):!0,[x=!1,S]=Ar({prop:i,defaultProp:o,onChange:c});return y.jsxs(z1e,{scope:n,checked:x,disabled:a,children:[y.jsx(Ne.button,{type:"button",role:"switch","aria-checked":x,"aria-required":s,"data-state":hj(x),"data-disabled":a?"":void 0,disabled:a,value:l,...d,ref:m,onClick:Re(e.onClick,_=>{S(E=>!E),v&&(b.current=_.isPropagationStopped(),b.current||_.stopPropagation())})}),v&&y.jsx(H1e,{control:p,bubbles:!b.current,name:r,value:l,checked:x,required:s,disabled:a,form:u,style:{transform:"translateX(-100%)"}})]})});uj.displayName=MR;var dj="SwitchThumb",fj=R.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,i=B1e(dj,n);return y.jsx(Ne.span,{"data-state":hj(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:t})});fj.displayName=dj;var H1e=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,o=R.useRef(null),s=x0(n),a=f0(t);return R.useEffect(()=>{const l=o.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&d){const p=new Event("click",{bubbles:r});d.call(l,n),l.dispatchEvent(p)}},[s,n,r]),y.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:o,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function hj(e){return e?"checked":"unchecked"}var z0=uj,pj=fj;const gj=R.forwardRef(({className:e,...t},n)=>y.jsx(z0,{className:be("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:y.jsx(pj,{className:be("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));gj.displayName=z0.displayName;const V1e=R.forwardRef(({className:e,...t},n)=>y.jsx(z0,{className:be("peer inline-flex h-4 w-8 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:y.jsx(pj,{className:be("pointer-events-none block h-3 w-3 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));V1e.displayName=z0.displayName;function W1e(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const U1e=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,G1e=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,q1e={};function Pk(e,t){return(q1e.jsx?G1e:U1e).test(e)}const Y1e=/[ \t\n\f\r]/g;function K1e(e){return typeof e=="object"?e.type==="text"?Tk(e.value):!1:Tk(e)}function Tk(e){return e.replace(Y1e,"")===""}class Kp{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}Kp.prototype.property={};Kp.prototype.normal={};Kp.prototype.space=null;function mj(e,t){const n={},r={};let i=-1;for(;++i<e.length;)Object.assign(n,e[i].property),Object.assign(r,e[i].normal);return new Kp(n,r,t)}function E_(e){return e.toLowerCase()}class ho{constructor(t,n){this.property=t,this.attribute=n}}ho.prototype.space=null;ho.prototype.boolean=!1;ho.prototype.booleanish=!1;ho.prototype.overloadedBoolean=!1;ho.prototype.number=!1;ho.prototype.commaSeparated=!1;ho.prototype.spaceSeparated=!1;ho.prototype.commaOrSpaceSeparated=!1;ho.prototype.mustUseProperty=!1;ho.prototype.defined=!1;let X1e=0;const lt=jc(),Wn=jc(),bj=jc(),Pe=jc(),hn=jc(),Lu=jc(),Ti=jc();function jc(){return 2**++X1e}const R_=Object.freeze(Object.defineProperty({__proto__:null,boolean:lt,booleanish:Wn,commaOrSpaceSeparated:Ti,commaSeparated:Lu,number:Pe,overloadedBoolean:bj,spaceSeparated:hn},Symbol.toStringTag,{value:"Module"})),G1=Object.keys(R_);class OR extends ho{constructor(t,n,r,i){let o=-1;if(super(t,n),Mk(this,"space",i),typeof r=="number")for(;++o<G1.length;){const s=G1[o];Mk(this,G1[o],(r&R_[s])===R_[s])}}}OR.prototype.defined=!0;function Mk(e,t,n){n&&(e[t]=n)}const Q1e={}.hasOwnProperty;function Vd(e){const t={},n={};let r;for(r in e.properties)if(Q1e.call(e.properties,r)){const i=e.properties[r],o=new OR(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[E_(r)]=r,n[E_(o.attribute)]=r}return new Kp(t,n,e.space)}const yj=Vd({space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),vj=Vd({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function xj(e,t){return t in e?e[t]:t}function wj(e,t){return xj(e,t.toLowerCase())}const Sj=Vd({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:wj,properties:{xmlns:null,xmlnsXLink:null}}),_j=Vd({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:Wn,ariaAutoComplete:null,ariaBusy:Wn,ariaChecked:Wn,ariaColCount:Pe,ariaColIndex:Pe,ariaColSpan:Pe,ariaControls:hn,ariaCurrent:null,ariaDescribedBy:hn,ariaDetails:null,ariaDisabled:Wn,ariaDropEffect:hn,ariaErrorMessage:null,ariaExpanded:Wn,ariaFlowTo:hn,ariaGrabbed:Wn,ariaHasPopup:null,ariaHidden:Wn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:hn,ariaLevel:Pe,ariaLive:null,ariaModal:Wn,ariaMultiLine:Wn,ariaMultiSelectable:Wn,ariaOrientation:null,ariaOwns:hn,ariaPlaceholder:null,ariaPosInSet:Pe,ariaPressed:Wn,ariaReadOnly:Wn,ariaRelevant:null,ariaRequired:Wn,ariaRoleDescription:hn,ariaRowCount:Pe,ariaRowIndex:Pe,ariaRowSpan:Pe,ariaSelected:Wn,ariaSetSize:Pe,ariaSort:null,ariaValueMax:Pe,ariaValueMin:Pe,ariaValueNow:Pe,ariaValueText:null,role:null}}),J1e=Vd({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:wj,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Lu,acceptCharset:hn,accessKey:hn,action:null,allow:null,allowFullScreen:lt,allowPaymentRequest:lt,allowUserMedia:lt,alt:null,as:null,async:lt,autoCapitalize:null,autoComplete:hn,autoFocus:lt,autoPlay:lt,blocking:hn,capture:null,charSet:null,checked:lt,cite:null,className:hn,cols:Pe,colSpan:null,content:null,contentEditable:Wn,controls:lt,controlsList:hn,coords:Pe|Lu,crossOrigin:null,data:null,dateTime:null,decoding:null,default:lt,defer:lt,dir:null,dirName:null,disabled:lt,download:bj,draggable:Wn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:lt,formTarget:null,headers:hn,height:Pe,hidden:lt,high:Pe,href:null,hrefLang:null,htmlFor:hn,httpEquiv:hn,id:null,imageSizes:null,imageSrcSet:null,inert:lt,inputMode:null,integrity:null,is:null,isMap:lt,itemId:null,itemProp:hn,itemRef:hn,itemScope:lt,itemType:hn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:lt,low:Pe,manifest:null,max:null,maxLength:Pe,media:null,method:null,min:null,minLength:Pe,multiple:lt,muted:lt,name:null,nonce:null,noModule:lt,noValidate:lt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:lt,optimum:Pe,pattern:null,ping:hn,placeholder:null,playsInline:lt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:lt,referrerPolicy:null,rel:hn,required:lt,reversed:lt,rows:Pe,rowSpan:Pe,sandbox:hn,scope:null,scoped:lt,seamless:lt,selected:lt,shadowRootClonable:lt,shadowRootDelegatesFocus:lt,shadowRootMode:null,shape:null,size:Pe,sizes:null,slot:null,span:Pe,spellCheck:Wn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Pe,step:null,style:null,tabIndex:Pe,target:null,title:null,translate:null,type:null,typeMustMatch:lt,useMap:null,value:Wn,width:Pe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:hn,axis:null,background:null,bgColor:null,border:Pe,borderColor:null,bottomMargin:Pe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:lt,declare:lt,event:null,face:null,frame:null,frameBorder:null,hSpace:Pe,leftMargin:Pe,link:null,longDesc:null,lowSrc:null,marginHeight:Pe,marginWidth:Pe,noResize:lt,noHref:lt,noShade:lt,noWrap:lt,object:null,profile:null,prompt:null,rev:null,rightMargin:Pe,rules:null,scheme:null,scrolling:Wn,standby:null,summary:null,text:null,topMargin:Pe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Pe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:lt,disableRemotePlayback:lt,prefix:null,property:null,results:Pe,security:null,unselectable:null}}),Z1e=Vd({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:xj,properties:{about:Ti,accentHeight:Pe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Pe,amplitude:Pe,arabicForm:null,ascent:Pe,attributeName:null,attributeType:null,azimuth:Pe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Pe,by:null,calcMode:null,capHeight:Pe,className:hn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Pe,diffuseConstant:Pe,direction:null,display:null,dur:null,divisor:Pe,dominantBaseline:null,download:lt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Pe,enableBackground:null,end:null,event:null,exponent:Pe,externalResourcesRequired:null,fill:null,fillOpacity:Pe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Lu,g2:Lu,glyphName:Lu,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Pe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Pe,horizOriginX:Pe,horizOriginY:Pe,id:null,ideographic:Pe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Pe,k:Pe,k1:Pe,k2:Pe,k3:Pe,k4:Pe,kernelMatrix:Ti,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Pe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Pe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Pe,overlineThickness:Pe,paintOrder:null,panose1:null,path:null,pathLength:Pe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:hn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Pe,pointsAtY:Pe,pointsAtZ:Pe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ti,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ti,rev:Ti,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ti,requiredFeatures:Ti,requiredFonts:Ti,requiredFormats:Ti,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Pe,specularExponent:Pe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Pe,strikethroughThickness:Pe,string:null,stroke:null,strokeDashArray:Ti,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Pe,strokeOpacity:Pe,strokeWidth:null,style:null,surfaceScale:Pe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ti,tabIndex:Pe,tableValues:null,target:null,targetX:Pe,targetY:Pe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ti,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Pe,underlineThickness:Pe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Pe,values:null,vAlphabetic:Pe,vMathematical:Pe,vectorEffect:null,vHanging:Pe,vIdeographic:Pe,version:null,vertAdvY:Pe,vertOriginX:Pe,vertOriginY:Pe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Pe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),ewe=/^data[-\w.:]+$/i,Ok=/-[a-z]/g,twe=/[A-Z]/g;function nwe(e,t){const n=E_(t);let r=t,i=ho;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&ewe.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Ok,iwe);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Ok.test(o)){let s=o.replace(twe,rwe);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=OR}return new i(r,t)}function rwe(e){return"-"+e.toLowerCase()}function iwe(e){return e.charAt(1).toUpperCase()}const owe={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},swe=mj([vj,yj,Sj,_j,J1e],"html"),DR=mj([vj,yj,Sj,_j,Z1e],"svg");function awe(e){return e.join(" ").trim()}var Cj={},Dk=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,lwe=/\n/g,cwe=/^\s*/,uwe=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,dwe=/^:\s*/,fwe=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,hwe=/^[;\s]*/,pwe=/^\s+|\s+$/g,gwe=`
|
|
380
|
-
`,Ak="/",kk="*",Nl="",mwe="comment",bwe="declaration",ywe=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(m){var b=m.match(lwe);b&&(n+=b.length);var v=m.lastIndexOf(gwe);r=~v?m.length-v:r+m.length}function o(){var m={line:n,column:r};return function(b){return b.position=new s(m),c(),b}}function s(m){this.start=m,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function a(m){var b=new Error(t.source+":"+n+":"+r+": "+m);if(b.reason=m,b.filename=t.source,b.line=n,b.column=r,b.source=e,!t.silent)throw b}function l(m){var b=m.exec(e);if(b){var v=b[0];return i(v),e=e.slice(v.length),b}}function c(){l(cwe)}function u(m){var b;for(m=m||[];b=d();)b!==!1&&m.push(b);return m}function d(){var m=o();if(!(Ak!=e.charAt(0)||kk!=e.charAt(1))){for(var b=2;Nl!=e.charAt(b)&&(kk!=e.charAt(b)||Ak!=e.charAt(b+1));)++b;if(b+=2,Nl===e.charAt(b-1))return a("End of comment missing");var v=e.slice(2,b-2);return r+=2,i(v),e=e.slice(b),r+=2,m({type:mwe,comment:v})}}function p(){var m=o(),b=l(uwe);if(b){if(d(),!l(dwe))return a("property missing ':'");var v=l(fwe),x=m({type:bwe,property:Ik(b[0].replace(Dk,Nl)),value:v?Ik(v[0].replace(Dk,Nl)):Nl});return l(hwe),x}}function h(){var m=[];u(m);for(var b;b=p();)b!==!1&&(m.push(b),u(m));return m}return c(),h()};function Ik(e){return e?e.replace(pwe,Nl):Nl}var vwe=Ca&&Ca.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Cj,"__esModule",{value:!0});var Nk=Cj.default=wwe,xwe=vwe(ywe);function wwe(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,xwe.default)(e),i=typeof t=="function";return r.forEach(function(o){if(o.type==="declaration"){var s=o.property,a=o.value;i?t(s,a,o):a&&(n=n||{},n[s]=a)}}),n}const Swe=Nk.default||Nk,Ej=Rj("end"),AR=Rj("start");function Rj(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function _we(e){const t=AR(e),n=Ej(e);if(t&&n)return{start:t,end:n}}function yh(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Lk(e.position):"start"in e||"end"in e?Lk(e):"line"in e||"column"in e?P_(e):""}function P_(e){return Fk(e&&e.line)+":"+Fk(e&&e.column)}function Lk(e){return P_(e&&e.start)+"-"+P_(e&&e.end)}function Fk(e){return e&&typeof e=="number"?e:1}class kr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=a?a.line:void 0,this.name=yh(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}kr.prototype.file="";kr.prototype.name="";kr.prototype.reason="";kr.prototype.message="";kr.prototype.stack="";kr.prototype.column=void 0;kr.prototype.line=void 0;kr.prototype.ancestors=void 0;kr.prototype.cause=void 0;kr.prototype.fatal=void 0;kr.prototype.place=void 0;kr.prototype.ruleId=void 0;kr.prototype.source=void 0;const kR={}.hasOwnProperty,Cwe=new Map,Ewe=/[A-Z]/g,Rwe=/-([a-z])/g,Pwe=new Set(["table","tbody","thead","tfoot","tr"]),Twe=new Set(["td","th"]),Pj="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Mwe(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Fwe(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Lwe(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?DR:swe,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=Tj(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function Tj(e,t,n){if(t.type==="element")return Owe(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Dwe(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return kwe(e,t,n);if(t.type==="mdxjsEsm")return Awe(e,t);if(t.type==="root")return Iwe(e,t,n);if(t.type==="text")return Nwe(e,t)}function Owe(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=DR,e.schema=i),e.ancestors.push(t);const o=Oj(e,t.tagName,!1),s=jwe(e,t);let a=NR(e,t);return Pwe.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!K1e(l):!0})),Mj(e,s,o,t),IR(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function Dwe(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}ap(e,t.position)}function Awe(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ap(e,t.position)}function kwe(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=DR,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:Oj(e,t.name,!0),s=$we(e,t),a=NR(e,t);return Mj(e,s,o,t),IR(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function Iwe(e,t,n){const r={};return IR(r,NR(e,t)),e.create(t,e.Fragment,r,n)}function Nwe(e,t){return t.value}function Mj(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function IR(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Lwe(e,t,n){return r;function r(i,o,s,a){const c=Array.isArray(s.children)?n:t;return a?c(o,s,a):c(o,s)}}function Fwe(e,t){return n;function n(r,i,o,s){const a=Array.isArray(o.children),l=AR(r);return t(i,o,s,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function jwe(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&kR.call(t.properties,i)){const o=zwe(e,i,t.properties[i]);if(o){const[s,a]=o;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&Twe.has(t.tagName)?r=a:n[s]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function $we(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else ap(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else ap(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function NR(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Cwe;for(;++r<t.children.length;){const o=t.children[r];let s;if(e.passKeys){const l=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(l){const c=i.get(l)||0;s=l+"-"+c,i.set(l,c+1)}}const a=Tj(e,o,s);a!==void 0&&n.push(a)}return n}function zwe(e,t,n){const r=nwe(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?W1e(n):awe(n)),r.property==="style"){let i=typeof n=="object"?n:Bwe(e,String(n));return e.stylePropertyNameCase==="css"&&(i=Hwe(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?owe[r.property]||r.property:r.attribute,n]}}function Bwe(e,t){const n={};try{Swe(t,r)}catch(i){if(!e.ignoreInvalidStyle){const o=i,s=new kr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:o,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=Pj+"#cannot-parse-style-attribute",s}}return n;function r(i,o){let s=i;s.slice(0,2)!=="--"&&(s.slice(0,4)==="-ms-"&&(s="ms-"+s.slice(4)),s=s.replace(Rwe,Wwe)),n[s]=o}}function Oj(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,s;for(;++o<i.length;){const a=Pk(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=s}else r=Pk(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return kR.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);ap(e)}function ap(e,t){const n=new kr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Pj+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Hwe(e){const t={};let n;for(n in e)kR.call(e,n)&&(t[Vwe(n)]=e[n]);return t}function Vwe(e){let t=e.replace(Ewe,Uwe);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Wwe(e,t){return t.toUpperCase()}function Uwe(e){return"-"+e.toLowerCase()}const q1={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Gwe={};function qwe(e,t){const n=Gwe,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Dj(e,r,i)}function Dj(e,t,n){if(Ywe(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return jk(e.children,t,n)}return Array.isArray(e)?jk(e,t,n):""}function jk(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Dj(e[i],t,n);return r.join("")}function Ywe(e){return!!(e&&typeof e=="object")}const $k=document.createElement("i");function LR(e){const t="&"+e+";";$k.innerHTML=t;const n=$k.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function fs(e,t,n,r){const i=e.length;let o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function io(e,t){return e.length>0?(fs(e,e.length,0,t),e):t}const zk={}.hasOwnProperty;function Kwe(e){const t={};let n=-1;for(;++n<e.length;)Xwe(t,e[n]);return t}function Xwe(e,t){let n;for(n in t){const i=(zk.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){zk.call(i,s)||(i[s]=[]);const a=o[s];Qwe(i[s],Array.isArray(a)?a:a?[a]:[])}}}function Qwe(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);fs(e,0,0,r)}function Aj(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Fu(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Zo=al(/[A-Za-z]/),Ni=al(/[\dA-Za-z]/),Jwe=al(/[#-'*+\--9=?A-Z^-~]/);function T_(e){return e!==null&&(e<32||e===127)}const M_=al(/\d/),Zwe=al(/[\dA-Fa-f]/),eSe=al(/[!-/:-@[-`{-~]/);function et(e){return e!==null&&e<-2}function mi(e){return e!==null&&(e<0||e===32)}function Ut(e){return e===-2||e===-1||e===32}const tSe=al(new RegExp("\\p{P}|\\p{S}","u")),nSe=al(/\s/);function al(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Wd(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&Ni(e.charCodeAt(n+1))&&Ni(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function pn(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(l){return Ut(l)?(e.enter(n),a(l)):t(l)}function a(l){return Ut(l)&&o++<i?(e.consume(l),a):(e.exit(n),t(l))}}const rSe={tokenize:iSe};function iSe(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),pn(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return et(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),s)}}const oSe={tokenize:sSe},Bk={tokenize:aSe};function sSe(e){const t=this,n=[];let r=0,i,o,s;return a;function a(_){if(r<n.length){const E=n[r];return t.containerState=E[1],e.attempt(E[0].continuation,l,c)(_)}return c(_)}function l(_){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&S();const E=t.events.length;let C=E,M;for(;C--;)if(t.events[C][0]==="exit"&&t.events[C][1].type==="chunkFlow"){M=t.events[C][1].end;break}x(r);let O=E;for(;O<t.events.length;)t.events[O][1].end={...M},O++;return fs(t.events,C+1,0,t.events.slice(E)),t.events.length=O,c(_)}return a(_)}function c(_){if(r===n.length){if(!i)return p(_);if(i.currentConstruct&&i.currentConstruct.concrete)return m(_);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Bk,u,d)(_)}function u(_){return i&&S(),x(r),p(_)}function d(_){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,m(_)}function p(_){return t.containerState={},e.attempt(Bk,h,m)(_)}function h(_){return r++,n.push([t.currentConstruct,t.containerState]),p(_)}function m(_){if(_===null){i&&S(),x(0),e.consume(_);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),b(_)}function b(_){if(_===null){v(e.exit("chunkFlow"),!0),x(0),e.consume(_);return}return et(_)?(e.consume(_),v(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(_),b)}function v(_,E){const C=t.sliceStream(_);if(E&&C.push(null),_.previous=o,o&&(o.next=_),o=_,i.defineSkip(_.start),i.write(C),t.parser.lazy[_.start.line]){let M=i.events.length;for(;M--;)if(i.events[M][1].start.offset<s&&(!i.events[M][1].end||i.events[M][1].end.offset>s))return;const O=t.events.length;let k=O,N,F;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){if(N){F=t.events[k][1].end;break}N=!0}for(x(r),M=O;M<t.events.length;)t.events[M][1].end={...F},M++;fs(t.events,k+1,0,t.events.slice(O)),t.events.length=M}}function x(_){let E=n.length;for(;E-- >_;){const C=n[E];t.containerState=C[1],C[0].exit.call(t,e)}n.length=_}function S(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function aSe(e,t,n){return pn(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Hk(e){if(e===null||mi(e)||nSe(e))return 1;if(tSe(e))return 2}function FR(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const O_={name:"attention",resolveAll:lSe,tokenize:cSe};function lSe(e,t){let n=-1,r,i,o,s,a,l,c,u;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},p={...e[n][1].start};Vk(d,-l),Vk(p,l),s={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},o={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[r][1].end={...s.start},e[n][1].start={...a.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=io(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=io(c,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),c=io(c,FR(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=io(c,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=io(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,fs(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function cSe(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Hk(r);let o;return s;function s(l){return o=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===o)return e.consume(l),a;const c=e.exit("attentionSequence"),u=Hk(l),d=!u||u===2&&i||n.includes(l),p=!i||i===2&&u||n.includes(r);return c._open=!!(o===42?d:d&&(i||!p)),c._close=!!(o===42?p:p&&(u||!d)),t(l)}}function Vk(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const uSe={name:"autolink",tokenize:dSe};function dSe(e,t,n){let r=0;return i;function i(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(h){return Zo(h)?(e.consume(h),s):h===64?n(h):c(h)}function s(h){return h===43||h===45||h===46||Ni(h)?(r=1,a(h)):c(h)}function a(h){return h===58?(e.consume(h),r=0,l):(h===43||h===45||h===46||Ni(h))&&r++<32?(e.consume(h),a):(r=0,c(h))}function l(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):h===null||h===32||h===60||T_(h)?n(h):(e.consume(h),l)}function c(h){return h===64?(e.consume(h),u):Jwe(h)?(e.consume(h),c):n(h)}function u(h){return Ni(h)?d(h):n(h)}function d(h){return h===46?(e.consume(h),r=0,u):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):p(h)}function p(h){if((h===45||Ni(h))&&r++<63){const m=h===45?p:d;return e.consume(h),m}return n(h)}}const B0={partial:!0,tokenize:fSe};function fSe(e,t,n){return r;function r(o){return Ut(o)?pn(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||et(o)?t(o):n(o)}}const kj={continuation:{tokenize:pSe},exit:gSe,name:"blockQuote",tokenize:hSe};function hSe(e,t,n){const r=this;return i;function i(s){if(s===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return Ut(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function pSe(e,t,n){const r=this;return i;function i(s){return Ut(s)?pn(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(kj,t,n)(s)}}function gSe(e){e.exit("blockQuote")}const Ij={name:"characterEscape",tokenize:mSe};function mSe(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return eSe(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const Nj={name:"characterReference",tokenize:bSe};function bSe(e,t,n){const r=this;let i=0,o,s;return a;function a(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),o=31,s=Ni,u(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=Zwe,u):(e.enter("characterReferenceValue"),o=7,s=M_,u(d))}function u(d){if(d===59&&i){const p=e.exit("characterReferenceValue");return s===Ni&&!LR(r.sliceSerialize(p))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(d)&&i++<o?(e.consume(d),u):n(d)}}const Wk={partial:!0,tokenize:vSe},Uk={concrete:!0,name:"codeFenced",tokenize:ySe};function ySe(e,t,n){const r=this,i={partial:!0,tokenize:C};let o=0,s=0,a;return l;function l(M){return c(M)}function c(M){const O=r.events[r.events.length-1];return o=O&&O[1].type==="linePrefix"?O[2].sliceSerialize(O[1],!0).length:0,a=M,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(M)}function u(M){return M===a?(s++,e.consume(M),u):s<3?n(M):(e.exit("codeFencedFenceSequence"),Ut(M)?pn(e,d,"whitespace")(M):d(M))}function d(M){return M===null||et(M)?(e.exit("codeFencedFence"),r.interrupt?t(M):e.check(Wk,b,E)(M)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(M))}function p(M){return M===null||et(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(M)):Ut(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),pn(e,h,"whitespace")(M)):M===96&&M===a?n(M):(e.consume(M),p)}function h(M){return M===null||et(M)?d(M):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(M))}function m(M){return M===null||et(M)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(M)):M===96&&M===a?n(M):(e.consume(M),m)}function b(M){return e.attempt(i,E,v)(M)}function v(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),x}function x(M){return o>0&&Ut(M)?pn(e,S,"linePrefix",o+1)(M):S(M)}function S(M){return M===null||et(M)?e.check(Wk,b,E)(M):(e.enter("codeFlowValue"),_(M))}function _(M){return M===null||et(M)?(e.exit("codeFlowValue"),S(M)):(e.consume(M),_)}function E(M){return e.exit("codeFenced"),t(M)}function C(M,O,k){let N=0;return F;function F(L){return M.enter("lineEnding"),M.consume(L),M.exit("lineEnding"),j}function j(L){return M.enter("codeFencedFence"),Ut(L)?pn(M,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):$(L)}function $(L){return L===a?(M.enter("codeFencedFenceSequence"),X(L)):k(L)}function X(L){return L===a?(N++,M.consume(L),X):N>=s?(M.exit("codeFencedFenceSequence"),Ut(L)?pn(M,V,"whitespace")(L):V(L)):k(L)}function V(L){return L===null||et(L)?(M.exit("codeFencedFence"),O(L)):k(L)}}}function vSe(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const Y1={name:"codeIndented",tokenize:wSe},xSe={partial:!0,tokenize:SSe};function wSe(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),pn(e,o,"linePrefix",5)(c)}function o(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?l(c):et(c)?e.attempt(xSe,s,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||et(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function SSe(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):et(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):pn(e,o,"linePrefix",5)(s)}function o(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):et(s)?i(s):n(s)}}const _Se={name:"codeText",previous:ESe,resolve:CSe,tokenize:RSe};function CSe(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function ESe(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function RSe(e,t,n){let r=0,i,o;return s;function s(d){return e.enter("codeText"),e.enter("codeTextSequence"),a(d)}function a(d){return d===96?(e.consume(d),r++,a):(e.exit("codeTextSequence"),l(d))}function l(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),l):d===96?(o=e.enter("codeTextSequence"),i=0,u(d)):et(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||et(d)?(e.exit("codeTextData"),l(d)):(e.consume(d),c)}function u(d){return d===96?(e.consume(d),i++,u):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(o.type="codeTextData",c(d))}}class PSe{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Df(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Df(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Df(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Df(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Df(this.left,n.reverse())}}}function Df(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Lj(e){const t={};let n=-1,r,i,o,s,a,l,c;const u=new PSe(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type==="chunkFlow"&&u.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,TSe(u,n)),n=t[n],c=!0);else if(r[1]._container){for(o=n,i=void 0;o--&&(s=u.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank");)s[0]==="enter"&&(i&&(u.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);i&&(r[1].end={...u.get(i)[1].start},a=u.slice(i,n),a.unshift(r),u.splice(i,n-i+1,a))}}return fs(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function TSe(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[],s=n._tokenizer||r.parser[n.contentType](n.start),a=s.events,l=[],c={};let u,d,p=-1,h=n,m=0,b=0;const v=[b];for(;h;){for(;e.get(++i)[1]!==h;);o.push(i),h._tokenizer||(u=r.sliceStream(h),h.next||u.push(null),d&&s.defineSkip(h.start),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(u),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),d=h,h=h.next}for(h=n;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(b=p+1,v.push(b),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(s.events=[],h?(h._tokenizer=void 0,h.previous=void 0):v.pop(),p=v.length;p--;){const x=a.slice(v[p],v[p+1]),S=o.pop();l.push([S,S+x.length-1]),e.splice(S,2,x)}for(l.reverse(),p=-1;++p<l.length;)c[m+l[p][0]]=m+l[p][1],m+=l[p][1]-l[p][0]-1;return c}const MSe={resolve:DSe,tokenize:ASe},OSe={partial:!0,tokenize:kSe};function DSe(e){return Lj(e),e}function ASe(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):et(a)?e.check(OSe,s,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function kSe(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),pn(e,o,"linePrefix")}function o(s){if(s===null||et(s))return n(s);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function Fj(e,t,n,r,i,o,s,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return d;function d(x){return x===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(x),e.exit(o),p):x===null||x===32||x===41||T_(x)?n(x):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),b(x))}function p(x){return x===62?(e.enter(o),e.consume(x),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(x))}function h(x){return x===62?(e.exit("chunkString"),e.exit(a),p(x)):x===null||x===60||et(x)?n(x):(e.consume(x),x===92?m:h)}function m(x){return x===60||x===62||x===92?(e.consume(x),h):h(x)}function b(x){return!u&&(x===null||x===41||mi(x))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(x)):u<c&&x===40?(e.consume(x),u++,b):x===41?(e.consume(x),u--,b):x===null||x===32||x===40||T_(x)?n(x):(e.consume(x),x===92?v:b)}function v(x){return x===40||x===41||x===92?(e.consume(x),b):b(x)}}function jj(e,t,n,r,i,o){const s=this;let a=0,l;return c;function c(h){return e.enter(r),e.enter(i),e.consume(h),e.exit(i),e.enter(o),u}function u(h){return a>999||h===null||h===91||h===93&&!l||h===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(h):h===93?(e.exit(o),e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):et(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===null||h===91||h===93||et(h)||a++>999?(e.exit("chunkString"),u(h)):(e.consume(h),l||(l=!Ut(h)),h===92?p:d)}function p(h){return h===91||h===92||h===93?(e.consume(h),a++,d):d(h)}}function $j(e,t,n,r,i,o){let s;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),s=p===40?41:p,l):n(p)}function l(p){return p===s?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(o),c(p))}function c(p){return p===s?(e.exit(o),l(s)):p===null?n(p):et(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),pn(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(p))}function u(p){return p===s||p===null||et(p)?(e.exit("chunkString"),c(p)):(e.consume(p),p===92?d:u)}function d(p){return p===s||p===92?(e.consume(p),u):u(p)}}function vh(e,t){let n;return r;function r(i){return et(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Ut(i)?pn(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const ISe={name:"definition",tokenize:LSe},NSe={partial:!0,tokenize:FSe};function LSe(e,t,n){const r=this;let i;return o;function o(h){return e.enter("definition"),s(h)}function s(h){return jj.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return i=Fu(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),l):n(h)}function l(h){return mi(h)?vh(e,c)(h):c(h)}function c(h){return Fj(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function u(h){return e.attempt(NSe,d,d)(h)}function d(h){return Ut(h)?pn(e,p,"whitespace")(h):p(h)}function p(h){return h===null||et(h)?(e.exit("definition"),r.parser.defined.push(i),t(h)):n(h)}}function FSe(e,t,n){return r;function r(a){return mi(a)?vh(e,i)(a):n(a)}function i(a){return $j(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return Ut(a)?pn(e,s,"whitespace")(a):s(a)}function s(a){return a===null||et(a)?t(a):n(a)}}const jSe={name:"hardBreakEscape",tokenize:$Se};function $Se(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return et(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const zSe={name:"headingAtx",resolve:BSe,tokenize:HSe};function BSe(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},fs(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function HSe(e,t,n){let r=0;return i;function i(u){return e.enter("atxHeading"),o(u)}function o(u){return e.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&r++<6?(e.consume(u),s):u===null||mi(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||et(u)?(e.exit("atxHeading"),t(u)):Ut(u)?pn(e,a,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||mi(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const VSe=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Gk=["pre","script","style","textarea"],WSe={concrete:!0,name:"htmlFlow",resolveTo:qSe,tokenize:YSe},USe={partial:!0,tokenize:XSe},GSe={partial:!0,tokenize:KSe};function qSe(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function YSe(e,t,n){const r=this;let i,o,s,a,l;return c;function c(D){return u(D)}function u(D){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(D),d}function d(D){return D===33?(e.consume(D),p):D===47?(e.consume(D),o=!0,b):D===63?(e.consume(D),i=3,r.interrupt?t:A):Zo(D)?(e.consume(D),s=String.fromCharCode(D),v):n(D)}function p(D){return D===45?(e.consume(D),i=2,h):D===91?(e.consume(D),i=5,a=0,m):Zo(D)?(e.consume(D),i=4,r.interrupt?t:A):n(D)}function h(D){return D===45?(e.consume(D),r.interrupt?t:A):n(D)}function m(D){const ee="CDATA[";return D===ee.charCodeAt(a++)?(e.consume(D),a===ee.length?r.interrupt?t:$:m):n(D)}function b(D){return Zo(D)?(e.consume(D),s=String.fromCharCode(D),v):n(D)}function v(D){if(D===null||D===47||D===62||mi(D)){const ee=D===47,K=s.toLowerCase();return!ee&&!o&&Gk.includes(K)?(i=1,r.interrupt?t(D):$(D)):VSe.includes(s.toLowerCase())?(i=6,ee?(e.consume(D),x):r.interrupt?t(D):$(D)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(D):o?S(D):_(D))}return D===45||Ni(D)?(e.consume(D),s+=String.fromCharCode(D),v):n(D)}function x(D){return D===62?(e.consume(D),r.interrupt?t:$):n(D)}function S(D){return Ut(D)?(e.consume(D),S):F(D)}function _(D){return D===47?(e.consume(D),F):D===58||D===95||Zo(D)?(e.consume(D),E):Ut(D)?(e.consume(D),_):F(D)}function E(D){return D===45||D===46||D===58||D===95||Ni(D)?(e.consume(D),E):C(D)}function C(D){return D===61?(e.consume(D),M):Ut(D)?(e.consume(D),C):_(D)}function M(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),l=D,O):Ut(D)?(e.consume(D),M):k(D)}function O(D){return D===l?(e.consume(D),l=null,N):D===null||et(D)?n(D):(e.consume(D),O)}function k(D){return D===null||D===34||D===39||D===47||D===60||D===61||D===62||D===96||mi(D)?C(D):(e.consume(D),k)}function N(D){return D===47||D===62||Ut(D)?_(D):n(D)}function F(D){return D===62?(e.consume(D),j):n(D)}function j(D){return D===null||et(D)?$(D):Ut(D)?(e.consume(D),j):n(D)}function $(D){return D===45&&i===2?(e.consume(D),U):D===60&&i===1?(e.consume(D),B):D===62&&i===4?(e.consume(D),Y):D===63&&i===3?(e.consume(D),A):D===93&&i===5?(e.consume(D),q):et(D)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(USe,G,X)(D)):D===null||et(D)?(e.exit("htmlFlowData"),X(D)):(e.consume(D),$)}function X(D){return e.check(GSe,V,G)(D)}function V(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),L}function L(D){return D===null||et(D)?X(D):(e.enter("htmlFlowData"),$(D))}function U(D){return D===45?(e.consume(D),A):$(D)}function B(D){return D===47?(e.consume(D),s="",W):$(D)}function W(D){if(D===62){const ee=s.toLowerCase();return Gk.includes(ee)?(e.consume(D),Y):$(D)}return Zo(D)&&s.length<8?(e.consume(D),s+=String.fromCharCode(D),W):$(D)}function q(D){return D===93?(e.consume(D),A):$(D)}function A(D){return D===62?(e.consume(D),Y):D===45&&i===2?(e.consume(D),A):$(D)}function Y(D){return D===null||et(D)?(e.exit("htmlFlowData"),G(D)):(e.consume(D),Y)}function G(D){return e.exit("htmlFlow"),t(D)}}function KSe(e,t,n){const r=this;return i;function i(s){return et(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function XSe(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(B0,t,n)}}const QSe={name:"htmlText",tokenize:JSe};function JSe(e,t,n){const r=this;let i,o,s;return a;function a(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),l}function l(A){return A===33?(e.consume(A),c):A===47?(e.consume(A),C):A===63?(e.consume(A),_):Zo(A)?(e.consume(A),k):n(A)}function c(A){return A===45?(e.consume(A),u):A===91?(e.consume(A),o=0,m):Zo(A)?(e.consume(A),S):n(A)}function u(A){return A===45?(e.consume(A),h):n(A)}function d(A){return A===null?n(A):A===45?(e.consume(A),p):et(A)?(s=d,B(A)):(e.consume(A),d)}function p(A){return A===45?(e.consume(A),h):d(A)}function h(A){return A===62?U(A):A===45?p(A):d(A)}function m(A){const Y="CDATA[";return A===Y.charCodeAt(o++)?(e.consume(A),o===Y.length?b:m):n(A)}function b(A){return A===null?n(A):A===93?(e.consume(A),v):et(A)?(s=b,B(A)):(e.consume(A),b)}function v(A){return A===93?(e.consume(A),x):b(A)}function x(A){return A===62?U(A):A===93?(e.consume(A),x):b(A)}function S(A){return A===null||A===62?U(A):et(A)?(s=S,B(A)):(e.consume(A),S)}function _(A){return A===null?n(A):A===63?(e.consume(A),E):et(A)?(s=_,B(A)):(e.consume(A),_)}function E(A){return A===62?U(A):_(A)}function C(A){return Zo(A)?(e.consume(A),M):n(A)}function M(A){return A===45||Ni(A)?(e.consume(A),M):O(A)}function O(A){return et(A)?(s=O,B(A)):Ut(A)?(e.consume(A),O):U(A)}function k(A){return A===45||Ni(A)?(e.consume(A),k):A===47||A===62||mi(A)?N(A):n(A)}function N(A){return A===47?(e.consume(A),U):A===58||A===95||Zo(A)?(e.consume(A),F):et(A)?(s=N,B(A)):Ut(A)?(e.consume(A),N):U(A)}function F(A){return A===45||A===46||A===58||A===95||Ni(A)?(e.consume(A),F):j(A)}function j(A){return A===61?(e.consume(A),$):et(A)?(s=j,B(A)):Ut(A)?(e.consume(A),j):N(A)}function $(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),i=A,X):et(A)?(s=$,B(A)):Ut(A)?(e.consume(A),$):(e.consume(A),V)}function X(A){return A===i?(e.consume(A),i=void 0,L):A===null?n(A):et(A)?(s=X,B(A)):(e.consume(A),X)}function V(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||mi(A)?N(A):(e.consume(A),V)}function L(A){return A===47||A===62||mi(A)?N(A):n(A)}function U(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function B(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),W}function W(A){return Ut(A)?pn(e,q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):q(A)}function q(A){return e.enter("htmlTextData"),s(A)}}const jR={name:"labelEnd",resolveAll:n_e,resolveTo:r_e,tokenize:i_e},ZSe={tokenize:o_e},e_e={tokenize:s_e},t_e={tokenize:a_e};function n_e(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&fs(e,0,e.length,n),e}function r_e(e,t){let n=e.length,r=0,i,o,s,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const l={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[o][1].start},end:{...e[s][1].end}},u={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",l,t],["enter",c,t]],a=io(a,e.slice(o+1,o+r+3)),a=io(a,[["enter",u,t]]),a=io(a,FR(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),a=io(a,[["exit",u,t],e[s-2],e[s-1],["exit",c,t]]),a=io(a,e.slice(s+1)),a=io(a,[["exit",l,t]]),fs(e,o,e.length,a),e}function i_e(e,t,n){const r=this;let i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(p){return o?o._inactive?d(p):(s=r.parser.defined.includes(Fu(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),l):n(p)}function l(p){return p===40?e.attempt(ZSe,u,s?u:d)(p):p===91?e.attempt(e_e,u,s?c:d)(p):s?u(p):d(p)}function c(p){return e.attempt(t_e,u,d)(p)}function u(p){return t(p)}function d(p){return o._balanced=!0,n(p)}}function o_e(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return mi(d)?vh(e,o)(d):o(d)}function o(d){return d===41?u(d):Fj(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function s(d){return mi(d)?vh(e,l)(d):u(d)}function a(d){return n(d)}function l(d){return d===34||d===39||d===40?$j(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return mi(d)?vh(e,u)(d):u(d)}function u(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function s_e(e,t,n){const r=this;return i;function i(a){return jj.call(r,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(Fu(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function a_e(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const l_e={name:"labelStartImage",resolveAll:jR.resolveAll,tokenize:c_e};function c_e(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const u_e={name:"labelStartLink",resolveAll:jR.resolveAll,tokenize:d_e};function d_e(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const K1={name:"lineEnding",tokenize:f_e};function f_e(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),pn(e,t,"linePrefix")}}const pb={name:"thematicBreak",tokenize:h_e};function h_e(e,t,n){let r=0,i;return o;function o(c){return e.enter("thematicBreak"),s(c)}function s(c){return i=c,a(c)}function a(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||et(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),Ut(c)?pn(e,a,"whitespace")(c):a(c))}}const si={continuation:{tokenize:b_e},exit:v_e,name:"list",tokenize:m_e},p_e={partial:!0,tokenize:x_e},g_e={partial:!0,tokenize:y_e};function m_e(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(h){const m=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:M_(h)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(pb,n,c)(h):c(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(h)}return n(h)}function l(h){return M_(h)&&++s<10?(e.consume(h),l):(!r.interrupt||s<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),c(h)):n(h)}function c(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(B0,r.interrupt?n:u,e.attempt(p_e,p,d))}function u(h){return r.containerState.initialBlankLine=!0,o++,p(h)}function d(h){return Ut(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):n(h)}function p(h){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function b_e(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(B0,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,pn(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!Ut(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(g_e,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,pn(e,e.attempt(si,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function y_e(e,t,n){const r=this;return pn(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function v_e(e){e.exit(this.containerState.type)}function x_e(e,t,n){const r=this;return pn(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!Ut(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const qk={name:"setextUnderline",resolveTo:w_e,tokenize:S_e};function w_e(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function S_e(e,t,n){const r=this;let i;return o;function o(c){let u=r.events.length,d;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){d=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=c,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),Ut(c)?pn(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||et(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const __e={tokenize:C_e};function C_e(e){const t=this,n=e.attempt(B0,r,e.attempt(this.parser.constructs.flowInitial,i,pn(e,e.attempt(this.parser.constructs.flow,i,e.attempt(MSe,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const E_e={resolveAll:Bj()},R_e=zj("string"),P_e=zj("text");function zj(e){return{resolveAll:Bj(e==="text"?T_e:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(u){return c(u)?o(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),o(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const d=i[u];let p=-1;if(d)for(;++p<d.length;){const h=d[p];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function Bj(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function T_e(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,s=-1,a=0,l;for(;o--;){const c=i[o];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(c===-2)l=!0,a++;else if(c!==-1){o++;break}}if(a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:r.start._bufferIndex+s,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const M_e={42:si,43:si,45:si,48:si,49:si,50:si,51:si,52:si,53:si,54:si,55:si,56:si,57:si,62:kj},O_e={91:ISe},D_e={[-2]:Y1,[-1]:Y1,32:Y1},A_e={35:zSe,42:pb,45:[qk,pb],60:WSe,61:qk,95:pb,96:Uk,126:Uk},k_e={38:Nj,92:Ij},I_e={[-5]:K1,[-4]:K1,[-3]:K1,33:l_e,38:Nj,42:O_,60:[uSe,QSe],91:u_e,92:[jSe,Ij],93:jR,95:O_,96:_Se},N_e={null:[O_,E_e]},L_e={null:[42,95]},F_e={null:[]},j_e=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:L_e,contentInitial:O_e,disable:F_e,document:M_e,flow:A_e,flowInitial:D_e,insideSpan:N_e,string:k_e,text:I_e},Symbol.toStringTag,{value:"Module"}));function $_e(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let s=[],a=[];const l={attempt:O(C),check:O(M),consume:S,enter:_,exit:E,interrupt:O(M,{interrupt:!0})},c={code:null,containerState:{},defineSkip:b,events:[],now:m,parser:e,previous:null,sliceSerialize:p,sliceStream:h,write:d};let u=t.tokenize.call(c,l);return t.resolveAll&&o.push(t),c;function d(j){return s=io(s,j),v(),s[s.length-1]!==null?[]:(k(t,0),c.events=FR(o,c.events,c),c.events)}function p(j,$){return B_e(h(j),$)}function h(j){return z_e(s,j)}function m(){const{_bufferIndex:j,_index:$,line:X,column:V,offset:L}=r;return{_bufferIndex:j,_index:$,line:X,column:V,offset:L}}function b(j){i[j.line]=j.column,F()}function v(){let j;for(;r._index<s.length;){const $=s[r._index];if(typeof $=="string")for(j=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===j&&r._bufferIndex<$.length;)x($.charCodeAt(r._bufferIndex));else x($)}}function x(j){u=u(j)}function S(j){et(j)?(r.line++,r.column=1,r.offset+=j===-3?2:1,F()):j!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=j}function _(j,$){const X=$||{};return X.type=j,X.start=m(),c.events.push(["enter",X,c]),a.push(X),X}function E(j){const $=a.pop();return $.end=m(),c.events.push(["exit",$,c]),$}function C(j,$){k(j,$.from)}function M(j,$){$.restore()}function O(j,$){return X;function X(V,L,U){let B,W,q,A;return Array.isArray(V)?G(V):"tokenize"in V?G([V]):Y(V);function Y(oe){return J;function J(Z){const ae=Z!==null&&oe[Z],ce=Z!==null&&oe.null,pe=[...Array.isArray(ae)?ae:ae?[ae]:[],...Array.isArray(ce)?ce:ce?[ce]:[]];return G(pe)(Z)}}function G(oe){return B=oe,W=0,oe.length===0?U:D(oe[W])}function D(oe){return J;function J(Z){return A=N(),q=oe,oe.partial||(c.currentConstruct=oe),oe.name&&c.parser.constructs.disable.null.includes(oe.name)?K():oe.tokenize.call($?Object.assign(Object.create(c),$):c,l,ee,K)(Z)}}function ee(oe){return j(q,A),L}function K(oe){return A.restore(),++W<B.length?D(B[W]):U}}}function k(j,$){j.resolveAll&&!o.includes(j)&&o.push(j),j.resolve&&fs(c.events,$,c.events.length-$,j.resolve(c.events.slice($),c)),j.resolveTo&&(c.events=j.resolveTo(c.events,c))}function N(){const j=m(),$=c.previous,X=c.currentConstruct,V=c.events.length,L=Array.from(a);return{from:V,restore:U};function U(){r=j,c.previous=$,c.currentConstruct=X,c.events.length=V,a=L,F()}}function F(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function z_e(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function B_e(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
|
|
381
|
-
`;break}case-3:{s=`\r
|
|
382
|
-
`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}function H_e(e){const r={constructs:Kwe([j_e,...(e||{}).extensions||[]]),content:i(rSe),defined:[],document:i(oSe),flow:i(__e),lazy:{},string:i(R_e),text:i(P_e)};return r;function i(o){return s;function s(a){return $_e(r,o,a)}}}function V_e(e){for(;!Lj(e););return e}const Yk=/[\0\t\n\r]/g;function W_e(){let e=1,t="",n=!0,r;return i;function i(o,s,a){const l=[];let c,u,d,p,h;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),d=0,t="",n&&(o.charCodeAt(0)===65279&&d++,n=void 0);d<o.length;){if(Yk.lastIndex=d,c=Yk.exec(o),p=c&&c.index!==void 0?c.index:o.length,h=o.charCodeAt(p),!c){t=o.slice(d);break}if(h===10&&d===p&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),d<p&&(l.push(o.slice(d,p)),e+=p-d),h){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}d=p+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const U_e=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function G_e(e){return e.replace(U_e,q_e)}function q_e(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return Aj(n.slice(o?2:1),o?16:10)}return LR(n)||e}const Hj={}.hasOwnProperty;function Y_e(e,t,n){return typeof t!="string"&&(n=t,t=void 0),K_e(n)(V_e(H_e(n).document().write(W_e()(e,t,!0))))}function K_e(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(ze),autolinkProtocol:N,autolinkEmail:N,atxHeading:o(Ee),blockQuote:o(ce),characterEscape:N,characterReference:N,codeFenced:o(pe),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(pe,s),codeText:o(ie,s),codeTextData:N,data:N,codeFlowValue:N,definition:o(ge),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(de),hardBreakEscape:o(De),hardBreakTrailing:o(De),htmlFlow:o($e,s),htmlFlowData:N,htmlText:o($e,s),htmlTextData:N,image:o(Te),label:s,link:o(ze),listItem:o(Mt),listItemValue:p,listOrdered:o(yt,d),listUnordered:o(yt),paragraph:o(mn),reference:D,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(Ee),strong:o(Ot),thematicBreak:o(Zt)},exit:{atxHeading:l(),atxHeadingSequence:C,autolink:l(),autolinkEmail:ae,autolinkProtocol:Z,blockQuote:l(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:K,characterReferenceMarkerNumeric:K,characterReferenceValue:oe,characterReference:J,codeFenced:l(v),codeFencedFence:b,codeFencedFenceInfo:h,codeFencedFenceMeta:m,codeFlowValue:F,codeIndented:l(x),codeText:l(L),codeTextData:F,data:F,definition:l(),definitionDestinationString:E,definitionLabelString:S,definitionTitleString:_,emphasis:l(),hardBreakEscape:l($),hardBreakTrailing:l($),htmlFlow:l(X),htmlFlowData:F,htmlText:l(V),htmlTextData:F,image:l(B),label:q,labelText:W,lineEnding:j,link:l(U),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ee,resourceDestinationString:A,resourceTitleString:Y,resource:G,setextHeading:l(k),setextHeadingLineSequence:O,setextHeadingText:M,strong:l(),thematicBreak:l()}};Vj(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(fe){let _e={type:"root",children:[]};const Be={stack:[_e],tokenStack:[],config:t,enter:a,exit:c,buffer:s,resume:u,data:n},Je=[];let st=-1;for(;++st<fe.length;)if(fe[st][1].type==="listOrdered"||fe[st][1].type==="listUnordered")if(fe[st][0]==="enter")Je.push(st);else{const On=Je.pop();st=i(fe,On,st)}for(st=-1;++st<fe.length;){const On=t[fe[st][0]];Hj.call(On,fe[st][1].type)&&On[fe[st][1].type].call(Object.assign({sliceSerialize:fe[st][2].sliceSerialize},Be),fe[st][1])}if(Be.tokenStack.length>0){const On=Be.tokenStack[Be.tokenStack.length-1];(On[1]||Kk).call(Be,void 0,On[0])}for(_e.position={start:xa(fe.length>0?fe[0][1].start:{line:1,column:1,offset:0}),end:xa(fe.length>0?fe[fe.length-2][1].end:{line:1,column:1,offset:0})},st=-1;++st<t.transforms.length;)_e=t.transforms[st](_e)||_e;return _e}function i(fe,_e,Be){let Je=_e-1,st=-1,On=!1,Fn,Rn,on,jn;for(;++Je<=Be;){const en=fe[Je];switch(en[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{en[0]==="enter"?st++:st--,jn=void 0;break}case"lineEndingBlank":{en[0]==="enter"&&(Fn&&!jn&&!st&&!on&&(on=Je),jn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:jn=void 0}if(!st&&en[0]==="enter"&&en[1].type==="listItemPrefix"||st===-1&&en[0]==="exit"&&(en[1].type==="listUnordered"||en[1].type==="listOrdered")){if(Fn){let nr=Je;for(Rn=void 0;nr--;){const Kn=fe[nr];if(Kn[1].type==="lineEnding"||Kn[1].type==="lineEndingBlank"){if(Kn[0]==="exit")continue;Rn&&(fe[Rn][1].type="lineEndingBlank",On=!0),Kn[1].type="lineEnding",Rn=nr}else if(!(Kn[1].type==="linePrefix"||Kn[1].type==="blockQuotePrefix"||Kn[1].type==="blockQuotePrefixWhitespace"||Kn[1].type==="blockQuoteMarker"||Kn[1].type==="listItemIndent"))break}on&&(!Rn||on<Rn)&&(Fn._spread=!0),Fn.end=Object.assign({},Rn?fe[Rn][1].start:en[1].end),fe.splice(Rn||Je,0,["exit",Fn,en[2]]),Je++,Be++}if(en[1].type==="listItemPrefix"){const nr={type:"listItem",_spread:!1,start:Object.assign({},en[1].start),end:void 0};Fn=nr,fe.splice(Je,0,["enter",nr,en[2]]),Je++,Be++,on=void 0,jn=!0}}}return fe[_e][1]._spread=On,Be}function o(fe,_e){return Be;function Be(Je){a.call(this,fe(Je),Je),_e&&_e.call(this,Je)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(fe,_e,Be){this.stack[this.stack.length-1].children.push(fe),this.stack.push(fe),this.tokenStack.push([_e,Be||void 0]),fe.position={start:xa(_e.start),end:void 0}}function l(fe){return _e;function _e(Be){fe&&fe.call(this,Be),c.call(this,Be)}}function c(fe,_e){const Be=this.stack.pop(),Je=this.tokenStack.pop();if(Je)Je[0].type!==fe.type&&(_e?_e.call(this,fe,Je[0]):(Je[1]||Kk).call(this,fe,Je[0]));else throw new Error("Cannot close `"+fe.type+"` ("+yh({start:fe.start,end:fe.end})+"): it’s not open");Be.position.end=xa(fe.end)}function u(){return qwe(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function p(fe){if(this.data.expectingFirstListItemValue){const _e=this.stack[this.stack.length-2];_e.start=Number.parseInt(this.sliceSerialize(fe),10),this.data.expectingFirstListItemValue=void 0}}function h(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.lang=fe}function m(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.meta=fe}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.value=fe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.value=fe.replace(/(\r?\n|\r)$/g,"")}function S(fe){const _e=this.resume(),Be=this.stack[this.stack.length-1];Be.label=_e,Be.identifier=Fu(this.sliceSerialize(fe)).toLowerCase()}function _(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.title=fe}function E(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.url=fe}function C(fe){const _e=this.stack[this.stack.length-1];if(!_e.depth){const Be=this.sliceSerialize(fe).length;_e.depth=Be}}function M(){this.data.setextHeadingSlurpLineEnding=!0}function O(fe){const _e=this.stack[this.stack.length-1];_e.depth=this.sliceSerialize(fe).codePointAt(0)===61?1:2}function k(){this.data.setextHeadingSlurpLineEnding=void 0}function N(fe){const Be=this.stack[this.stack.length-1].children;let Je=Be[Be.length-1];(!Je||Je.type!=="text")&&(Je=un(),Je.position={start:xa(fe.start),end:void 0},Be.push(Je)),this.stack.push(Je)}function F(fe){const _e=this.stack.pop();_e.value+=this.sliceSerialize(fe),_e.position.end=xa(fe.end)}function j(fe){const _e=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Be=_e.children[_e.children.length-1];Be.position.end=xa(fe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(_e.type)&&(N.call(this,fe),F.call(this,fe))}function $(){this.data.atHardBreak=!0}function X(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.value=fe}function V(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.value=fe}function L(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.value=fe}function U(){const fe=this.stack[this.stack.length-1];if(this.data.inReference){const _e=this.data.referenceType||"shortcut";fe.type+="Reference",fe.referenceType=_e,delete fe.url,delete fe.title}else delete fe.identifier,delete fe.label;this.data.referenceType=void 0}function B(){const fe=this.stack[this.stack.length-1];if(this.data.inReference){const _e=this.data.referenceType||"shortcut";fe.type+="Reference",fe.referenceType=_e,delete fe.url,delete fe.title}else delete fe.identifier,delete fe.label;this.data.referenceType=void 0}function W(fe){const _e=this.sliceSerialize(fe),Be=this.stack[this.stack.length-2];Be.label=G_e(_e),Be.identifier=Fu(_e).toLowerCase()}function q(){const fe=this.stack[this.stack.length-1],_e=this.resume(),Be=this.stack[this.stack.length-1];if(this.data.inReference=!0,Be.type==="link"){const Je=fe.children;Be.children=Je}else Be.alt=_e}function A(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.url=fe}function Y(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.title=fe}function G(){this.data.inReference=void 0}function D(){this.data.referenceType="collapsed"}function ee(fe){const _e=this.resume(),Be=this.stack[this.stack.length-1];Be.label=_e,Be.identifier=Fu(this.sliceSerialize(fe)).toLowerCase(),this.data.referenceType="full"}function K(fe){this.data.characterReferenceType=fe.type}function oe(fe){const _e=this.sliceSerialize(fe),Be=this.data.characterReferenceType;let Je;Be?(Je=Aj(_e,Be==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Je=LR(_e);const st=this.stack[this.stack.length-1];st.value+=Je}function J(fe){const _e=this.stack.pop();_e.position.end=xa(fe.end)}function Z(fe){F.call(this,fe);const _e=this.stack[this.stack.length-1];_e.url=this.sliceSerialize(fe)}function ae(fe){F.call(this,fe);const _e=this.stack[this.stack.length-1];_e.url="mailto:"+this.sliceSerialize(fe)}function ce(){return{type:"blockquote",children:[]}}function pe(){return{type:"code",lang:null,meta:null,value:""}}function ie(){return{type:"inlineCode",value:""}}function ge(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function de(){return{type:"emphasis",children:[]}}function Ee(){return{type:"heading",depth:0,children:[]}}function De(){return{type:"break"}}function $e(){return{type:"html",value:""}}function Te(){return{type:"image",title:null,url:"",alt:null}}function ze(){return{type:"link",title:null,url:"",children:[]}}function yt(fe){return{type:"list",ordered:fe.type==="listOrdered",start:null,spread:fe._spread,children:[]}}function Mt(fe){return{type:"listItem",spread:fe._spread,checked:null,children:[]}}function mn(){return{type:"paragraph",children:[]}}function Ot(){return{type:"strong",children:[]}}function un(){return{type:"text",value:""}}function Zt(){return{type:"thematicBreak"}}}function xa(e){return{line:e.line,column:e.column,offset:e.offset}}function Vj(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Vj(e,r):X_e(e,r)}}function X_e(e,t){let n;for(n in t)if(Hj.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Kk(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+yh({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+yh({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+yh({start:t.start,end:t.end})+") is still open")}function Q_e(e){const t=this;t.parser=n;function n(r){return Y_e(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function J_e(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Z_e(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
383
|
-
`}]}function eCe(e,t){const n=t.value?t.value+`
|
|
384
|
-
`:"",r={};t.lang&&(r.className=["language-"+t.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function tCe(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function nCe(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function rCe(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Wd(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let s,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=o+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function iCe(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function oCe(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Wj(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function sCe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Wj(e,t);const i={src:Wd(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function aCe(e,t){const n={src:Wd(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function lCe(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function cCe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Wj(e,t);const i={href:Wd(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function uCe(e,t){const n={href:Wd(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function dCe(e,t,n){const r=e.all(t),i=n?fCe(n):Uj(t),o={},s=[];if(typeof t.checked=="boolean"){const u=r[0];let d;u&&u.type==="element"&&u.tagName==="p"?d=u:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const u=r[a];(i||a!==0||u.type!=="element"||u.tagName!=="p")&&s.push({type:"text",value:`
|
|
385
|
-
`}),u.type==="element"&&u.tagName==="p"&&!i?s.push(...u.children):s.push(u)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&s.push({type:"text",value:`
|
|
386
|
-
`});const c={type:"element",tagName:"li",properties:o,children:s};return e.patch(t,c),e.applyData(t,c)}function fCe(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=Uj(n[r])}return t}function Uj(e){const t=e.spread;return t??e.children.length>1}function hCe(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function pCe(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function gCe(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function mCe(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function bCe(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=AR(t.children[1]),l=Ej(t.children[t.children.length-1]);a&&l&&(s.position={start:a,end:l}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function yCe(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let l=-1;const c=[];for(;++l<a;){const d=t.children[l],p={},h=s?s[l]:void 0;h&&(p.align=h);let m={type:"element",tagName:o,properties:p,children:[]};d&&(m.children=e.all(d),e.patch(d,m),m=e.applyData(d,m)),c.push(m)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function vCe(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Xk=9,Qk=32;function xCe(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(Jk(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(Jk(t.slice(i),i>0,!1)),o.join("")}function Jk(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===Xk||o===Qk;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===Xk||o===Qk;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function wCe(e,t){const n={type:"text",value:xCe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function SCe(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const _Ce={blockquote:J_e,break:Z_e,code:eCe,delete:tCe,emphasis:nCe,footnoteReference:rCe,heading:iCe,html:oCe,imageReference:sCe,image:aCe,inlineCode:lCe,linkReference:cCe,link:uCe,listItem:dCe,list:hCe,paragraph:pCe,root:gCe,strong:mCe,table:bCe,tableCell:vCe,tableRow:yCe,text:wCe,thematicBreak:SCe,toml:Vm,yaml:Vm,definition:Vm,footnoteDefinition:Vm};function Vm(){}const Gj=-1,H0=0,py=1,gy=2,$R=3,zR=4,BR=5,HR=6,qj=7,Yj=8,Zk=typeof self=="object"?self:globalThis,CCe=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,s]=t[i];switch(o){case H0:case Gj:return n(s,i);case py:{const a=n([],i);for(const l of s)a.push(r(l));return a}case gy:{const a=n({},i);for(const[l,c]of s)a[r(l)]=r(c);return a}case $R:return n(new Date(s),i);case zR:{const{source:a,flags:l}=s;return n(new RegExp(a,l),i)}case BR:{const a=n(new Map,i);for(const[l,c]of s)a.set(r(l),r(c));return a}case HR:{const a=n(new Set,i);for(const l of s)a.add(r(l));return a}case qj:{const{name:a,message:l}=s;return n(new Zk[a](l),i)}case Yj:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i)}return n(new Zk[o](s),i)};return r},eI=e=>CCe(new Map,e)(0),hu="",{toString:ECe}={},{keys:RCe}=Object,Af=e=>{const t=typeof e;if(t!=="object"||!e)return[H0,t];const n=ECe.call(e).slice(8,-1);switch(n){case"Array":return[py,hu];case"Object":return[gy,hu];case"Date":return[$R,hu];case"RegExp":return[zR,hu];case"Map":return[BR,hu];case"Set":return[HR,hu]}return n.includes("Array")?[py,n]:n.includes("Error")?[qj,n]:[gy,n]},Wm=([e,t])=>e===H0&&(t==="function"||t==="symbol"),PCe=(e,t,n,r)=>{const i=(s,a)=>{const l=r.push(s)-1;return n.set(a,l),l},o=s=>{if(n.has(s))return n.get(s);let[a,l]=Af(s);switch(a){case H0:{let u=s;switch(l){case"bigint":a=Yj,u=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return i([Gj],s)}return i([a,u],s)}case py:{if(l)return i([l,[...s]],s);const u=[],d=i([a,u],s);for(const p of s)u.push(o(p));return d}case gy:{if(l)switch(l){case"BigInt":return i([l,s.toString()],s);case"Boolean":case"Number":case"String":return i([l,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());const u=[],d=i([a,u],s);for(const p of RCe(s))(e||!Wm(Af(s[p])))&&u.push([o(p),o(s[p])]);return d}case $R:return i([a,s.toISOString()],s);case zR:{const{source:u,flags:d}=s;return i([a,{source:u,flags:d}],s)}case BR:{const u=[],d=i([a,u],s);for(const[p,h]of s)(e||!(Wm(Af(p))||Wm(Af(h))))&&u.push([o(p),o(h)]);return d}case HR:{const u=[],d=i([a,u],s);for(const p of s)(e||!Wm(Af(p)))&&u.push(o(p));return d}}const{message:c}=s;return i([a,{name:l,message:c}],s)};return o},tI=(e,{json:t,lossy:n}={})=>{const r=[];return PCe(!(t||n),!!t,new Map,r)(e),r},my=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?eI(tI(e,t)):structuredClone(e):(e,t)=>eI(tI(e,t));function TCe(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function MCe(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function OCe(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||TCe,r=e.options.footnoteBackLabel||MCe,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const u=e.all(c),d=String(c.identifier).toUpperCase(),p=Wd(d.toLowerCase());let h=0;const m=[],b=e.footnoteCounts.get(d);for(;b!==void 0&&++h<=b;){m.length>0&&m.push({type:"text",value:" "});let S=typeof n=="string"?n:n(l,h);typeof S=="string"&&(S={type:"text",value:S}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,h),className:["data-footnote-backref"]},children:Array.isArray(S)?S:[S]})}const v=u[u.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const S=v.children[v.children.length-1];S&&S.type==="text"?S.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...m)}else u.push(...m);const x={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(u,!0)};e.patch(c,x),a.push(x)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...my(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
387
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
|
388
|
-
`}]}}const Kj=function(e){if(e==null)return ICe;if(typeof e=="function")return V0(e);if(typeof e=="object")return Array.isArray(e)?DCe(e):ACe(e);if(typeof e=="string")return kCe(e);throw new Error("Expected function, string, or object as test")};function DCe(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Kj(e[n]);return V0(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function ACe(e){const t=e;return V0(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function kCe(e){return V0(t);function t(n){return n&&n.type===e}}function V0(e){return t;function t(n,r,i){return!!(NCe(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function ICe(){return!0}function NCe(e){return e!==null&&typeof e=="object"&&"type"in e}const Xj=[],LCe=!0,nI=!1,FCe="skip";function jCe(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=Kj(i),s=r?-1:1;a(e,void 0,[])();function a(l,c,u){const d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){const h=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(l.type+(h?"<"+h+">":""))+")"})}return p;function p(){let h=Xj,m,b,v;if((!t||o(l,c,u[u.length-1]||void 0))&&(h=$Ce(n(l,u)),h[0]===nI))return h;if("children"in l&&l.children){const x=l;if(x.children&&h[0]!==FCe)for(b=(r?x.children.length:-1)+s,v=u.concat(x);b>-1&&b<x.children.length;){const S=x.children[b];if(m=a(S,b,v)(),m[0]===nI)return m;b=typeof m[1]=="number"?m[1]:b+s}}return h}}}function $Ce(e){return Array.isArray(e)?e:typeof e=="number"?[LCe,e]:e==null?Xj:[e]}function Qj(e,t,n,r){let i,o,s;typeof t=="function"?(o=void 0,s=t,i=n):(o=t,s=n,i=r),jCe(e,o,a,i);function a(l,c){const u=c[c.length-1],d=u?u.children.indexOf(l):void 0;return s(l,d,u)}}const D_={}.hasOwnProperty,zCe={};function BCe(e,t){const n=t||zCe,r=new Map,i=new Map,o=new Map,s={..._Ce,...n.handlers},a={all:c,applyData:VCe,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:s,one:l,options:n,patch:HCe,wrap:UCe};return Qj(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const d=u.type==="definition"?r:i,p=String(u.identifier).toUpperCase();d.has(p)||d.set(p,u)}}),a;function l(u,d){const p=u.type,h=a.handlers[p];if(D_.call(a.handlers,p)&&h)return h(a,u,d);if(a.options.passThrough&&a.options.passThrough.includes(p)){if("children"in u){const{children:b,...v}=u,x=my(v);return x.children=a.all(u),x}return my(u)}return(a.options.unknownHandler||WCe)(a,u,d)}function c(u){const d=[];if("children"in u){const p=u.children;let h=-1;for(;++h<p.length;){const m=a.one(p[h],u);if(m){if(h&&p[h-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=rI(m.value)),!Array.isArray(m)&&m.type==="element")){const b=m.children[0];b&&b.type==="text"&&(b.value=rI(b.value))}Array.isArray(m)?d.push(...m):d.push(m)}}}return d}}function HCe(e,t){e.position&&(t.position=_we(e))}function VCe(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&o&&Object.assign(n.properties,my(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function WCe(e,t){const n=t.data||{},r="value"in t&&!(D_.call(n,"hProperties")||D_.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function UCe(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
389
|
-
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
390
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
391
|
-
`}),n}function rI(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function iI(e,t){const n=BCe(e,t),r=n.one(e,void 0),i=OCe(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
|
|
392
|
-
`},i),o}function GCe(e,t){return e&&"run"in e?async function(n,r){const i=iI(n,{file:r,...t});await e.run(i,r)}:function(n,r){return iI(n,{file:r,...e||t})}}function oI(e){if(e)throw e}var gb=Object.prototype.hasOwnProperty,Jj=Object.prototype.toString,sI=Object.defineProperty,aI=Object.getOwnPropertyDescriptor,lI=function(t){return typeof Array.isArray=="function"?Array.isArray(t):Jj.call(t)==="[object Array]"},cI=function(t){if(!t||Jj.call(t)!=="[object Object]")return!1;var n=gb.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&gb.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||gb.call(t,i)},uI=function(t,n){sI&&n.name==="__proto__"?sI(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},dI=function(t,n){if(n==="__proto__")if(gb.call(t,n)){if(aI)return aI(t,n).value}else return;return t[n]},qCe=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,c=arguments.length,u=!1;for(typeof a=="boolean"&&(u=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<c;++l)if(t=arguments[l],t!=null)for(n in t)r=dI(a,n),i=dI(t,n),a!==i&&(u&&i&&(cI(i)||(o=lI(i)))?(o?(o=!1,s=r&&lI(r)?r:[]):s=r&&cI(r)?r:{},uI(a,{name:n,newValue:e(u,s,i)})):typeof i<"u"&&uI(a,{name:n,newValue:i}));return a};const X1=Oc(qCe);function A_(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function YCe(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...i);function a(l,...c){const u=e[++o];let d=-1;if(l){s(l);return}for(;++d<i.length;)(c[d]===null||c[d]===void 0)&&(c[d]=i[d]);i=c,u?KCe(u,a)(...c):s(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function KCe(e,t){let n;return r;function r(...s){const a=e.length>s.length;let l;a&&s.push(i);try{l=e.apply(this,s)}catch(c){const u=c;if(a&&n)throw u;return i(u)}a||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(s,...a){n||(n=!0,t(s,...a))}function o(s){i(null,s)}}const Ho={basename:XCe,dirname:QCe,extname:JCe,join:ZCe,sep:"/"};function XCe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Xp(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function QCe(e){if(Xp(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function JCe(e){Xp(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function ZCe(...e){let t=-1,n;for(;++t<e.length;)Xp(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":eEe(n)}function eEe(e){Xp(e);const t=e.codePointAt(0)===47;let n=tEe(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function tEe(e,t){let n="",r=0,i=-1,o=0,s=-1,a,l;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(i===s-1||o===1))if(i!==s-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function Xp(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const nEe={cwd:rEe};function rEe(){return"/"}function k_(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function iEe(e){if(typeof e=="string")e=new URL(e);else if(!k_(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return oEe(e)}function oEe(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Q1=["history","path","basename","stem","extname","dirname"];class Zj{constructor(t){let n;t?k_(t)?n={path:t}:typeof t=="string"||sEe(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":nEe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Q1.length;){const o=Q1[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)Q1.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Ho.basename(this.path):void 0}set basename(t){Z1(t,"basename"),J1(t,"basename"),this.path=Ho.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ho.dirname(this.path):void 0}set dirname(t){fI(this.basename,"dirname"),this.path=Ho.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ho.extname(this.path):void 0}set extname(t){if(J1(t,"extname"),fI(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ho.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){k_(t)&&(t=iEe(t)),Z1(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ho.basename(this.path,this.extname):void 0}set stem(t){Z1(t,"stem"),J1(t,"stem"),this.path=Ho.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new kr(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function J1(e,t){if(e&&e.includes(Ho.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ho.sep+"`")}function Z1(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function fI(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function sEe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const aEe=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},lEe={}.hasOwnProperty;class VR extends aEe{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=YCe()}copy(){const t=new VR;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(X1(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(nw("data",this.frozen),this.namespace[t]=n,this):lEe.call(this.namespace,t)&&this.namespace[t]||void 0:t?(nw("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Um(t),r=this.parser||this.Parser;return ew("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),ew("process",this.parser||this.Parser),tw("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,s){const a=Um(t),l=r.parse(a);r.run(l,a,function(u,d,p){if(u||!d||!p)return c(u);const h=d,m=r.stringify(h,p);dEe(m)?p.value=m:p.result=m,c(u,p)});function c(u,d){u||!d?s(u):o?o(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),ew("processSync",this.parser||this.Parser),tw("processSync",this.compiler||this.Compiler),this.process(t,i),pI("processSync","process",n),r;function i(o,s){n=!0,oI(o),r=s}}run(t,n,r){hI(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(s,a){const l=Um(n);i.run(t,l,c);function c(u,d,p){const h=d||t;u?a(u):s?s(h):r(void 0,h,p)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),pI("runSync","run",r),i;function o(s,a){oI(s),i=a,r=!0}}stringify(t,n){this.freeze();const r=Um(n),i=this.compiler||this.Compiler;return tw("stringify",i),hI(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(nw("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...d]=c;l(u,d)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(i.settings=X1(!0,i.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const d=c[u];o(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let d=-1,p=-1;for(;++d<r.length;)if(r[d][0]===c){p=d;break}if(p===-1)r.push([c,...u]);else if(u.length>0){let[h,...m]=u;const b=r[p][1];A_(b)&&A_(h)&&(h=X1(!0,b,h)),r[p]=[c,h,...m]}}}}const cEe=new VR().freeze();function ew(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function tw(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function nw(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function hI(e){if(!A_(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function pI(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Um(e){return uEe(e)?e:new Zj(e)}function uEe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function dEe(e){return typeof e=="string"||fEe(e)}function fEe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const hEe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",gI=[],mI={allowDangerousHtml:!0},pEe=/^(https?|ircs?|mailto|xmpp)$/i,gEe=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function e9(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,o=e.components,s=e.disallowedElements,a=e.rehypePlugins||gI,l=e.remarkPlugins||gI,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...mI}:mI,u=e.skipHtml,d=e.unwrapDisallowed,p=e.urlTransform||mEe,h=cEe().use(Q_e).use(l).use(GCe,c).use(a),m=new Zj;typeof r=="string"&&(m.value=r);for(const S of gEe)Object.hasOwn(e,S.from)&&(""+S.from+(S.to?"use `"+S.to+"` instead":"remove it")+hEe+S.id,void 0);const b=h.parse(m);let v=h.runSync(b,m);return i&&(v={type:"element",tagName:"div",properties:{className:i},children:v.type==="root"?v.children:[v]}),Qj(v,x),Mwe(v,{Fragment:y.Fragment,components:o,ignoreInvalidStyle:!0,jsx:y.jsx,jsxs:y.jsxs,passKeys:!0,passNode:!0});function x(S,_,E){if(S.type==="raw"&&E&&typeof _=="number")return u?E.children.splice(_,1):E.children[_]={type:"text",value:S.value},_;if(S.type==="element"){let C;for(C in q1)if(Object.hasOwn(q1,C)&&Object.hasOwn(S.properties,C)){const M=S.properties[C],O=q1[C];(O===null||O.includes(S.tagName))&&(S.properties[C]=p(String(M||""),C,S))}}if(S.type==="element"){let C=t?!t.includes(S.tagName):s?s.includes(S.tagName):!1;if(!C&&n&&typeof _=="number"&&(C=!n(S,_,E)),C&&E&&typeof _=="number")return d&&S.children?E.children.splice(_,1,...S.children):E.children.splice(_,1),_}}}function mEe(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||pEe.test(e.slice(0,t))?e:""}function bEe(){const e=P.useRef(null),[t,n]=P.useState(""),[r,i]=P.useState(!1),o=ye(N=>N.dashboard.aiScopeTables);Qy();const s=ye(N=>N.selectedSheetId),{addFrame:a,setSelectedFrameId:l,setIsDashboardEditing:c}=Hn(),{authToken:u}=Vi(),d=nC(),{messages:p,input:h,handleInputChange:m,handleSubmit:b,addToolResult:v,stop:x,isLoading:S}=F1e({api:"https://semaphor.cloud/api/v1/chat",headers:{Authorization:`Bearer ${u==null?void 0:u.accessToken}`},maxSteps:10,async onToolCall({toolCall:N}){if(E(N.toolName),N.toolName==="getLocation"){const F=["New York","Los Angeles","Chicago","San Francisco"];return F[Math.floor(Math.random()*F.length)]}if(N.toolName==="getTables")return JSON.stringify(o||[]);if(N.toolName==="getData"){console.log(N.args);const F=N.args;if(!(F!=null&&F.sql)||!(F!=null&&F.connectionId))return"Please provide sql, connectionId and table";const j=await d.fetchQuery({queryKey:["chat",F.connectionId,F.sql],queryFn:()=>Dy("https://semaphor.cloud/api/v1/query",(u==null?void 0:u.accessToken)||(u==null?void 0:u.accessToken)||"",{connection_id:F.connectionId,sql:F.sql,cache_config:Q_()})});return n("Summarizing"),JSON.stringify(j)}},onFinish(N,F){console.log("onFinish",N,F),N.content&&n("")}}),_=()=>{var N;(N=e.current)==null||N.scrollIntoView({behavior:"smooth"})};P.useEffect(()=>{_()},[p]);function E(N){N==="getTables"&&n("Initializing"),N==="getSchemas"&&n("Analyzing"),N==="getData"&&n("Fetching")}function C(N){const F=N.toolInvocations||[];return F.length===0||F.find($=>$.toolName==="getData"&&"result"in $)?!0:r}function M(N){return N==null?void 0:N.map(F=>{var $;const j=F.role==="user";return C(F)?y.jsxs("div",{className:be("relative rounded-md bg-background px-4 py-4 text-sm text-foreground/80",{"bg-muted":j}),children:[y.jsx("div",{className:"space-y-2",children:y.jsxs("div",{className:"flex shrink-0 items-start gap-3",children:[y.jsx("div",{className:"text-muted-foreground",children:j?y.jsx(d4,{className:"size-5 shrink-0"}):y.jsx(eS,{className:"size-5 shrink-0"})}),y.jsx("div",{children:y.jsx(e9,{components:yEe,children:F.content})})]})}),($=F.toolInvocations)==null?void 0:$.map(X=>{const V=X.toolCallId;return"result"in X?y.jsx("div",{children:O(X)},V):y.jsxs("div",{children:["Calling ",X.toolName,"..."]},V)})]},F.id):null})}function O(N){if("result"in N){let F;try{const j=JSON.parse(N.result);if(F=y.jsx("pre",{className:"whitespace-normal text-xs",children:JSON.stringify(j,null,2)}),N.toolName==="getData"){const $=bE({cardType:N.args.chartType,data:j.records});return y.jsxs("div",{className:"space-y-2",children:[r&&y.jsxs("div",{children:[y.jsx("span",{className:"font-semibold text-blue-700",children:"Tool call"})," ",`${N.toolName}: `,F]}),y.jsxs("div",{className:"flex h-[350px] w-[99%] grow flex-col py-2",children:[y.jsx(pi,{onClick:()=>{const X=N.args.chartTitle,V=N.args.connectionId;k({sql:N.args.sql,data:j.records,cardType:N.args.chartType,cardCfg:$,cardTitle:X,connectionId:V})},variant:"secondary",size:"sm",className:"absolute right-3 top-3",children:"Add"}),$&&y.jsx(UE,{cfg:$})]})]})}}catch{F=y.jsx("span",{children:N.result})}return y.jsxs("div",{children:[y.jsx("span",{className:"font-semibold text-blue-700",children:"Tool call"})," ",`${N.toolName}: `,F]})}return`Calling ${N.toolName}...`}function k({sql:N,data:F,cardCfg:j,cardTitle:$,connectionId:X,cardType:V}){if(!s)return;const L={id:Va(),title:$||"Title",description:"Description",preferences:{onClickFilter:[{columnIndex:0,expression:""}],chartOptions:{indexAxis:V==="horizontalBar"?"y":"x"}},type:j.type,cfg:j,sql:N,data:F,connectionId:X},U={id:Va(),cards:[L],activeCardId:L.id};c(!0),a(s,U,"start"),l(U.id)}return y.jsxs("div",{role:"chat-box",className:"flex h-full grow flex-col justify-between break-words rounded-md bg-muted/30 px-6 py-8",children:[y.jsxs("div",{className:"flex items-center gap-3",children:[y.jsx(wn,{className:"flex items-center gap-2 text-xl",children:"Assistant"}),y.jsxs(Fd,{openDelay:700,children:[y.jsx(jd,{children:y.jsx(o4,{className:"size-4 text-muted-foreground"})}),y.jsx(Fc,{className:"w-70",children:y.jsxs("div",{className:"flex justify-between space-x-2 text-muted-foreground",children:[y.jsx(eS,{className:"size-5"}),y.jsxs("div",{className:"space-y-1",children:[y.jsx("p",{className:"text-sm",children:o&&(o==null?void 0:o.length)>0?"I can analyze following datasets":"No datasets in scope"}),y.jsx("div",{className:"space-y-2 pt-2",children:o==null?void 0:o.map((N,F)=>y.jsxs("div",{className:"flex gap-2 text-xs",children:[y.jsx(c4,{className:"size-4 opacity-70"}),y.jsx("span",{children:N.tableName})]},F))})]})]})})]}),!1]}),y.jsx(kp,{className:"my-4"}),y.jsx("div",{className:"",children:y.jsxs("form",{className:"mb-1 flex w-full grow items-center justify-between gap-2 rounded-md",onSubmit:b,children:[y.jsxs("div",{className:"flex w-full items-center justify-between rounded-md border bg-background",children:[y.jsx(lc,{className:"w-full border-none focus-visible:ring-0 focus-visible:ring-offset-0",value:h,disabled:S,placeholder:"What can I help you with?",onChange:m}),y.jsx("button",{className:"mr-3",children:y.jsx(z5,{className:"size-4 text-muted-foreground/70 hover:text-muted-foreground"})})]}),S&&y.jsx(pi,{size:"sm",className:"rounded-full",onClick:()=>x(),children:y.jsx(cee,{className:"size-2.5 bg-background"})})]})}),y.jsxs(cc,{className:"flex flex-1 basis-0 flex-col flex-wrap justify-end",children:[y.jsxs("div",{className:"flex items-center text-xs text-foreground/90",children:[S&&t!==""&&y.jsx(JZ,{className:"size-10 animate-pulse"}),t]}),y.jsx("div",{className:"flex flex-col-reverse gap-2 py-2",children:M(p)}),y.jsx($p,{orientation:"vertical"})]})]})}const yEe={li:({node:e,...t})=>y.jsx("li",{className:"my-2 ml-5 list-disc rounded-md bg-muted/50 px-2 py-1",...t}),pre:({node:e,...t})=>y.jsx("pre",{className:"word my-2 overflow-auto whitespace-pre-wrap break-words rounded-md bg-muted/50 p-2 text-xs text-foreground/80",...t})},{createElement:_d,createContext:vEe,createRef:pMe,forwardRef:t9,useCallback:ai,useContext:n9,useEffect:dc,useImperativeHandle:r9,useLayoutEffect:xEe,useMemo:wEe,useRef:ui,useState:ju}=R,bI=R[`useId${Math.random()}`.slice(0,5)],SEe=xEe,W0=vEe(null);W0.displayName="PanelGroupContext";const fc=SEe,_Ee=typeof bI=="function"?bI:()=>null;let CEe=0;function WR(e=null){const t=_Ee(),n=ui(e||t||null);return n.current===null&&(n.current=""+CEe++),e??n.current}function i9({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:i,forwardedRef:o,id:s,maxSize:a,minSize:l,onCollapse:c,onExpand:u,onResize:d,order:p,style:h,tagName:m="div",...b}){const v=n9(W0);if(v===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:x,expandPanel:S,getPanelSize:_,getPanelStyle:E,groupId:C,isPanelCollapsed:M,reevaluatePanelConstraints:O,registerPanel:k,resizePanel:N,unregisterPanel:F}=v,j=WR(s),$=ui({callbacks:{onCollapse:c,onExpand:u,onResize:d},constraints:{collapsedSize:n,collapsible:r,defaultSize:i,maxSize:a,minSize:l},id:j,idIsFromProps:s!==void 0,order:p});ui({didLogMissingDefaultSizeWarning:!1}),fc(()=>{const{callbacks:V,constraints:L}=$.current,U={...L};$.current.id=j,$.current.idIsFromProps=s!==void 0,$.current.order=p,V.onCollapse=c,V.onExpand=u,V.onResize=d,L.collapsedSize=n,L.collapsible=r,L.defaultSize=i,L.maxSize=a,L.minSize=l,(U.collapsedSize!==L.collapsedSize||U.collapsible!==L.collapsible||U.maxSize!==L.maxSize||U.minSize!==L.minSize)&&O($.current,U)}),fc(()=>{const V=$.current;return k(V),()=>{F(V)}},[p,j,k,F]),r9(o,()=>({collapse:()=>{x($.current)},expand:V=>{S($.current,V)},getId(){return j},getSize(){return _($.current)},isCollapsed(){return M($.current)},isExpanded(){return!M($.current)},resize:V=>{N($.current,V)}}),[x,S,_,M,j,N]);const X=E($.current,i);return _d(m,{...b,children:e,className:t,id:s,style:{...X,...h},"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-group-id":C,"data-panel-id":j,"data-panel-size":parseFloat(""+X.flexGrow).toFixed(1)})}const o9=t9((e,t)=>_d(i9,{...e,forwardedRef:t}));i9.displayName="Panel";o9.displayName="forwardRef(Panel)";let I_=null,Wl=null;function EEe(e,t){if(t){const n=(t&u9)!==0,r=(t&d9)!==0,i=(t&f9)!==0,o=(t&h9)!==0;if(n)return i?"se-resize":o?"ne-resize":"e-resize";if(r)return i?"sw-resize":o?"nw-resize":"w-resize";if(i)return"s-resize";if(o)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function REe(){Wl!==null&&(document.head.removeChild(Wl),I_=null,Wl=null)}function rw(e,t){const n=EEe(e,t);I_!==n&&(I_=n,Wl===null&&(Wl=document.createElement("style"),document.head.appendChild(Wl)),Wl.innerHTML=`*{cursor: ${n}!important;}`)}function s9(e){return e.type==="keydown"}function a9(e){return e.type.startsWith("pointer")}function l9(e){return e.type.startsWith("mouse")}function U0(e){if(a9(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(l9(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function PEe(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function TEe(e,t,n){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function MEe(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:xI(e),b:xI(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;bt(r,"Stacking order can only be calculated for elements with a common ancestor");const i={a:vI(yI(n.a)),b:vI(yI(n.b))};if(i.a===i.b){const o=r.childNodes,s={a:n.a.at(-1),b:n.b.at(-1)};let a=o.length;for(;a--;){const l=o[a];if(l===s.a)return 1;if(l===s.b)return-1}}return Math.sign(i.a-i.b)}const OEe=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function DEe(e){var t;const n=getComputedStyle((t=c9(e))!==null&&t!==void 0?t:e).display;return n==="flex"||n==="inline-flex"}function AEe(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||DEe(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||OEe.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function yI(e){let t=e.length;for(;t--;){const n=e[t];if(bt(n,"Missing node"),AEe(n))return n}return null}function vI(e){return e&&Number(getComputedStyle(e).zIndex)||0}function xI(e){const t=[];for(;e;)t.push(e),e=c9(e);return t}function c9(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const u9=1,d9=2,f9=4,h9=8,kEe=PEe()==="coarse";let Oo=[],$u=!1,Ea=new Map,G0=new Map;const lp=new Set;function IEe(e,t,n,r,i){var o;const{ownerDocument:s}=t,a={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:i},l=(o=Ea.get(s))!==null&&o!==void 0?o:0;return Ea.set(s,l+1),lp.add(a),by(),function(){var u;G0.delete(e),lp.delete(a);const d=(u=Ea.get(s))!==null&&u!==void 0?u:1;if(Ea.set(s,d-1),by(),d===1&&Ea.delete(s),Oo.includes(a)){const p=Oo.indexOf(a);p>=0&&Oo.splice(p,1),GR(),i("up",!0,null)}}}function wI(e){const{target:t}=e,{x:n,y:r}=U0(e);$u=!0,UR({target:t,x:n,y:r}),by(),Oo.length>0&&(yy("down",e),e.preventDefault(),e.stopPropagation())}function kf(e){const{x:t,y:n}=U0(e);if($u&&e.buttons===0&&($u=!1,yy("up",e)),!$u){const{target:r}=e;UR({target:r,x:t,y:n})}yy("move",e),GR(),Oo.length>0&&e.preventDefault()}function pu(e){const{target:t}=e,{x:n,y:r}=U0(e);G0.clear(),$u=!1,Oo.length>0&&e.preventDefault(),yy("up",e),UR({target:t,x:n,y:r}),GR(),by()}function UR({target:e,x:t,y:n}){Oo.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),lp.forEach(i=>{const{element:o,hitAreaMargins:s}=i,a=o.getBoundingClientRect(),{bottom:l,left:c,right:u,top:d}=a,p=kEe?s.coarse:s.fine;if(t>=c-p&&t<=u+p&&n>=d-p&&n<=l+p){if(r!==null&&document.contains(r)&&o!==r&&!o.contains(r)&&!r.contains(o)&&MEe(r,o)>0){let m=r,b=!1;for(;m&&!m.contains(o);){if(TEe(m.getBoundingClientRect(),a)){b=!0;break}m=m.parentElement}if(b)return}Oo.push(i)}})}function iw(e,t){G0.set(e,t)}function GR(){let e=!1,t=!1;Oo.forEach(r=>{const{direction:i}=r;i==="horizontal"?e=!0:t=!0});let n=0;G0.forEach(r=>{n|=r}),e&&t?rw("intersection",n):e?rw("horizontal",n):t?rw("vertical",n):REe()}function by(){Ea.forEach((e,t)=>{const{body:n}=t;n.removeEventListener("contextmenu",pu),n.removeEventListener("pointerdown",wI),n.removeEventListener("pointerleave",kf),n.removeEventListener("pointermove",kf)}),window.removeEventListener("pointerup",pu),window.removeEventListener("pointercancel",pu),lp.size>0&&($u?(Oo.length>0&&Ea.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("contextmenu",pu),n.addEventListener("pointerleave",kf),n.addEventListener("pointermove",kf))}),window.addEventListener("pointerup",pu),window.addEventListener("pointercancel",pu)):Ea.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("pointerdown",wI,{capture:!0}),n.addEventListener("pointermove",kf))}))}function yy(e,t){lp.forEach(n=>{const{setResizeHandlerState:r}=n,i=Oo.includes(n);r(e,i,t)})}function NEe(){const[e,t]=ju(0);return ai(()=>t(n=>n+1),[])}function bt(e,t){if(!e)throw console.error(t),Error(t)}const qR=10;function Rc(e,t,n=qR){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function Us(e,t,n=qR){return Rc(e,t,n)===0}function Ai(e,t,n){return Rc(e,t,n)===0}function LEe(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){const i=e[r],o=t[r];if(!Ai(i,o,n))return!1}return!0}function Cu({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];bt(r!=null,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:o,maxSize:s=100,minSize:a=0}=r;if(Rc(n,a)<0)if(o){const l=(i+a)/2;Rc(n,l)<0?n=i:n=a}else n=a;return n=Math.min(s,n),n=parseFloat(n.toFixed(qR)),n}function Xf({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:o}){if(Ai(e,0))return t;const s=[...t],[a,l]=r;bt(a!=null,"Invalid first pivot index"),bt(l!=null,"Invalid second pivot index");let c=0;if(o==="keyboard"){{const d=e<0?l:a,p=n[d];bt(p,`Panel constraints not found for index ${d}`);const{collapsedSize:h=0,collapsible:m,minSize:b=0}=p;if(m){const v=t[d];if(bt(v!=null,`Previous layout not found for panel index ${d}`),Ai(v,h)){const x=b-v;Rc(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}{const d=e<0?a:l,p=n[d];bt(p,`No panel constraints found for index ${d}`);const{collapsedSize:h=0,collapsible:m,minSize:b=0}=p;if(m){const v=t[d];if(bt(v!=null,`Previous layout not found for panel index ${d}`),Ai(v,b)){const x=v-h;Rc(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}}{const d=e<0?1:-1;let p=e<0?l:a,h=0;for(;;){const b=t[p];bt(b!=null,`Previous layout not found for panel index ${p}`);const x=Cu({panelConstraints:n,panelIndex:p,size:100})-b;if(h+=x,p+=d,p<0||p>=n.length)break}const m=Math.min(Math.abs(e),Math.abs(h));e=e<0?0-m:m}{let p=e<0?a:l;for(;p>=0&&p<n.length;){const h=Math.abs(e)-Math.abs(c),m=t[p];bt(m!=null,`Previous layout not found for panel index ${p}`);const b=m-h,v=Cu({panelConstraints:n,panelIndex:p,size:b});if(!Ai(m,v)&&(c+=m-v,s[p]=v,c.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?p--:p++}}if(LEe(i,s))return i;{const d=e<0?l:a,p=t[d];bt(p!=null,`Previous layout not found for panel index ${d}`);const h=p+c,m=Cu({panelConstraints:n,panelIndex:d,size:h});if(s[d]=m,!Ai(m,h)){let b=h-m,x=e<0?l:a;for(;x>=0&&x<n.length;){const S=s[x];bt(S!=null,`Previous layout not found for panel index ${x}`);const _=S+b,E=Cu({panelConstraints:n,panelIndex:x,size:_});if(Ai(S,E)||(b-=E-S,s[x]=E),Ai(b,0))break;e>0?x--:x++}}}const u=s.reduce((d,p)=>p+d,0);return Ai(u,100)?s:i}function FEe({layout:e,panelsArray:t,pivotIndices:n}){let r=0,i=100,o=0,s=0;const a=n[0];bt(a!=null,"No pivot index found"),t.forEach((d,p)=>{const{constraints:h}=d,{maxSize:m=100,minSize:b=0}=h;p===a?(r=b,i=m):(o+=b,s+=m)});const l=Math.min(i,100-o),c=Math.max(r,100-s),u=e[a];return{valueMax:l,valueMin:c,valueNow:u}}function cp(e,t=document){return Array.from(t.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function p9(e,t,n=document){const i=cp(e,n).findIndex(o=>o.getAttribute("data-panel-resize-handle-id")===t);return i??null}function g9(e,t,n){const r=p9(e,t,n);return r!=null?[r,r+1]:[-1,-1]}function m9(e,t=document){var n;if(t instanceof HTMLElement&&(t==null||(n=t.dataset)===null||n===void 0?void 0:n.panelGroupId)==e)return t;const r=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return r||null}function q0(e,t=document){const n=t.querySelector(`[data-panel-resize-handle-id="${e}"]`);return n||null}function jEe(e,t,n,r=document){var i,o,s,a;const l=q0(t,r),c=cp(e,r),u=l?c.indexOf(l):-1,d=(i=(o=n[u])===null||o===void 0?void 0:o.id)!==null&&i!==void 0?i:null,p=(s=(a=n[u+1])===null||a===void 0?void 0:a.id)!==null&&s!==void 0?s:null;return[d,p]}function $Ee({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:i,panelGroupElement:o,setLayout:s}){ui({didWarnAboutMissingResizeHandle:!1}),fc(()=>{if(!o)return;const a=cp(n,o);for(let l=0;l<i.length-1;l++){const{valueMax:c,valueMin:u,valueNow:d}=FEe({layout:r,panelsArray:i,pivotIndices:[l,l+1]}),p=a[l];if(p!=null){const h=i[l];bt(h,`No panel data found for index "${l}"`),p.setAttribute("aria-controls",h.id),p.setAttribute("aria-valuemax",""+Math.round(c)),p.setAttribute("aria-valuemin",""+Math.round(u)),p.setAttribute("aria-valuenow",d!=null?""+Math.round(d):"")}}return()=>{a.forEach((l,c)=>{l.removeAttribute("aria-controls"),l.removeAttribute("aria-valuemax"),l.removeAttribute("aria-valuemin"),l.removeAttribute("aria-valuenow")})}},[n,r,i,o]),dc(()=>{if(!o)return;const a=t.current;bt(a,"Eager values not found");const{panelDataArray:l}=a,c=m9(n,o);bt(c!=null,`No group found for id "${n}"`);const u=cp(n,o);bt(u,`No resize handles found for group id "${n}"`);const d=u.map(p=>{const h=p.getAttribute("data-panel-resize-handle-id");bt(h,"Resize handle element has no handle id attribute");const[m,b]=jEe(n,h,l,o);if(m==null||b==null)return()=>{};const v=x=>{if(!x.defaultPrevented)switch(x.key){case"Enter":{x.preventDefault();const S=l.findIndex(_=>_.id===m);if(S>=0){const _=l[S];bt(_,`No panel data found for index ${S}`);const E=r[S],{collapsedSize:C=0,collapsible:M,minSize:O=0}=_.constraints;if(E!=null&&M){const k=Xf({delta:Ai(E,C)?O-C:C-E,initialLayout:r,panelConstraints:l.map(N=>N.constraints),pivotIndices:g9(n,h,o),prevLayout:r,trigger:"keyboard"});r!==k&&s(k)}}break}}};return p.addEventListener("keydown",v),()=>{p.removeEventListener("keydown",v)}});return()=>{d.forEach(p=>p())}},[o,e,t,n,r,i,s])}function SI(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function b9(e,t){const n=e==="horizontal",{x:r,y:i}=U0(t);return n?r:i}function zEe(e,t,n,r,i){const o=n==="horizontal",s=q0(t,i);bt(s,`No resize handle element found for id "${t}"`);const a=s.getAttribute("data-panel-group-id");bt(a,"Resize handle element has no group id attribute");let{initialCursorPosition:l}=r;const c=b9(n,e),u=m9(a,i);bt(u,`No group element found for id "${a}"`);const d=u.getBoundingClientRect(),p=o?d.width:d.height;return(c-l)/p*100}function BEe(e,t,n,r,i,o){if(s9(e)){const s=n==="horizontal";let a=0;e.shiftKey?a=100:i!=null?a=i:a=10;let l=0;switch(e.key){case"ArrowDown":l=s?0:a;break;case"ArrowLeft":l=s?-a:0;break;case"ArrowRight":l=s?a:0;break;case"ArrowUp":l=s?0:-a;break;case"End":l=100;break;case"Home":l=-100;break}return l}else return r==null?0:zEe(e,t,n,r,o)}function HEe({panelDataArray:e}){const t=Array(e.length),n=e.map(o=>o.constraints);let r=0,i=100;for(let o=0;o<e.length;o++){const s=n[o];bt(s,`Panel constraints not found for index ${o}`);const{defaultSize:a}=s;a!=null&&(r++,t[o]=a,i-=a)}for(let o=0;o<e.length;o++){const s=n[o];bt(s,`Panel constraints not found for index ${o}`);const{defaultSize:a}=s;if(a!=null)continue;const l=e.length-r,c=i/l;r++,t[o]=c,i-=c}return t}function gu(e,t,n){t.forEach((r,i)=>{const o=e[i];bt(o,`Panel data not found for index ${i}`);const{callbacks:s,constraints:a,id:l}=o,{collapsedSize:c=0,collapsible:u}=a,d=n[l];if(d==null||r!==d){n[l]=r;const{onCollapse:p,onExpand:h,onResize:m}=s;m&&m(r,d),u&&(p||h)&&(h&&(d==null||Us(d,c))&&!Us(r,c)&&h(),p&&(d==null||!Us(d,c))&&Us(r,c)&&p())}})}function Gm(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function VEe({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:i,precision:o=3}){const s=n[i];let a;return s==null?a=e!=null?e.toPrecision(o):"1":r.length===1?a="1":a=s.toPrecision(o),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}function WEe(e,t=10){let n=null;return(...i)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...i)},t)}}function _I(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function y9(e){return`react-resizable-panels:${e}`}function v9(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:i,order:o}=t;return i?r:o?`${o}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function x9(e,t){try{const n=y9(e),r=t.getItem(n);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function UEe(e,t,n){var r,i;const o=(r=x9(e,n))!==null&&r!==void 0?r:{},s=v9(t);return(i=o[s])!==null&&i!==void 0?i:null}function GEe(e,t,n,r,i){var o;const s=y9(e),a=v9(t),l=(o=x9(e,i))!==null&&o!==void 0?o:{};l[a]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{i.setItem(s,JSON.stringify(l))}catch(c){console.error(c)}}function CI({layout:e,panelConstraints:t}){const n=[...e],r=n.reduce((o,s)=>o+s,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(o=>`${o}%`).join(", ")}`);if(!Ai(r,100)&&n.length>0)for(let o=0;o<t.length;o++){const s=n[o];bt(s!=null,`No layout data found for index ${o}`);const a=100/r*s;n[o]=a}let i=0;for(let o=0;o<t.length;o++){const s=n[o];bt(s!=null,`No layout data found for index ${o}`);const a=Cu({panelConstraints:t,panelIndex:o,size:s});s!=a&&(i+=s-a,n[o]=a)}if(!Ai(i,0))for(let o=0;o<t.length;o++){const s=n[o];bt(s!=null,`No layout data found for index ${o}`);const a=s+i,l=Cu({panelConstraints:t,panelIndex:o,size:a});if(s!==l&&(i-=l-s,n[o]=l,Ai(i,0)))break}return n}const qEe=100,Qf={getItem:e=>(_I(Qf),Qf.getItem(e)),setItem:(e,t)=>{_I(Qf),Qf.setItem(e,t)}},EI={};function w9({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:i,id:o=null,onLayout:s=null,keyboardResizeBy:a=null,storage:l=Qf,style:c,tagName:u="div",...d}){const p=WR(o),h=ui(null),[m,b]=ju(null),[v,x]=ju([]),S=NEe(),_=ui({}),E=ui(new Map),C=ui(0),M=ui({autoSaveId:e,direction:r,dragState:m,id:p,keyboardResizeBy:a,onLayout:s,storage:l}),O=ui({layout:v,panelDataArray:[],panelDataArrayChanged:!1});ui({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),r9(i,()=>({getId:()=>M.current.id,getLayout:()=>{const{layout:D}=O.current;return D},setLayout:D=>{const{onLayout:ee}=M.current,{layout:K,panelDataArray:oe}=O.current,J=CI({layout:D,panelConstraints:oe.map(Z=>Z.constraints)});SI(K,J)||(x(J),O.current.layout=J,ee&&ee(J),gu(oe,J,_.current))}}),[]),fc(()=>{M.current.autoSaveId=e,M.current.direction=r,M.current.dragState=m,M.current.id=p,M.current.onLayout=s,M.current.storage=l}),$Ee({committedValuesRef:M,eagerValuesRef:O,groupId:p,layout:v,panelDataArray:O.current.panelDataArray,setLayout:x,panelGroupElement:h.current}),dc(()=>{const{panelDataArray:D}=O.current;if(e){if(v.length===0||v.length!==D.length)return;let ee=EI[e];ee==null&&(ee=WEe(GEe,qEe),EI[e]=ee);const K=[...D],oe=new Map(E.current);ee(e,K,oe,v,l)}},[e,v,l]),dc(()=>{});const k=ai(D=>{const{onLayout:ee}=M.current,{layout:K,panelDataArray:oe}=O.current;if(D.constraints.collapsible){const J=oe.map(pe=>pe.constraints),{collapsedSize:Z=0,panelSize:ae,pivotIndices:ce}=El(oe,D,K);if(bt(ae!=null,`Panel size not found for panel "${D.id}"`),!Us(ae,Z)){E.current.set(D.id,ae);const ie=bu(oe,D)===oe.length-1?ae-Z:Z-ae,ge=Xf({delta:ie,initialLayout:K,panelConstraints:J,pivotIndices:ce,prevLayout:K,trigger:"imperative-api"});Gm(K,ge)||(x(ge),O.current.layout=ge,ee&&ee(ge),gu(oe,ge,_.current))}}},[]),N=ai((D,ee)=>{const{onLayout:K}=M.current,{layout:oe,panelDataArray:J}=O.current;if(D.constraints.collapsible){const Z=J.map(de=>de.constraints),{collapsedSize:ae=0,panelSize:ce=0,minSize:pe=0,pivotIndices:ie}=El(J,D,oe),ge=ee??pe;if(Us(ce,ae)){const de=E.current.get(D.id),Ee=de!=null&&de>=ge?de:ge,$e=bu(J,D)===J.length-1?ce-Ee:Ee-ce,Te=Xf({delta:$e,initialLayout:oe,panelConstraints:Z,pivotIndices:ie,prevLayout:oe,trigger:"imperative-api"});Gm(oe,Te)||(x(Te),O.current.layout=Te,K&&K(Te),gu(J,Te,_.current))}}},[]),F=ai(D=>{const{layout:ee,panelDataArray:K}=O.current,{panelSize:oe}=El(K,D,ee);return bt(oe!=null,`Panel size not found for panel "${D.id}"`),oe},[]),j=ai((D,ee)=>{const{panelDataArray:K}=O.current,oe=bu(K,D);return VEe({defaultSize:ee,dragState:m,layout:v,panelData:K,panelIndex:oe})},[m,v]),$=ai(D=>{const{layout:ee,panelDataArray:K}=O.current,{collapsedSize:oe=0,collapsible:J,panelSize:Z}=El(K,D,ee);return bt(Z!=null,`Panel size not found for panel "${D.id}"`),J===!0&&Us(Z,oe)},[]),X=ai(D=>{const{layout:ee,panelDataArray:K}=O.current,{collapsedSize:oe=0,collapsible:J,panelSize:Z}=El(K,D,ee);return bt(Z!=null,`Panel size not found for panel "${D.id}"`),!J||Rc(Z,oe)>0},[]),V=ai(D=>{const{panelDataArray:ee}=O.current;ee.push(D),ee.sort((K,oe)=>{const J=K.order,Z=oe.order;return J==null&&Z==null?0:J==null?-1:Z==null?1:J-Z}),O.current.panelDataArrayChanged=!0,S()},[S]);fc(()=>{if(O.current.panelDataArrayChanged){O.current.panelDataArrayChanged=!1;const{autoSaveId:D,onLayout:ee,storage:K}=M.current,{layout:oe,panelDataArray:J}=O.current;let Z=null;if(D){const ce=UEe(D,J,K);ce&&(E.current=new Map(Object.entries(ce.expandToSizes)),Z=ce.layout)}Z==null&&(Z=HEe({panelDataArray:J}));const ae=CI({layout:Z,panelConstraints:J.map(ce=>ce.constraints)});SI(oe,ae)||(x(ae),O.current.layout=ae,ee&&ee(ae),gu(J,ae,_.current))}}),fc(()=>{const D=O.current;return()=>{D.layout=[]}},[]);const L=ai(D=>{let ee=!1;const K=h.current;return K&&window.getComputedStyle(K,null).getPropertyValue("direction")==="rtl"&&(ee=!0),function(J){J.preventDefault();const Z=h.current;if(!Z)return()=>null;const{direction:ae,dragState:ce,id:pe,keyboardResizeBy:ie,onLayout:ge}=M.current,{layout:de,panelDataArray:Ee}=O.current,{initialLayout:De}=ce??{},$e=g9(pe,D,Z);let Te=BEe(J,D,ae,ce,ie,Z);const ze=ae==="horizontal";ze&&ee&&(Te=-Te);const yt=Ee.map(Ot=>Ot.constraints),Mt=Xf({delta:Te,initialLayout:De??de,panelConstraints:yt,pivotIndices:$e,prevLayout:de,trigger:s9(J)?"keyboard":"mouse-or-touch"}),mn=!Gm(de,Mt);(a9(J)||l9(J))&&C.current!=Te&&(C.current=Te,!mn&&Te!==0?ze?iw(D,Te<0?u9:d9):iw(D,Te<0?f9:h9):iw(D,0)),mn&&(x(Mt),O.current.layout=Mt,ge&&ge(Mt),gu(Ee,Mt,_.current))}},[]),U=ai((D,ee)=>{const{onLayout:K}=M.current,{layout:oe,panelDataArray:J}=O.current,Z=J.map(de=>de.constraints),{panelSize:ae,pivotIndices:ce}=El(J,D,oe);bt(ae!=null,`Panel size not found for panel "${D.id}"`);const ie=bu(J,D)===J.length-1?ae-ee:ee-ae,ge=Xf({delta:ie,initialLayout:oe,panelConstraints:Z,pivotIndices:ce,prevLayout:oe,trigger:"imperative-api"});Gm(oe,ge)||(x(ge),O.current.layout=ge,K&&K(ge),gu(J,ge,_.current))},[]),B=ai((D,ee)=>{const{layout:K,panelDataArray:oe}=O.current,{collapsedSize:J=0,collapsible:Z}=ee,{collapsedSize:ae=0,collapsible:ce,maxSize:pe=100,minSize:ie=0}=D.constraints,{panelSize:ge}=El(oe,D,K);ge!=null&&(Z&&ce&&Us(ge,J)?Us(J,ae)||U(D,ae):ge<ie?U(D,ie):ge>pe&&U(D,pe))},[U]),W=ai((D,ee)=>{const{direction:K}=M.current,{layout:oe}=O.current;if(!h.current)return;const J=q0(D,h.current);bt(J,`Drag handle element not found for id "${D}"`);const Z=b9(K,ee);b({dragHandleId:D,dragHandleRect:J.getBoundingClientRect(),initialCursorPosition:Z,initialLayout:oe})},[]),q=ai(()=>{b(null)},[]),A=ai(D=>{const{panelDataArray:ee}=O.current,K=bu(ee,D);K>=0&&(ee.splice(K,1),delete _.current[D.id],O.current.panelDataArrayChanged=!0,S())},[S]),Y=wEe(()=>({collapsePanel:k,direction:r,dragState:m,expandPanel:N,getPanelSize:F,getPanelStyle:j,groupId:p,isPanelCollapsed:$,isPanelExpanded:X,reevaluatePanelConstraints:B,registerPanel:V,registerResizeHandle:L,resizePanel:U,startDragging:W,stopDragging:q,unregisterPanel:A,panelGroupElement:h.current}),[k,m,r,N,F,j,p,$,X,B,V,L,U,W,q,A]),G={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return _d(W0.Provider,{value:Y},_d(u,{...d,children:t,className:n,id:o,ref:h,style:{...G,...c},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":p}))}const S9=t9((e,t)=>_d(w9,{...e,forwardedRef:t}));w9.displayName="PanelGroup";S9.displayName="forwardRef(PanelGroup)";function bu(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function El(e,t,n){const r=bu(e,t),o=r===e.length-1?[r-1,r]:[r,r+1],s=n[r];return{...t.constraints,panelSize:s,pivotIndices:o}}function YEe({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){dc(()=>{if(e||n==null||r==null)return;const i=q0(t,r);if(i==null)return;const o=s=>{if(!s.defaultPrevented)switch(s.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{s.preventDefault(),n(s);break}case"F6":{s.preventDefault();const a=i.getAttribute("data-panel-group-id");bt(a,`No group element found for id "${a}"`);const l=cp(a,r),c=p9(a,t,r);bt(c!==null,`No resize element found for id "${t}"`);const u=s.shiftKey?c>0?c-1:l.length-1:c+1<l.length?c+1:0;l[u].focus();break}}};return i.addEventListener("keydown",o),()=>{i.removeEventListener("keydown",o)}},[r,e,t,n])}function YR({children:e=null,className:t="",disabled:n=!1,hitAreaMargins:r,id:i,onBlur:o,onDragging:s,onFocus:a,style:l={},tabIndex:c=0,tagName:u="div",...d}){var p,h;const m=ui(null),b=ui({onDragging:s});dc(()=>{b.current.onDragging=s});const v=n9(W0);if(v===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:x,groupId:S,registerResizeHandle:_,startDragging:E,stopDragging:C,panelGroupElement:M}=v,O=WR(i),[k,N]=ju("inactive"),[F,j]=ju(!1),[$,X]=ju(null),V=ui({state:k});fc(()=>{V.current.state=k}),dc(()=>{if(n)X(null);else{const W=_(O);X(()=>W)}},[n,O,_]);const L=(p=r==null?void 0:r.coarse)!==null&&p!==void 0?p:15,U=(h=r==null?void 0:r.fine)!==null&&h!==void 0?h:5;return dc(()=>{if(n||$==null)return;const W=m.current;return bt(W,"Element ref not attached"),IEe(O,W,x,{coarse:L,fine:U},(A,Y,G)=>{if(Y)switch(A){case"down":{N("drag"),bt(G,'Expected event to be defined for "down" action'),E(O,G);const{onDragging:D}=b.current;D&&D(!0);break}case"move":{const{state:D}=V.current;D!=="drag"&&N("hover"),bt(G,'Expected event to be defined for "move" action'),$(G);break}case"up":{N("hover"),C();const{onDragging:D}=b.current;D&&D(!1);break}}else N("inactive")})},[L,x,n,U,_,O,$,E,C]),YEe({disabled:n,handleId:O,resizeHandler:$,panelGroupElement:M}),_d(u,{...d,children:e,className:t,id:i,onBlur:()=>{j(!1),o==null||o()},onFocus:()=>{j(!0),a==null||a()},ref:m,role:"separator",style:{...{touchAction:"none",userSelect:"none"},...l},tabIndex:c,"data-panel-group-direction":x,"data-panel-group-id":S,"data-resize-handle":"","data-resize-handle-active":k==="drag"?"pointer":F?"keyboard":void 0,"data-resize-handle-state":k,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":O})}YR.displayName="PanelResizeHandle";const _9=({className:e,...t})=>y.jsx(S9,{className:be("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}),N_=o9,KEe=({withHandle:e,className:t,...n})=>y.jsx(YR,{className:be("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),...n,children:e&&y.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:y.jsx(J5,{className:"h-2.5 w-2.5"})})}),XEe=({withHandle:e,className:t,onTabClick:n,open:r,...i})=>y.jsx(YR,{className:be("relative flex w-px items-start justify-end bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",{"justify-start":r},t),...i,children:e&&y.jsx("div",{className:be("z-50 flex items-center justify-start",{"border-l":r}),children:y.jsx(pi,{variant:"secondary",className:be("h-7 p-0.5",{"rounded-bl-none rounded-br-md rounded-tl-none rounded-tr-md":r,"mt-0 rounded-bl-md rounded-br-none rounded-tl-md rounded-tr-none":!r}),onClick:()=>n(!r),children:r?y.jsx(Zy,{className:"size-4"}):y.jsx(NC,{className:"size-4"})})})});var KR="Dialog",[C9,E9]=tr(KR),[QEe,No]=C9(KR),R9=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!0}=e,a=R.useRef(null),l=R.useRef(null),[c=!1,u]=Ar({prop:r,defaultProp:i,onChange:o});return y.jsx(QEe,{scope:t,triggerRef:a,contentRef:l,contentId:qn(),titleId:qn(),descriptionId:qn(),open:c,onOpenChange:u,onOpenToggle:R.useCallback(()=>u(d=>!d),[u]),modal:s,children:n})};R9.displayName=KR;var P9="DialogTrigger",T9=R.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=No(P9,n),o=rt(t,i.triggerRef);return y.jsx(Ne.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":JR(i.open),...r,ref:o,onClick:Re(e.onClick,i.onOpenToggle)})});T9.displayName=P9;var XR="DialogPortal",[JEe,M9]=C9(XR,{forceMount:void 0}),O9=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=No(XR,t);return y.jsx(JEe,{scope:t,forceMount:n,children:R.Children.map(r,s=>y.jsx(Yn,{present:n||o.open,children:y.jsx(Ap,{asChild:!0,container:i,children:s})}))})};O9.displayName=XR;var vy="DialogOverlay",D9=R.forwardRef((e,t)=>{const n=M9(vy,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=No(vy,e.__scopeDialog);return o.modal?y.jsx(Yn,{present:r||o.open,children:y.jsx(ZEe,{...i,ref:t})}):null});D9.displayName=vy;var ZEe=R.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=No(vy,n);return y.jsx(Np,{as:Js,allowPinchZoom:!0,shards:[i.contentRef],children:y.jsx(Ne.div,{"data-state":JR(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Pc="DialogContent",A9=R.forwardRef((e,t)=>{const n=M9(Pc,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=No(Pc,e.__scopeDialog);return y.jsx(Yn,{present:r||o.open,children:o.modal?y.jsx(eRe,{...i,ref:t}):y.jsx(tRe,{...i,ref:t})})});A9.displayName=Pc;var eRe=R.forwardRef((e,t)=>{const n=No(Pc,e.__scopeDialog),r=R.useRef(null),i=rt(t,n.contentRef,r);return R.useEffect(()=>{const o=r.current;if(o)return w0(o)},[]),y.jsx(k9,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Re(e.onCloseAutoFocus,o=>{var s;o.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:Re(e.onPointerDownOutside,o=>{const s=o.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&o.preventDefault()}),onFocusOutside:Re(e.onFocusOutside,o=>o.preventDefault())})}),tRe=R.forwardRef((e,t)=>{const n=No(Pc,e.__scopeDialog),r=R.useRef(!1),i=R.useRef(!1);return y.jsx(k9,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,o),o.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=o.target;((c=n.triggerRef.current)==null?void 0:c.contains(s))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),k9=R.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...s}=e,a=No(Pc,n),l=R.useRef(null),c=rt(t,l);return v0(),y.jsxs(y.Fragment,{children:[y.jsx(Ip,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:y.jsx(Lc,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":JR(a.open),...s,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),y.jsxs(y.Fragment,{children:[y.jsx(rRe,{titleId:a.titleId}),y.jsx(oRe,{contentRef:l,descriptionId:a.descriptionId})]})]})}),QR="DialogTitle",I9=R.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=No(QR,n);return y.jsx(Ne.h2,{id:i.titleId,...r,ref:t})});I9.displayName=QR;var N9="DialogDescription",L9=R.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=No(N9,n);return y.jsx(Ne.p,{id:i.descriptionId,...r,ref:t})});L9.displayName=N9;var F9="DialogClose",j9=R.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=No(F9,n);return y.jsx(Ne.button,{type:"button",...r,ref:t,onClick:Re(e.onClick,()=>i.onOpenChange(!1))})});j9.displayName=F9;function JR(e){return e?"open":"closed"}var $9="DialogTitleWarning",[nRe,z9]=kX($9,{contentName:Pc,titleName:QR,docsSlug:"dialog"}),rRe=({titleId:e})=>{const t=z9($9),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
393
|
-
|
|
394
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
395
|
-
|
|
396
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return R.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},iRe="DialogDescriptionWarning",oRe=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${z9(iRe).contentName}}.`;return R.useEffect(()=>{var o;const i=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},ZR=R9,B9=T9,e2=O9,Y0=D9,K0=A9,t2=I9,n2=L9,r2=j9,H9="AlertDialog",[sRe,gMe]=tr(H9,[E9]),ra=E9(),V9=e=>{const{__scopeAlertDialog:t,...n}=e,r=ra(t);return y.jsx(ZR,{...r,...n,modal:!0})};V9.displayName=H9;var aRe="AlertDialogTrigger",lRe=R.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=ra(n);return y.jsx(B9,{...i,...r,ref:t})});lRe.displayName=aRe;var cRe="AlertDialogPortal",W9=e=>{const{__scopeAlertDialog:t,...n}=e,r=ra(t);return y.jsx(e2,{...r,...n})};W9.displayName=cRe;var uRe="AlertDialogOverlay",U9=R.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=ra(n);return y.jsx(Y0,{...i,...r,ref:t})});U9.displayName=uRe;var zu="AlertDialogContent",[dRe,fRe]=sRe(zu),G9=R.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,o=ra(n),s=R.useRef(null),a=rt(t,s),l=R.useRef(null);return y.jsx(nRe,{contentName:zu,titleName:q9,docsSlug:"alert-dialog",children:y.jsx(dRe,{scope:n,cancelRef:l,children:y.jsxs(K0,{role:"alertdialog",...o,...i,ref:a,onOpenAutoFocus:Re(i.onOpenAutoFocus,c=>{var u;c.preventDefault(),(u=l.current)==null||u.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[y.jsx(iC,{children:r}),y.jsx(pRe,{contentRef:s})]})})})});G9.displayName=zu;var q9="AlertDialogTitle",Y9=R.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=ra(n);return y.jsx(t2,{...i,...r,ref:t})});Y9.displayName=q9;var K9="AlertDialogDescription",X9=R.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=ra(n);return y.jsx(n2,{...i,...r,ref:t})});X9.displayName=K9;var hRe="AlertDialogAction",Q9=R.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=ra(n);return y.jsx(r2,{...i,...r,ref:t})});Q9.displayName=hRe;var J9="AlertDialogCancel",Z9=R.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=fRe(J9,n),o=ra(n),s=rt(t,i);return y.jsx(r2,{...o,...r,ref:s})});Z9.displayName=J9;var pRe=({contentRef:e})=>{const t=`\`${zu}\` requires a description for the component to be accessible for screen reader users.
|
|
397
|
-
|
|
398
|
-
You can add a description to the \`${zu}\` by passing a \`${K9}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
399
|
-
|
|
400
|
-
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${zu}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
401
|
-
|
|
402
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return R.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},gRe=V9,mRe=W9,e$=U9,t$=G9,n$=Q9,r$=Z9,i$=Y9,o$=X9;const bRe=gRe,yRe=mRe,s$=R.forwardRef(({className:e,...t},n)=>y.jsx(e$,{className:be("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));s$.displayName=e$.displayName;const a$=R.forwardRef(({className:e,...t},n)=>y.jsx(yRe,{children:y.jsxs(Dc,{children:[y.jsx(s$,{}),y.jsx(t$,{ref:n,className:be("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]})}));a$.displayName=t$.displayName;const l$=({className:e,...t})=>y.jsx("div",{className:be("flex flex-col space-y-2 text-center sm:text-left",e),...t});l$.displayName="AlertDialogHeader";const c$=({className:e,...t})=>y.jsx("div",{className:be("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});c$.displayName="AlertDialogFooter";const u$=R.forwardRef(({className:e,...t},n)=>y.jsx(i$,{ref:n,className:be("text-lg font-semibold",e),...t}));u$.displayName=i$.displayName;const d$=R.forwardRef(({className:e,...t},n)=>y.jsx(o$,{ref:n,className:be("text-sm text-muted-foreground",e),...t}));d$.displayName=o$.displayName;const f$=R.forwardRef(({className:e,...t},n)=>y.jsx(n$,{ref:n,className:be($h(),e),...t}));f$.displayName=n$.displayName;const h$=R.forwardRef(({className:e,...t},n)=>y.jsx(r$,{ref:n,className:be($h({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));h$.displayName=r$.displayName;function vRe({open:e,setOpen:t}){const n=ye(o=>o.selectedSheetId),{deleteSheet:r}=Hn();function i(){n&&(r(n),t(!1))}return y.jsx(bRe,{open:e,onOpenChange:t,children:y.jsxs(a$,{children:[y.jsxs(l$,{children:[y.jsx(u$,{children:"Delete Sheet"}),y.jsx(d$,{children:"Are you sure you want to delete this sheet along with all its cards? This action cannot be undone."})]}),y.jsxs(c$,{children:[y.jsx(h$,{children:"Cancel"}),y.jsx(f$,{onClick:i,children:"Delete"})]})]})})}function p$(){var v,x;const[e,t]=P.useState(!1),n=ye(S=>{var _;return(_=S.dashboard)==null?void 0:_.sheets}),{showAssistant:r}=Vi(),i=P.useRef(null),[o,s]=P.useState(!1),a=ye(S=>S.isDashboardEditing),l=ye(S=>S.themeStyle),c=ye(S=>S.selectedSheetId),{setSelectedSheetId:u,setSheetTitle:d,addSheet:p}=Hn();if(!n)return null;function h(S){var _,E;S?((_=i.current)==null||_.resize(35),s(!0)):(s(!1),(E=i.current)==null||E.resize(0))}function m(){const S={id:Va(),title:"New Sheet"};p(S)}function b(){return(l==null?void 0:l.canvasTheme)==="muted"||!(l!=null&&l.canvasTheme)?"hsl(var(--semaphor-muted))":(l==null?void 0:l.canvasTheme)==="clear"?"":l==null?void 0:l.canvasTheme}return y.jsxs(cC,{role:"dashboard-tabs-container",className:be("relative flex grow flex-col",l==null?void 0:l.dashboardTabsContainer),onValueChange:S=>{u(S)},value:c||n[0].id,children:[y.jsx("div",{children:(n.length>1||a)&&y.jsxs(Fy,{role:"tab-list",className:"flex h-11 items-center justify-start gap-2 rounded-none bg-transparent px-2.5 py-3",children:[n==null?void 0:n.map(S=>{var _,E;return y.jsx(rs,{text:S.title,onSave:C=>d(S.id,C),children:y.jsxs(jy,{style:{borderRadius:(E=(_=l==null?void 0:l.chart)==null?void 0:_.options)==null?void 0:E.borderRadius},onClick:()=>u(S.id),className:"flex items-center gap-1 rounded-none border px-2 py-1",value:S.id,children:[S.title,a&&c===S.id&&n.length>1&&y.jsx(Md,{className:"ml-1 size-3",onClick:()=>t(!0)})]})},S.id)}),a&&y.jsx("div",{style:{borderRadius:(x=(v=l==null?void 0:l.chart)==null?void 0:v.options)==null?void 0:x.borderRadius},className:"flex h-7 items-center justify-center border-none bg-muted p-2 hover:cursor-pointer dark:border-l-background",onClick:m,children:y.jsx(jC,{className:"size-3"})})]})}),y.jsxs(_9,{className:"grow",direction:"horizontal",children:[y.jsx(N_,{children:y.jsx("div",{style:{},children:n==null?void 0:n.map(S=>y.jsx(uC,{style:{backgroundColor:b()},className:be("mt-0",{}),value:S.id,children:y.jsx(Exe,{sheet:S})},S.id))})}),r===!0&&y.jsxs(y.Fragment,{children:[y.jsx(XEe,{open:o,onTabClick:h,withHandle:!0}),y.jsx(N_,{onResize:S=>{S<1?s(!1):o||s(!0)},defaultSize:0,ref:i,children:y.jsx(bEe,{})})]})]}),y.jsx(vRe,{open:e,setOpen:t})]})}function g$({children:e}){return y.jsx(KK,{defaultTheme:"system",storageKey:"vite-ui-theme",children:y.jsx($ue,{delayDuration:0,children:e})})}function m$(e){return y.jsx(e0,{FallbackComponent:$C,children:y.jsx(PN,{dashboardProps:e,children:y.jsx(g$,{children:y.jsx(DN,{...e,children:y.jsx(p$,{})})})})})}var L_=["Enter"," "],xRe=["ArrowDown","PageUp","Home"],b$=["ArrowUp","PageDown","End"],wRe=[...xRe,...b$],SRe={ltr:[...L_,"ArrowRight"],rtl:[...L_,"ArrowLeft"]},_Re={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Qp="Menu",[up,CRe,ERe]=Ny(Qp),[$c,y$]=tr(Qp,[ERe,ys,Pd]),X0=ys(),v$=Pd(),[RRe,zc]=$c(Qp),[PRe,Jp]=$c(Qp),x$=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:s=!0}=e,a=X0(t),[l,c]=R.useState(null),u=R.useRef(!1),d=er(o),p=Ac(i);return R.useEffect(()=>{const h=()=>{u.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>u.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),y.jsx(Mp,{...a,children:y.jsx(RRe,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:c,children:y.jsx(PRe,{scope:t,onClose:R.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:p,modal:s,children:r})})})};x$.displayName=Qp;var TRe="MenuAnchor",i2=R.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=X0(n);return y.jsx(Ld,{...i,...r,ref:t})});i2.displayName=TRe;var o2="MenuPortal",[MRe,w$]=$c(o2,{forceMount:void 0}),S$=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,o=zc(o2,t);return y.jsx(MRe,{scope:t,forceMount:n,children:y.jsx(Yn,{present:n||o.open,children:y.jsx(Ap,{asChild:!0,container:i,children:r})})})};S$.displayName=o2;var lo="MenuContent",[ORe,s2]=$c(lo),_$=R.forwardRef((e,t)=>{const n=w$(lo,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=zc(lo,e.__scopeMenu),s=Jp(lo,e.__scopeMenu);return y.jsx(up.Provider,{scope:e.__scopeMenu,children:y.jsx(Yn,{present:r||o.open,children:y.jsx(up.Slot,{scope:e.__scopeMenu,children:s.modal?y.jsx(DRe,{...i,ref:t}):y.jsx(ARe,{...i,ref:t})})})})}),DRe=R.forwardRef((e,t)=>{const n=zc(lo,e.__scopeMenu),r=R.useRef(null),i=rt(t,r);return R.useEffect(()=>{const o=r.current;if(o)return w0(o)},[]),y.jsx(a2,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Re(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),ARe=R.forwardRef((e,t)=>{const n=zc(lo,e.__scopeMenu);return y.jsx(a2,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),a2=R.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,onDismiss:h,disableOutsideScroll:m,...b}=e,v=zc(lo,n),x=Jp(lo,n),S=X0(n),_=v$(n),E=CRe(n),[C,M]=R.useState(null),O=R.useRef(null),k=rt(t,O,v.onContentChange),N=R.useRef(0),F=R.useRef(""),j=R.useRef(0),$=R.useRef(null),X=R.useRef("right"),V=R.useRef(0),L=m?Np:R.Fragment,U=m?{as:Js,allowPinchZoom:!0}:void 0,B=q=>{var J,Z;const A=F.current+q,Y=E().filter(ae=>!ae.disabled),G=document.activeElement,D=(J=Y.find(ae=>ae.ref.current===G))==null?void 0:J.textValue,ee=Y.map(ae=>ae.textValue),K=WRe(ee,A,D),oe=(Z=Y.find(ae=>ae.textValue===K))==null?void 0:Z.ref.current;(function ae(ce){F.current=ce,window.clearTimeout(N.current),ce!==""&&(N.current=window.setTimeout(()=>ae(""),1e3))})(A),oe&&setTimeout(()=>oe.focus())};R.useEffect(()=>()=>window.clearTimeout(N.current),[]),v0();const W=R.useCallback(q=>{var Y,G;return X.current===((Y=$.current)==null?void 0:Y.side)&&GRe(q,(G=$.current)==null?void 0:G.area)},[]);return y.jsx(ORe,{scope:n,searchRef:F,onItemEnter:R.useCallback(q=>{W(q)&&q.preventDefault()},[W]),onItemLeave:R.useCallback(q=>{var A;W(q)||((A=O.current)==null||A.focus(),M(null))},[W]),onTriggerLeave:R.useCallback(q=>{W(q)&&q.preventDefault()},[W]),pointerGraceTimerRef:j,onPointerGraceIntentChange:R.useCallback(q=>{$.current=q},[]),children:y.jsx(L,{...U,children:y.jsx(Ip,{asChild:!0,trapped:i,onMountAutoFocus:Re(o,q=>{var A;q.preventDefault(),(A=O.current)==null||A.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:y.jsx(Lc,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,onDismiss:h,children:y.jsx(oC,{asChild:!0,..._,dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:M,onEntryFocus:Re(l,q=>{x.isUsingKeyboardRef.current||q.preventDefault()}),preventScrollOnEntryFocus:!0,children:y.jsx(Op,{role:"menu","aria-orientation":"vertical","data-state":$$(v.open),"data-radix-menu-content":"",dir:x.dir,...S,...b,ref:k,style:{outline:"none",...b.style},onKeyDown:Re(b.onKeyDown,q=>{const Y=q.target.closest("[data-radix-menu-content]")===q.currentTarget,G=q.ctrlKey||q.altKey||q.metaKey,D=q.key.length===1;Y&&(q.key==="Tab"&&q.preventDefault(),!G&&D&&B(q.key));const ee=O.current;if(q.target!==ee||!wRe.includes(q.key))return;q.preventDefault();const oe=E().filter(J=>!J.disabled).map(J=>J.ref.current);b$.includes(q.key)&&oe.reverse(),HRe(oe)}),onBlur:Re(e.onBlur,q=>{q.currentTarget.contains(q.target)||(window.clearTimeout(N.current),F.current="")}),onPointerMove:Re(e.onPointerMove,dp(q=>{const A=q.target,Y=V.current!==q.clientX;if(q.currentTarget.contains(A)&&Y){const G=q.clientX>V.current?"right":"left";X.current=G,V.current=q.clientX}}))})})})})})})});_$.displayName=lo;var kRe="MenuGroup",l2=R.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return y.jsx(Ne.div,{role:"group",...r,ref:t})});l2.displayName=kRe;var IRe="MenuLabel",C$=R.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return y.jsx(Ne.div,{...r,ref:t})});C$.displayName=IRe;var xy="MenuItem",RI="menu.itemSelect",Q0=R.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=R.useRef(null),s=Jp(xy,e.__scopeMenu),a=s2(xy,e.__scopeMenu),l=rt(t,o),c=R.useRef(!1),u=()=>{const d=o.current;if(!n&&d){const p=new CustomEvent(RI,{bubbles:!0,cancelable:!0});d.addEventListener(RI,h=>r==null?void 0:r(h),{once:!0}),AN(d,p),p.defaultPrevented?c.current=!1:s.onClose()}};return y.jsx(E$,{...i,ref:l,disabled:n,onClick:Re(e.onClick,u),onPointerDown:d=>{var p;(p=e.onPointerDown)==null||p.call(e,d),c.current=!0},onPointerUp:Re(e.onPointerUp,d=>{var p;c.current||(p=d.currentTarget)==null||p.click()}),onKeyDown:Re(e.onKeyDown,d=>{const p=a.searchRef.current!=="";n||p&&d.key===" "||L_.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Q0.displayName=xy;var E$=R.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,s=s2(xy,n),a=v$(n),l=R.useRef(null),c=rt(t,l),[u,d]=R.useState(!1),[p,h]=R.useState("");return R.useEffect(()=>{const m=l.current;m&&h((m.textContent??"").trim())},[o.children]),y.jsx(up.ItemSlot,{scope:n,disabled:r,textValue:i??p,children:y.jsx(sC,{asChild:!0,...a,focusable:!r,children:y.jsx(Ne.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:c,onPointerMove:Re(e.onPointerMove,dp(m=>{r?s.onItemLeave(m):(s.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Re(e.onPointerLeave,dp(m=>s.onItemLeave(m))),onFocus:Re(e.onFocus,()=>d(!0)),onBlur:Re(e.onBlur,()=>d(!1))})})})}),NRe="MenuCheckboxItem",R$=R.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return y.jsx(D$,{scope:e.__scopeMenu,checked:n,children:y.jsx(Q0,{role:"menuitemcheckbox","aria-checked":wy(n)?"mixed":n,...i,ref:t,"data-state":u2(n),onSelect:Re(i.onSelect,()=>r==null?void 0:r(wy(n)?!0:!n),{checkForDefaultPrevented:!1})})})});R$.displayName=NRe;var P$="MenuRadioGroup",[LRe,FRe]=$c(P$,{value:void 0,onValueChange:()=>{}}),T$=R.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,o=er(r);return y.jsx(LRe,{scope:e.__scopeMenu,value:n,onValueChange:o,children:y.jsx(l2,{...i,ref:t})})});T$.displayName=P$;var M$="MenuRadioItem",O$=R.forwardRef((e,t)=>{const{value:n,...r}=e,i=FRe(M$,e.__scopeMenu),o=n===i.value;return y.jsx(D$,{scope:e.__scopeMenu,checked:o,children:y.jsx(Q0,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":u2(o),onSelect:Re(r.onSelect,()=>{var s;return(s=i.onValueChange)==null?void 0:s.call(i,n)},{checkForDefaultPrevented:!1})})})});O$.displayName=M$;var c2="MenuItemIndicator",[D$,jRe]=$c(c2,{checked:!1}),A$=R.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,o=jRe(c2,n);return y.jsx(Yn,{present:r||wy(o.checked)||o.checked===!0,children:y.jsx(Ne.span,{...i,ref:t,"data-state":u2(o.checked)})})});A$.displayName=c2;var $Re="MenuSeparator",k$=R.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return y.jsx(Ne.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});k$.displayName=$Re;var zRe="MenuArrow",I$=R.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=X0(n);return y.jsx(Dp,{...i,...r,ref:t})});I$.displayName=zRe;var BRe="MenuSub",[mMe,N$]=$c(BRe),Jf="MenuSubTrigger",L$=R.forwardRef((e,t)=>{const n=zc(Jf,e.__scopeMenu),r=Jp(Jf,e.__scopeMenu),i=N$(Jf,e.__scopeMenu),o=s2(Jf,e.__scopeMenu),s=R.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=o,c={__scopeMenu:e.__scopeMenu},u=R.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return R.useEffect(()=>u,[u]),R.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),l(null)}},[a,l]),y.jsx(i2,{asChild:!0,...c,children:y.jsx(E$,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":$$(n.open),...e,ref:Iy(t,i.onTriggerChange),onClick:d=>{var p;(p=e.onClick)==null||p.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Re(e.onPointerMove,dp(d=>{o.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(o.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:Re(e.onPointerLeave,dp(d=>{var h,m;u();const p=(h=n.content)==null?void 0:h.getBoundingClientRect();if(p){const b=(m=n.content)==null?void 0:m.dataset.side,v=b==="right",x=v?-5:5,S=p[v?"left":"right"],_=p[v?"right":"left"];o.onPointerGraceIntentChange({area:[{x:d.clientX+x,y:d.clientY},{x:S,y:p.top},{x:_,y:p.top},{x:_,y:p.bottom},{x:S,y:p.bottom}],side:b}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(d),d.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Re(e.onKeyDown,d=>{var h;const p=o.searchRef.current!=="";e.disabled||p&&d.key===" "||SRe[r.dir].includes(d.key)&&(n.onOpenChange(!0),(h=n.content)==null||h.focus(),d.preventDefault())})})})});L$.displayName=Jf;var F$="MenuSubContent",j$=R.forwardRef((e,t)=>{const n=w$(lo,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=zc(lo,e.__scopeMenu),s=Jp(lo,e.__scopeMenu),a=N$(F$,e.__scopeMenu),l=R.useRef(null),c=rt(t,l);return y.jsx(up.Provider,{scope:e.__scopeMenu,children:y.jsx(Yn,{present:r||o.open,children:y.jsx(up.Slot,{scope:e.__scopeMenu,children:y.jsx(a2,{id:a.contentId,"aria-labelledby":a.triggerId,...i,ref:c,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var d;s.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:Re(e.onFocusOutside,u=>{u.target!==a.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Re(e.onEscapeKeyDown,u=>{s.onClose(),u.preventDefault()}),onKeyDown:Re(e.onKeyDown,u=>{var h;const d=u.currentTarget.contains(u.target),p=_Re[s.dir].includes(u.key);d&&p&&(o.onOpenChange(!1),(h=a.trigger)==null||h.focus(),u.preventDefault())})})})})})});j$.displayName=F$;function $$(e){return e?"open":"closed"}function wy(e){return e==="indeterminate"}function u2(e){return wy(e)?"indeterminate":e?"checked":"unchecked"}function HRe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function VRe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function WRe(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let s=VRe(e,Math.max(o,0));i.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function URe(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,s=t.length-1;o<t.length;s=o++){const a=t[o].x,l=t[o].y,c=t[s].x,u=t[s].y;l>r!=u>r&&n<(c-a)*(r-l)/(u-l)+a&&(i=!i)}return i}function GRe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return URe(n,t)}function dp(e){return t=>t.pointerType==="mouse"?e(t):void 0}var qRe=x$,YRe=i2,KRe=S$,XRe=_$,QRe=l2,JRe=C$,ZRe=Q0,e2e=R$,t2e=T$,n2e=O$,r2e=A$,i2e=k$,o2e=I$,s2e=L$,a2e=j$,d2="DropdownMenu",[l2e,bMe]=tr(d2,[y$]),Qr=y$(),[c2e,z$]=l2e(d2),B$=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:s,modal:a=!0}=e,l=Qr(t),c=R.useRef(null),[u=!1,d]=Ar({prop:i,defaultProp:o,onChange:s});return y.jsx(c2e,{scope:t,triggerId:qn(),triggerRef:c,contentId:qn(),open:u,onOpenChange:d,onOpenToggle:R.useCallback(()=>d(p=>!p),[d]),modal:a,children:y.jsx(qRe,{...l,open:u,onOpenChange:d,dir:r,modal:a,children:n})})};B$.displayName=d2;var H$="DropdownMenuTrigger",V$=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,o=z$(H$,n),s=Qr(n);return y.jsx(YRe,{asChild:!0,...s,children:y.jsx(Ne.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:Iy(t,o.triggerRef),onPointerDown:Re(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(o.onOpenToggle(),o.open||a.preventDefault())}),onKeyDown:Re(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&o.onOpenToggle(),a.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});V$.displayName=H$;var u2e="DropdownMenuPortal",W$=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Qr(t);return y.jsx(KRe,{...r,...n})};W$.displayName=u2e;var U$="DropdownMenuContent",G$=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=z$(U$,n),o=Qr(n),s=R.useRef(!1);return y.jsx(XRe,{id:i.contentId,"aria-labelledby":i.triggerId,...o,...r,ref:t,onCloseAutoFocus:Re(e.onCloseAutoFocus,a=>{var l;s.current||(l=i.triggerRef.current)==null||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:Re(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!i.modal||u)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});G$.displayName=U$;var d2e="DropdownMenuGroup",f2e=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Qr(n);return y.jsx(QRe,{...i,...r,ref:t})});f2e.displayName=d2e;var h2e="DropdownMenuLabel",q$=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Qr(n);return y.jsx(JRe,{...i,...r,ref:t})});q$.displayName=h2e;var p2e="DropdownMenuItem",Y$=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Qr(n);return y.jsx(ZRe,{...i,...r,ref:t})});Y$.displayName=p2e;var g2e="DropdownMenuCheckboxItem",K$=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Qr(n);return y.jsx(e2e,{...i,...r,ref:t})});K$.displayName=g2e;var m2e="DropdownMenuRadioGroup",X$=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Qr(n);return y.jsx(t2e,{...i,...r,ref:t})});X$.displayName=m2e;var b2e="DropdownMenuRadioItem",Q$=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Qr(n);return y.jsx(n2e,{...i,...r,ref:t})});Q$.displayName=b2e;var y2e="DropdownMenuItemIndicator",J$=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Qr(n);return y.jsx(r2e,{...i,...r,ref:t})});J$.displayName=y2e;var v2e="DropdownMenuSeparator",Z$=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Qr(n);return y.jsx(i2e,{...i,...r,ref:t})});Z$.displayName=v2e;var x2e="DropdownMenuArrow",w2e=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Qr(n);return y.jsx(o2e,{...i,...r,ref:t})});w2e.displayName=x2e;var S2e="DropdownMenuSubTrigger",ez=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Qr(n);return y.jsx(s2e,{...i,...r,ref:t})});ez.displayName=S2e;var _2e="DropdownMenuSubContent",tz=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Qr(n);return y.jsx(a2e,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});tz.displayName=_2e;var C2e=B$,E2e=V$,R2e=W$,nz=G$,rz=q$,iz=Y$,oz=K$,P2e=X$,sz=Q$,az=J$,lz=Z$,cz=ez,uz=tz;const T2e=C2e,M2e=E2e,O2e=P2e,D2e=R.forwardRef(({className:e,inset:t,children:n,...r},i)=>y.jsxs(cz,{ref:i,className:be("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,y.jsx(Zy,{className:"ml-auto h-4 w-4"})]}));D2e.displayName=cz.displayName;const A2e=R.forwardRef(({className:e,...t},n)=>y.jsx(Dc,{children:y.jsx(uz,{ref:n,className:be("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t})}));A2e.displayName=uz.displayName;const dz=R.forwardRef(({className:e,sideOffset:t=4,...n},r)=>y.jsx(R2e,{children:y.jsx(Dc,{children:y.jsx(nz,{ref:r,sideOffset:t,className:be("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})})}));dz.displayName=nz.displayName;const fz=R.forwardRef(({className:e,inset:t,...n},r)=>y.jsx(iz,{ref:r,className:be("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));fz.displayName=iz.displayName;const k2e=R.forwardRef(({className:e,children:t,checked:n,...r},i)=>y.jsxs(oz,{ref:i,className:be("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[y.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:y.jsx(az,{children:y.jsx(Td,{className:"h-4 w-4"})})}),t]}));k2e.displayName=oz.displayName;const hz=R.forwardRef(({className:e,children:t,...n},r)=>y.jsxs(sz,{ref:r,className:be("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[y.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:y.jsx(az,{children:y.jsx(LC,{className:"h-2 w-2 fill-current"})})}),t]}));hz.displayName=sz.displayName;const pz=R.forwardRef(({className:e,inset:t,...n},r)=>y.jsx(rz,{ref:r,className:be("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));pz.displayName=rz.displayName;const gz=R.forwardRef(({className:e,...t},n)=>y.jsx(lz,{ref:n,className:be("-mx-1 my-1 h-px bg-muted",e),...t}));gz.displayName=lz.displayName;const I2e=ZR,N2e=B9,L2e=e2,mz=R.forwardRef(({className:e,...t},n)=>y.jsx(Y0,{ref:n,className:be("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));mz.displayName=Y0.displayName;const bz=R.forwardRef(({className:e,children:t,...n},r)=>y.jsx(L2e,{children:y.jsxs(Dc,{children:[y.jsx(mz,{}),y.jsxs(K0,{ref:r,className:be("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,y.jsxs(r2,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[y.jsx(Md,{className:"h-4 w-4"}),y.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}));bz.displayName=K0.displayName;const yz=({className:e,...t})=>y.jsx("div",{className:be("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});yz.displayName="DialogHeader";const vz=({className:e,...t})=>y.jsx("div",{className:be("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});vz.displayName="DialogFooter";const xz=R.forwardRef(({className:e,...t},n)=>y.jsx(t2,{ref:n,className:be("text-lg font-semibold leading-none tracking-tight",e),...t}));xz.displayName=t2.displayName;const wz=R.forwardRef(({className:e,...t},n)=>y.jsx(n2,{ref:n,className:be("text-sm text-muted-foreground",e),...t}));wz.displayName=n2.displayName;const Sz=P.forwardRef(({className:e,...t},n)=>y.jsx("div",{role:"editor-panel",ref:n,className:be("flex grow h-full",e),...t}));Sz.displayName="EditorPanel";const _z=P.forwardRef(({className:e,...t},n)=>y.jsx("div",{ref:n,className:be(" flex flex-col space-y-2 w-[270px]",e),...t}));_z.displayName="EditorAside";const Cz=P.forwardRef(({className:e,...t},n)=>y.jsx("div",{ref:n,className:be(" grow",e),...t}));Cz.displayName="EditorMain";function F2e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function TI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?PI(Object(n),!0).forEach(function(r){F2e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function j2e(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function $2e(e,t){if(e==null)return{};var n=j2e(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function z2e(e,t){return B2e(e)||H2e(e,t)||V2e(e,t)||W2e()}function B2e(e){if(Array.isArray(e))return e}function H2e(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,i=!1,o=void 0;try{for(var s=e[Symbol.iterator](),a;!(r=(a=s.next()).done)&&(n.push(a.value),!(t&&n.length===t));r=!0);}catch(l){i=!0,o=l}finally{try{!r&&s.return!=null&&s.return()}finally{if(i)throw o}}return n}}function V2e(e,t){if(e){if(typeof e=="string")return MI(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return MI(e,t)}}function MI(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function W2e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
403
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function U2e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function DI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OI(Object(n),!0).forEach(function(r){U2e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function G2e(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return t.reduceRight(function(i,o){return o(i)},r)}}function Zf(e){return function t(){for(var n=this,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return i.length>=e.length?e.apply(this,i):function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return t.apply(n,[].concat(i,a))}}}function Sy(e){return{}.toString.call(e).includes("Object")}function q2e(e){return!Object.keys(e).length}function fp(e){return typeof e=="function"}function Y2e(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function K2e(e,t){return Sy(t)||Ha("changeType"),Object.keys(t).some(function(n){return!Y2e(e,n)})&&Ha("changeField"),t}function X2e(e){fp(e)||Ha("selectorType")}function Q2e(e){fp(e)||Sy(e)||Ha("handlerType"),Sy(e)&&Object.values(e).some(function(t){return!fp(t)})&&Ha("handlersType")}function J2e(e){e||Ha("initialIsRequired"),Sy(e)||Ha("initialType"),q2e(e)&&Ha("initialContent")}function Z2e(e,t){throw new Error(e[t]||e.default)}var ePe={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},Ha=Zf(Z2e)(ePe),qm={changes:K2e,selector:X2e,handler:Q2e,initial:J2e};function tPe(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};qm.initial(e),qm.handler(t);var n={current:e},r=Zf(iPe)(n,t),i=Zf(rPe)(n),o=Zf(qm.changes)(e),s=Zf(nPe)(n);function a(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(u){return u};return qm.selector(c),c(n.current)}function l(c){G2e(r,i,o,s)(c)}return[a,l]}function nPe(e,t){return fp(t)?t(e.current):t}function rPe(e,t){return e.current=DI(DI({},e.current),t),t}function iPe(e,t,n){return fp(t)?t(e.current):Object.keys(n).forEach(function(r){var i;return(i=t[r])===null||i===void 0?void 0:i.call(t,e.current[r])}),n}var oPe={create:tPe},sPe={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function aPe(e){return function t(){for(var n=this,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return i.length>=e.length?e.apply(this,i):function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return t.apply(n,[].concat(i,a))}}}function lPe(e){return{}.toString.call(e).includes("Object")}function cPe(e){return e||AI("configIsRequired"),lPe(e)||AI("configType"),e.urls?(uPe(),{paths:{vs:e.urls.monacoBase}}):e}function uPe(){console.warn(Ez.deprecation)}function dPe(e,t){throw new Error(e[t]||e.default)}var Ez={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
|
404
|
-
You are using deprecated way of configuration.
|
|
405
|
-
|
|
406
|
-
Instead of using
|
|
407
|
-
monaco.config({ urls: { monacoBase: '...' } })
|
|
408
|
-
use
|
|
409
|
-
monaco.config({ paths: { vs: '...' } })
|
|
410
|
-
|
|
411
|
-
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
412
|
-
`},AI=aPe(dPe)(Ez),fPe={config:cPe},hPe=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(i){return n.reduceRight(function(o,s){return s(o)},i)}};function Rz(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],Rz(e[n],t[n]))}),TI(TI({},e),t)}var pPe={type:"cancelation",msg:"operation is manually canceled"};function ow(e){var t=!1,n=new Promise(function(r,i){e.then(function(o){return t?i(pPe):r(o)}),e.catch(i)});return n.cancel=function(){return t=!0},n}var gPe=oPe.create({config:sPe,isInitialized:!1,resolve:null,reject:null,monaco:null}),Pz=z2e(gPe,2),Zp=Pz[0],J0=Pz[1];function mPe(e){var t=fPe.config(e),n=t.monaco,r=$2e(t,["monaco"]);J0(function(i){return{config:Rz(i.config,r),monaco:n}})}function bPe(){var e=Zp(function(t){var n=t.monaco,r=t.isInitialized,i=t.resolve;return{monaco:n,isInitialized:r,resolve:i}});if(!e.isInitialized){if(J0({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),ow(sw);if(window.monaco&&window.monaco.editor)return Tz(window.monaco),e.resolve(window.monaco),ow(sw);hPe(yPe,xPe)(wPe)}return ow(sw)}function yPe(e){return document.body.appendChild(e)}function vPe(e){var t=document.createElement("script");return e&&(t.src=e),t}function xPe(e){var t=Zp(function(r){var i=r.config,o=r.reject;return{config:i,reject:o}}),n=vPe("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function wPe(){var e=Zp(function(n){var r=n.config,i=n.resolve,o=n.reject;return{config:r,resolve:i,reject:o}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){Tz(n),e.resolve(n)},function(n){e.reject(n)})}function Tz(e){Zp().monaco||J0({monaco:e})}function SPe(){return Zp(function(e){var t=e.monaco;return t})}var sw=new Promise(function(e,t){return J0({resolve:e,reject:t})}),_y={config:mPe,init:bPe,__getMonacoInstance:SPe},_Pe={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},aw=_Pe,CPe={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},EPe=CPe;function RPe({children:e}){return P.createElement("div",{style:EPe.container},e)}var PPe=RPe,TPe=PPe;function MPe({width:e,height:t,isEditorReady:n,loading:r,_ref:i,className:o,wrapperProps:s}){return P.createElement("section",{style:{...aw.wrapper,width:e,height:t},...s},!n&&P.createElement(TPe,null,r),P.createElement("div",{ref:i,style:{...aw.fullWidth,...!n&&aw.hide},className:o}))}var OPe=MPe,Mz=P.memo(OPe);function DPe(e){P.useEffect(e,[])}var f2=DPe;function APe(e,t,n=!0){let r=P.useRef(!0);P.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var Ii=APe;function xh(){}function Eu(e,t,n,r){return kPe(e,r)||IPe(e,t,n,r)}function kPe(e,t){return e.editor.getModel(Oz(e,t))}function IPe(e,t,n,r){return e.editor.createModel(t,n,r?Oz(e,r):void 0)}function Oz(e,t){return e.Uri.parse(t)}function NPe({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:i,originalModelPath:o,modifiedModelPath:s,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:c="light",loading:u="Loading...",options:d={},height:p="100%",width:h="100%",className:m,wrapperProps:b={},beforeMount:v=xh,onMount:x=xh}){let[S,_]=P.useState(!1),[E,C]=P.useState(!0),M=P.useRef(null),O=P.useRef(null),k=P.useRef(null),N=P.useRef(x),F=P.useRef(v),j=P.useRef(!1);f2(()=>{let L=_y.init();return L.then(U=>(O.current=U)&&C(!1)).catch(U=>(U==null?void 0:U.type)!=="cancelation"&&console.error("Monaco initialization: error:",U)),()=>M.current?V():L.cancel()}),Ii(()=>{if(M.current&&O.current){let L=M.current.getOriginalEditor(),U=Eu(O.current,e||"",r||n||"text",o||"");U!==L.getModel()&&L.setModel(U)}},[o],S),Ii(()=>{if(M.current&&O.current){let L=M.current.getModifiedEditor(),U=Eu(O.current,t||"",i||n||"text",s||"");U!==L.getModel()&&L.setModel(U)}},[s],S),Ii(()=>{let L=M.current.getModifiedEditor();L.getOption(O.current.editor.EditorOption.readOnly)?L.setValue(t||""):t!==L.getValue()&&(L.executeEdits("",[{range:L.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),L.pushUndoStop())},[t],S),Ii(()=>{var L,U;(U=(L=M.current)==null?void 0:L.getModel())==null||U.original.setValue(e||"")},[e],S),Ii(()=>{let{original:L,modified:U}=M.current.getModel();O.current.editor.setModelLanguage(L,r||n||"text"),O.current.editor.setModelLanguage(U,i||n||"text")},[n,r,i],S),Ii(()=>{var L;(L=O.current)==null||L.editor.setTheme(c)},[c],S),Ii(()=>{var L;(L=M.current)==null||L.updateOptions(d)},[d],S);let $=P.useCallback(()=>{var B;if(!O.current)return;F.current(O.current);let L=Eu(O.current,e||"",r||n||"text",o||""),U=Eu(O.current,t||"",i||n||"text",s||"");(B=M.current)==null||B.setModel({original:L,modified:U})},[n,t,i,e,r,o,s]),X=P.useCallback(()=>{var L;!j.current&&k.current&&(M.current=O.current.editor.createDiffEditor(k.current,{automaticLayout:!0,...d}),$(),(L=O.current)==null||L.editor.setTheme(c),_(!0),j.current=!0)},[d,c,$]);P.useEffect(()=>{S&&N.current(M.current,O.current)},[S]),P.useEffect(()=>{!E&&!S&&X()},[E,S,X]);function V(){var U,B,W,q;let L=(U=M.current)==null?void 0:U.getModel();a||((B=L==null?void 0:L.original)==null||B.dispose()),l||((W=L==null?void 0:L.modified)==null||W.dispose()),(q=M.current)==null||q.dispose()}return P.createElement(Mz,{width:h,height:p,isEditorReady:S,loading:u,_ref:k,className:m,wrapperProps:b})}var LPe=NPe;P.memo(LPe);function FPe(){let[e,t]=P.useState(_y.__getMonacoInstance());return f2(()=>{let n;return e||(n=_y.init(),n.then(r=>{t(r)})),()=>n==null?void 0:n.cancel()}),e}var jPe=FPe;function $Pe(e){let t=P.useRef();return P.useEffect(()=>{t.current=e},[e]),t.current}var zPe=$Pe,Ym=new Map;function BPe({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:i,path:o,theme:s="light",line:a,loading:l="Loading...",options:c={},overrideServices:u={},saveViewState:d=!0,keepCurrentModel:p=!1,width:h="100%",height:m="100%",className:b,wrapperProps:v={},beforeMount:x=xh,onMount:S=xh,onChange:_,onValidate:E=xh}){let[C,M]=P.useState(!1),[O,k]=P.useState(!0),N=P.useRef(null),F=P.useRef(null),j=P.useRef(null),$=P.useRef(S),X=P.useRef(x),V=P.useRef(),L=P.useRef(r),U=zPe(o),B=P.useRef(!1),W=P.useRef(!1);f2(()=>{let Y=_y.init();return Y.then(G=>(N.current=G)&&k(!1)).catch(G=>(G==null?void 0:G.type)!=="cancelation"&&console.error("Monaco initialization: error:",G)),()=>F.current?A():Y.cancel()}),Ii(()=>{var G,D,ee,K;let Y=Eu(N.current,e||r||"",t||i||"",o||n||"");Y!==((G=F.current)==null?void 0:G.getModel())&&(d&&Ym.set(U,(D=F.current)==null?void 0:D.saveViewState()),(ee=F.current)==null||ee.setModel(Y),d&&((K=F.current)==null||K.restoreViewState(Ym.get(o))))},[o],C),Ii(()=>{var Y;(Y=F.current)==null||Y.updateOptions(c)},[c],C),Ii(()=>{!F.current||r===void 0||(F.current.getOption(N.current.editor.EditorOption.readOnly)?F.current.setValue(r):r!==F.current.getValue()&&(W.current=!0,F.current.executeEdits("",[{range:F.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),F.current.pushUndoStop(),W.current=!1))},[r],C),Ii(()=>{var G,D;let Y=(G=F.current)==null?void 0:G.getModel();Y&&i&&((D=N.current)==null||D.editor.setModelLanguage(Y,i))},[i],C),Ii(()=>{var Y;a!==void 0&&((Y=F.current)==null||Y.revealLine(a))},[a],C),Ii(()=>{var Y;(Y=N.current)==null||Y.editor.setTheme(s)},[s],C);let q=P.useCallback(()=>{var Y;if(!(!j.current||!N.current)&&!B.current){X.current(N.current);let G=o||n,D=Eu(N.current,r||e||"",t||i||"",G||"");F.current=(Y=N.current)==null?void 0:Y.editor.create(j.current,{model:D,automaticLayout:!0,...c},u),d&&F.current.restoreViewState(Ym.get(G)),N.current.editor.setTheme(s),a!==void 0&&F.current.revealLine(a),M(!0),B.current=!0}},[e,t,n,r,i,o,c,u,d,s,a]);P.useEffect(()=>{C&&$.current(F.current,N.current)},[C]),P.useEffect(()=>{!O&&!C&&q()},[O,C,q]),L.current=r,P.useEffect(()=>{var Y,G;C&&_&&((Y=V.current)==null||Y.dispose(),V.current=(G=F.current)==null?void 0:G.onDidChangeModelContent(D=>{W.current||_(F.current.getValue(),D)}))},[C,_]),P.useEffect(()=>{if(C){let Y=N.current.editor.onDidChangeMarkers(G=>{var ee;let D=(ee=F.current.getModel())==null?void 0:ee.uri;if(D&&G.find(K=>K.path===D.path)){let K=N.current.editor.getModelMarkers({resource:D});E==null||E(K)}});return()=>{Y==null||Y.dispose()}}return()=>{}},[C,E]);function A(){var Y,G;(Y=V.current)==null||Y.dispose(),p?d&&Ym.set(o,F.current.saveViewState()):(G=F.current.getModel())==null||G.dispose(),F.current.dispose()}return P.createElement(Mz,{width:h,height:m,isEditorReady:C,loading:l,_ref:j,className:b,wrapperProps:v})}var HPe=BPe,Dz=P.memo(HPe),VPe=Dz,h2="Collapsible",[WPe,Az]=tr(h2),[UPe,p2]=WPe(h2),kz=R.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:s,...a}=e,[l=!1,c]=Ar({prop:r,defaultProp:i,onChange:s});return y.jsx(UPe,{scope:n,disabled:o,contentId:qn(),open:l,onOpenToggle:R.useCallback(()=>c(u=>!u),[c]),children:y.jsx(Ne.div,{"data-state":m2(l),"data-disabled":o?"":void 0,...a,ref:t})})});kz.displayName=h2;var Iz="CollapsibleTrigger",Nz=R.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=p2(Iz,n);return y.jsx(Ne.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":m2(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:Re(e.onClick,i.onOpenToggle)})});Nz.displayName=Iz;var g2="CollapsibleContent",Lz=R.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=p2(g2,e.__scopeCollapsible);return y.jsx(Yn,{present:n||i.open,children:({present:o})=>y.jsx(GPe,{...r,ref:t,present:o})})});Lz.displayName=g2;var GPe=R.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=e,s=p2(g2,n),[a,l]=R.useState(r),c=R.useRef(null),u=rt(t,c),d=R.useRef(0),p=d.current,h=R.useRef(0),m=h.current,b=s.open||a,v=R.useRef(b),x=R.useRef(void 0);return R.useEffect(()=>{const S=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(S)},[]),mr(()=>{const S=c.current;if(S){x.current=x.current||{transitionDuration:S.style.transitionDuration,animationName:S.style.animationName},S.style.transitionDuration="0s",S.style.animationName="none";const _=S.getBoundingClientRect();d.current=_.height,h.current=_.width,v.current||(S.style.transitionDuration=x.current.transitionDuration,S.style.animationName=x.current.animationName),l(r)}},[s.open,r]),y.jsx(Ne.div,{"data-state":m2(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!b,...o,ref:u,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:b&&i})});function m2(e){return e?"open":"closed"}var qPe=kz,YPe=Nz,KPe=Lz,ia="Accordion",XPe=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[b2,QPe,JPe]=Ny(ia),[Z0,yMe]=tr(ia,[JPe,Az]),y2=Az(),Fz=P.forwardRef((e,t)=>{const{type:n,...r}=e,i=r,o=r;return y.jsx(b2.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?y.jsx(nTe,{...o,ref:t}):y.jsx(tTe,{...i,ref:t})})});Fz.displayName=ia;var[jz,ZPe]=Z0(ia),[$z,eTe]=Z0(ia,{collapsible:!1}),tTe=P.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:o=!1,...s}=e,[a,l]=Ar({prop:n,defaultProp:r,onChange:i});return y.jsx(jz,{scope:e.__scopeAccordion,value:a?[a]:[],onItemOpen:l,onItemClose:P.useCallback(()=>o&&l(""),[o,l]),children:y.jsx($z,{scope:e.__scopeAccordion,collapsible:o,children:y.jsx(zz,{...s,ref:t})})})}),nTe=P.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...o}=e,[s=[],a]=Ar({prop:n,defaultProp:r,onChange:i}),l=P.useCallback(u=>a((d=[])=>[...d,u]),[a]),c=P.useCallback(u=>a((d=[])=>d.filter(p=>p!==u)),[a]);return y.jsx(jz,{scope:e.__scopeAccordion,value:s,onItemOpen:l,onItemClose:c,children:y.jsx($z,{scope:e.__scopeAccordion,collapsible:!0,children:y.jsx(zz,{...o,ref:t})})})}),[rTe,ev]=Z0(ia),zz=P.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:i,orientation:o="vertical",...s}=e,a=P.useRef(null),l=rt(a,t),c=QPe(n),d=Ac(i)==="ltr",p=Re(e.onKeyDown,h=>{var k;if(!XPe.includes(h.key))return;const m=h.target,b=c().filter(N=>{var F;return!((F=N.ref.current)!=null&&F.disabled)}),v=b.findIndex(N=>N.ref.current===m),x=b.length;if(v===-1)return;h.preventDefault();let S=v;const _=0,E=x-1,C=()=>{S=v+1,S>E&&(S=_)},M=()=>{S=v-1,S<_&&(S=E)};switch(h.key){case"Home":S=_;break;case"End":S=E;break;case"ArrowRight":o==="horizontal"&&(d?C():M());break;case"ArrowDown":o==="vertical"&&C();break;case"ArrowLeft":o==="horizontal"&&(d?M():C());break;case"ArrowUp":o==="vertical"&&M();break}const O=S%x;(k=b[O].ref.current)==null||k.focus()});return y.jsx(rTe,{scope:n,disabled:r,direction:i,orientation:o,children:y.jsx(b2.Slot,{scope:n,children:y.jsx(Ne.div,{...s,"data-orientation":o,ref:l,onKeyDown:r?void 0:p})})})}),Cy="AccordionItem",[iTe,v2]=Z0(Cy),Bz=P.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...i}=e,o=ev(Cy,n),s=ZPe(Cy,n),a=y2(n),l=qn(),c=r&&s.value.includes(r)||!1,u=o.disabled||e.disabled;return y.jsx(iTe,{scope:n,open:c,disabled:u,triggerId:l,children:y.jsx(qPe,{"data-orientation":o.orientation,"data-state":qz(c),...a,...i,ref:t,disabled:u,open:c,onOpenChange:d=>{d?s.onItemOpen(r):s.onItemClose(r)}})})});Bz.displayName=Cy;var Hz="AccordionHeader",Vz=P.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=ev(ia,n),o=v2(Hz,n);return y.jsx(Ne.h3,{"data-orientation":i.orientation,"data-state":qz(o.open),"data-disabled":o.disabled?"":void 0,...r,ref:t})});Vz.displayName=Hz;var F_="AccordionTrigger",Wz=P.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=ev(ia,n),o=v2(F_,n),s=eTe(F_,n),a=y2(n);return y.jsx(b2.ItemSlot,{scope:n,children:y.jsx(YPe,{"aria-disabled":o.open&&!s.collapsible||void 0,"data-orientation":i.orientation,id:o.triggerId,...a,...r,ref:t})})});Wz.displayName=F_;var Uz="AccordionContent",Gz=P.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=ev(ia,n),o=v2(Uz,n),s=y2(n);return y.jsx(KPe,{role:"region","aria-labelledby":o.triggerId,"data-orientation":i.orientation,...s,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});Gz.displayName=Uz;function qz(e){return e?"open":"closed"}var oTe=Fz,sTe=Bz,aTe=Vz,Yz=Wz,Kz=Gz;const lTe=oTe,Xz=R.forwardRef(({className:e,...t},n)=>y.jsx(sTe,{ref:n,className:be("border-b",e),...t}));Xz.displayName="AccordionItem";const Qz=R.forwardRef(({className:e,children:t,...n},r)=>y.jsx(aTe,{className:"flex",children:y.jsxs(Yz,{ref:r,className:be("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,y.jsx(Jy,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));Qz.displayName=Yz.displayName;const Jz=R.forwardRef(({className:e,children:t,...n},r)=>y.jsx(Kz,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:y.jsx("div",{className:be("pb-4 pt-0",e),children:t})}));Jz.displayName=Kz.displayName;var kI=1,cTe=.9,uTe=.8,dTe=.17,lw=.1,cw=.999,fTe=.9999,hTe=.99,pTe=/[\\\/_+.#"@\[\(\{&]/,gTe=/[\\\/_+.#"@\[\(\{&]/g,mTe=/[\s-]/,Zz=/[\s-]/g;function j_(e,t,n,r,i,o,s){if(o===t.length)return i===e.length?kI:hTe;var a=`${i},${o}`;if(s[a]!==void 0)return s[a];for(var l=r.charAt(o),c=n.indexOf(l,i),u=0,d,p,h,m;c>=0;)d=j_(e,t,n,r,c+1,o+1,s),d>u&&(c===i?d*=kI:pTe.test(e.charAt(c-1))?(d*=uTe,h=e.slice(i,c-1).match(gTe),h&&i>0&&(d*=Math.pow(cw,h.length))):mTe.test(e.charAt(c-1))?(d*=cTe,m=e.slice(i,c-1).match(Zz),m&&i>0&&(d*=Math.pow(cw,m.length))):(d*=dTe,i>0&&(d*=Math.pow(cw,c-i))),e.charAt(c)!==t.charAt(o)&&(d*=fTe)),(d<lw&&n.charAt(c-1)===r.charAt(o+1)||r.charAt(o+1)===r.charAt(o)&&n.charAt(c-1)!==r.charAt(o))&&(p=j_(e,t,n,r,c+1,o+2,s),p*lw>d&&(d=p*lw)),d>u&&(u=d),c=n.indexOf(l,c+1);return s[a]=u,u}function II(e){return e.toLowerCase().replace(Zz," ")}function bTe(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,j_(e,t,II(e),II(t),0,0,{})}var If='[cmdk-group=""]',uw='[cmdk-group-items=""]',yTe='[cmdk-group-heading=""]',x2='[cmdk-item=""]',NI=`${x2}:not([aria-disabled="true"])`,$_="cmdk-item-select",Ll="data-value",vTe=(e,t,n)=>bTe(e,t,n),eB=R.createContext(void 0),eg=()=>R.useContext(eB),tB=R.createContext(void 0),w2=()=>R.useContext(tB),nB=R.createContext(void 0),rB=R.forwardRef((e,t)=>{let n=yu(()=>{var G,D;return{search:"",value:(D=(G=e.value)!=null?G:e.defaultValue)!=null?D:"",filtered:{count:0,items:new Map,groups:new Set}}}),r=yu(()=>new Set),i=yu(()=>new Map),o=yu(()=>new Map),s=yu(()=>new Set),a=iB(e),{label:l,children:c,value:u,onValueChange:d,filter:p,shouldFilter:h,loop:m,disablePointerSelection:b=!1,vimBindings:v=!0,...x}=e,S=qn(),_=qn(),E=qn(),C=R.useRef(null),M=OTe();Tc(()=>{if(u!==void 0){let G=u.trim();n.current.value=G,O.emit()}},[u]),Tc(()=>{M(6,X)},[]);let O=R.useMemo(()=>({subscribe:G=>(s.current.add(G),()=>s.current.delete(G)),snapshot:()=>n.current,setState:(G,D,ee)=>{var K,oe,J;if(!Object.is(n.current[G],D)){if(n.current[G]=D,G==="search")$(),F(),M(1,j);else if(G==="value"&&(ee||M(5,X),((K=a.current)==null?void 0:K.value)!==void 0)){let Z=D??"";(J=(oe=a.current).onValueChange)==null||J.call(oe,Z);return}O.emit()}},emit:()=>{s.current.forEach(G=>G())}}),[]),k=R.useMemo(()=>({value:(G,D,ee)=>{var K;D!==((K=o.current.get(G))==null?void 0:K.value)&&(o.current.set(G,{value:D,keywords:ee}),n.current.filtered.items.set(G,N(D,ee)),M(2,()=>{F(),O.emit()}))},item:(G,D)=>(r.current.add(G),D&&(i.current.has(D)?i.current.get(D).add(G):i.current.set(D,new Set([G]))),M(3,()=>{$(),F(),n.current.value||j(),O.emit()}),()=>{o.current.delete(G),r.current.delete(G),n.current.filtered.items.delete(G);let ee=V();M(4,()=>{$(),(ee==null?void 0:ee.getAttribute("id"))===G&&j(),O.emit()})}),group:G=>(i.current.has(G)||i.current.set(G,new Set),()=>{o.current.delete(G),i.current.delete(G)}),filter:()=>a.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:S,inputId:E,labelId:_,listInnerRef:C}),[]);function N(G,D){var ee,K;let oe=(K=(ee=a.current)==null?void 0:ee.filter)!=null?K:vTe;return G?oe(G,n.current.search,D):0}function F(){if(!n.current.search||a.current.shouldFilter===!1)return;let G=n.current.filtered.items,D=[];n.current.filtered.groups.forEach(K=>{let oe=i.current.get(K),J=0;oe.forEach(Z=>{let ae=G.get(Z);J=Math.max(ae,J)}),D.push([K,J])});let ee=C.current;L().sort((K,oe)=>{var J,Z;let ae=K.getAttribute("id"),ce=oe.getAttribute("id");return((J=G.get(ce))!=null?J:0)-((Z=G.get(ae))!=null?Z:0)}).forEach(K=>{let oe=K.closest(uw);oe?oe.appendChild(K.parentElement===oe?K:K.closest(`${uw} > *`)):ee.appendChild(K.parentElement===ee?K:K.closest(`${uw} > *`))}),D.sort((K,oe)=>oe[1]-K[1]).forEach(K=>{var oe;let J=(oe=C.current)==null?void 0:oe.querySelector(`${If}[${Ll}="${encodeURIComponent(K[0])}"]`);J==null||J.parentElement.appendChild(J)})}function j(){let G=L().find(ee=>ee.getAttribute("aria-disabled")!=="true"),D=G==null?void 0:G.getAttribute(Ll);O.setState("value",D||void 0)}function $(){var G,D,ee,K;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let oe=0;for(let J of r.current){let Z=(D=(G=o.current.get(J))==null?void 0:G.value)!=null?D:"",ae=(K=(ee=o.current.get(J))==null?void 0:ee.keywords)!=null?K:[],ce=N(Z,ae);n.current.filtered.items.set(J,ce),ce>0&&oe++}for(let[J,Z]of i.current)for(let ae of Z)if(n.current.filtered.items.get(ae)>0){n.current.filtered.groups.add(J);break}n.current.filtered.count=oe}function X(){var G,D,ee;let K=V();K&&(((G=K.parentElement)==null?void 0:G.firstChild)===K&&((ee=(D=K.closest(If))==null?void 0:D.querySelector(yTe))==null||ee.scrollIntoView({block:"nearest"})),K.scrollIntoView({block:"nearest"}))}function V(){var G;return(G=C.current)==null?void 0:G.querySelector(`${x2}[aria-selected="true"]`)}function L(){var G;return Array.from(((G=C.current)==null?void 0:G.querySelectorAll(NI))||[])}function U(G){let D=L()[G];D&&O.setState("value",D.getAttribute(Ll))}function B(G){var D;let ee=V(),K=L(),oe=K.findIndex(Z=>Z===ee),J=K[oe+G];(D=a.current)!=null&&D.loop&&(J=oe+G<0?K[K.length-1]:oe+G===K.length?K[0]:K[oe+G]),J&&O.setState("value",J.getAttribute(Ll))}function W(G){let D=V(),ee=D==null?void 0:D.closest(If),K;for(;ee&&!K;)ee=G>0?TTe(ee,If):MTe(ee,If),K=ee==null?void 0:ee.querySelector(NI);K?O.setState("value",K.getAttribute(Ll)):B(G)}let q=()=>U(L().length-1),A=G=>{G.preventDefault(),G.metaKey?q():G.altKey?W(1):B(1)},Y=G=>{G.preventDefault(),G.metaKey?U(0):G.altKey?W(-1):B(-1)};return R.createElement(Ne.div,{ref:t,tabIndex:-1,...x,"cmdk-root":"",onKeyDown:G=>{var D;if((D=x.onKeyDown)==null||D.call(x,G),!G.defaultPrevented)switch(G.key){case"n":case"j":{v&&G.ctrlKey&&A(G);break}case"ArrowDown":{A(G);break}case"p":case"k":{v&&G.ctrlKey&&Y(G);break}case"ArrowUp":{Y(G);break}case"Home":{G.preventDefault(),U(0);break}case"End":{G.preventDefault(),q();break}case"Enter":if(!G.nativeEvent.isComposing&&G.keyCode!==229){G.preventDefault();let ee=V();if(ee){let K=new Event($_);ee.dispatchEvent(K)}}}}},R.createElement("label",{"cmdk-label":"",htmlFor:k.inputId,id:k.labelId,style:ATe},l),tv(e,G=>R.createElement(tB.Provider,{value:O},R.createElement(eB.Provider,{value:k},G))))}),xTe=R.forwardRef((e,t)=>{var n,r;let i=qn(),o=R.useRef(null),s=R.useContext(nB),a=eg(),l=iB(e),c=(r=(n=l.current)==null?void 0:n.forceMount)!=null?r:s==null?void 0:s.forceMount;Tc(()=>{if(!c)return a.item(i,s==null?void 0:s.id)},[c]);let u=oB(i,o,[e.value,e.children,o],e.keywords),d=w2(),p=Mc(M=>M.value&&M.value===u.current),h=Mc(M=>c||a.filter()===!1?!0:M.search?M.filtered.items.get(i)>0:!0);R.useEffect(()=>{let M=o.current;if(!(!M||e.disabled))return M.addEventListener($_,m),()=>M.removeEventListener($_,m)},[h,e.onSelect,e.disabled]);function m(){var M,O;b(),(O=(M=l.current).onSelect)==null||O.call(M,u.current)}function b(){d.setState("value",u.current,!0)}if(!h)return null;let{disabled:v,value:x,onSelect:S,forceMount:_,keywords:E,...C}=e;return R.createElement(Ne.div,{ref:hp([o,t]),...C,id:i,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!p,"data-disabled":!!v,"data-selected":!!p,onPointerMove:v||a.getDisablePointerSelection()?void 0:b,onClick:v?void 0:m},e.children)}),wTe=R.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...o}=e,s=qn(),a=R.useRef(null),l=R.useRef(null),c=qn(),u=eg(),d=Mc(h=>i||u.filter()===!1?!0:h.search?h.filtered.groups.has(s):!0);Tc(()=>u.group(s),[]),oB(s,a,[e.value,e.heading,l]);let p=R.useMemo(()=>({id:s,forceMount:i}),[i]);return R.createElement(Ne.div,{ref:hp([a,t]),...o,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&R.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:c},n),tv(e,h=>R.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?c:void 0},R.createElement(nB.Provider,{value:p},h))))}),STe=R.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=R.useRef(null),o=Mc(s=>!s.search);return!n&&!o?null:R.createElement(Ne.div,{ref:hp([i,t]),...r,"cmdk-separator":"",role:"separator"})}),_Te=R.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,o=w2(),s=Mc(u=>u.search),a=Mc(u=>u.value),l=eg(),c=R.useMemo(()=>{var u;let d=(u=l.listInnerRef.current)==null?void 0:u.querySelector(`${x2}[${Ll}="${encodeURIComponent(a)}"]`);return d==null?void 0:d.getAttribute("id")},[]);return R.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),R.createElement(Ne.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:"text",value:i?e.value:s,onChange:u=>{i||o.setState("search",u.target.value),n==null||n(u.target.value)}})}),CTe=R.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...i}=e,o=R.useRef(null),s=R.useRef(null),a=eg();return R.useEffect(()=>{if(s.current&&o.current){let l=s.current,c=o.current,u,d=new ResizeObserver(()=>{u=requestAnimationFrame(()=>{let p=l.offsetHeight;c.style.setProperty("--cmdk-list-height",p.toFixed(1)+"px")})});return d.observe(l),()=>{cancelAnimationFrame(u),d.unobserve(l)}}},[]),R.createElement(Ne.div,{ref:hp([o,t]),...i,"cmdk-list":"",role:"listbox","aria-label":r,id:a.listId},tv(e,l=>R.createElement("div",{ref:hp([s,a.listInnerRef]),"cmdk-list-sizer":""},l)))}),ETe=R.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:o,container:s,...a}=e;return R.createElement(ZR,{open:n,onOpenChange:r},R.createElement(e2,{container:s},R.createElement(Y0,{"cmdk-overlay":"",className:i}),R.createElement(K0,{"aria-label":e.label,"cmdk-dialog":"",className:o},R.createElement(rB,{ref:t,...a}))))}),RTe=R.forwardRef((e,t)=>Mc(n=>n.filtered.count===0)?R.createElement(Ne.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),PTe=R.forwardRef((e,t)=>{let{progress:n,children:r,label:i="Loading...",...o}=e;return R.createElement(Ne.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},tv(e,s=>R.createElement("div",{"aria-hidden":!0},s)))}),xi=Object.assign(rB,{List:CTe,Item:xTe,Input:_Te,Group:wTe,Separator:STe,Dialog:ETe,Empty:RTe,Loading:PTe});function TTe(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function MTe(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function iB(e){let t=R.useRef(e);return Tc(()=>{t.current=e}),t}var Tc=typeof window>"u"?R.useEffect:R.useLayoutEffect;function yu(e){let t=R.useRef();return t.current===void 0&&(t.current=e()),t}function hp(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function Mc(e){let t=w2(),n=()=>e(t.snapshot());return tj.useSyncExternalStore(t.subscribe,n,n)}function oB(e,t,n,r=[]){let i=R.useRef(),o=eg();return Tc(()=>{var s;let a=(()=>{var c;for(let u of n){if(typeof u=="string")return u.trim();if(typeof u=="object"&&"current"in u)return u.current?(c=u.current.textContent)==null?void 0:c.trim():i.current}})(),l=r.map(c=>c.trim());o.value(e,a,l),(s=t.current)==null||s.setAttribute(Ll,a),i.current=a}),i}var OTe=()=>{let[e,t]=R.useState(),n=yu(()=>new Map);return Tc(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,i)=>{n.current.set(r,i),t({})}};function DTe(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function tv({asChild:e,children:t},n){return e&&R.isValidElement(t)?R.cloneElement(DTe(t),{ref:t.ref},n(t.props.children)):n(t)}var ATe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const sB=R.forwardRef(({className:e,...t},n)=>y.jsx(xi,{ref:n,className:be("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));sB.displayName=xi.displayName;const aB=R.forwardRef(({className:e,...t},n)=>y.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[y.jsx(a4,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),y.jsx(xi.Input,{ref:n,className:be("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));aB.displayName=xi.Input.displayName;const lB=R.forwardRef(({className:e,...t},n)=>y.jsx(xi.List,{ref:n,className:be("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));lB.displayName=xi.List.displayName;const cB=R.forwardRef((e,t)=>y.jsx(xi.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));cB.displayName=xi.Empty.displayName;const uB=R.forwardRef(({className:e,...t},n)=>y.jsx(xi.Group,{ref:n,className:be("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));uB.displayName=xi.Group.displayName;const kTe=R.forwardRef(({className:e,...t},n)=>y.jsx(xi.Separator,{ref:n,className:be("-mx-1 h-px bg-border",e),...t}));kTe.displayName=xi.Separator.displayName;const dB=R.forwardRef(({className:e,...t},n)=>y.jsx(xi.Item,{ref:n,className:be("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t}));dB.displayName=xi.Item.displayName;var ITe=Object.defineProperty,NTe=(e,t,n)=>t in e?ITe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Km=(e,t,n)=>NTe(e,typeof t!="symbol"?t+"":t,n);const LTe={stringify:e=>e?"true":"false",parse:e=>/^[ty1-9]/i.test(e)},FTe={stringify:e=>e.name,parse:(e,t,n)=>{const r=(()=>{if(typeof window<"u"&&e in window)return window[e];if(typeof global<"u"&&e in global)return global[e]})();return typeof r=="function"?r.bind(n):void 0}},jTe={stringify:e=>JSON.stringify(e),parse:e=>JSON.parse(e)},$Te={stringify:e=>`${e}`,parse:e=>parseFloat(e)},zTe={stringify:e=>e,parse:e=>e},dw={string:zTe,number:$Te,boolean:LTe,function:FTe,json:jTe};function BTe(e){return e.replace(/([a-z0-9])([A-Z])/g,(t,n,r)=>`${n}-${r.toLowerCase()}`)}const Xm=Symbol.for("r2wc.render"),Qm=Symbol.for("r2wc.connected"),Rl=Symbol.for("r2wc.context"),ks=Symbol.for("r2wc.props");function HTe(e,t,n){var r,i,o;t.props||(t.props=e.propTypes?Object.keys(e.propTypes):[]),t.events||(t.events=[]);const s=Array.isArray(t.props)?t.props.slice():Object.keys(t.props),a=Array.isArray(t.events)?t.events.slice():Object.keys(t.events),l={},c={},u={},d={};for(const h of s){l[h]=Array.isArray(t.props)?"string":t.props[h];const m=BTe(h);u[h]=m,d[m]=h}for(const h of a)c[h]=Array.isArray(t.events)?{}:t.events[h];class p extends HTMLElement{constructor(){super(),Km(this,o,!0),Km(this,i),Km(this,r,{}),Km(this,"container"),t.shadow?this.container=this.attachShadow({mode:t.shadow}):this.container=this,this[ks].container=this.container;for(const m of s){const b=u[m],v=this.getAttribute(b),x=l[m],S=x?dw[x]:null;S!=null&&S.parse&&v&&(this[ks][m]=S.parse(v,b,this))}for(const m of a)this[ks][m]=b=>{const v=m.replace(/^on/,"").toLowerCase();this.dispatchEvent(new CustomEvent(v,{detail:b,...c[m]}))}}static get observedAttributes(){return Object.keys(d)}connectedCallback(){this[Qm]=!0,this[Xm]()}disconnectedCallback(){this[Qm]=!1,this[Rl]&&n.unmount(this[Rl]),delete this[Rl]}attributeChangedCallback(m,b,v){const x=d[m],S=l[x],_=S?dw[S]:null;x in l&&_!=null&&_.parse&&v&&(this[ks][x]=_.parse(v,m,this),this[Xm]())}[(o=Qm,i=Rl,r=ks,Xm)](){this[Qm]&&(this[Rl]?n.update(this[Rl],this[ks]):this[Rl]=n.mount(this.container,e,this[ks]))}}for(const h of s){const m=u[h],b=l[h];Object.defineProperty(p.prototype,h,{enumerable:!0,configurable:!0,get(){return this[ks][h]},set(v){this[ks][h]=v;const x=b?dw[b]:null;if(x!=null&&x.stringify){const S=x.stringify(v,m,this);this.getAttribute(m)!==S&&this.setAttribute(m,S)}else this[Xm]()}})}return p}function VTe(e,t,n){const r=Sw(e),i=P.createElement(t,n);return r.render(i),{root:r,ReactComponent:t}}function WTe({root:e,ReactComponent:t},n){const r=P.createElement(t,n);e.render(r)}function UTe({root:e}){e.unmount()}function GTe(e,t={}){return HTe(e,t,{mount:VTe,update:WTe,unmount:UTe})}const qTe={id:"string",version:"string",authToken:"json",placeholders:"json",defaultFilterValues:"json",currentTheme:"string",customCards:"json",customStyle:"json",onChartElementClicked:"function",onFilterValuesChange:"function",onEvent:"function",onSave:"function",LoadingComponent:"function",ErrorComponent:"function",showAssistant:"boolean"},YTe=GTe(m$,{props:qTe});exports.Accordion=lTe;exports.AccordionContent=Jz;exports.AccordionItem=Xz;exports.AccordionTrigger=Qz;exports.Bot=eS;exports.Button=pi;exports.Calendar=U5;exports.Card=MN;exports.CardContent=ky;exports.CardDescription=rC;exports.CardHeader=Ay;exports.CardTitle=Rd;exports.CaretSortIcon=WZ;exports.ChartJsVisual=UE;exports.Check=Td;exports.CheckIcon=j5;exports.Checkbox=j0;exports.ChevronDown=Jy;exports.ChevronLeft=NC;exports.ChevronRight=Zy;exports.ChevronUp=G5;exports.Circle=LC;exports.ClipboardCopyIcon=KZ;exports.ColorFormat=DF;exports.Command=sB;exports.CommandEmpty=cB;exports.CommandGroup=uB;exports.CommandInput=aB;exports.CommandItem=dB;exports.CommandList=lB;exports.Copy=q5;exports.Cross2Icon=$5;exports.DATAMODEL_NAMESPCACE=cN;exports.Dashboard=m$;exports.DashboardPanel=DN;exports.DashboardTabs=p$;exports.DashboardWC=YTe;exports.Dialog=I2e;exports.DialogContent=bz;exports.DialogDescription=wz;exports.DialogFooter=vz;exports.DialogHeader=yz;exports.DialogTitle=xz;exports.DialogTrigger=N2e;exports.Download=Y5;exports.DropdownMenu=T2e;exports.DropdownMenuContent=dz;exports.DropdownMenuItem=fz;exports.DropdownMenuLabel=pz;exports.DropdownMenuRadioGroup=O2e;exports.DropdownMenuRadioItem=hz;exports.DropdownMenuSeparator=gz;exports.DropdownMenuTrigger=M2e;exports.Editable=rs;exports.EditorAside=_z;exports.EditorMain=Cz;exports.EditorPanel=Sz;exports.ErrorBoundary=e0;exports.Eye=X5;exports.EyeOff=K5;exports.Fallback=$C;exports.FallbackEditorCard=Bee;exports.Filter=Q5;exports.FilterComponent=CR;exports.FilterHeader=L7;exports.FilterX=FC;exports.Ft=VPe;exports.GripVertical=J5;exports.HoverCard=Fd;exports.HoverCardContent=Fc;exports.HoverCardTrigger=jd;exports.Icon=W5;exports.IdCard=Z5;exports.Info=e4;exports.Input=lc;exports.KPICard=Zb;exports.LOCALE_CURRENCY_PAIRS=_w;exports.Label=wn;exports.Le=jPe;exports.Lightbulb=n4;exports.LightbulbOff=t4;exports.Markdown=e9;exports.MultiInputEmptyRenderer=FF;exports.Oe=Sxe;exports.PYTHON_DEFAULT_CODE=q_;exports.PaperPlaneIcon=z5;exports.Pencil=r4;exports.Percent=i4;exports.PlayIcon=oee;exports.Plus=jC;exports.Popover=R0;exports.PopoverContent=jp;exports.PopoverTrigger=P0;exports.RadioGroup=Vh;exports.RadioGroupItem=Vl;exports.ResizableHandle=KEe;exports.ResizablePanel=N_;exports.ResizablePanelGroup=_9;exports.ScanSearch=o4;exports.ScrollArea=cc;exports.ScrollBar=$p;exports.Search=a4;exports.SearchX=s4;exports.Select=js;exports.SelectContent=Wo;exports.SelectGroup=mu;exports.SelectItem=kn;exports.SelectLabel=kl;exports.SelectSeparator=hh;exports.SelectTrigger=Vo;exports.SelectValue=$s;exports.SemaphorContextProvider=PN;exports.SemaphorQueryClient=EN;exports.Separator=kp;exports.Settings=l4;exports.SliderIcon=aee;exports.Switch=gj;exports.Table=c4;exports.TableBody=LE;exports.TableCell=jE;exports.TableHead=FE;exports.TableHeader=NE;exports.TableRow=dh;exports.TableVisual=IF;exports.Tabs=cC;exports.TabsContent=uC;exports.TabsList=Fy;exports.TabsTrigger=jy;exports.TextCard=oy;exports.Textarea=ER;exports.Toggle=T0;exports.Tooltip=r6;exports.TooltipContent=kE;exports.TooltipTrigger=i6;exports.TooltipTrigger$1=AE;exports.TreePalm=u4;exports.TriangleDownIcon=B5;exports.TriangleUpIcon=H5;exports.UXProvider=g$;exports.UserRound=d4;exports.X=Md;exports._=Jl;exports.ce=F7;exports.cn=be;exports.createChartConfig=bE;exports.createLucideIcon=Gt;exports.createSqlGenConfig=kK;exports.de=Dz;exports.flexRender=qS;exports.fmt=K_;exports.getCanvasBackgroundColor=_h;exports.getColumnDataType=IK;exports.getContrastColor=nd;exports.getCoreRowModel=w6;exports.getDefaultFilterSql=Ove;exports.getFilterValueType=Pu;exports.getKeys=sr;exports.getNumberAxis=BC;exports.getPaginationRowModel=S6;exports.getPlugins=qK;exports.getQualifiedTableName=uN;exports.getRequest=BK;exports.getSortedRowModel=_6;exports.getSql=AK;exports.getTenantAndEndUserId=HK;exports.getTokenParams=fN;exports.hslStringToHex=h4;exports.invalidateToken=UK;exports.isBooleanDataType=X_;exports.isColumnInSqlGen=NK;exports.isDateDataType=Ed;exports.isNumberDataType=yp;exports.isObjectEmpty=zK;exports.isTextDataType=My;exports.jsxRuntimeExports=y;exports.loadManifest=NF;exports.pivotData=Tb;exports.postRequest=Dy;exports.removeRing=eh;exports.resolveDataType=Oy;exports.titleCase=WK;exports.useCard=ece;exports.useCustomVisual=LF;exports.useDashboardActions=Hn;exports.useDashboardCardQuery=Wa;exports.useDashboardStore=ye;exports.useDateFilterHook=vbe;exports.useEditorActions=Qy;exports.useEditorStore=Ur;exports.useQuery=xp;exports.useQueryClient=nC;exports.useReactTable=C6;exports.useSemaphorContext=Vi;exports.useTextFilterHook=Dve;exports.useTheme=pN;exports.useTopoJson=fL;exports.v4=Va;
|