react-semaphor 0.0.331 → 0.0.332
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/B4MFY5CR-D6VLDens.js +1200 -0
- package/dist/chunks/B4MFY5CR-DSyPShbg.js +9104 -0
- package/dist/chunks/HO4MOOFI-PCPf0V7Q.js +33 -0
- package/dist/chunks/HO4MOOFI-XrF2yHxb.js +1 -0
- package/dist/chunks/HUY7CZI3-BZLAkw5U.js +1 -0
- package/dist/chunks/HUY7CZI3-DT2fc5Um.js +42 -0
- package/dist/chunks/index-B0j1CW59.js +392 -0
- package/dist/chunks/{index-Balo3fZW.js → index-BGmqxQsB.js} +364 -364
- package/dist/chunks/index-BrrtYt6g.js +240 -0
- package/dist/chunks/{index-C2PdR3St.js → index-HSAFthpc.js} +17549 -15266
- package/dist/chunks/{lucide-react-B-QrWK14.js → lucide-react-DWPc-x9m.js} +3 -3
- package/dist/chunks/{lucide-react-3Uze18Bl.js → lucide-react-Dwcz19Mq.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +19 -19
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/index-CIKx2XGC.js +0 -240
- package/dist/chunks/index-DBTi9K8K.js +0 -392
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
"use strict";var HX=Object.defineProperty;var _M=e=>{throw TypeError(e)};var VX=(e,t,n)=>t in e?HX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Me=(e,t,n)=>VX(e,typeof t!="symbol"?t+"":t,n),Dw=(e,t,n)=>t.has(e)||_M("Cannot "+n);var Z=(e,t,n)=>(Dw(e,t,"read from private field"),n?n.call(e):t.get(e)),Ne=(e,t,n)=>t.has(e)?_M("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Pe=(e,t,n,r)=>(Dw(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Lt=(e,t,n)=>(Dw(e,t,"access private method"),n);var Um=(e,t,n,r)=>({set _(i){Pe(e,t,i,n)},get _(){return Z(e,t,r)}});const P=require("react"),kr=require("react-dom");function N5(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 E=N5(P),Mc=N5(kr);var La=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function bE(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 FS={exports:{}},Wf={};/**
|
|
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 CM;function WX(){if(CM)return Wf;CM=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 Wf.Fragment=n,Wf.jsx=s,Wf.jsxs=s,Wf}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 EM;function UX(){return EM||(EM=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(ne){if(ne===null||typeof ne!="object")return null;var Ce=m&&ne[m]||ne[b];return typeof Ce=="function"?Ce:null}var x=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w(ne){{for(var Ce=arguments.length,Ae=new Array(Ce>1?Ce-1:0),We=1;We<Ce;We++)Ae[We-1]=arguments[We];_("error",ne,Ae)}}function _(ne,Ce,Ae){{var We=x.ReactDebugCurrentFrame,kt=We.getStackAddendum();kt!==""&&(Ce+="%s",Ae=Ae.concat([kt]));var $t=Ae.map(function(wt){return String(wt)});$t.unshift("Warning: "+Ce),Function.prototype.apply.call(console[ne],console,$t)}}var R=!1,C=!1,T=!1,M=!1,I=!1,k;k=Symbol.for("react.module.reference");function L(ne){return!!(typeof ne=="string"||typeof ne=="function"||ne===r||ne===o||I||ne===i||ne===c||ne===u||M||ne===h||R||C||T||typeof ne=="object"&&ne!==null&&(ne.$$typeof===p||ne.$$typeof===d||ne.$$typeof===s||ne.$$typeof===a||ne.$$typeof===l||ne.$$typeof===k||ne.getModuleId!==void 0))}function j(ne,Ce,Ae){var We=ne.displayName;if(We)return We;var kt=Ce.displayName||Ce.name||"";return kt!==""?Ae+"("+kt+")":Ae}function $(ne){return ne.displayName||"Context"}function X(ne){if(ne==null)return null;if(typeof ne.tag=="number"&&w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof ne=="function")return ne.displayName||ne.name||null;if(typeof ne=="string")return ne;switch(ne){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 ne=="object")switch(ne.$$typeof){case a:var Ce=ne;return $(Ce)+".Consumer";case s:var Ae=ne;return $(Ae._context)+".Provider";case l:return j(ne,ne.render,"ForwardRef");case d:var We=ne.displayName||null;return We!==null?We:X(ne.type)||"Memo";case p:{var kt=ne,$t=kt._payload,wt=kt._init;try{return X(wt($t))}catch{return null}}}return null}var H=Object.assign,F=0,G,B,W,K,D,Y,U;function A(){}A.__reactDisabledLog=!0;function te(){{if(F===0){G=console.log,B=console.info,W=console.warn,K=console.error,D=console.group,Y=console.groupCollapsed,U=console.groupEnd;var ne={configurable:!0,enumerable:!0,value:A,writable:!0};Object.defineProperties(console,{info:ne,log:ne,warn:ne,error:ne,group:ne,groupCollapsed:ne,groupEnd:ne})}F++}}function q(){{if(F--,F===0){var ne={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:H({},ne,{value:G}),info:H({},ne,{value:B}),warn:H({},ne,{value:W}),error:H({},ne,{value:K}),group:H({},ne,{value:D}),groupCollapsed:H({},ne,{value:Y}),groupEnd:H({},ne,{value:U})})}F<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var se=x.ReactCurrentDispatcher,J;function ee(ne,Ce,Ae){{if(J===void 0)try{throw Error()}catch(kt){var We=kt.stack.trim().match(/\n( *(at )?)/);J=We&&We[1]||""}return`
|
|
18
|
+
`+J+ne}}var ae=!1,ce;{var ge=typeof WeakMap=="function"?WeakMap:Map;ce=new ge}function oe(ne,Ce){if(!ne||ae)return"";{var Ae=ce.get(ne);if(Ae!==void 0)return Ae}var We;ae=!0;var kt=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var $t;$t=se.current,se.current=null,te();try{if(Ce){var wt=function(){throw Error()};if(Object.defineProperty(wt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(wt,[])}catch(Rt){We=Rt}Reflect.construct(ne,[],wt)}else{try{wt.call()}catch(Rt){We=Rt}ne.call(wt.prototype)}}else{try{throw Error()}catch(Rt){We=Rt}ne()}}catch(Rt){if(Rt&&We&&typeof Rt.stack=="string"){for(var gt=Rt.stack.split(`
|
|
19
|
+
`),Le=We.stack.split(`
|
|
20
|
+
`),re=gt.length-1,we=Le.length-1;re>=1&&we>=0&>[re]!==Le[we];)we--;for(;re>=1&&we>=0;re--,we--)if(gt[re]!==Le[we]){if(re!==1||we!==1)do if(re--,we--,we<0||gt[re]!==Le[we]){var Ie=`
|
|
21
|
+
`+gt[re].replace(" at new "," at ");return ne.displayName&&Ie.includes("<anonymous>")&&(Ie=Ie.replace("<anonymous>",ne.displayName)),typeof ne=="function"&&ce.set(ne,Ie),Ie}while(re>=1&&we>=0);break}}}finally{ae=!1,se.current=$t,q(),Error.prepareStackTrace=kt}var Dt=ne?ne.displayName||ne.name:"",gn=Dt?ee(Dt):"";return typeof ne=="function"&&ce.set(ne,gn),gn}function pe(ne,Ce,Ae){return oe(ne,!1)}function de(ne){var Ce=ne.prototype;return!!(Ce&&Ce.isReactComponent)}function Ee(ne,Ce,Ae){if(ne==null)return"";if(typeof ne=="function")return oe(ne,de(ne));if(typeof ne=="string")return ee(ne);switch(ne){case c:return ee("Suspense");case u:return ee("SuspenseList")}if(typeof ne=="object")switch(ne.$$typeof){case l:return pe(ne.render);case d:return Ee(ne.type,Ce,Ae);case p:{var We=ne,kt=We._payload,$t=We._init;try{return Ee($t(kt),Ce,Ae)}catch{}}}return""}var De=Object.prototype.hasOwnProperty,ze={},Oe=x.ReactDebugCurrentFrame;function Be(ne){if(ne){var Ce=ne._owner,Ae=Ee(ne.type,ne._source,Ce?Ce.type:null);Oe.setExtraStackFrame(Ae)}else Oe.setExtraStackFrame(null)}function vt(ne,Ce,Ae,We,kt){{var $t=Function.call.bind(De);for(var wt in ne)if($t(ne,wt)){var gt=void 0;try{if(typeof ne[wt]!="function"){var Le=Error((We||"React class")+": "+Ae+" type `"+wt+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof ne[wt]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Le.name="Invariant Violation",Le}gt=ne[wt](Ce,wt,We,Ae,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(re){gt=re}gt&&!(gt instanceof Error)&&(Be(kt),w("%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).",We||"React class",Ae,wt,typeof gt),Be(null)),gt instanceof Error&&!(gt.message in ze)&&(ze[gt.message]=!0,Be(kt),w("Failed %s type: %s",Ae,gt.message),Be(null))}}}var Mt=Array.isArray;function xn(ne){return Mt(ne)}function At(ne){{var Ce=typeof Symbol=="function"&&Symbol.toStringTag,Ae=Ce&&ne[Symbol.toStringTag]||ne.constructor.name||"Object";return Ae}}function pn(ne){try{return en(ne),!1}catch{return!0}}function en(ne){return""+ne}function fe(ne){if(pn(ne))return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",At(ne)),en(ne)}var _e=x.ReactCurrentOwner,He={key:!0,ref:!0,__self:!0,__source:!0},Ze,st;function kn(ne){if(De.call(ne,"ref")){var Ce=Object.getOwnPropertyDescriptor(ne,"ref").get;if(Ce&&Ce.isReactWarning)return!1}return ne.ref!==void 0}function Bn(ne){if(De.call(ne,"key")){var Ce=Object.getOwnPropertyDescriptor(ne,"key").get;if(Ce&&Ce.isReactWarning)return!1}return ne.key!==void 0}function Mn(ne,Ce){typeof ne.ref=="string"&&_e.current}function sn(ne,Ce){{var Ae=function(){Ze||(Ze=!0,w("%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))};Ae.isReactWarning=!0,Object.defineProperty(ne,"key",{get:Ae,configurable:!0})}}function Hn(ne,Ce){{var Ae=function(){st||(st=!0,w("%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))};Ae.isReactWarning=!0,Object.defineProperty(ne,"ref",{get:Ae,configurable:!0})}}var tn=function(ne,Ce,Ae,We,kt,$t,wt){var gt={$$typeof:t,type:ne,key:Ce,ref:Ae,props:wt,_owner:$t};return gt._store={},Object.defineProperty(gt._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(gt,"_self",{configurable:!1,enumerable:!1,writable:!1,value:We}),Object.defineProperty(gt,"_source",{configurable:!1,enumerable:!1,writable:!1,value:kt}),Object.freeze&&(Object.freeze(gt.props),Object.freeze(gt)),gt};function sr(ne,Ce,Ae,We,kt){{var $t,wt={},gt=null,Le=null;Ae!==void 0&&(fe(Ae),gt=""+Ae),Bn(Ce)&&(fe(Ce.key),gt=""+Ce.key),kn(Ce)&&(Le=Ce.ref,Mn(Ce,kt));for($t in Ce)De.call(Ce,$t)&&!He.hasOwnProperty($t)&&(wt[$t]=Ce[$t]);if(ne&&ne.defaultProps){var re=ne.defaultProps;for($t in re)wt[$t]===void 0&&(wt[$t]=re[$t])}if(gt||Le){var we=typeof ne=="function"?ne.displayName||ne.name||"Unknown":ne;gt&&sn(wt,we),Le&&Hn(wt,we)}return tn(ne,gt,Le,kt,We,_e.current,wt)}}var Zn=x.ReactCurrentOwner,Qi=x.ReactDebugCurrentFrame;function Cr(ne){if(ne){var Ce=ne._owner,Ae=Ee(ne.type,ne._source,Ce?Ce.type:null);Qi.setExtraStackFrame(Ae)}else Qi.setExtraStackFrame(null)}var Wo;Wo=!1;function Er(ne){return typeof ne=="object"&&ne!==null&&ne.$$typeof===t}function Br(){{if(Zn.current){var ne=X(Zn.current.type);if(ne)return`
|
|
22
|
+
|
|
23
|
+
Check the render method of \``+ne+"`."}return""}}function _l(ne){return""}var je={};function xt(ne){{var Ce=Br();if(!Ce){var Ae=typeof ne=="string"?ne:ne.displayName||ne.name;Ae&&(Ce=`
|
|
24
|
+
|
|
25
|
+
Check the top-level render call using <`+Ae+">.")}return Ce}}function Ht(ne,Ce){{if(!ne._store||ne._store.validated||ne.key!=null)return;ne._store.validated=!0;var Ae=xt(Ce);if(je[Ae])return;je[Ae]=!0;var We="";ne&&ne._owner&&ne._owner!==Zn.current&&(We=" It was passed a child from "+X(ne._owner.type)+"."),Cr(ne),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',Ae,We),Cr(null)}}function er(ne,Ce){{if(typeof ne!="object")return;if(xn(ne))for(var Ae=0;Ae<ne.length;Ae++){var We=ne[Ae];Er(We)&&Ht(We,Ce)}else if(Er(ne))ne._store&&(ne._store.validated=!0);else if(ne){var kt=v(ne);if(typeof kt=="function"&&kt!==ne.entries)for(var $t=kt.call(ne),wt;!(wt=$t.next()).done;)Er(wt.value)&&Ht(wt.value,Ce)}}}function tr(ne){{var Ce=ne.type;if(Ce==null||typeof Ce=="string")return;var Ae;if(typeof Ce=="function")Ae=Ce.propTypes;else if(typeof Ce=="object"&&(Ce.$$typeof===l||Ce.$$typeof===d))Ae=Ce.propTypes;else return;if(Ae){var We=X(Ce);vt(Ae,ne.props,"prop",We,ne)}else if(Ce.PropTypes!==void 0&&!Wo){Wo=!0;var kt=X(Ce);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",kt||"Unknown")}typeof Ce.getDefaultProps=="function"&&!Ce.getDefaultProps.isReactClassApproved&&w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Hr(ne){{for(var Ce=Object.keys(ne.props),Ae=0;Ae<Ce.length;Ae++){var We=Ce[Ae];if(We!=="children"&&We!=="key"){Cr(ne),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",We),Cr(null);break}}ne.ref!==null&&(Cr(ne),w("Invalid attribute `ref` supplied to `React.Fragment`."),Cr(null))}}var mr={};function ar(ne,Ce,Ae,We,kt,$t){{var wt=L(ne);if(!wt){var gt="";(ne===void 0||typeof ne=="object"&&ne!==null&&Object.keys(ne).length===0)&&(gt+=" 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 Le=_l();Le?gt+=Le:gt+=Br();var re;ne===null?re="null":xn(ne)?re="array":ne!==void 0&&ne.$$typeof===t?(re="<"+(X(ne.type)||"Unknown")+" />",gt=" Did you accidentally export a JSX literal instead of a component?"):re=typeof ne,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",re,gt)}var we=sr(ne,Ce,Ae,kt,$t);if(we==null)return we;if(wt){var Ie=Ce.children;if(Ie!==void 0)if(We)if(xn(Ie)){for(var Dt=0;Dt<Ie.length;Dt++)er(Ie[Dt],ne);Object.freeze&&Object.freeze(Ie)}else w("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 er(Ie,ne)}if(De.call(Ce,"key")){var gn=X(ne),Rt=Object.keys(Ce).filter(function(Ms){return Ms!=="key"}),qn=Rt.length>0?"{key: someKey, "+Rt.join(": ..., ")+": ...}":"{key: someKey}";if(!mr[gn+qn]){var si=Rt.length>0?"{"+Rt.join(": ..., ")+": ...}":"{}";w(`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} />`,qn,gn,si,gn),mr[gn+qn]=!0}}return ne===r?Hr(we):tr(we),we}}function wn(ne,Ce,Ae){return ar(ne,Ce,Ae,!0)}function ba(ne,Ce,Ae){return ar(ne,Ce,Ae,!1)}var iu=ba,ou=wn;Uf.Fragment=r,Uf.jsx=iu,Uf.jsxs=ou}()),Uf}process.env.NODE_ENV==="production"?FS.exports=WX():FS.exports=UX();var y=FS.exports;function L5(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=L5(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Cy(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=L5(e))&&(r&&(r+=" "),r+=t);return r}const GX=Object.freeze(Object.defineProperty({__proto__:null,clsx:Cy,default:Cy},Symbol.toStringTag,{value:"Module"})),yE="-",qX=e=>{const t=KX(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(yE);return a[0]===""&&a.length!==1&&a.shift(),F5(a,t)||YX(s)},getConflictingClassGroupIds:(s,a)=>{const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}}},F5=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?F5(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(yE);return(s=t.validators.find(({validator:a})=>a(o)))==null?void 0:s.classGroupId},RM=/^\[(.+)\]$/,YX=e=>{if(RM.test(e)){const t=RM.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},KX=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return QX(Object.entries(e.classGroups),n).forEach(([o,s])=>{jS(s,r,o,t)}),r},jS=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:PM(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(XX(i)){jS(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,s])=>{jS(s,PM(t,o),n,r)})})},PM=(e,t)=>{let n=e;return t.split(yE).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},XX=e=>e.isThemeGetter,QX=(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,JX=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)}}},j5="!",ZX=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(j5),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},eQ=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},tQ=e=>({cache:JX(e.cacheSize),parseClassName:ZX(e),...qX(e)}),nQ=/\s+/,rQ=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,o=[],s=e.trim().split(nQ);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=eQ(u).join(":"),x=d?v+j5:v,w=x+b;if(o.includes(w))continue;o.push(w);const _=i(b,m);for(let R=0;R<_.length;++R){const C=_[R];o.push(x+C)}a=c+(a.length>0?" "+a:a)}return a};function iQ(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=$5(t))&&(r&&(r+=" "),r+=n);return r}const $5=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=$5(e[r]))&&(n&&(n+=" "),n+=t);return n};function oQ(e,...t){let n,r,i,o=s;function s(l){const c=t.reduce((u,d)=>d(u),e());return n=tQ(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=rQ(l,n);return i(l,u),u}return function(){return o(iQ.apply(null,arguments))}}const _n=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},z5=/^\[(?:([a-z-]+):)?(.+)\]$/i,sQ=/^\d+\/\d+$/,aQ=new Set(["px","full","screen"]),lQ=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,cQ=/\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$/,uQ=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,dQ=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,fQ=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,zs=e=>Uu(e)||aQ.has(e)||sQ.test(e),Pa=e=>lf(e,"length",xQ),Uu=e=>!!e&&!Number.isNaN(Number(e)),Iw=e=>lf(e,"number",Uu),Gf=e=>!!e&&Number.isInteger(Number(e)),hQ=e=>e.endsWith("%")&&Uu(e.slice(0,-1)),ft=e=>z5.test(e),Ta=e=>lQ.test(e),pQ=new Set(["length","size","percentage"]),gQ=e=>lf(e,pQ,B5),mQ=e=>lf(e,"position",B5),bQ=new Set(["image","url"]),yQ=e=>lf(e,bQ,SQ),vQ=e=>lf(e,"",wQ),qf=()=>!0,lf=(e,t,n)=>{const r=z5.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},xQ=e=>cQ.test(e)&&!uQ.test(e),B5=()=>!1,wQ=e=>dQ.test(e),SQ=e=>fQ.test(e),_Q=()=>{const e=_n("colors"),t=_n("spacing"),n=_n("blur"),r=_n("brightness"),i=_n("borderColor"),o=_n("borderRadius"),s=_n("borderSpacing"),a=_n("borderWidth"),l=_n("contrast"),c=_n("grayscale"),u=_n("hueRotate"),d=_n("invert"),p=_n("gap"),h=_n("gradientColorStops"),m=_n("gradientColorStopPositions"),b=_n("inset"),v=_n("margin"),x=_n("opacity"),w=_n("padding"),_=_n("saturate"),R=_n("scale"),C=_n("sepia"),T=_n("skew"),M=_n("space"),I=_n("translate"),k=()=>["auto","contain","none"],L=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto",ft,t],$=()=>[ft,t],X=()=>["",zs,Pa],H=()=>["auto",Uu,ft],F=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],G=()=>["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"],K=()=>["","0",ft],D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Y=()=>[Uu,ft];return{cacheSize:500,separator:":",theme:{colors:[qf],spacing:[zs,Pa],blur:["none","",Ta,ft],brightness:Y(),borderColor:[e],borderRadius:["none","","full",Ta,ft],borderSpacing:$(),borderWidth:X(),contrast:Y(),grayscale:K(),hueRotate:Y(),invert:K(),gap:$(),gradientColorStops:[e],gradientColorStopPositions:[hQ,Pa],inset:j(),margin:j(),opacity:Y(),padding:$(),saturate:Y(),scale:Y(),sepia:K(),skew:Y(),space:$(),translate:$()},classGroups:{aspect:[{aspect:["auto","square","video",ft]}],container:["container"],columns:[{columns:[Ta]}],"break-after":[{"break-after":D()}],"break-before":[{"break-before":D()}],"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:[...F(),ft]}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],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",Gf,ft]}],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",ft]}],grow:[{grow:K()}],shrink:[{shrink:K()}],order:[{order:["first","last","none",Gf,ft]}],"grid-cols":[{"grid-cols":[qf]}],"col-start-end":[{col:["auto",{span:["full",Gf,ft]},ft]}],"col-start":[{"col-start":H()}],"col-end":[{"col-end":H()}],"grid-rows":[{"grid-rows":[qf]}],"row-start-end":[{row:["auto",{span:[Gf,ft]},ft]}],"row-start":[{"row-start":H()}],"row-end":[{"row-end":H()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ft]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ft]}],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:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],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":[M]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[M]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ft,t]}],"min-w":[{"min-w":[ft,t,"min","max","fit"]}],"max-w":[{"max-w":[ft,t,"none","full","min","max","fit","prose",{screen:[Ta]},Ta]}],h:[{h:[ft,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ft,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ft,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ft,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ta,Pa]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Iw]}],"font-family":[{font:[qf]}],"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",ft]}],"line-clamp":[{"line-clamp":["none",Uu,Iw]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",zs,ft]}],"list-image":[{"list-image":["none",ft]}],"list-style-type":[{list:["none","disc","decimal",ft]}],"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:[...G(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",zs,Pa]}],"underline-offset":[{"underline-offset":["auto",zs,ft]}],"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",ft]}],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",ft]}],"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:[...F(),mQ]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",gQ]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},yQ]}],"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:[...G(),"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:G()}],"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:["",...G()]}],"outline-offset":[{"outline-offset":[zs,ft]}],"outline-w":[{outline:[zs,Pa]}],"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":[zs,Pa]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ta,vQ]}],"shadow-color":[{shadow:[qf]}],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",Ta,ft]}],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",ft]}],duration:[{duration:Y()}],ease:[{ease:["linear","in","out","in-out",ft]}],delay:[{delay:Y()}],animate:[{animate:["none","spin","ping","pulse","bounce",ft]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[R]}],"scale-x":[{"scale-x":[R]}],"scale-y":[{"scale-y":[R]}],rotate:[{rotate:[Gf,ft]}],"translate-x":[{"translate-x":[I]}],"translate-y":[{"translate-y":[I]}],"skew-x":[{"skew-x":[T]}],"skew-y":[{"skew-y":[T]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ft]}],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",ft]}],"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",ft]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[zs,Pa,Iw]}],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"]}}},CQ=oQ(_Q);class mh extends Error{}mh.prototype.name="InvalidTokenError";function EQ(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 RQ(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 EQ(t)}catch{return atob(t)}}function vE(e,t){if(typeof e!="string")throw new mh("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 mh(`Invalid token specified: missing part #${n+1}`);let i;try{i=RQ(r)}catch(o){throw new mh(`Invalid token specified: invalid base64 for part #${n+1} (${o.message})`)}try{return JSON.parse(i)}catch(o){throw new mh(`Invalid token specified: invalid json for part #${n+1} (${o.message})`)}}async function PQ(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 TQ(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 CQ(Cy(e))}async function OQ(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 z0(e,t,n={}){try{const r=JSON.stringify(n),i=await PQ(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 TQ(s.payload,t);return JSON.parse(a.decryptedData)}return s}catch(r){throw console.error("Error during fetch:",r),r}}function MQ(e){if(!e)return{tenantId:"",endUserId:""};const t=vE(e);return{tenantId:t==null?void 0:t.tenantId,endUserId:t==null?void 0:t.endUserId}}function AQ(e){if(!e)return;const t=vE(e);if(t.params&&t.params.currencyFormat)return t.params.currencyFormat}function H5(e){return e?vE(e).params:void 0}function DQ(e,t){if(!e)return"";const n=/\{\{\s*ref\('([^']+)'\)\s*\}\}/g;return e.replace(n,(i,o)=>IQ(o,t))}function IQ(e,t){const n=t==null?void 0:t.find(r=>r.name===e);return n?`(${n.sql}) as ${n.name}`:(console.log(e),`'${e}_table'`)}function kQ(e){return e.charAt(0).toUpperCase()+e.slice(1)}const jh="focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";async function NQ(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();return i&&(n+=`?${i}`),await(await fetch(n,{headers:{Authorization:`Bearer ${e}`}})).json()}async function LQ(e){return e?await(await fetch("https://semaphor.cloud/api/v1/plugins",{headers:{Authorization:`Bearer ${e}`}})).json():null}const TM=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},FQ=e=>e?TM(e):TM;var $S={exports:{}},kw={},Gm={exports:{}},Nw={};/**
|
|
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 OM;function jQ(){if(OM)return Nw;OM=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 Nw.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,Nw}var Lw={};/**
|
|
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 MM;function $Q(){return MM||(MM=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,w=v[1];return l(function(){x.value=b,x.getSnapshot=m,n(x)&&w({inst:x})},[h,b,m]),a(function(){return n(x)&&w({inst:x}),h(function(){n(x)&&w({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;Lw.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())}()),Lw}var AM;function xE(){return AM||(AM=1,process.env.NODE_ENV==="production"?Gm.exports=jQ():Gm.exports=$Q()),Gm.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 DM;function zQ(){if(DM)return kw;DM=1;var e=P,t=xE();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 kw.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(T){if(!w){if(w=!0,_=T,T=p(T),h!==void 0&&b.hasValue){var M=b.value;if(h(M,T))return R=M}return R=T}if(M=R,r(_,T))return M;var I=p(T);return h!==void 0&&h(M,I)?(_=T,M):(_=T,R=I)}var w=!1,_,R,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},kw}var Fw={};/**
|
|
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 IM;function BQ(){return IM||(IM=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=xE(),r=typeof Object.is=="function"?Object.is:e,i=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,a=t.useMemo,l=t.useDebugValue;Fw.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(T){if(!w){if(w=!0,_=T,T=p(T),h!==void 0&&b.hasValue){var M=b.value;if(h(M,T))return R=M}return R=T}if(M=R,r(_,T))return M;var I=p(T);return h!==void 0&&h(M,I)?(_=T,M):(_=T,R=I)}var w=!1,_,R,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())}()),Fw}process.env.NODE_ENV==="production"?$S.exports=zQ():$S.exports=BQ();var HQ=$S.exports;const VQ=qc(HQ),{useDebugValue:WQ}=P,{useSyncExternalStoreWithSelector:UQ}=VQ,GQ=e=>e;function qQ(e,t=GQ,n){const r=UQ(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return WQ(r),r}const kM=e=>{const t=typeof e=="function"?FQ(e):e,n=(r,i)=>qQ(t,r,i);return Object.assign(n,t),n},V5=e=>e?kM(e):kM;var W5=Symbol.for("immer-nothing"),NM=Symbol.for("immer-draftable"),Wi=Symbol.for("immer-state"),YQ=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 vi(e,...t){if(process.env.NODE_ENV!=="production"){const n=YQ[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 kd=Object.getPrototypeOf;function Nd(e){return!!e&&!!e[Wi]}function Ac(e){var t;return e?U5(e)||Array.isArray(e)||!!e[NM]||!!((t=e.constructor)!=null&&t[NM])||H0(e)||V0(e):!1}var KQ=Object.prototype.constructor.toString();function U5(e){if(!e||typeof e!="object")return!1;const t=kd(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)===KQ}function Ey(e,t){B0(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function B0(e){const t=e[Wi];return t?t.type_:Array.isArray(e)?1:H0(e)?2:V0(e)?3:0}function zS(e,t){return B0(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function G5(e,t,n){const r=B0(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function XQ(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function H0(e){return e instanceof Map}function V0(e){return e instanceof Set}function Hl(e){return e.copy_||e.base_}function BS(e,t){if(H0(e))return new Map(e);if(V0(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=U5(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Wi];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(kd(e),r)}else{const r=kd(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function wE(e,t=!1){return W0(e)||Nd(e)||!Ac(e)||(B0(e)>1&&(e.set=e.add=e.clear=e.delete=QQ),Object.freeze(e),t&&Object.entries(e).forEach(([n,r])=>wE(r,!0))),e}function QQ(){vi(2)}function W0(e){return Object.isFrozen(e)}var JQ={};function Dc(e){const t=JQ[e];return t||vi(0,e),t}var ap;function q5(){return ap}function ZQ(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function LM(e,t){t&&(Dc("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function HS(e){VS(e),e.drafts_.forEach(eJ),e.drafts_=null}function VS(e){e===ap&&(ap=e.parent_)}function FM(e){return ap=ZQ(ap,e)}function eJ(e){const t=e[Wi];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function jM(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Wi].modified_&&(HS(t),vi(4)),Ac(e)&&(e=Ry(t,e),t.parent_||Py(t,e)),t.patches_&&Dc("Patches").generateReplacementPatches_(n[Wi].base_,e,t.patches_,t.inversePatches_)):e=Ry(t,n,[]),HS(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==W5?e:void 0}function Ry(e,t,n){if(W0(t))return t;const r=t[Wi];if(!r)return Ey(t,(i,o)=>$M(e,r,t,i,o,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return Py(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),Ey(o,(a,l)=>$M(e,r,i,a,l,n,s)),Py(e,i,!1),n&&e.patches_&&Dc("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function $M(e,t,n,r,i,o,s){if(process.env.NODE_ENV!=="production"&&i===n&&vi(5),Nd(i)){const a=o&&t&&t.type_!==3&&!zS(t.assigned_,r)?o.concat(r):void 0,l=Ry(e,i,a);if(G5(n,r,l),Nd(l))e.canAutoFreeze_=!1;else return}else s&&n.add(i);if(Ac(i)&&!W0(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Ry(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,r)&&Py(e,i)}}function Py(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&wE(t,n)}function tJ(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:q5(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,o=SE;n&&(i=[r],o=lp);const{revoke:s,proxy:a}=Proxy.revocable(i,o);return r.draft_=a,r.revoke_=s,a}var SE={get(e,t){if(t===Wi)return e;const n=Hl(e);if(!zS(n,t))return nJ(e,n,t);const r=n[t];return e.finalized_||!Ac(r)?r:r===jw(e.base_,t)?($w(e),e.copy_[t]=US(r,e)):r},has(e,t){return t in Hl(e)},ownKeys(e){return Reflect.ownKeys(Hl(e))},set(e,t,n){const r=Y5(Hl(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=jw(Hl(e),t),o=i==null?void 0:i[Wi];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(XQ(n,i)&&(n!==void 0||zS(e.base_,t)))return!0;$w(e),WS(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 jw(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,$w(e),WS(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Hl(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){vi(11)},getPrototypeOf(e){return kd(e.base_)},setPrototypeOf(){vi(12)}},lp={};Ey(SE,(e,t)=>{lp[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});lp.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&vi(13),lp.set.call(this,e,t,void 0)};lp.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&vi(14),SE.set.call(this,e[0],t,n,e[0])};function jw(e,t){const n=e[Wi];return(n?Hl(n):e)[t]}function nJ(e,t,n){var i;const r=Y5(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function Y5(e,t){if(!(t in e))return;let n=kd(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=kd(n)}}function WS(e){e.modified_||(e.modified_=!0,e.parent_&&WS(e.parent_))}function $w(e){e.copy_||(e.copy_=BS(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var rJ=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"&&vi(6),r!==void 0&&typeof r!="function"&&vi(7);let i;if(Ac(t)){const o=FM(this),s=US(t,void 0);let a=!0;try{i=n(s),a=!1}finally{a?HS(o):VS(o)}return LM(o,r),jM(i,o)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===W5&&(i=void 0),this.autoFreeze_&&wE(i,!0),r){const o=[],s=[];Dc("Patches").generateReplacementPatches_(t,i,o,s),r(o,s)}return i}else vi(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){Ac(e)||vi(8),Nd(e)&&(e=iJ(e));const t=FM(this),n=US(e,void 0);return n[Wi].isManual_=!0,VS(t),n}finishDraft(e,t){const n=e&&e[Wi];(!n||!n.isManual_)&&vi(9);const{scope_:r}=n;return LM(r,t),jM(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=Dc("Patches").applyPatches_;return Nd(e)?r(e,t):this.produce(e,i=>r(i,t))}};function US(e,t){const n=H0(e)?Dc("MapSet").proxyMap_(e,t):V0(e)?Dc("MapSet").proxySet_(e,t):tJ(e,t);return(t?t.scope_:q5()).drafts_.push(n),n}function iJ(e){return Nd(e)||vi(10,e),K5(e)}function K5(e){if(!Ac(e)||W0(e))return e;const t=e[Wi];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=BS(e,t.scope_.immer_.useStrictShallowCopy_)}else n=BS(e,!0);return Ey(n,(r,i)=>{G5(n,r,K5(i))}),t&&(t.finalized_=!1),n}var Ui=new rJ,oJ=Ui.produce;Ui.produceWithPatches.bind(Ui);Ui.setAutoFreeze.bind(Ui);Ui.setUseStrictShallowCopy.bind(Ui);Ui.applyPatches.bind(Ui);Ui.createDraft.bind(Ui);Ui.finishDraft.bind(Ui);const sJ=e=>(t,n,r)=>(r.setState=(i,o,...s)=>{const a=typeof i=="function"?oJ(i):i;return t(a,o,...s)},e(r.setState,n,r)),X5=sJ;var GS,qm=kr;if(process.env.NODE_ENV==="production")GS=qm.createRoot,qm.hydrateRoot;else{var zM=qm.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;GS=function(e,t){zM.usingClientEntryPoint=!0;try{return qm.createRoot(e,t)}finally{zM.usingClientEntryPoint=!1}}}var Q5={},J5={},_E={exports:{}},ht=String,Z5=function(){return{isColorSupported:!1,reset:ht,bold:ht,dim:ht,italic:ht,underline:ht,inverse:ht,hidden:ht,strikethrough:ht,black:ht,red:ht,green:ht,yellow:ht,blue:ht,magenta:ht,cyan:ht,white:ht,gray:ht,bgBlack:ht,bgRed:ht,bgGreen:ht,bgYellow:ht,bgBlue:ht,bgMagenta:ht,bgCyan:ht,bgWhite:ht,blackBright:ht,redBright:ht,greenBright:ht,yellowBright:ht,blueBright:ht,magentaBright:ht,cyanBright:ht,whiteBright:ht,bgBlackBright:ht,bgRedBright:ht,bgGreenBright:ht,bgYellowBright:ht,bgBlueBright:ht,bgMagentaBright:ht,bgCyanBright:ht,bgWhiteBright:ht}};_E.exports=Z5();_E.exports.createColors=Z5;var aJ=_E.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(aJ);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])}}})(J5);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return i}});const t=n(J5);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}}})(Q5);let zw=Q5;var lJ=(zw.__esModule?zw:{default:zw}).default;const jt=qc(lJ),eL=`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
|
+
`,tL="dm",qS=[{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"}],cJ=[{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)"}]}],CE=["lg","md","sm","xs","xxs"],Ty={default:{dashboardPanel:"",dashboardTabsContainer:"",gridLayout:{className:""},chart:{font:{family:"Open Sans, Arial, sans-serif"},dataset:{backgroundColor:[jt.blue[500],jt.teal[500],jt.amber[500],jt.red[500],jt.indigo[500],jt.green[500]],borderColor:[jt.blue[500],jt.teal[500],jt.amber[500],jt.red[500],jt.indigo[500],jt.green[500]]},options:{interaction:{mode:"index"},plugins:{datalabels:{display:!1,color:YS},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:[jt.blue[500],jt.teal[500],jt.amber[500],jt.red[500],jt.indigo[500],jt.green[500]],borderColor:[jt.blue[500],jt.teal[500],jt.amber[500],jt.red[500],jt.indigo[500],jt.green[500]],datalables:{color:YS}},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:jt.slate[800]}},y:{grid:{display:!0,color:jt.slate[800]}}}}}}};function YS(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=cp()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=cp()),Ld(n)}function cp(){return ve.getState().theme==="dark"?"#000000":"#FFFFFF"}function Ld(e){let t=0,n=0,r=0,i=0;const o=u=>{if(!u)return jt.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 U0=["text","enum","varchar","nvarchar","nvarchar2","char","character","longtext","nchar","char varying","nchar varying","character varying","string"],vg=["number","integer","int","int64","bigint","smallint","tinyint","byteint","numeric","decimal","dec","double","real","double precision","float","float4","float8","float64"],cf=["date","datetime","time","timestamp","timestamp without time zone","timestamp_ns"],EE=["boolean"];function RE(e){return e.match(/[A-Z]/)?`"${e}"`:e}function uJ(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?`${tL}.${r}`:nL(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 dJ(e,t,n="AVG"){var o,s,a,l;let r={};const i=RE(e.column_name);return U0.includes(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]}),vg.includes(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 Gu(e){return U0.includes(e.dataType)?"string":vg.includes(e.dataType)?"number":cf.includes(e.dataType)?"date":EE.includes(e.dataType)?"boolean":"string"}function fJ(e){let t;const n=e.data_type.toLowerCase();return U0.includes(n)?t="T":vg.includes(n)?t="#":cf.includes(n)?t="D":EE.includes(n)?t="B":t="?",t}function hJ(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 nL(e,t){return t==="api"||e===RE("NA")||e==="public"?t:e?`${e}.${t}`:`${t}`}const pJ=e=>{const t=new Date(e);return!isNaN(t.getTime())},gJ=e=>!isNaN(Number(e))&&!isNaN(parseFloat(e)),G0=e=>{let t;return typeof e=="number"?t="number":typeof e=="string"?pJ(e)?t="date":gJ(e)?t="number":t="string":typeof e=="boolean"?t="boolean":e instanceof Date?t="date":t="unknown",t};function mJ({get:e,dataPoint:t,card:n}){var p;const{addOrUpdateFilterValue:r,addFilteringCard:i,removeFilterValue: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:G0(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 Oy={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
|
+
*/Oy.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,w=4,_=8,R=16,C=32,T=64,M=128,I=256,k=512,L=30,j="...",$=800,X=16,H=1,F=2,G=3,B=1/0,W=9007199254740991,K=17976931348623157e292,D=NaN,Y=4294967295,U=Y-1,A=Y>>>1,te=[["ary",M],["bind",v],["bindKey",x],["curry",_],["curryRight",R],["flip",k],["partial",C],["partialRight",T],["rearg",I]],q="[object Arguments]",se="[object Array]",J="[object AsyncFunction]",ee="[object Boolean]",ae="[object Date]",ce="[object DOMException]",ge="[object Error]",oe="[object Function]",pe="[object GeneratorFunction]",de="[object Map]",Ee="[object Number]",De="[object Null]",ze="[object Object]",Oe="[object Promise]",Be="[object Proxy]",vt="[object RegExp]",Mt="[object Set]",xn="[object String]",At="[object Symbol]",pn="[object Undefined]",en="[object WeakMap]",fe="[object WeakSet]",_e="[object ArrayBuffer]",He="[object DataView]",Ze="[object Float32Array]",st="[object Float64Array]",kn="[object Int8Array]",Bn="[object Int16Array]",Mn="[object Int32Array]",sn="[object Uint8Array]",Hn="[object Uint8ClampedArray]",tn="[object Uint16Array]",sr="[object Uint32Array]",Zn=/\b__p \+= '';/g,Qi=/\b(__p \+=) '' \+/g,Cr=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Wo=/&(?:amp|lt|gt|quot|#39);/g,Er=/[&<>"']/g,Br=RegExp(Wo.source),_l=RegExp(Er.source),je=/<%-([\s\S]+?)%>/g,xt=/<%([\s\S]+?)%>/g,Ht=/<%=([\s\S]+?)%>/g,er=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tr=/^\w*$/,Hr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,mr=/[\\^$.*+?()[\]{}|]/g,ar=RegExp(mr.source),wn=/^\s+/,ba=/\s/,iu=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ou=/\{\n\/\* \[wrapped with (.+)\] \*/,ne=/,? & /,Ce=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Ae=/[()=,{}\[\]\/\s]/,We=/\\(\\)?/g,kt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,$t=/\w*$/,wt=/^[-+]0x[0-9a-f]+$/i,gt=/^0b[01]+$/i,Le=/^\[object .+?Constructor\]$/,re=/^0o[0-7]+$/i,we=/^(?:0|[1-9]\d*)$/,Ie=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Dt=/($^)/,gn=/['\n\r\u2028\u2029\\]/g,Rt="\\ud800-\\udfff",qn="\\u0300-\\u036f",si="\\ufe20-\\ufe2f",Ms="\\u20d0-\\u20ff",lr=qn+si+Ms,Pf="\\u2700-\\u27bf",Tf="a-z\\xdf-\\xf6\\xf8-\\xff",jV="\\xac\\xb1\\xd7\\xf7",$V="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",zV="\\u2000-\\u206f",BV=" \\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",tT="A-Z\\xc0-\\xd6\\xd8-\\xde",nT="\\ufe0e\\ufe0f",rT=jV+$V+zV+BV,Sx="['’]",HV="["+Rt+"]",iT="["+rT+"]",om="["+lr+"]",oT="\\d+",VV="["+Pf+"]",sT="["+Tf+"]",aT="[^"+Rt+rT+oT+Pf+Tf+tT+"]",_x="\\ud83c[\\udffb-\\udfff]",WV="(?:"+om+"|"+_x+")",lT="[^"+Rt+"]",Cx="(?:\\ud83c[\\udde6-\\uddff]){2}",Ex="[\\ud800-\\udbff][\\udc00-\\udfff]",su="["+tT+"]",cT="\\u200d",uT="(?:"+sT+"|"+aT+")",UV="(?:"+su+"|"+aT+")",dT="(?:"+Sx+"(?:d|ll|m|re|s|t|ve))?",fT="(?:"+Sx+"(?:D|LL|M|RE|S|T|VE))?",hT=WV+"?",pT="["+nT+"]?",GV="(?:"+cT+"(?:"+[lT,Cx,Ex].join("|")+")"+pT+hT+")*",qV="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",YV="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",gT=pT+hT+GV,KV="(?:"+[VV,Cx,Ex].join("|")+")"+gT,XV="(?:"+[lT+om+"?",om,Cx,Ex,HV].join("|")+")",QV=RegExp(Sx,"g"),JV=RegExp(om,"g"),Rx=RegExp(_x+"(?="+_x+")|"+XV+gT,"g"),ZV=RegExp([su+"?"+sT+"+"+dT+"(?="+[iT,su,"$"].join("|")+")",UV+"+"+fT+"(?="+[iT,su+uT,"$"].join("|")+")",su+"?"+uT+"+"+dT,su+"+"+fT,YV,qV,oT,KV].join("|"),"g"),eW=RegExp("["+cT+Rt+lr+nT+"]"),tW=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,nW=["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"],rW=-1,Sn={};Sn[Ze]=Sn[st]=Sn[kn]=Sn[Bn]=Sn[Mn]=Sn[sn]=Sn[Hn]=Sn[tn]=Sn[sr]=!0,Sn[q]=Sn[se]=Sn[_e]=Sn[ee]=Sn[He]=Sn[ae]=Sn[ge]=Sn[oe]=Sn[de]=Sn[Ee]=Sn[ze]=Sn[vt]=Sn[Mt]=Sn[xn]=Sn[en]=!1;var mn={};mn[q]=mn[se]=mn[_e]=mn[He]=mn[ee]=mn[ae]=mn[Ze]=mn[st]=mn[kn]=mn[Bn]=mn[Mn]=mn[de]=mn[Ee]=mn[ze]=mn[vt]=mn[Mt]=mn[xn]=mn[At]=mn[sn]=mn[Hn]=mn[tn]=mn[sr]=!0,mn[ge]=mn[oe]=mn[en]=!1;var iW={À:"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"},oW={"&":"&","<":"<",">":">",'"':""","'":"'"},sW={"&":"&","<":"<",">":">",""":'"',"'":"'"},aW={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},lW=parseFloat,cW=parseInt,mT=typeof La=="object"&&La&&La.Object===Object&&La,uW=typeof self=="object"&&self&&self.Object===Object&&self,br=mT||uW||Function("return this")(),Px=t&&!t.nodeType&&t,Cl=Px&&!0&&e&&!e.nodeType&&e,bT=Cl&&Cl.exports===Px,Tx=bT&&mT.process,Ji=function(){try{var le=Cl&&Cl.require&&Cl.require("util").types;return le||Tx&&Tx.binding&&Tx.binding("util")}catch{}}(),yT=Ji&&Ji.isArrayBuffer,vT=Ji&&Ji.isDate,xT=Ji&&Ji.isMap,wT=Ji&&Ji.isRegExp,ST=Ji&&Ji.isSet,_T=Ji&&Ji.isTypedArray;function Ti(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 dW(le,me,he,$e){for(var ot=-1,Wt=le==null?0:le.length;++ot<Wt;){var nr=le[ot];me($e,nr,he(nr),le)}return $e}function Zi(le,me){for(var he=-1,$e=le==null?0:le.length;++he<$e&&me(le[he],he,le)!==!1;);return le}function fW(le,me){for(var he=le==null?0:le.length;he--&&me(le[he],he,le)!==!1;);return le}function CT(le,me){for(var he=-1,$e=le==null?0:le.length;++he<$e;)if(!me(le[he],he,le))return!1;return!0}function ya(le,me){for(var he=-1,$e=le==null?0:le.length,ot=0,Wt=[];++he<$e;){var nr=le[he];me(nr,he,le)&&(Wt[ot++]=nr)}return Wt}function sm(le,me){var he=le==null?0:le.length;return!!he&&au(le,me,0)>-1}function Ox(le,me,he){for(var $e=-1,ot=le==null?0:le.length;++$e<ot;)if(he(me,le[$e]))return!0;return!1}function An(le,me){for(var he=-1,$e=le==null?0:le.length,ot=Array($e);++he<$e;)ot[he]=me(le[he],he,le);return ot}function va(le,me){for(var he=-1,$e=me.length,ot=le.length;++he<$e;)le[ot+he]=me[he];return le}function Mx(le,me,he,$e){var ot=-1,Wt=le==null?0:le.length;for($e&&Wt&&(he=le[++ot]);++ot<Wt;)he=me(he,le[ot],ot,le);return he}function hW(le,me,he,$e){var ot=le==null?0:le.length;for($e&&ot&&(he=le[--ot]);ot--;)he=me(he,le[ot],ot,le);return he}function Ax(le,me){for(var he=-1,$e=le==null?0:le.length;++he<$e;)if(me(le[he],he,le))return!0;return!1}var pW=Dx("length");function gW(le){return le.split("")}function mW(le){return le.match(Ce)||[]}function ET(le,me,he){var $e;return he(le,function(ot,Wt,nr){if(me(ot,Wt,nr))return $e=Wt,!1}),$e}function am(le,me,he,$e){for(var ot=le.length,Wt=he+($e?1:-1);$e?Wt--:++Wt<ot;)if(me(le[Wt],Wt,le))return Wt;return-1}function au(le,me,he){return me===me?TW(le,me,he):am(le,RT,he)}function bW(le,me,he,$e){for(var ot=he-1,Wt=le.length;++ot<Wt;)if($e(le[ot],me))return ot;return-1}function RT(le){return le!==le}function PT(le,me){var he=le==null?0:le.length;return he?kx(le,me)/he:D}function Dx(le){return function(me){return me==null?n:me[le]}}function Ix(le){return function(me){return le==null?n:le[me]}}function TT(le,me,he,$e,ot){return ot(le,function(Wt,nr,dn){he=$e?($e=!1,Wt):me(he,Wt,nr,dn)}),he}function yW(le,me){var he=le.length;for(le.sort(me);he--;)le[he]=le[he].value;return le}function kx(le,me){for(var he,$e=-1,ot=le.length;++$e<ot;){var Wt=me(le[$e]);Wt!==n&&(he=he===n?Wt:he+Wt)}return he}function Nx(le,me){for(var he=-1,$e=Array(le);++he<le;)$e[he]=me(he);return $e}function vW(le,me){return An(me,function(he){return[he,le[he]]})}function OT(le){return le&&le.slice(0,IT(le)+1).replace(wn,"")}function Oi(le){return function(me){return le(me)}}function Lx(le,me){return An(me,function(he){return le[he]})}function Of(le,me){return le.has(me)}function MT(le,me){for(var he=-1,$e=le.length;++he<$e&&au(me,le[he],0)>-1;);return he}function AT(le,me){for(var he=le.length;he--&&au(me,le[he],0)>-1;);return he}function xW(le,me){for(var he=le.length,$e=0;he--;)le[he]===me&&++$e;return $e}var wW=Ix(iW),SW=Ix(oW);function _W(le){return"\\"+aW[le]}function CW(le,me){return le==null?n:le[me]}function lu(le){return eW.test(le)}function EW(le){return tW.test(le)}function RW(le){for(var me,he=[];!(me=le.next()).done;)he.push(me.value);return he}function Fx(le){var me=-1,he=Array(le.size);return le.forEach(function($e,ot){he[++me]=[ot,$e]}),he}function DT(le,me){return function(he){return le(me(he))}}function xa(le,me){for(var he=-1,$e=le.length,ot=0,Wt=[];++he<$e;){var nr=le[he];(nr===me||nr===u)&&(le[he]=u,Wt[ot++]=he)}return Wt}function lm(le){var me=-1,he=Array(le.size);return le.forEach(function($e){he[++me]=$e}),he}function PW(le){var me=-1,he=Array(le.size);return le.forEach(function($e){he[++me]=[$e,$e]}),he}function TW(le,me,he){for(var $e=he-1,ot=le.length;++$e<ot;)if(le[$e]===me)return $e;return-1}function OW(le,me,he){for(var $e=he+1;$e--;)if(le[$e]===me)return $e;return $e}function cu(le){return lu(le)?AW(le):pW(le)}function So(le){return lu(le)?DW(le):gW(le)}function IT(le){for(var me=le.length;me--&&ba.test(le.charAt(me)););return me}var MW=Ix(sW);function AW(le){for(var me=Rx.lastIndex=0;Rx.test(le);)++me;return me}function DW(le){return le.match(Rx)||[]}function IW(le){return le.match(ZV)||[]}var kW=function le(me){me=me==null?br:uu.defaults(br.Object(),me,uu.pick(br,nW));var he=me.Array,$e=me.Date,ot=me.Error,Wt=me.Function,nr=me.Math,dn=me.Object,jx=me.RegExp,NW=me.String,eo=me.TypeError,cm=he.prototype,LW=Wt.prototype,du=dn.prototype,um=me["__core-js_shared__"],dm=LW.toString,nn=du.hasOwnProperty,FW=0,kT=function(){var f=/[^.]+$/.exec(um&&um.keys&&um.keys.IE_PROTO||"");return f?"Symbol(src)_1."+f:""}(),fm=du.toString,jW=dm.call(dn),$W=br._,zW=jx("^"+dm.call(nn).replace(mr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),hm=bT?me.Buffer:n,wa=me.Symbol,pm=me.Uint8Array,NT=hm?hm.allocUnsafe:n,gm=DT(dn.getPrototypeOf,dn),LT=dn.create,FT=du.propertyIsEnumerable,mm=cm.splice,jT=wa?wa.isConcatSpreadable:n,Mf=wa?wa.iterator:n,El=wa?wa.toStringTag:n,bm=function(){try{var f=Ml(dn,"defineProperty");return f({},"",{}),f}catch{}}(),BW=me.clearTimeout!==br.clearTimeout&&me.clearTimeout,HW=$e&&$e.now!==br.Date.now&&$e.now,VW=me.setTimeout!==br.setTimeout&&me.setTimeout,ym=nr.ceil,vm=nr.floor,$x=dn.getOwnPropertySymbols,WW=hm?hm.isBuffer:n,$T=me.isFinite,UW=cm.join,GW=DT(dn.keys,dn),rr=nr.max,Rr=nr.min,qW=$e.now,YW=me.parseInt,zT=nr.random,KW=cm.reverse,zx=Ml(me,"DataView"),Af=Ml(me,"Map"),Bx=Ml(me,"Promise"),fu=Ml(me,"Set"),Df=Ml(me,"WeakMap"),If=Ml(dn,"create"),xm=Df&&new Df,hu={},XW=Al(zx),QW=Al(Af),JW=Al(Bx),ZW=Al(fu),eU=Al(Df),wm=wa?wa.prototype:n,kf=wm?wm.valueOf:n,BT=wm?wm.toString:n;function z(f){if(Nn(f)&&!at(f)&&!(f instanceof It)){if(f instanceof to)return f;if(nn.call(f,"__wrapped__"))return HO(f)}return new to(f)}var pu=function(){function f(){}return function(g){if(!Dn(g))return{};if(LT)return LT(g);f.prototype=g;var S=new f;return f.prototype=n,S}}();function Sm(){}function to(f,g){this.__wrapped__=f,this.__actions__=[],this.__chain__=!!g,this.__index__=0,this.__values__=n}z.templateSettings={escape:je,evaluate:xt,interpolate:Ht,variable:"",imports:{_:z}},z.prototype=Sm.prototype,z.prototype.constructor=z,to.prototype=pu(Sm.prototype),to.prototype.constructor=to;function It(f){this.__wrapped__=f,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Y,this.__views__=[]}function tU(){var f=new It(this.__wrapped__);return f.__actions__=ai(this.__actions__),f.__dir__=this.__dir__,f.__filtered__=this.__filtered__,f.__iteratees__=ai(this.__iteratees__),f.__takeCount__=this.__takeCount__,f.__views__=ai(this.__views__),f}function nU(){if(this.__filtered__){var f=new It(this);f.__dir__=-1,f.__filtered__=!0}else f=this.clone(),f.__dir__*=-1;return f}function rU(){var f=this.__wrapped__.value(),g=this.__dir__,S=at(f),O=g<0,N=S?f.length:0,V=gG(0,N,this.__views__),Q=V.start,ie=V.end,ue=ie-Q,ye=O?ie:Q-1,xe=this.__iteratees__,Se=xe.length,ke=0,Ve=Rr(ue,this.__takeCount__);if(!S||!O&&N==ue&&Ve==ue)return dO(f,this.__actions__);var Ge=[];e:for(;ue--&&ke<Ve;){ye+=g;for(var mt=-1,qe=f[ye];++mt<Se;){var Pt=xe[mt],Nt=Pt.iteratee,Di=Pt.type,Ur=Nt(qe);if(Di==F)qe=Ur;else if(!Ur){if(Di==H)continue e;break e}}Ge[ke++]=qe}return Ge}It.prototype=pu(Sm.prototype),It.prototype.constructor=It;function Rl(f){var g=-1,S=f==null?0:f.length;for(this.clear();++g<S;){var O=f[g];this.set(O[0],O[1])}}function iU(){this.__data__=If?If(null):{},this.size=0}function oU(f){var g=this.has(f)&&delete this.__data__[f];return this.size-=g?1:0,g}function sU(f){var g=this.__data__;if(If){var S=g[f];return S===l?n:S}return nn.call(g,f)?g[f]:n}function aU(f){var g=this.__data__;return If?g[f]!==n:nn.call(g,f)}function lU(f,g){var S=this.__data__;return this.size+=this.has(f)?0:1,S[f]=If&&g===n?l:g,this}Rl.prototype.clear=iU,Rl.prototype.delete=oU,Rl.prototype.get=sU,Rl.prototype.has=aU,Rl.prototype.set=lU;function As(f){var g=-1,S=f==null?0:f.length;for(this.clear();++g<S;){var O=f[g];this.set(O[0],O[1])}}function cU(){this.__data__=[],this.size=0}function uU(f){var g=this.__data__,S=_m(g,f);if(S<0)return!1;var O=g.length-1;return S==O?g.pop():mm.call(g,S,1),--this.size,!0}function dU(f){var g=this.__data__,S=_m(g,f);return S<0?n:g[S][1]}function fU(f){return _m(this.__data__,f)>-1}function hU(f,g){var S=this.__data__,O=_m(S,f);return O<0?(++this.size,S.push([f,g])):S[O][1]=g,this}As.prototype.clear=cU,As.prototype.delete=uU,As.prototype.get=dU,As.prototype.has=fU,As.prototype.set=hU;function Ds(f){var g=-1,S=f==null?0:f.length;for(this.clear();++g<S;){var O=f[g];this.set(O[0],O[1])}}function pU(){this.size=0,this.__data__={hash:new Rl,map:new(Af||As),string:new Rl}}function gU(f){var g=Nm(this,f).delete(f);return this.size-=g?1:0,g}function mU(f){return Nm(this,f).get(f)}function bU(f){return Nm(this,f).has(f)}function yU(f,g){var S=Nm(this,f),O=S.size;return S.set(f,g),this.size+=S.size==O?0:1,this}Ds.prototype.clear=pU,Ds.prototype.delete=gU,Ds.prototype.get=mU,Ds.prototype.has=bU,Ds.prototype.set=yU;function Pl(f){var g=-1,S=f==null?0:f.length;for(this.__data__=new Ds;++g<S;)this.add(f[g])}function vU(f){return this.__data__.set(f,l),this}function xU(f){return this.__data__.has(f)}Pl.prototype.add=Pl.prototype.push=vU,Pl.prototype.has=xU;function _o(f){var g=this.__data__=new As(f);this.size=g.size}function wU(){this.__data__=new As,this.size=0}function SU(f){var g=this.__data__,S=g.delete(f);return this.size=g.size,S}function _U(f){return this.__data__.get(f)}function CU(f){return this.__data__.has(f)}function EU(f,g){var S=this.__data__;if(S instanceof As){var O=S.__data__;if(!Af||O.length<i-1)return O.push([f,g]),this.size=++S.size,this;S=this.__data__=new Ds(O)}return S.set(f,g),this.size=S.size,this}_o.prototype.clear=wU,_o.prototype.delete=SU,_o.prototype.get=_U,_o.prototype.has=CU,_o.prototype.set=EU;function HT(f,g){var S=at(f),O=!S&&Dl(f),N=!S&&!O&&Ra(f),V=!S&&!O&&!N&&yu(f),Q=S||O||N||V,ie=Q?Nx(f.length,NW):[],ue=ie.length;for(var ye in f)(g||nn.call(f,ye))&&!(Q&&(ye=="length"||N&&(ye=="offset"||ye=="parent")||V&&(ye=="buffer"||ye=="byteLength"||ye=="byteOffset")||Ls(ye,ue)))&&ie.push(ye);return ie}function VT(f){var g=f.length;return g?f[Jx(0,g-1)]:n}function RU(f,g){return Lm(ai(f),Tl(g,0,f.length))}function PU(f){return Lm(ai(f))}function Hx(f,g,S){(S!==n&&!Co(f[g],S)||S===n&&!(g in f))&&Is(f,g,S)}function Nf(f,g,S){var O=f[g];(!(nn.call(f,g)&&Co(O,S))||S===n&&!(g in f))&&Is(f,g,S)}function _m(f,g){for(var S=f.length;S--;)if(Co(f[S][0],g))return S;return-1}function TU(f,g,S,O){return Sa(f,function(N,V,Q){g(O,N,S(N),Q)}),O}function WT(f,g){return f&&Go(g,cr(g),f)}function OU(f,g){return f&&Go(g,ci(g),f)}function Is(f,g,S){g=="__proto__"&&bm?bm(f,g,{configurable:!0,enumerable:!0,value:S,writable:!0}):f[g]=S}function Vx(f,g){for(var S=-1,O=g.length,N=he(O),V=f==null;++S<O;)N[S]=V?n:_w(f,g[S]);return N}function Tl(f,g,S){return f===f&&(S!==n&&(f=f<=S?f:S),g!==n&&(f=f>=g?f:g)),f}function no(f,g,S,O,N,V){var Q,ie=g&d,ue=g&p,ye=g&h;if(S&&(Q=N?S(f,O,N,V):S(f)),Q!==n)return Q;if(!Dn(f))return f;var xe=at(f);if(xe){if(Q=bG(f),!ie)return ai(f,Q)}else{var Se=Pr(f),ke=Se==oe||Se==pe;if(Ra(f))return pO(f,ie);if(Se==ze||Se==q||ke&&!N){if(Q=ue||ke?{}:IO(f),!ie)return ue?sG(f,OU(Q,f)):oG(f,WT(Q,f))}else{if(!mn[Se])return N?f:{};Q=yG(f,Se,ie)}}V||(V=new _o);var Ve=V.get(f);if(Ve)return Ve;V.set(f,Q),lM(f)?f.forEach(function(qe){Q.add(no(qe,g,S,qe,f,V))}):sM(f)&&f.forEach(function(qe,Pt){Q.set(Pt,no(qe,g,S,Pt,f,V))});var Ge=ye?ue?cw:lw:ue?ci:cr,mt=xe?n:Ge(f);return Zi(mt||f,function(qe,Pt){mt&&(Pt=qe,qe=f[Pt]),Nf(Q,Pt,no(qe,g,S,Pt,f,V))}),Q}function MU(f){var g=cr(f);return function(S){return UT(S,f,g)}}function UT(f,g,S){var O=S.length;if(f==null)return!O;for(f=dn(f);O--;){var N=S[O],V=g[N],Q=f[N];if(Q===n&&!(N in f)||!V(Q))return!1}return!0}function GT(f,g,S){if(typeof f!="function")throw new eo(s);return Hf(function(){f.apply(n,S)},g)}function Lf(f,g,S,O){var N=-1,V=sm,Q=!0,ie=f.length,ue=[],ye=g.length;if(!ie)return ue;S&&(g=An(g,Oi(S))),O?(V=Ox,Q=!1):g.length>=i&&(V=Of,Q=!1,g=new Pl(g));e:for(;++N<ie;){var xe=f[N],Se=S==null?xe:S(xe);if(xe=O||xe!==0?xe:0,Q&&Se===Se){for(var ke=ye;ke--;)if(g[ke]===Se)continue e;ue.push(xe)}else V(g,Se,O)||ue.push(xe)}return ue}var Sa=vO(Uo),qT=vO(Ux,!0);function AU(f,g){var S=!0;return Sa(f,function(O,N,V){return S=!!g(O,N,V),S}),S}function Cm(f,g,S){for(var O=-1,N=f.length;++O<N;){var V=f[O],Q=g(V);if(Q!=null&&(ie===n?Q===Q&&!Ai(Q):S(Q,ie)))var ie=Q,ue=V}return ue}function DU(f,g,S,O){var N=f.length;for(S=dt(S),S<0&&(S=-S>N?0:N+S),O=O===n||O>N?N:dt(O),O<0&&(O+=N),O=S>O?0:uM(O);S<O;)f[S++]=g;return f}function YT(f,g){var S=[];return Sa(f,function(O,N,V){g(O,N,V)&&S.push(O)}),S}function yr(f,g,S,O,N){var V=-1,Q=f.length;for(S||(S=xG),N||(N=[]);++V<Q;){var ie=f[V];g>0&&S(ie)?g>1?yr(ie,g-1,S,O,N):va(N,ie):O||(N[N.length]=ie)}return N}var Wx=xO(),KT=xO(!0);function Uo(f,g){return f&&Wx(f,g,cr)}function Ux(f,g){return f&&KT(f,g,cr)}function Em(f,g){return ya(g,function(S){return Fs(f[S])})}function Ol(f,g){g=Ca(g,f);for(var S=0,O=g.length;f!=null&&S<O;)f=f[qo(g[S++])];return S&&S==O?f:n}function XT(f,g,S){var O=g(f);return at(f)?O:va(O,S(f))}function Vr(f){return f==null?f===n?pn:De:El&&El in dn(f)?pG(f):PG(f)}function Gx(f,g){return f>g}function IU(f,g){return f!=null&&nn.call(f,g)}function kU(f,g){return f!=null&&g in dn(f)}function NU(f,g,S){return f>=Rr(g,S)&&f<rr(g,S)}function qx(f,g,S){for(var O=S?Ox:sm,N=f[0].length,V=f.length,Q=V,ie=he(V),ue=1/0,ye=[];Q--;){var xe=f[Q];Q&&g&&(xe=An(xe,Oi(g))),ue=Rr(xe.length,ue),ie[Q]=!S&&(g||N>=120&&xe.length>=120)?new Pl(Q&&xe):n}xe=f[0];var Se=-1,ke=ie[0];e:for(;++Se<N&&ye.length<ue;){var Ve=xe[Se],Ge=g?g(Ve):Ve;if(Ve=S||Ve!==0?Ve:0,!(ke?Of(ke,Ge):O(ye,Ge,S))){for(Q=V;--Q;){var mt=ie[Q];if(!(mt?Of(mt,Ge):O(f[Q],Ge,S)))continue e}ke&&ke.push(Ge),ye.push(Ve)}}return ye}function LU(f,g,S,O){return Uo(f,function(N,V,Q){g(O,S(N),V,Q)}),O}function Ff(f,g,S){g=Ca(g,f),f=FO(f,g);var O=f==null?f:f[qo(io(g))];return O==null?n:Ti(O,f,S)}function QT(f){return Nn(f)&&Vr(f)==q}function FU(f){return Nn(f)&&Vr(f)==_e}function jU(f){return Nn(f)&&Vr(f)==ae}function jf(f,g,S,O,N){return f===g?!0:f==null||g==null||!Nn(f)&&!Nn(g)?f!==f&&g!==g:$U(f,g,S,O,jf,N)}function $U(f,g,S,O,N,V){var Q=at(f),ie=at(g),ue=Q?se:Pr(f),ye=ie?se:Pr(g);ue=ue==q?ze:ue,ye=ye==q?ze:ye;var xe=ue==ze,Se=ye==ze,ke=ue==ye;if(ke&&Ra(f)){if(!Ra(g))return!1;Q=!0,xe=!1}if(ke&&!xe)return V||(V=new _o),Q||yu(f)?MO(f,g,S,O,N,V):fG(f,g,ue,S,O,N,V);if(!(S&m)){var Ve=xe&&nn.call(f,"__wrapped__"),Ge=Se&&nn.call(g,"__wrapped__");if(Ve||Ge){var mt=Ve?f.value():f,qe=Ge?g.value():g;return V||(V=new _o),N(mt,qe,S,O,V)}}return ke?(V||(V=new _o),hG(f,g,S,O,N,V)):!1}function zU(f){return Nn(f)&&Pr(f)==de}function Yx(f,g,S,O){var N=S.length,V=N,Q=!O;if(f==null)return!V;for(f=dn(f);N--;){var ie=S[N];if(Q&&ie[2]?ie[1]!==f[ie[0]]:!(ie[0]in f))return!1}for(;++N<V;){ie=S[N];var ue=ie[0],ye=f[ue],xe=ie[1];if(Q&&ie[2]){if(ye===n&&!(ue in f))return!1}else{var Se=new _o;if(O)var ke=O(ye,xe,ue,f,g,Se);if(!(ke===n?jf(xe,ye,m|b,O,Se):ke))return!1}}return!0}function JT(f){if(!Dn(f)||SG(f))return!1;var g=Fs(f)?zW:Le;return g.test(Al(f))}function BU(f){return Nn(f)&&Vr(f)==vt}function HU(f){return Nn(f)&&Pr(f)==Mt}function VU(f){return Nn(f)&&Hm(f.length)&&!!Sn[Vr(f)]}function ZT(f){return typeof f=="function"?f:f==null?ui:typeof f=="object"?at(f)?nO(f[0],f[1]):tO(f):wM(f)}function Kx(f){if(!Bf(f))return GW(f);var g=[];for(var S in dn(f))nn.call(f,S)&&S!="constructor"&&g.push(S);return g}function WU(f){if(!Dn(f))return RG(f);var g=Bf(f),S=[];for(var O in f)O=="constructor"&&(g||!nn.call(f,O))||S.push(O);return S}function Xx(f,g){return f<g}function eO(f,g){var S=-1,O=li(f)?he(f.length):[];return Sa(f,function(N,V,Q){O[++S]=g(N,V,Q)}),O}function tO(f){var g=dw(f);return g.length==1&&g[0][2]?NO(g[0][0],g[0][1]):function(S){return S===f||Yx(S,f,g)}}function nO(f,g){return hw(f)&&kO(g)?NO(qo(f),g):function(S){var O=_w(S,f);return O===n&&O===g?Cw(S,f):jf(g,O,m|b)}}function Rm(f,g,S,O,N){f!==g&&Wx(g,function(V,Q){if(N||(N=new _o),Dn(V))UU(f,g,Q,S,Rm,O,N);else{var ie=O?O(gw(f,Q),V,Q+"",f,g,N):n;ie===n&&(ie=V),Hx(f,Q,ie)}},ci)}function UU(f,g,S,O,N,V,Q){var ie=gw(f,S),ue=gw(g,S),ye=Q.get(ue);if(ye){Hx(f,S,ye);return}var xe=V?V(ie,ue,S+"",f,g,Q):n,Se=xe===n;if(Se){var ke=at(ue),Ve=!ke&&Ra(ue),Ge=!ke&&!Ve&&yu(ue);xe=ue,ke||Ve||Ge?at(ie)?xe=ie:Vn(ie)?xe=ai(ie):Ve?(Se=!1,xe=pO(ue,!0)):Ge?(Se=!1,xe=gO(ue,!0)):xe=[]:Vf(ue)||Dl(ue)?(xe=ie,Dl(ie)?xe=dM(ie):(!Dn(ie)||Fs(ie))&&(xe=IO(ue))):Se=!1}Se&&(Q.set(ue,xe),N(xe,ue,O,V,Q),Q.delete(ue)),Hx(f,S,xe)}function rO(f,g){var S=f.length;if(S)return g+=g<0?S:0,Ls(g,S)?f[g]:n}function iO(f,g,S){g.length?g=An(g,function(V){return at(V)?function(Q){return Ol(Q,V.length===1?V[0]:V)}:V}):g=[ui];var O=-1;g=An(g,Oi(Ue()));var N=eO(f,function(V,Q,ie){var ue=An(g,function(ye){return ye(V)});return{criteria:ue,index:++O,value:V}});return yW(N,function(V,Q){return iG(V,Q,S)})}function GU(f,g){return oO(f,g,function(S,O){return Cw(f,O)})}function oO(f,g,S){for(var O=-1,N=g.length,V={};++O<N;){var Q=g[O],ie=Ol(f,Q);S(ie,Q)&&$f(V,Ca(Q,f),ie)}return V}function qU(f){return function(g){return Ol(g,f)}}function Qx(f,g,S,O){var N=O?bW:au,V=-1,Q=g.length,ie=f;for(f===g&&(g=ai(g)),S&&(ie=An(f,Oi(S)));++V<Q;)for(var ue=0,ye=g[V],xe=S?S(ye):ye;(ue=N(ie,xe,ue,O))>-1;)ie!==f&&mm.call(ie,ue,1),mm.call(f,ue,1);return f}function sO(f,g){for(var S=f?g.length:0,O=S-1;S--;){var N=g[S];if(S==O||N!==V){var V=N;Ls(N)?mm.call(f,N,1):tw(f,N)}}return f}function Jx(f,g){return f+vm(zT()*(g-f+1))}function YU(f,g,S,O){for(var N=-1,V=rr(ym((g-f)/(S||1)),0),Q=he(V);V--;)Q[O?V:++N]=f,f+=S;return Q}function Zx(f,g){var S="";if(!f||g<1||g>W)return S;do g%2&&(S+=f),g=vm(g/2),g&&(f+=f);while(g);return S}function St(f,g){return mw(LO(f,g,ui),f+"")}function KU(f){return VT(vu(f))}function XU(f,g){var S=vu(f);return Lm(S,Tl(g,0,S.length))}function $f(f,g,S,O){if(!Dn(f))return f;g=Ca(g,f);for(var N=-1,V=g.length,Q=V-1,ie=f;ie!=null&&++N<V;){var ue=qo(g[N]),ye=S;if(ue==="__proto__"||ue==="constructor"||ue==="prototype")return f;if(N!=Q){var xe=ie[ue];ye=O?O(xe,ue,ie):n,ye===n&&(ye=Dn(xe)?xe:Ls(g[N+1])?[]:{})}Nf(ie,ue,ye),ie=ie[ue]}return f}var aO=xm?function(f,g){return xm.set(f,g),f}:ui,QU=bm?function(f,g){return bm(f,"toString",{configurable:!0,enumerable:!1,value:Rw(g),writable:!0})}:ui;function JU(f){return Lm(vu(f))}function ro(f,g,S){var O=-1,N=f.length;g<0&&(g=-g>N?0:N+g),S=S>N?N:S,S<0&&(S+=N),N=g>S?0:S-g>>>0,g>>>=0;for(var V=he(N);++O<N;)V[O]=f[O+g];return V}function ZU(f,g){var S;return Sa(f,function(O,N,V){return S=g(O,N,V),!S}),!!S}function Pm(f,g,S){var O=0,N=f==null?O:f.length;if(typeof g=="number"&&g===g&&N<=A){for(;O<N;){var V=O+N>>>1,Q=f[V];Q!==null&&!Ai(Q)&&(S?Q<=g:Q<g)?O=V+1:N=V}return N}return ew(f,g,ui,S)}function ew(f,g,S,O){var N=0,V=f==null?0:f.length;if(V===0)return 0;g=S(g);for(var Q=g!==g,ie=g===null,ue=Ai(g),ye=g===n;N<V;){var xe=vm((N+V)/2),Se=S(f[xe]),ke=Se!==n,Ve=Se===null,Ge=Se===Se,mt=Ai(Se);if(Q)var qe=O||Ge;else ye?qe=Ge&&(O||ke):ie?qe=Ge&&ke&&(O||!Ve):ue?qe=Ge&&ke&&!Ve&&(O||!mt):Ve||mt?qe=!1:qe=O?Se<=g:Se<g;qe?N=xe+1:V=xe}return Rr(V,U)}function lO(f,g){for(var S=-1,O=f.length,N=0,V=[];++S<O;){var Q=f[S],ie=g?g(Q):Q;if(!S||!Co(ie,ue)){var ue=ie;V[N++]=Q===0?0:Q}}return V}function cO(f){return typeof f=="number"?f:Ai(f)?D:+f}function Mi(f){if(typeof f=="string")return f;if(at(f))return An(f,Mi)+"";if(Ai(f))return BT?BT.call(f):"";var g=f+"";return g=="0"&&1/f==-1/0?"-0":g}function _a(f,g,S){var O=-1,N=sm,V=f.length,Q=!0,ie=[],ue=ie;if(S)Q=!1,N=Ox;else if(V>=i){var ye=g?null:uG(f);if(ye)return lm(ye);Q=!1,N=Of,ue=new Pl}else ue=g?[]:ie;e:for(;++O<V;){var xe=f[O],Se=g?g(xe):xe;if(xe=S||xe!==0?xe:0,Q&&Se===Se){for(var ke=ue.length;ke--;)if(ue[ke]===Se)continue e;g&&ue.push(Se),ie.push(xe)}else N(ue,Se,S)||(ue!==ie&&ue.push(Se),ie.push(xe))}return ie}function tw(f,g){return g=Ca(g,f),f=FO(f,g),f==null||delete f[qo(io(g))]}function uO(f,g,S,O){return $f(f,g,S(Ol(f,g)),O)}function Tm(f,g,S,O){for(var N=f.length,V=O?N:-1;(O?V--:++V<N)&&g(f[V],V,f););return S?ro(f,O?0:V,O?V+1:N):ro(f,O?V+1:0,O?N:V)}function dO(f,g){var S=f;return S instanceof It&&(S=S.value()),Mx(g,function(O,N){return N.func.apply(N.thisArg,va([O],N.args))},S)}function nw(f,g,S){var O=f.length;if(O<2)return O?_a(f[0]):[];for(var N=-1,V=he(O);++N<O;)for(var Q=f[N],ie=-1;++ie<O;)ie!=N&&(V[N]=Lf(V[N]||Q,f[ie],g,S));return _a(yr(V,1),g,S)}function fO(f,g,S){for(var O=-1,N=f.length,V=g.length,Q={};++O<N;){var ie=O<V?g[O]:n;S(Q,f[O],ie)}return Q}function rw(f){return Vn(f)?f:[]}function iw(f){return typeof f=="function"?f:ui}function Ca(f,g){return at(f)?f:hw(f,g)?[f]:BO(Kt(f))}var eG=St;function Ea(f,g,S){var O=f.length;return S=S===n?O:S,!g&&S>=O?f:ro(f,g,S)}var hO=BW||function(f){return br.clearTimeout(f)};function pO(f,g){if(g)return f.slice();var S=f.length,O=NT?NT(S):new f.constructor(S);return f.copy(O),O}function ow(f){var g=new f.constructor(f.byteLength);return new pm(g).set(new pm(f)),g}function tG(f,g){var S=g?ow(f.buffer):f.buffer;return new f.constructor(S,f.byteOffset,f.byteLength)}function nG(f){var g=new f.constructor(f.source,$t.exec(f));return g.lastIndex=f.lastIndex,g}function rG(f){return kf?dn(kf.call(f)):{}}function gO(f,g){var S=g?ow(f.buffer):f.buffer;return new f.constructor(S,f.byteOffset,f.length)}function mO(f,g){if(f!==g){var S=f!==n,O=f===null,N=f===f,V=Ai(f),Q=g!==n,ie=g===null,ue=g===g,ye=Ai(g);if(!ie&&!ye&&!V&&f>g||V&&Q&&ue&&!ie&&!ye||O&&Q&&ue||!S&&ue||!N)return 1;if(!O&&!V&&!ye&&f<g||ye&&S&&N&&!O&&!V||ie&&S&&N||!Q&&N||!ue)return-1}return 0}function iG(f,g,S){for(var O=-1,N=f.criteria,V=g.criteria,Q=N.length,ie=S.length;++O<Q;){var ue=mO(N[O],V[O]);if(ue){if(O>=ie)return ue;var ye=S[O];return ue*(ye=="desc"?-1:1)}}return f.index-g.index}function bO(f,g,S,O){for(var N=-1,V=f.length,Q=S.length,ie=-1,ue=g.length,ye=rr(V-Q,0),xe=he(ue+ye),Se=!O;++ie<ue;)xe[ie]=g[ie];for(;++N<Q;)(Se||N<V)&&(xe[S[N]]=f[N]);for(;ye--;)xe[ie++]=f[N++];return xe}function yO(f,g,S,O){for(var N=-1,V=f.length,Q=-1,ie=S.length,ue=-1,ye=g.length,xe=rr(V-ie,0),Se=he(xe+ye),ke=!O;++N<xe;)Se[N]=f[N];for(var Ve=N;++ue<ye;)Se[Ve+ue]=g[ue];for(;++Q<ie;)(ke||N<V)&&(Se[Ve+S[Q]]=f[N++]);return Se}function ai(f,g){var S=-1,O=f.length;for(g||(g=he(O));++S<O;)g[S]=f[S];return g}function Go(f,g,S,O){var N=!S;S||(S={});for(var V=-1,Q=g.length;++V<Q;){var ie=g[V],ue=O?O(S[ie],f[ie],ie,S,f):n;ue===n&&(ue=f[ie]),N?Is(S,ie,ue):Nf(S,ie,ue)}return S}function oG(f,g){return Go(f,fw(f),g)}function sG(f,g){return Go(f,AO(f),g)}function Om(f,g){return function(S,O){var N=at(S)?dW:TU,V=g?g():{};return N(S,f,Ue(O,2),V)}}function gu(f){return St(function(g,S){var O=-1,N=S.length,V=N>1?S[N-1]:n,Q=N>2?S[2]:n;for(V=f.length>3&&typeof V=="function"?(N--,V):n,Q&&Wr(S[0],S[1],Q)&&(V=N<3?n:V,N=1),g=dn(g);++O<N;){var ie=S[O];ie&&f(g,ie,O,V)}return g})}function vO(f,g){return function(S,O){if(S==null)return S;if(!li(S))return f(S,O);for(var N=S.length,V=g?N:-1,Q=dn(S);(g?V--:++V<N)&&O(Q[V],V,Q)!==!1;);return S}}function xO(f){return function(g,S,O){for(var N=-1,V=dn(g),Q=O(g),ie=Q.length;ie--;){var ue=Q[f?ie:++N];if(S(V[ue],ue,V)===!1)break}return g}}function aG(f,g,S){var O=g&v,N=zf(f);function V(){var Q=this&&this!==br&&this instanceof V?N:f;return Q.apply(O?S:this,arguments)}return V}function wO(f){return function(g){g=Kt(g);var S=lu(g)?So(g):n,O=S?S[0]:g.charAt(0),N=S?Ea(S,1).join(""):g.slice(1);return O[f]()+N}}function mu(f){return function(g){return Mx(vM(yM(g).replace(QV,"")),f,"")}}function zf(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 S=pu(f.prototype),O=f.apply(S,g);return Dn(O)?O:S}}function lG(f,g,S){var O=zf(f);function N(){for(var V=arguments.length,Q=he(V),ie=V,ue=bu(N);ie--;)Q[ie]=arguments[ie];var ye=V<3&&Q[0]!==ue&&Q[V-1]!==ue?[]:xa(Q,ue);if(V-=ye.length,V<S)return RO(f,g,Mm,N.placeholder,n,Q,ye,n,n,S-V);var xe=this&&this!==br&&this instanceof N?O:f;return Ti(xe,this,Q)}return N}function SO(f){return function(g,S,O){var N=dn(g);if(!li(g)){var V=Ue(S,3);g=cr(g),S=function(ie){return V(N[ie],ie,N)}}var Q=f(g,S,O);return Q>-1?N[V?g[Q]:Q]:n}}function _O(f){return Ns(function(g){var S=g.length,O=S,N=to.prototype.thru;for(f&&g.reverse();O--;){var V=g[O];if(typeof V!="function")throw new eo(s);if(N&&!Q&&km(V)=="wrapper")var Q=new to([],!0)}for(O=Q?O:S;++O<S;){V=g[O];var ie=km(V),ue=ie=="wrapper"?uw(V):n;ue&&pw(ue[0])&&ue[1]==(M|_|C|I)&&!ue[4].length&&ue[9]==1?Q=Q[km(ue[0])].apply(Q,ue[3]):Q=V.length==1&&pw(V)?Q[ie]():Q.thru(V)}return function(){var ye=arguments,xe=ye[0];if(Q&&ye.length==1&&at(xe))return Q.plant(xe).value();for(var Se=0,ke=S?g[Se].apply(this,ye):xe;++Se<S;)ke=g[Se].call(this,ke);return ke}})}function Mm(f,g,S,O,N,V,Q,ie,ue,ye){var xe=g&M,Se=g&v,ke=g&x,Ve=g&(_|R),Ge=g&k,mt=ke?n:zf(f);function qe(){for(var Pt=arguments.length,Nt=he(Pt),Di=Pt;Di--;)Nt[Di]=arguments[Di];if(Ve)var Ur=bu(qe),Ii=xW(Nt,Ur);if(O&&(Nt=bO(Nt,O,N,Ve)),V&&(Nt=yO(Nt,V,Q,Ve)),Pt-=Ii,Ve&&Pt<ye){var Wn=xa(Nt,Ur);return RO(f,g,Mm,qe.placeholder,S,Nt,Wn,ie,ue,ye-Pt)}var Eo=Se?S:this,$s=ke?Eo[f]:f;return Pt=Nt.length,ie?Nt=TG(Nt,ie):Ge&&Pt>1&&Nt.reverse(),xe&&ue<Pt&&(Nt.length=ue),this&&this!==br&&this instanceof qe&&($s=mt||zf($s)),$s.apply(Eo,Nt)}return qe}function CO(f,g){return function(S,O){return LU(S,f,g(O),{})}}function Am(f,g){return function(S,O){var N;if(S===n&&O===n)return g;if(S!==n&&(N=S),O!==n){if(N===n)return O;typeof S=="string"||typeof O=="string"?(S=Mi(S),O=Mi(O)):(S=cO(S),O=cO(O)),N=f(S,O)}return N}}function sw(f){return Ns(function(g){return g=An(g,Oi(Ue())),St(function(S){var O=this;return f(g,function(N){return Ti(N,O,S)})})})}function Dm(f,g){g=g===n?" ":Mi(g);var S=g.length;if(S<2)return S?Zx(g,f):g;var O=Zx(g,ym(f/cu(g)));return lu(g)?Ea(So(O),0,f).join(""):O.slice(0,f)}function cG(f,g,S,O){var N=g&v,V=zf(f);function Q(){for(var ie=-1,ue=arguments.length,ye=-1,xe=O.length,Se=he(xe+ue),ke=this&&this!==br&&this instanceof Q?V:f;++ye<xe;)Se[ye]=O[ye];for(;ue--;)Se[ye++]=arguments[++ie];return Ti(ke,N?S:this,Se)}return Q}function EO(f){return function(g,S,O){return O&&typeof O!="number"&&Wr(g,S,O)&&(S=O=n),g=js(g),S===n?(S=g,g=0):S=js(S),O=O===n?g<S?1:-1:js(O),YU(g,S,O,f)}}function Im(f){return function(g,S){return typeof g=="string"&&typeof S=="string"||(g=oo(g),S=oo(S)),f(g,S)}}function RO(f,g,S,O,N,V,Q,ie,ue,ye){var xe=g&_,Se=xe?Q:n,ke=xe?n:Q,Ve=xe?V:n,Ge=xe?n:V;g|=xe?C:T,g&=~(xe?T:C),g&w||(g&=-4);var mt=[f,g,N,Ve,Se,Ge,ke,ie,ue,ye],qe=S.apply(n,mt);return pw(f)&&jO(qe,mt),qe.placeholder=O,$O(qe,f,g)}function aw(f){var g=nr[f];return function(S,O){if(S=oo(S),O=O==null?0:Rr(dt(O),292),O&&$T(S)){var N=(Kt(S)+"e").split("e"),V=g(N[0]+"e"+(+N[1]+O));return N=(Kt(V)+"e").split("e"),+(N[0]+"e"+(+N[1]-O))}return g(S)}}var uG=fu&&1/lm(new fu([,-0]))[1]==B?function(f){return new fu(f)}:Ow;function PO(f){return function(g){var S=Pr(g);return S==de?Fx(g):S==Mt?PW(g):vW(g,f(g))}}function ks(f,g,S,O,N,V,Q,ie){var ue=g&x;if(!ue&&typeof f!="function")throw new eo(s);var ye=O?O.length:0;if(ye||(g&=-97,O=N=n),Q=Q===n?Q:rr(dt(Q),0),ie=ie===n?ie:dt(ie),ye-=N?N.length:0,g&T){var xe=O,Se=N;O=N=n}var ke=ue?n:uw(f),Ve=[f,g,S,O,N,xe,Se,V,Q,ie];if(ke&&EG(Ve,ke),f=Ve[0],g=Ve[1],S=Ve[2],O=Ve[3],N=Ve[4],ie=Ve[9]=Ve[9]===n?ue?0:f.length:rr(Ve[9]-ye,0),!ie&&g&(_|R)&&(g&=-25),!g||g==v)var Ge=aG(f,g,S);else g==_||g==R?Ge=lG(f,g,ie):(g==C||g==(v|C))&&!N.length?Ge=cG(f,g,S,O):Ge=Mm.apply(n,Ve);var mt=ke?aO:jO;return $O(mt(Ge,Ve),f,g)}function TO(f,g,S,O){return f===n||Co(f,du[S])&&!nn.call(O,S)?g:f}function OO(f,g,S,O,N,V){return Dn(f)&&Dn(g)&&(V.set(g,f),Rm(f,g,n,OO,V),V.delete(g)),f}function dG(f){return Vf(f)?n:f}function MO(f,g,S,O,N,V){var Q=S&m,ie=f.length,ue=g.length;if(ie!=ue&&!(Q&&ue>ie))return!1;var ye=V.get(f),xe=V.get(g);if(ye&&xe)return ye==g&&xe==f;var Se=-1,ke=!0,Ve=S&b?new Pl:n;for(V.set(f,g),V.set(g,f);++Se<ie;){var Ge=f[Se],mt=g[Se];if(O)var qe=Q?O(mt,Ge,Se,g,f,V):O(Ge,mt,Se,f,g,V);if(qe!==n){if(qe)continue;ke=!1;break}if(Ve){if(!Ax(g,function(Pt,Nt){if(!Of(Ve,Nt)&&(Ge===Pt||N(Ge,Pt,S,O,V)))return Ve.push(Nt)})){ke=!1;break}}else if(!(Ge===mt||N(Ge,mt,S,O,V))){ke=!1;break}}return V.delete(f),V.delete(g),ke}function fG(f,g,S,O,N,V,Q){switch(S){case He:if(f.byteLength!=g.byteLength||f.byteOffset!=g.byteOffset)return!1;f=f.buffer,g=g.buffer;case _e:return!(f.byteLength!=g.byteLength||!V(new pm(f),new pm(g)));case ee:case ae:case Ee:return Co(+f,+g);case ge:return f.name==g.name&&f.message==g.message;case vt:case xn:return f==g+"";case de:var ie=Fx;case Mt:var ue=O&m;if(ie||(ie=lm),f.size!=g.size&&!ue)return!1;var ye=Q.get(f);if(ye)return ye==g;O|=b,Q.set(f,g);var xe=MO(ie(f),ie(g),O,N,V,Q);return Q.delete(f),xe;case At:if(kf)return kf.call(f)==kf.call(g)}return!1}function hG(f,g,S,O,N,V){var Q=S&m,ie=lw(f),ue=ie.length,ye=lw(g),xe=ye.length;if(ue!=xe&&!Q)return!1;for(var Se=ue;Se--;){var ke=ie[Se];if(!(Q?ke in g:nn.call(g,ke)))return!1}var Ve=V.get(f),Ge=V.get(g);if(Ve&&Ge)return Ve==g&&Ge==f;var mt=!0;V.set(f,g),V.set(g,f);for(var qe=Q;++Se<ue;){ke=ie[Se];var Pt=f[ke],Nt=g[ke];if(O)var Di=Q?O(Nt,Pt,ke,g,f,V):O(Pt,Nt,ke,f,g,V);if(!(Di===n?Pt===Nt||N(Pt,Nt,S,O,V):Di)){mt=!1;break}qe||(qe=ke=="constructor")}if(mt&&!qe){var Ur=f.constructor,Ii=g.constructor;Ur!=Ii&&"constructor"in f&&"constructor"in g&&!(typeof Ur=="function"&&Ur instanceof Ur&&typeof Ii=="function"&&Ii instanceof Ii)&&(mt=!1)}return V.delete(f),V.delete(g),mt}function Ns(f){return mw(LO(f,n,UO),f+"")}function lw(f){return XT(f,cr,fw)}function cw(f){return XT(f,ci,AO)}var uw=xm?function(f){return xm.get(f)}:Ow;function km(f){for(var g=f.name+"",S=hu[g],O=nn.call(hu,g)?S.length:0;O--;){var N=S[O],V=N.func;if(V==null||V==f)return N.name}return g}function bu(f){var g=nn.call(z,"placeholder")?z:f;return g.placeholder}function Ue(){var f=z.iteratee||Pw;return f=f===Pw?ZT:f,arguments.length?f(arguments[0],arguments[1]):f}function Nm(f,g){var S=f.__data__;return wG(g)?S[typeof g=="string"?"string":"hash"]:S.map}function dw(f){for(var g=cr(f),S=g.length;S--;){var O=g[S],N=f[O];g[S]=[O,N,kO(N)]}return g}function Ml(f,g){var S=CW(f,g);return JT(S)?S:n}function pG(f){var g=nn.call(f,El),S=f[El];try{f[El]=n;var O=!0}catch{}var N=fm.call(f);return O&&(g?f[El]=S:delete f[El]),N}var fw=$x?function(f){return f==null?[]:(f=dn(f),ya($x(f),function(g){return FT.call(f,g)}))}:Mw,AO=$x?function(f){for(var g=[];f;)va(g,fw(f)),f=gm(f);return g}:Mw,Pr=Vr;(zx&&Pr(new zx(new ArrayBuffer(1)))!=He||Af&&Pr(new Af)!=de||Bx&&Pr(Bx.resolve())!=Oe||fu&&Pr(new fu)!=Mt||Df&&Pr(new Df)!=en)&&(Pr=function(f){var g=Vr(f),S=g==ze?f.constructor:n,O=S?Al(S):"";if(O)switch(O){case XW:return He;case QW:return de;case JW:return Oe;case ZW:return Mt;case eU:return en}return g});function gG(f,g,S){for(var O=-1,N=S.length;++O<N;){var V=S[O],Q=V.size;switch(V.type){case"drop":f+=Q;break;case"dropRight":g-=Q;break;case"take":g=Rr(g,f+Q);break;case"takeRight":f=rr(f,g-Q);break}}return{start:f,end:g}}function mG(f){var g=f.match(ou);return g?g[1].split(ne):[]}function DO(f,g,S){g=Ca(g,f);for(var O=-1,N=g.length,V=!1;++O<N;){var Q=qo(g[O]);if(!(V=f!=null&&S(f,Q)))break;f=f[Q]}return V||++O!=N?V:(N=f==null?0:f.length,!!N&&Hm(N)&&Ls(Q,N)&&(at(f)||Dl(f)))}function bG(f){var g=f.length,S=new f.constructor(g);return g&&typeof f[0]=="string"&&nn.call(f,"index")&&(S.index=f.index,S.input=f.input),S}function IO(f){return typeof f.constructor=="function"&&!Bf(f)?pu(gm(f)):{}}function yG(f,g,S){var O=f.constructor;switch(g){case _e:return ow(f);case ee:case ae:return new O(+f);case He:return tG(f,S);case Ze:case st:case kn:case Bn:case Mn:case sn:case Hn:case tn:case sr:return gO(f,S);case de:return new O;case Ee:case xn:return new O(f);case vt:return nG(f);case Mt:return new O;case At:return rG(f)}}function vG(f,g){var S=g.length;if(!S)return f;var O=S-1;return g[O]=(S>1?"& ":"")+g[O],g=g.join(S>2?", ":" "),f.replace(iu,`{
|
|
73
|
+
/* [wrapped with `+g+`] */
|
|
74
|
+
`)}function xG(f){return at(f)||Dl(f)||!!(jT&&f&&f[jT])}function Ls(f,g){var S=typeof f;return g=g??W,!!g&&(S=="number"||S!="symbol"&&we.test(f))&&f>-1&&f%1==0&&f<g}function Wr(f,g,S){if(!Dn(S))return!1;var O=typeof g;return(O=="number"?li(S)&&Ls(g,S.length):O=="string"&&g in S)?Co(S[g],f):!1}function hw(f,g){if(at(f))return!1;var S=typeof f;return S=="number"||S=="symbol"||S=="boolean"||f==null||Ai(f)?!0:tr.test(f)||!er.test(f)||g!=null&&f in dn(g)}function wG(f){var g=typeof f;return g=="string"||g=="number"||g=="symbol"||g=="boolean"?f!=="__proto__":f===null}function pw(f){var g=km(f),S=z[g];if(typeof S!="function"||!(g in It.prototype))return!1;if(f===S)return!0;var O=uw(S);return!!O&&f===O[0]}function SG(f){return!!kT&&kT in f}var _G=um?Fs:Aw;function Bf(f){var g=f&&f.constructor,S=typeof g=="function"&&g.prototype||du;return f===S}function kO(f){return f===f&&!Dn(f)}function NO(f,g){return function(S){return S==null?!1:S[f]===g&&(g!==n||f in dn(S))}}function CG(f){var g=zm(f,function(O){return S.size===c&&S.clear(),O}),S=g.cache;return g}function EG(f,g){var S=f[1],O=g[1],N=S|O,V=N<(v|x|M),Q=O==M&&S==_||O==M&&S==I&&f[7].length<=g[8]||O==(M|I)&&g[7].length<=g[8]&&S==_;if(!(V||Q))return f;O&v&&(f[2]=g[2],N|=S&v?0:w);var ie=g[3];if(ie){var ue=f[3];f[3]=ue?bO(ue,ie,g[4]):ie,f[4]=ue?xa(f[3],u):g[4]}return ie=g[5],ie&&(ue=f[5],f[5]=ue?yO(ue,ie,g[6]):ie,f[6]=ue?xa(f[5],u):g[6]),ie=g[7],ie&&(f[7]=ie),O&M&&(f[8]=f[8]==null?g[8]:Rr(f[8],g[8])),f[9]==null&&(f[9]=g[9]),f[0]=g[0],f[1]=N,f}function RG(f){var g=[];if(f!=null)for(var S in dn(f))g.push(S);return g}function PG(f){return fm.call(f)}function LO(f,g,S){return g=rr(g===n?f.length-1:g,0),function(){for(var O=arguments,N=-1,V=rr(O.length-g,0),Q=he(V);++N<V;)Q[N]=O[g+N];N=-1;for(var ie=he(g+1);++N<g;)ie[N]=O[N];return ie[g]=S(Q),Ti(f,this,ie)}}function FO(f,g){return g.length<2?f:Ol(f,ro(g,0,-1))}function TG(f,g){for(var S=f.length,O=Rr(g.length,S),N=ai(f);O--;){var V=g[O];f[O]=Ls(V,S)?N[V]:n}return f}function gw(f,g){if(!(g==="constructor"&&typeof f[g]=="function")&&g!="__proto__")return f[g]}var jO=zO(aO),Hf=VW||function(f,g){return br.setTimeout(f,g)},mw=zO(QU);function $O(f,g,S){var O=g+"";return mw(f,vG(O,OG(mG(O),S)))}function zO(f){var g=0,S=0;return function(){var O=qW(),N=X-(O-S);if(S=O,N>0){if(++g>=$)return arguments[0]}else g=0;return f.apply(n,arguments)}}function Lm(f,g){var S=-1,O=f.length,N=O-1;for(g=g===n?O:g;++S<g;){var V=Jx(S,N),Q=f[V];f[V]=f[S],f[S]=Q}return f.length=g,f}var BO=CG(function(f){var g=[];return f.charCodeAt(0)===46&&g.push(""),f.replace(Hr,function(S,O,N,V){g.push(N?V.replace(We,"$1"):O||S)}),g});function qo(f){if(typeof f=="string"||Ai(f))return f;var g=f+"";return g=="0"&&1/f==-1/0?"-0":g}function Al(f){if(f!=null){try{return dm.call(f)}catch{}try{return f+""}catch{}}return""}function OG(f,g){return Zi(te,function(S){var O="_."+S[0];g&S[1]&&!sm(f,O)&&f.push(O)}),f.sort()}function HO(f){if(f instanceof It)return f.clone();var g=new to(f.__wrapped__,f.__chain__);return g.__actions__=ai(f.__actions__),g.__index__=f.__index__,g.__values__=f.__values__,g}function MG(f,g,S){(S?Wr(f,g,S):g===n)?g=1:g=rr(dt(g),0);var O=f==null?0:f.length;if(!O||g<1)return[];for(var N=0,V=0,Q=he(ym(O/g));N<O;)Q[V++]=ro(f,N,N+=g);return Q}function AG(f){for(var g=-1,S=f==null?0:f.length,O=0,N=[];++g<S;){var V=f[g];V&&(N[O++]=V)}return N}function DG(){var f=arguments.length;if(!f)return[];for(var g=he(f-1),S=arguments[0],O=f;O--;)g[O-1]=arguments[O];return va(at(S)?ai(S):[S],yr(g,1))}var IG=St(function(f,g){return Vn(f)?Lf(f,yr(g,1,Vn,!0)):[]}),kG=St(function(f,g){var S=io(g);return Vn(S)&&(S=n),Vn(f)?Lf(f,yr(g,1,Vn,!0),Ue(S,2)):[]}),NG=St(function(f,g){var S=io(g);return Vn(S)&&(S=n),Vn(f)?Lf(f,yr(g,1,Vn,!0),n,S):[]});function LG(f,g,S){var O=f==null?0:f.length;return O?(g=S||g===n?1:dt(g),ro(f,g<0?0:g,O)):[]}function FG(f,g,S){var O=f==null?0:f.length;return O?(g=S||g===n?1:dt(g),g=O-g,ro(f,0,g<0?0:g)):[]}function jG(f,g){return f&&f.length?Tm(f,Ue(g,3),!0,!0):[]}function $G(f,g){return f&&f.length?Tm(f,Ue(g,3),!0):[]}function zG(f,g,S,O){var N=f==null?0:f.length;return N?(S&&typeof S!="number"&&Wr(f,g,S)&&(S=0,O=N),DU(f,g,S,O)):[]}function VO(f,g,S){var O=f==null?0:f.length;if(!O)return-1;var N=S==null?0:dt(S);return N<0&&(N=rr(O+N,0)),am(f,Ue(g,3),N)}function WO(f,g,S){var O=f==null?0:f.length;if(!O)return-1;var N=O-1;return S!==n&&(N=dt(S),N=S<0?rr(O+N,0):Rr(N,O-1)),am(f,Ue(g,3),N,!0)}function UO(f){var g=f==null?0:f.length;return g?yr(f,1):[]}function BG(f){var g=f==null?0:f.length;return g?yr(f,B):[]}function HG(f,g){var S=f==null?0:f.length;return S?(g=g===n?1:dt(g),yr(f,g)):[]}function VG(f){for(var g=-1,S=f==null?0:f.length,O={};++g<S;){var N=f[g];O[N[0]]=N[1]}return O}function GO(f){return f&&f.length?f[0]:n}function WG(f,g,S){var O=f==null?0:f.length;if(!O)return-1;var N=S==null?0:dt(S);return N<0&&(N=rr(O+N,0)),au(f,g,N)}function UG(f){var g=f==null?0:f.length;return g?ro(f,0,-1):[]}var GG=St(function(f){var g=An(f,rw);return g.length&&g[0]===f[0]?qx(g):[]}),qG=St(function(f){var g=io(f),S=An(f,rw);return g===io(S)?g=n:S.pop(),S.length&&S[0]===f[0]?qx(S,Ue(g,2)):[]}),YG=St(function(f){var g=io(f),S=An(f,rw);return g=typeof g=="function"?g:n,g&&S.pop(),S.length&&S[0]===f[0]?qx(S,n,g):[]});function KG(f,g){return f==null?"":UW.call(f,g)}function io(f){var g=f==null?0:f.length;return g?f[g-1]:n}function XG(f,g,S){var O=f==null?0:f.length;if(!O)return-1;var N=O;return S!==n&&(N=dt(S),N=N<0?rr(O+N,0):Rr(N,O-1)),g===g?OW(f,g,N):am(f,RT,N,!0)}function QG(f,g){return f&&f.length?rO(f,dt(g)):n}var JG=St(qO);function qO(f,g){return f&&f.length&&g&&g.length?Qx(f,g):f}function ZG(f,g,S){return f&&f.length&&g&&g.length?Qx(f,g,Ue(S,2)):f}function eq(f,g,S){return f&&f.length&&g&&g.length?Qx(f,g,n,S):f}var tq=Ns(function(f,g){var S=f==null?0:f.length,O=Vx(f,g);return sO(f,An(g,function(N){return Ls(N,S)?+N:N}).sort(mO)),O});function nq(f,g){var S=[];if(!(f&&f.length))return S;var O=-1,N=[],V=f.length;for(g=Ue(g,3);++O<V;){var Q=f[O];g(Q,O,f)&&(S.push(Q),N.push(O))}return sO(f,N),S}function bw(f){return f==null?f:KW.call(f)}function rq(f,g,S){var O=f==null?0:f.length;return O?(S&&typeof S!="number"&&Wr(f,g,S)?(g=0,S=O):(g=g==null?0:dt(g),S=S===n?O:dt(S)),ro(f,g,S)):[]}function iq(f,g){return Pm(f,g)}function oq(f,g,S){return ew(f,g,Ue(S,2))}function sq(f,g){var S=f==null?0:f.length;if(S){var O=Pm(f,g);if(O<S&&Co(f[O],g))return O}return-1}function aq(f,g){return Pm(f,g,!0)}function lq(f,g,S){return ew(f,g,Ue(S,2),!0)}function cq(f,g){var S=f==null?0:f.length;if(S){var O=Pm(f,g,!0)-1;if(Co(f[O],g))return O}return-1}function uq(f){return f&&f.length?lO(f):[]}function dq(f,g){return f&&f.length?lO(f,Ue(g,2)):[]}function fq(f){var g=f==null?0:f.length;return g?ro(f,1,g):[]}function hq(f,g,S){return f&&f.length?(g=S||g===n?1:dt(g),ro(f,0,g<0?0:g)):[]}function pq(f,g,S){var O=f==null?0:f.length;return O?(g=S||g===n?1:dt(g),g=O-g,ro(f,g<0?0:g,O)):[]}function gq(f,g){return f&&f.length?Tm(f,Ue(g,3),!1,!0):[]}function mq(f,g){return f&&f.length?Tm(f,Ue(g,3)):[]}var bq=St(function(f){return _a(yr(f,1,Vn,!0))}),yq=St(function(f){var g=io(f);return Vn(g)&&(g=n),_a(yr(f,1,Vn,!0),Ue(g,2))}),vq=St(function(f){var g=io(f);return g=typeof g=="function"?g:n,_a(yr(f,1,Vn,!0),n,g)});function xq(f){return f&&f.length?_a(f):[]}function wq(f,g){return f&&f.length?_a(f,Ue(g,2)):[]}function Sq(f,g){return g=typeof g=="function"?g:n,f&&f.length?_a(f,n,g):[]}function yw(f){if(!(f&&f.length))return[];var g=0;return f=ya(f,function(S){if(Vn(S))return g=rr(S.length,g),!0}),Nx(g,function(S){return An(f,Dx(S))})}function YO(f,g){if(!(f&&f.length))return[];var S=yw(f);return g==null?S:An(S,function(O){return Ti(g,n,O)})}var _q=St(function(f,g){return Vn(f)?Lf(f,g):[]}),Cq=St(function(f){return nw(ya(f,Vn))}),Eq=St(function(f){var g=io(f);return Vn(g)&&(g=n),nw(ya(f,Vn),Ue(g,2))}),Rq=St(function(f){var g=io(f);return g=typeof g=="function"?g:n,nw(ya(f,Vn),n,g)}),Pq=St(yw);function Tq(f,g){return fO(f||[],g||[],Nf)}function Oq(f,g){return fO(f||[],g||[],$f)}var Mq=St(function(f){var g=f.length,S=g>1?f[g-1]:n;return S=typeof S=="function"?(f.pop(),S):n,YO(f,S)});function KO(f){var g=z(f);return g.__chain__=!0,g}function Aq(f,g){return g(f),f}function Fm(f,g){return g(f)}var Dq=Ns(function(f){var g=f.length,S=g?f[0]:0,O=this.__wrapped__,N=function(V){return Vx(V,f)};return g>1||this.__actions__.length||!(O instanceof It)||!Ls(S)?this.thru(N):(O=O.slice(S,+S+(g?1:0)),O.__actions__.push({func:Fm,args:[N],thisArg:n}),new to(O,this.__chain__).thru(function(V){return g&&!V.length&&V.push(n),V}))});function Iq(){return KO(this)}function kq(){return new to(this.value(),this.__chain__)}function Nq(){this.__values__===n&&(this.__values__=cM(this.value()));var f=this.__index__>=this.__values__.length,g=f?n:this.__values__[this.__index__++];return{done:f,value:g}}function Lq(){return this}function Fq(f){for(var g,S=this;S instanceof Sm;){var O=HO(S);O.__index__=0,O.__values__=n,g?N.__wrapped__=O:g=O;var N=O;S=S.__wrapped__}return N.__wrapped__=f,g}function jq(){var f=this.__wrapped__;if(f instanceof It){var g=f;return this.__actions__.length&&(g=new It(this)),g=g.reverse(),g.__actions__.push({func:Fm,args:[bw],thisArg:n}),new to(g,this.__chain__)}return this.thru(bw)}function $q(){return dO(this.__wrapped__,this.__actions__)}var zq=Om(function(f,g,S){nn.call(f,S)?++f[S]:Is(f,S,1)});function Bq(f,g,S){var O=at(f)?CT:AU;return S&&Wr(f,g,S)&&(g=n),O(f,Ue(g,3))}function Hq(f,g){var S=at(f)?ya:YT;return S(f,Ue(g,3))}var Vq=SO(VO),Wq=SO(WO);function Uq(f,g){return yr(jm(f,g),1)}function Gq(f,g){return yr(jm(f,g),B)}function qq(f,g,S){return S=S===n?1:dt(S),yr(jm(f,g),S)}function XO(f,g){var S=at(f)?Zi:Sa;return S(f,Ue(g,3))}function QO(f,g){var S=at(f)?fW:qT;return S(f,Ue(g,3))}var Yq=Om(function(f,g,S){nn.call(f,S)?f[S].push(g):Is(f,S,[g])});function Kq(f,g,S,O){f=li(f)?f:vu(f),S=S&&!O?dt(S):0;var N=f.length;return S<0&&(S=rr(N+S,0)),Vm(f)?S<=N&&f.indexOf(g,S)>-1:!!N&&au(f,g,S)>-1}var Xq=St(function(f,g,S){var O=-1,N=typeof g=="function",V=li(f)?he(f.length):[];return Sa(f,function(Q){V[++O]=N?Ti(g,Q,S):Ff(Q,g,S)}),V}),Qq=Om(function(f,g,S){Is(f,S,g)});function jm(f,g){var S=at(f)?An:eO;return S(f,Ue(g,3))}function Jq(f,g,S,O){return f==null?[]:(at(g)||(g=g==null?[]:[g]),S=O?n:S,at(S)||(S=S==null?[]:[S]),iO(f,g,S))}var Zq=Om(function(f,g,S){f[S?0:1].push(g)},function(){return[[],[]]});function eY(f,g,S){var O=at(f)?Mx:TT,N=arguments.length<3;return O(f,Ue(g,4),S,N,Sa)}function tY(f,g,S){var O=at(f)?hW:TT,N=arguments.length<3;return O(f,Ue(g,4),S,N,qT)}function nY(f,g){var S=at(f)?ya:YT;return S(f,Bm(Ue(g,3)))}function rY(f){var g=at(f)?VT:KU;return g(f)}function iY(f,g,S){(S?Wr(f,g,S):g===n)?g=1:g=dt(g);var O=at(f)?RU:XU;return O(f,g)}function oY(f){var g=at(f)?PU:JU;return g(f)}function sY(f){if(f==null)return 0;if(li(f))return Vm(f)?cu(f):f.length;var g=Pr(f);return g==de||g==Mt?f.size:Kx(f).length}function aY(f,g,S){var O=at(f)?Ax:ZU;return S&&Wr(f,g,S)&&(g=n),O(f,Ue(g,3))}var lY=St(function(f,g){if(f==null)return[];var S=g.length;return S>1&&Wr(f,g[0],g[1])?g=[]:S>2&&Wr(g[0],g[1],g[2])&&(g=[g[0]]),iO(f,yr(g,1),[])}),$m=HW||function(){return br.Date.now()};function cY(f,g){if(typeof g!="function")throw new eo(s);return f=dt(f),function(){if(--f<1)return g.apply(this,arguments)}}function JO(f,g,S){return g=S?n:g,g=f&&g==null?f.length:g,ks(f,M,n,n,n,n,g)}function ZO(f,g){var S;if(typeof g!="function")throw new eo(s);return f=dt(f),function(){return--f>0&&(S=g.apply(this,arguments)),f<=1&&(g=n),S}}var vw=St(function(f,g,S){var O=v;if(S.length){var N=xa(S,bu(vw));O|=C}return ks(f,O,g,S,N)}),eM=St(function(f,g,S){var O=v|x;if(S.length){var N=xa(S,bu(eM));O|=C}return ks(g,O,f,S,N)});function tM(f,g,S){g=S?n:g;var O=ks(f,_,n,n,n,n,n,g);return O.placeholder=tM.placeholder,O}function nM(f,g,S){g=S?n:g;var O=ks(f,R,n,n,n,n,n,g);return O.placeholder=nM.placeholder,O}function rM(f,g,S){var O,N,V,Q,ie,ue,ye=0,xe=!1,Se=!1,ke=!0;if(typeof f!="function")throw new eo(s);g=oo(g)||0,Dn(S)&&(xe=!!S.leading,Se="maxWait"in S,V=Se?rr(oo(S.maxWait)||0,g):V,ke="trailing"in S?!!S.trailing:ke);function Ve(Wn){var Eo=O,$s=N;return O=N=n,ye=Wn,Q=f.apply($s,Eo),Q}function Ge(Wn){return ye=Wn,ie=Hf(Pt,g),xe?Ve(Wn):Q}function mt(Wn){var Eo=Wn-ue,$s=Wn-ye,SM=g-Eo;return Se?Rr(SM,V-$s):SM}function qe(Wn){var Eo=Wn-ue,$s=Wn-ye;return ue===n||Eo>=g||Eo<0||Se&&$s>=V}function Pt(){var Wn=$m();if(qe(Wn))return Nt(Wn);ie=Hf(Pt,mt(Wn))}function Nt(Wn){return ie=n,ke&&O?Ve(Wn):(O=N=n,Q)}function Di(){ie!==n&&hO(ie),ye=0,O=ue=N=ie=n}function Ur(){return ie===n?Q:Nt($m())}function Ii(){var Wn=$m(),Eo=qe(Wn);if(O=arguments,N=this,ue=Wn,Eo){if(ie===n)return Ge(ue);if(Se)return hO(ie),ie=Hf(Pt,g),Ve(ue)}return ie===n&&(ie=Hf(Pt,g)),Q}return Ii.cancel=Di,Ii.flush=Ur,Ii}var uY=St(function(f,g){return GT(f,1,g)}),dY=St(function(f,g,S){return GT(f,oo(g)||0,S)});function fY(f){return ks(f,k)}function zm(f,g){if(typeof f!="function"||g!=null&&typeof g!="function")throw new eo(s);var S=function(){var O=arguments,N=g?g.apply(this,O):O[0],V=S.cache;if(V.has(N))return V.get(N);var Q=f.apply(this,O);return S.cache=V.set(N,Q)||V,Q};return S.cache=new(zm.Cache||Ds),S}zm.Cache=Ds;function Bm(f){if(typeof f!="function")throw new eo(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 hY(f){return ZO(2,f)}var pY=eG(function(f,g){g=g.length==1&&at(g[0])?An(g[0],Oi(Ue())):An(yr(g,1),Oi(Ue()));var S=g.length;return St(function(O){for(var N=-1,V=Rr(O.length,S);++N<V;)O[N]=g[N].call(this,O[N]);return Ti(f,this,O)})}),xw=St(function(f,g){var S=xa(g,bu(xw));return ks(f,C,n,g,S)}),iM=St(function(f,g){var S=xa(g,bu(iM));return ks(f,T,n,g,S)}),gY=Ns(function(f,g){return ks(f,I,n,n,n,g)});function mY(f,g){if(typeof f!="function")throw new eo(s);return g=g===n?g:dt(g),St(f,g)}function bY(f,g){if(typeof f!="function")throw new eo(s);return g=g==null?0:rr(dt(g),0),St(function(S){var O=S[g],N=Ea(S,0,g);return O&&va(N,O),Ti(f,this,N)})}function yY(f,g,S){var O=!0,N=!0;if(typeof f!="function")throw new eo(s);return Dn(S)&&(O="leading"in S?!!S.leading:O,N="trailing"in S?!!S.trailing:N),rM(f,g,{leading:O,maxWait:g,trailing:N})}function vY(f){return JO(f,1)}function xY(f,g){return xw(iw(g),f)}function wY(){if(!arguments.length)return[];var f=arguments[0];return at(f)?f:[f]}function SY(f){return no(f,h)}function _Y(f,g){return g=typeof g=="function"?g:n,no(f,h,g)}function CY(f){return no(f,d|h)}function EY(f,g){return g=typeof g=="function"?g:n,no(f,d|h,g)}function RY(f,g){return g==null||UT(f,g,cr(g))}function Co(f,g){return f===g||f!==f&&g!==g}var PY=Im(Gx),TY=Im(function(f,g){return f>=g}),Dl=QT(function(){return arguments}())?QT:function(f){return Nn(f)&&nn.call(f,"callee")&&!FT.call(f,"callee")},at=he.isArray,OY=yT?Oi(yT):FU;function li(f){return f!=null&&Hm(f.length)&&!Fs(f)}function Vn(f){return Nn(f)&&li(f)}function MY(f){return f===!0||f===!1||Nn(f)&&Vr(f)==ee}var Ra=WW||Aw,AY=vT?Oi(vT):jU;function DY(f){return Nn(f)&&f.nodeType===1&&!Vf(f)}function IY(f){if(f==null)return!0;if(li(f)&&(at(f)||typeof f=="string"||typeof f.splice=="function"||Ra(f)||yu(f)||Dl(f)))return!f.length;var g=Pr(f);if(g==de||g==Mt)return!f.size;if(Bf(f))return!Kx(f).length;for(var S in f)if(nn.call(f,S))return!1;return!0}function kY(f,g){return jf(f,g)}function NY(f,g,S){S=typeof S=="function"?S:n;var O=S?S(f,g):n;return O===n?jf(f,g,n,S):!!O}function ww(f){if(!Nn(f))return!1;var g=Vr(f);return g==ge||g==ce||typeof f.message=="string"&&typeof f.name=="string"&&!Vf(f)}function LY(f){return typeof f=="number"&&$T(f)}function Fs(f){if(!Dn(f))return!1;var g=Vr(f);return g==oe||g==pe||g==J||g==Be}function oM(f){return typeof f=="number"&&f==dt(f)}function Hm(f){return typeof f=="number"&&f>-1&&f%1==0&&f<=W}function Dn(f){var g=typeof f;return f!=null&&(g=="object"||g=="function")}function Nn(f){return f!=null&&typeof f=="object"}var sM=xT?Oi(xT):zU;function FY(f,g){return f===g||Yx(f,g,dw(g))}function jY(f,g,S){return S=typeof S=="function"?S:n,Yx(f,g,dw(g),S)}function $Y(f){return aM(f)&&f!=+f}function zY(f){if(_G(f))throw new ot(o);return JT(f)}function BY(f){return f===null}function HY(f){return f==null}function aM(f){return typeof f=="number"||Nn(f)&&Vr(f)==Ee}function Vf(f){if(!Nn(f)||Vr(f)!=ze)return!1;var g=gm(f);if(g===null)return!0;var S=nn.call(g,"constructor")&&g.constructor;return typeof S=="function"&&S instanceof S&&dm.call(S)==jW}var Sw=wT?Oi(wT):BU;function VY(f){return oM(f)&&f>=-9007199254740991&&f<=W}var lM=ST?Oi(ST):HU;function Vm(f){return typeof f=="string"||!at(f)&&Nn(f)&&Vr(f)==xn}function Ai(f){return typeof f=="symbol"||Nn(f)&&Vr(f)==At}var yu=_T?Oi(_T):VU;function WY(f){return f===n}function UY(f){return Nn(f)&&Pr(f)==en}function GY(f){return Nn(f)&&Vr(f)==fe}var qY=Im(Xx),YY=Im(function(f,g){return f<=g});function cM(f){if(!f)return[];if(li(f))return Vm(f)?So(f):ai(f);if(Mf&&f[Mf])return RW(f[Mf]());var g=Pr(f),S=g==de?Fx:g==Mt?lm:vu;return S(f)}function js(f){if(!f)return f===0?f:0;if(f=oo(f),f===B||f===-1/0){var g=f<0?-1:1;return g*K}return f===f?f:0}function dt(f){var g=js(f),S=g%1;return g===g?S?g-S:g:0}function uM(f){return f?Tl(dt(f),0,Y):0}function oo(f){if(typeof f=="number")return f;if(Ai(f))return D;if(Dn(f)){var g=typeof f.valueOf=="function"?f.valueOf():f;f=Dn(g)?g+"":g}if(typeof f!="string")return f===0?f:+f;f=OT(f);var S=gt.test(f);return S||re.test(f)?cW(f.slice(2),S?2:8):wt.test(f)?D:+f}function dM(f){return Go(f,ci(f))}function KY(f){return f?Tl(dt(f),-9007199254740991,W):f===0?f:0}function Kt(f){return f==null?"":Mi(f)}var XY=gu(function(f,g){if(Bf(g)||li(g)){Go(g,cr(g),f);return}for(var S in g)nn.call(g,S)&&Nf(f,S,g[S])}),fM=gu(function(f,g){Go(g,ci(g),f)}),Wm=gu(function(f,g,S,O){Go(g,ci(g),f,O)}),QY=gu(function(f,g,S,O){Go(g,cr(g),f,O)}),JY=Ns(Vx);function ZY(f,g){var S=pu(f);return g==null?S:WT(S,g)}var eK=St(function(f,g){f=dn(f);var S=-1,O=g.length,N=O>2?g[2]:n;for(N&&Wr(g[0],g[1],N)&&(O=1);++S<O;)for(var V=g[S],Q=ci(V),ie=-1,ue=Q.length;++ie<ue;){var ye=Q[ie],xe=f[ye];(xe===n||Co(xe,du[ye])&&!nn.call(f,ye))&&(f[ye]=V[ye])}return f}),tK=St(function(f){return f.push(n,OO),Ti(hM,n,f)});function nK(f,g){return ET(f,Ue(g,3),Uo)}function rK(f,g){return ET(f,Ue(g,3),Ux)}function iK(f,g){return f==null?f:Wx(f,Ue(g,3),ci)}function oK(f,g){return f==null?f:KT(f,Ue(g,3),ci)}function sK(f,g){return f&&Uo(f,Ue(g,3))}function aK(f,g){return f&&Ux(f,Ue(g,3))}function lK(f){return f==null?[]:Em(f,cr(f))}function cK(f){return f==null?[]:Em(f,ci(f))}function _w(f,g,S){var O=f==null?n:Ol(f,g);return O===n?S:O}function uK(f,g){return f!=null&&DO(f,g,IU)}function Cw(f,g){return f!=null&&DO(f,g,kU)}var dK=CO(function(f,g,S){g!=null&&typeof g.toString!="function"&&(g=fm.call(g)),f[g]=S},Rw(ui)),fK=CO(function(f,g,S){g!=null&&typeof g.toString!="function"&&(g=fm.call(g)),nn.call(f,g)?f[g].push(S):f[g]=[S]},Ue),hK=St(Ff);function cr(f){return li(f)?HT(f):Kx(f)}function ci(f){return li(f)?HT(f,!0):WU(f)}function pK(f,g){var S={};return g=Ue(g,3),Uo(f,function(O,N,V){Is(S,g(O,N,V),O)}),S}function gK(f,g){var S={};return g=Ue(g,3),Uo(f,function(O,N,V){Is(S,N,g(O,N,V))}),S}var mK=gu(function(f,g,S){Rm(f,g,S)}),hM=gu(function(f,g,S,O){Rm(f,g,S,O)}),bK=Ns(function(f,g){var S={};if(f==null)return S;var O=!1;g=An(g,function(V){return V=Ca(V,f),O||(O=V.length>1),V}),Go(f,cw(f),S),O&&(S=no(S,d|p|h,dG));for(var N=g.length;N--;)tw(S,g[N]);return S});function yK(f,g){return pM(f,Bm(Ue(g)))}var vK=Ns(function(f,g){return f==null?{}:GU(f,g)});function pM(f,g){if(f==null)return{};var S=An(cw(f),function(O){return[O]});return g=Ue(g),oO(f,S,function(O,N){return g(O,N[0])})}function xK(f,g,S){g=Ca(g,f);var O=-1,N=g.length;for(N||(N=1,f=n);++O<N;){var V=f==null?n:f[qo(g[O])];V===n&&(O=N,V=S),f=Fs(V)?V.call(f):V}return f}function wK(f,g,S){return f==null?f:$f(f,g,S)}function SK(f,g,S,O){return O=typeof O=="function"?O:n,f==null?f:$f(f,g,S,O)}var gM=PO(cr),mM=PO(ci);function _K(f,g,S){var O=at(f),N=O||Ra(f)||yu(f);if(g=Ue(g,4),S==null){var V=f&&f.constructor;N?S=O?new V:[]:Dn(f)?S=Fs(V)?pu(gm(f)):{}:S={}}return(N?Zi:Uo)(f,function(Q,ie,ue){return g(S,Q,ie,ue)}),S}function CK(f,g){return f==null?!0:tw(f,g)}function EK(f,g,S){return f==null?f:uO(f,g,iw(S))}function RK(f,g,S,O){return O=typeof O=="function"?O:n,f==null?f:uO(f,g,iw(S),O)}function vu(f){return f==null?[]:Lx(f,cr(f))}function PK(f){return f==null?[]:Lx(f,ci(f))}function TK(f,g,S){return S===n&&(S=g,g=n),S!==n&&(S=oo(S),S=S===S?S:0),g!==n&&(g=oo(g),g=g===g?g:0),Tl(oo(f),g,S)}function OK(f,g,S){return g=js(g),S===n?(S=g,g=0):S=js(S),f=oo(f),NU(f,g,S)}function MK(f,g,S){if(S&&typeof S!="boolean"&&Wr(f,g,S)&&(g=S=n),S===n&&(typeof g=="boolean"?(S=g,g=n):typeof f=="boolean"&&(S=f,f=n)),f===n&&g===n?(f=0,g=1):(f=js(f),g===n?(g=f,f=0):g=js(g)),f>g){var O=f;f=g,g=O}if(S||f%1||g%1){var N=zT();return Rr(f+N*(g-f+lW("1e-"+((N+"").length-1))),g)}return Jx(f,g)}var AK=mu(function(f,g,S){return g=g.toLowerCase(),f+(S?bM(g):g)});function bM(f){return Ew(Kt(f).toLowerCase())}function yM(f){return f=Kt(f),f&&f.replace(Ie,wW).replace(JV,"")}function DK(f,g,S){f=Kt(f),g=Mi(g);var O=f.length;S=S===n?O:Tl(dt(S),0,O);var N=S;return S-=g.length,S>=0&&f.slice(S,N)==g}function IK(f){return f=Kt(f),f&&_l.test(f)?f.replace(Er,SW):f}function kK(f){return f=Kt(f),f&&ar.test(f)?f.replace(mr,"\\$&"):f}var NK=mu(function(f,g,S){return f+(S?"-":"")+g.toLowerCase()}),LK=mu(function(f,g,S){return f+(S?" ":"")+g.toLowerCase()}),FK=wO("toLowerCase");function jK(f,g,S){f=Kt(f),g=dt(g);var O=g?cu(f):0;if(!g||O>=g)return f;var N=(g-O)/2;return Dm(vm(N),S)+f+Dm(ym(N),S)}function $K(f,g,S){f=Kt(f),g=dt(g);var O=g?cu(f):0;return g&&O<g?f+Dm(g-O,S):f}function zK(f,g,S){f=Kt(f),g=dt(g);var O=g?cu(f):0;return g&&O<g?Dm(g-O,S)+f:f}function BK(f,g,S){return S||g==null?g=0:g&&(g=+g),YW(Kt(f).replace(wn,""),g||0)}function HK(f,g,S){return(S?Wr(f,g,S):g===n)?g=1:g=dt(g),Zx(Kt(f),g)}function VK(){var f=arguments,g=Kt(f[0]);return f.length<3?g:g.replace(f[1],f[2])}var WK=mu(function(f,g,S){return f+(S?"_":"")+g.toLowerCase()});function UK(f,g,S){return S&&typeof S!="number"&&Wr(f,g,S)&&(g=S=n),S=S===n?Y:S>>>0,S?(f=Kt(f),f&&(typeof g=="string"||g!=null&&!Sw(g))&&(g=Mi(g),!g&&lu(f))?Ea(So(f),0,S):f.split(g,S)):[]}var GK=mu(function(f,g,S){return f+(S?" ":"")+Ew(g)});function qK(f,g,S){return f=Kt(f),S=S==null?0:Tl(dt(S),0,f.length),g=Mi(g),f.slice(S,S+g.length)==g}function YK(f,g,S){var O=z.templateSettings;S&&Wr(f,g,S)&&(g=n),f=Kt(f),g=Wm({},g,O,TO);var N=Wm({},g.imports,O.imports,TO),V=cr(N),Q=Lx(N,V),ie,ue,ye=0,xe=g.interpolate||Dt,Se="__p += '",ke=jx((g.escape||Dt).source+"|"+xe.source+"|"+(xe===Ht?kt:Dt).source+"|"+(g.evaluate||Dt).source+"|$","g"),Ve="//# sourceURL="+(nn.call(g,"sourceURL")?(g.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++rW+"]")+`
|
|
75
|
+
`;f.replace(ke,function(qe,Pt,Nt,Di,Ur,Ii){return Nt||(Nt=Di),Se+=f.slice(ye,Ii).replace(gn,_W),Pt&&(ie=!0,Se+=`' +
|
|
76
|
+
__e(`+Pt+`) +
|
|
77
|
+
'`),Ur&&(ue=!0,Se+=`';
|
|
78
|
+
`+Ur+`;
|
|
79
|
+
__p += '`),Nt&&(Se+=`' +
|
|
80
|
+
((__t = (`+Nt+`)) == null ? '' : __t) +
|
|
81
|
+
'`),ye=Ii+qe.length,qe}),Se+=`';
|
|
82
|
+
`;var Ge=nn.call(g,"variable")&&g.variable;if(!Ge)Se=`with (obj) {
|
|
83
|
+
`+Se+`
|
|
84
|
+
}
|
|
85
|
+
`;else if(Ae.test(Ge))throw new ot(a);Se=(ue?Se.replace(Zn,""):Se).replace(Qi,"$1").replace(Cr,"$1;"),Se="function("+(Ge||"obj")+`) {
|
|
86
|
+
`+(Ge?"":`obj || (obj = {});
|
|
87
|
+
`)+"var __t, __p = ''"+(ie?", __e = _.escape":"")+(ue?`, __j = Array.prototype.join;
|
|
88
|
+
function print() { __p += __j.call(arguments, '') }
|
|
89
|
+
`:`;
|
|
90
|
+
`)+Se+`return __p
|
|
91
|
+
}`;var mt=xM(function(){return Wt(V,Ve+"return "+Se).apply(n,Q)});if(mt.source=Se,ww(mt))throw mt;return mt}function KK(f){return Kt(f).toLowerCase()}function XK(f){return Kt(f).toUpperCase()}function QK(f,g,S){if(f=Kt(f),f&&(S||g===n))return OT(f);if(!f||!(g=Mi(g)))return f;var O=So(f),N=So(g),V=MT(O,N),Q=AT(O,N)+1;return Ea(O,V,Q).join("")}function JK(f,g,S){if(f=Kt(f),f&&(S||g===n))return f.slice(0,IT(f)+1);if(!f||!(g=Mi(g)))return f;var O=So(f),N=AT(O,So(g))+1;return Ea(O,0,N).join("")}function ZK(f,g,S){if(f=Kt(f),f&&(S||g===n))return f.replace(wn,"");if(!f||!(g=Mi(g)))return f;var O=So(f),N=MT(O,So(g));return Ea(O,N).join("")}function eX(f,g){var S=L,O=j;if(Dn(g)){var N="separator"in g?g.separator:N;S="length"in g?dt(g.length):S,O="omission"in g?Mi(g.omission):O}f=Kt(f);var V=f.length;if(lu(f)){var Q=So(f);V=Q.length}if(S>=V)return f;var ie=S-cu(O);if(ie<1)return O;var ue=Q?Ea(Q,0,ie).join(""):f.slice(0,ie);if(N===n)return ue+O;if(Q&&(ie+=ue.length-ie),Sw(N)){if(f.slice(ie).search(N)){var ye,xe=ue;for(N.global||(N=jx(N.source,Kt($t.exec(N))+"g")),N.lastIndex=0;ye=N.exec(xe);)var Se=ye.index;ue=ue.slice(0,Se===n?ie:Se)}}else if(f.indexOf(Mi(N),ie)!=ie){var ke=ue.lastIndexOf(N);ke>-1&&(ue=ue.slice(0,ke))}return ue+O}function tX(f){return f=Kt(f),f&&Br.test(f)?f.replace(Wo,MW):f}var nX=mu(function(f,g,S){return f+(S?" ":"")+g.toUpperCase()}),Ew=wO("toUpperCase");function vM(f,g,S){return f=Kt(f),g=S?n:g,g===n?EW(f)?IW(f):mW(f):f.match(g)||[]}var xM=St(function(f,g){try{return Ti(f,n,g)}catch(S){return ww(S)?S:new ot(S)}}),rX=Ns(function(f,g){return Zi(g,function(S){S=qo(S),Is(f,S,vw(f[S],f))}),f});function iX(f){var g=f==null?0:f.length,S=Ue();return f=g?An(f,function(O){if(typeof O[1]!="function")throw new eo(s);return[S(O[0]),O[1]]}):[],St(function(O){for(var N=-1;++N<g;){var V=f[N];if(Ti(V[0],this,O))return Ti(V[1],this,O)}})}function oX(f){return MU(no(f,d))}function Rw(f){return function(){return f}}function sX(f,g){return f==null||f!==f?g:f}var aX=_O(),lX=_O(!0);function ui(f){return f}function Pw(f){return ZT(typeof f=="function"?f:no(f,d))}function cX(f){return tO(no(f,d))}function uX(f,g){return nO(f,no(g,d))}var dX=St(function(f,g){return function(S){return Ff(S,f,g)}}),fX=St(function(f,g){return function(S){return Ff(f,S,g)}});function Tw(f,g,S){var O=cr(g),N=Em(g,O);S==null&&!(Dn(g)&&(N.length||!O.length))&&(S=g,g=f,f=this,N=Em(g,cr(g)));var V=!(Dn(S)&&"chain"in S)||!!S.chain,Q=Fs(f);return Zi(N,function(ie){var ue=g[ie];f[ie]=ue,Q&&(f.prototype[ie]=function(){var ye=this.__chain__;if(V||ye){var xe=f(this.__wrapped__),Se=xe.__actions__=ai(this.__actions__);return Se.push({func:ue,args:arguments,thisArg:f}),xe.__chain__=ye,xe}return ue.apply(f,va([this.value()],arguments))})}),f}function hX(){return br._===this&&(br._=$W),this}function Ow(){}function pX(f){return f=dt(f),St(function(g){return rO(g,f)})}var gX=sw(An),mX=sw(CT),bX=sw(Ax);function wM(f){return hw(f)?Dx(qo(f)):qU(f)}function yX(f){return function(g){return f==null?n:Ol(f,g)}}var vX=EO(),xX=EO(!0);function Mw(){return[]}function Aw(){return!1}function wX(){return{}}function SX(){return""}function _X(){return!0}function CX(f,g){if(f=dt(f),f<1||f>W)return[];var S=Y,O=Rr(f,Y);g=Ue(g),f-=Y;for(var N=Nx(O,g);++S<f;)g(S);return N}function EX(f){return at(f)?An(f,qo):Ai(f)?[f]:ai(BO(Kt(f)))}function RX(f){var g=++FW;return Kt(f)+g}var PX=Am(function(f,g){return f+g},0),TX=aw("ceil"),OX=Am(function(f,g){return f/g},1),MX=aw("floor");function AX(f){return f&&f.length?Cm(f,ui,Gx):n}function DX(f,g){return f&&f.length?Cm(f,Ue(g,2),Gx):n}function IX(f){return PT(f,ui)}function kX(f,g){return PT(f,Ue(g,2))}function NX(f){return f&&f.length?Cm(f,ui,Xx):n}function LX(f,g){return f&&f.length?Cm(f,Ue(g,2),Xx):n}var FX=Am(function(f,g){return f*g},1),jX=aw("round"),$X=Am(function(f,g){return f-g},0);function zX(f){return f&&f.length?kx(f,ui):0}function BX(f,g){return f&&f.length?kx(f,Ue(g,2)):0}return z.after=cY,z.ary=JO,z.assign=XY,z.assignIn=fM,z.assignInWith=Wm,z.assignWith=QY,z.at=JY,z.before=ZO,z.bind=vw,z.bindAll=rX,z.bindKey=eM,z.castArray=wY,z.chain=KO,z.chunk=MG,z.compact=AG,z.concat=DG,z.cond=iX,z.conforms=oX,z.constant=Rw,z.countBy=zq,z.create=ZY,z.curry=tM,z.curryRight=nM,z.debounce=rM,z.defaults=eK,z.defaultsDeep=tK,z.defer=uY,z.delay=dY,z.difference=IG,z.differenceBy=kG,z.differenceWith=NG,z.drop=LG,z.dropRight=FG,z.dropRightWhile=jG,z.dropWhile=$G,z.fill=zG,z.filter=Hq,z.flatMap=Uq,z.flatMapDeep=Gq,z.flatMapDepth=qq,z.flatten=UO,z.flattenDeep=BG,z.flattenDepth=HG,z.flip=fY,z.flow=aX,z.flowRight=lX,z.fromPairs=VG,z.functions=lK,z.functionsIn=cK,z.groupBy=Yq,z.initial=UG,z.intersection=GG,z.intersectionBy=qG,z.intersectionWith=YG,z.invert=dK,z.invertBy=fK,z.invokeMap=Xq,z.iteratee=Pw,z.keyBy=Qq,z.keys=cr,z.keysIn=ci,z.map=jm,z.mapKeys=pK,z.mapValues=gK,z.matches=cX,z.matchesProperty=uX,z.memoize=zm,z.merge=mK,z.mergeWith=hM,z.method=dX,z.methodOf=fX,z.mixin=Tw,z.negate=Bm,z.nthArg=pX,z.omit=bK,z.omitBy=yK,z.once=hY,z.orderBy=Jq,z.over=gX,z.overArgs=pY,z.overEvery=mX,z.overSome=bX,z.partial=xw,z.partialRight=iM,z.partition=Zq,z.pick=vK,z.pickBy=pM,z.property=wM,z.propertyOf=yX,z.pull=JG,z.pullAll=qO,z.pullAllBy=ZG,z.pullAllWith=eq,z.pullAt=tq,z.range=vX,z.rangeRight=xX,z.rearg=gY,z.reject=nY,z.remove=nq,z.rest=mY,z.reverse=bw,z.sampleSize=iY,z.set=wK,z.setWith=SK,z.shuffle=oY,z.slice=rq,z.sortBy=lY,z.sortedUniq=uq,z.sortedUniqBy=dq,z.split=UK,z.spread=bY,z.tail=fq,z.take=hq,z.takeRight=pq,z.takeRightWhile=gq,z.takeWhile=mq,z.tap=Aq,z.throttle=yY,z.thru=Fm,z.toArray=cM,z.toPairs=gM,z.toPairsIn=mM,z.toPath=EX,z.toPlainObject=dM,z.transform=_K,z.unary=vY,z.union=bq,z.unionBy=yq,z.unionWith=vq,z.uniq=xq,z.uniqBy=wq,z.uniqWith=Sq,z.unset=CK,z.unzip=yw,z.unzipWith=YO,z.update=EK,z.updateWith=RK,z.values=vu,z.valuesIn=PK,z.without=_q,z.words=vM,z.wrap=xY,z.xor=Cq,z.xorBy=Eq,z.xorWith=Rq,z.zip=Pq,z.zipObject=Tq,z.zipObjectDeep=Oq,z.zipWith=Mq,z.entries=gM,z.entriesIn=mM,z.extend=fM,z.extendWith=Wm,Tw(z,z),z.add=PX,z.attempt=xM,z.camelCase=AK,z.capitalize=bM,z.ceil=TX,z.clamp=TK,z.clone=SY,z.cloneDeep=CY,z.cloneDeepWith=EY,z.cloneWith=_Y,z.conformsTo=RY,z.deburr=yM,z.defaultTo=sX,z.divide=OX,z.endsWith=DK,z.eq=Co,z.escape=IK,z.escapeRegExp=kK,z.every=Bq,z.find=Vq,z.findIndex=VO,z.findKey=nK,z.findLast=Wq,z.findLastIndex=WO,z.findLastKey=rK,z.floor=MX,z.forEach=XO,z.forEachRight=QO,z.forIn=iK,z.forInRight=oK,z.forOwn=sK,z.forOwnRight=aK,z.get=_w,z.gt=PY,z.gte=TY,z.has=uK,z.hasIn=Cw,z.head=GO,z.identity=ui,z.includes=Kq,z.indexOf=WG,z.inRange=OK,z.invoke=hK,z.isArguments=Dl,z.isArray=at,z.isArrayBuffer=OY,z.isArrayLike=li,z.isArrayLikeObject=Vn,z.isBoolean=MY,z.isBuffer=Ra,z.isDate=AY,z.isElement=DY,z.isEmpty=IY,z.isEqual=kY,z.isEqualWith=NY,z.isError=ww,z.isFinite=LY,z.isFunction=Fs,z.isInteger=oM,z.isLength=Hm,z.isMap=sM,z.isMatch=FY,z.isMatchWith=jY,z.isNaN=$Y,z.isNative=zY,z.isNil=HY,z.isNull=BY,z.isNumber=aM,z.isObject=Dn,z.isObjectLike=Nn,z.isPlainObject=Vf,z.isRegExp=Sw,z.isSafeInteger=VY,z.isSet=lM,z.isString=Vm,z.isSymbol=Ai,z.isTypedArray=yu,z.isUndefined=WY,z.isWeakMap=UY,z.isWeakSet=GY,z.join=KG,z.kebabCase=NK,z.last=io,z.lastIndexOf=XG,z.lowerCase=LK,z.lowerFirst=FK,z.lt=qY,z.lte=YY,z.max=AX,z.maxBy=DX,z.mean=IX,z.meanBy=kX,z.min=NX,z.minBy=LX,z.stubArray=Mw,z.stubFalse=Aw,z.stubObject=wX,z.stubString=SX,z.stubTrue=_X,z.multiply=FX,z.nth=QG,z.noConflict=hX,z.noop=Ow,z.now=$m,z.pad=jK,z.padEnd=$K,z.padStart=zK,z.parseInt=BK,z.random=MK,z.reduce=eY,z.reduceRight=tY,z.repeat=HK,z.replace=VK,z.result=xK,z.round=jX,z.runInContext=le,z.sample=rY,z.size=sY,z.snakeCase=WK,z.some=aY,z.sortedIndex=iq,z.sortedIndexBy=oq,z.sortedIndexOf=sq,z.sortedLastIndex=aq,z.sortedLastIndexBy=lq,z.sortedLastIndexOf=cq,z.startCase=GK,z.startsWith=qK,z.subtract=$X,z.sum=zX,z.sumBy=BX,z.template=YK,z.times=CX,z.toFinite=js,z.toInteger=dt,z.toLength=uM,z.toLower=KK,z.toNumber=oo,z.toSafeInteger=KY,z.toString=Kt,z.toUpper=XK,z.trim=QK,z.trimEnd=JK,z.trimStart=ZK,z.truncate=eX,z.unescape=tX,z.uniqueId=RX,z.upperCase=nX,z.upperFirst=Ew,z.each=XO,z.eachRight=QO,z.first=GO,Tw(z,function(){var f={};return Uo(z,function(g,S){nn.call(z.prototype,S)||(f[S]=g)}),f}(),{chain:!1}),z.VERSION=r,Zi(["bind","bindKey","curry","curryRight","partial","partialRight"],function(f){z[f].placeholder=z}),Zi(["drop","take"],function(f,g){It.prototype[f]=function(S){S=S===n?1:rr(dt(S),0);var O=this.__filtered__&&!g?new It(this):this.clone();return O.__filtered__?O.__takeCount__=Rr(S,O.__takeCount__):O.__views__.push({size:Rr(S,Y),type:f+(O.__dir__<0?"Right":"")}),O},It.prototype[f+"Right"]=function(S){return this.reverse()[f](S).reverse()}}),Zi(["filter","map","takeWhile"],function(f,g){var S=g+1,O=S==H||S==G;It.prototype[f]=function(N){var V=this.clone();return V.__iteratees__.push({iteratee:Ue(N,3),type:S}),V.__filtered__=V.__filtered__||O,V}}),Zi(["head","last"],function(f,g){var S="take"+(g?"Right":"");It.prototype[f]=function(){return this[S](1).value()[0]}}),Zi(["initial","tail"],function(f,g){var S="drop"+(g?"":"Right");It.prototype[f]=function(){return this.__filtered__?new It(this):this[S](1)}}),It.prototype.compact=function(){return this.filter(ui)},It.prototype.find=function(f){return this.filter(f).head()},It.prototype.findLast=function(f){return this.reverse().find(f)},It.prototype.invokeMap=St(function(f,g){return typeof f=="function"?new It(this):this.map(function(S){return Ff(S,f,g)})}),It.prototype.reject=function(f){return this.filter(Bm(Ue(f)))},It.prototype.slice=function(f,g){f=dt(f);var S=this;return S.__filtered__&&(f>0||g<0)?new It(S):(f<0?S=S.takeRight(-f):f&&(S=S.drop(f)),g!==n&&(g=dt(g),S=g<0?S.dropRight(-g):S.take(g-f)),S)},It.prototype.takeRightWhile=function(f){return this.reverse().takeWhile(f).reverse()},It.prototype.toArray=function(){return this.take(Y)},Uo(It.prototype,function(f,g){var S=/^(?:filter|find|map|reject)|While$/.test(g),O=/^(?:head|last)$/.test(g),N=z[O?"take"+(g=="last"?"Right":""):g],V=O||/^find/.test(g);N&&(z.prototype[g]=function(){var Q=this.__wrapped__,ie=O?[1]:arguments,ue=Q instanceof It,ye=ie[0],xe=ue||at(Q),Se=function(Pt){var Nt=N.apply(z,va([Pt],ie));return O&&ke?Nt[0]:Nt};xe&&S&&typeof ye=="function"&&ye.length!=1&&(ue=xe=!1);var ke=this.__chain__,Ve=!!this.__actions__.length,Ge=V&&!ke,mt=ue&&!Ve;if(!V&&xe){Q=mt?Q:new It(this);var qe=f.apply(Q,ie);return qe.__actions__.push({func:Fm,args:[Se],thisArg:n}),new to(qe,ke)}return Ge&&mt?f.apply(this,ie):(qe=this.thru(Se),Ge?O?qe.value()[0]:qe.value():qe)})}),Zi(["pop","push","shift","sort","splice","unshift"],function(f){var g=cm[f],S=/^(?:push|sort|unshift)$/.test(f)?"tap":"thru",O=/^(?:pop|shift)$/.test(f);z.prototype[f]=function(){var N=arguments;if(O&&!this.__chain__){var V=this.value();return g.apply(at(V)?V:[],N)}return this[S](function(Q){return g.apply(at(Q)?Q:[],N)})}}),Uo(It.prototype,function(f,g){var S=z[g];if(S){var O=S.name+"";nn.call(hu,O)||(hu[O]=[]),hu[O].push({name:g,func:S})}}),hu[Mm(n,x).name]=[{name:"wrapper",func:n}],It.prototype.clone=tU,It.prototype.reverse=nU,It.prototype.value=rU,z.prototype.at=Dq,z.prototype.chain=Iq,z.prototype.commit=kq,z.prototype.next=Nq,z.prototype.plant=Fq,z.prototype.reverse=jq,z.prototype.toJSON=z.prototype.valueOf=z.prototype.value=$q,z.prototype.first=z.prototype.head,Mf&&(z.prototype[Mf]=Lq),z},uu=kW();Cl?((Cl.exports=uu)._=uu,Px._=uu):br._=uu}).call(La)})(Oy,Oy.exports);var bh=Oy.exports;const gc=qc(bh);function BM({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 CE.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 HM(e,t){if(!t)return;const n={...t};return CE.forEach(r=>{n[r]&&(n[r]=n[r].filter(i=>i.i!==e))}),n}function PE(e){return ve.getState().dashboard.globalCacheConfig}const ve=V5()(X5((e,t)=>({isSessionExpired:!1,currentBreakpoint:"lg",dashboard:{id:"",style:Ty},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:Ty},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=>{CE.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&&bh.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&&bh.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&&bh.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&&bh.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})},removeFilterValue: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=>{BM({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=HM(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))}})},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=BM({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),HM(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)=>{mJ({card:n,dataPoint:r,set:e,get:t})}}}))),hr=()=>ve(e=>e.actions),bJ={theme:"system",setTheme:()=>null},rL=P.createContext(bJ);function yJ({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(rL.Provider,{...r,value:s,children:e})}const iL=()=>{const e=P.useContext(rL);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};var xg=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(){}},Ic=typeof window>"u"||"Deno"in globalThis;function lo(){}function vJ(e,t){return typeof e=="function"?e(t):e}function KS(e){return typeof e=="number"&&e>=0&&e!==1/0}function oL(e,t){return Math.max(e+(t||0)-Date.now(),0)}function qu(e,t){return typeof e=="function"?e(t):e}function Do(e,t){return typeof e=="function"?e(t):e}function VM(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==TE(s,t.options))return!1}else if(!dp(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 WM(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(up(t.options.mutationKey)!==up(o))return!1}else if(!dp(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function TE(e,t){return((t==null?void 0:t.queryKeyHashFn)||up)(e)}function up(e){return JSON.stringify(e,(t,n)=>JS(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function dp(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!dp(e[n],t[n])):!1}function XS(e,t){if(e===t)return e;const n=UM(e)&&UM(t);if(n||JS(e)&&JS(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]=XS(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return i===s&&l===i?e:a}return t}function QS(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 UM(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function JS(e){if(!GM(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!GM(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function GM(e){return Object.prototype.toString.call(e)==="[object Object]"}function xJ(e){return new Promise(t=>{setTimeout(t,e)})}function ZS(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 XS(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 XS(e,t)}return t}function wJ(e){return e}function SJ(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function _J(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var My=Symbol();function sL(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===My&&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===My?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var sc,ja,sd,C5,CJ=(C5=class extends xg{constructor(){super();Ne(this,sc);Ne(this,ja);Ne(this,sd);Pe(this,sd,t=>{if(!Ic&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){Z(this,ja)||this.setEventListener(Z(this,sd))}onUnsubscribe(){var t;this.hasListeners()||((t=Z(this,ja))==null||t.call(this),Pe(this,ja,void 0))}setEventListener(t){var n;Pe(this,sd,t),(n=Z(this,ja))==null||n.call(this),Pe(this,ja,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){Z(this,sc)!==t&&(Pe(this,sc,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof Z(this,sc)=="boolean"?Z(this,sc):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},sc=new WeakMap,ja=new WeakMap,sd=new WeakMap,C5),OE=new CJ,ad,$a,ld,E5,EJ=(E5=class extends xg{constructor(){super();Ne(this,ad,!0);Ne(this,$a);Ne(this,ld);Pe(this,ld,t=>{if(!Ic&&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(){Z(this,$a)||this.setEventListener(Z(this,ld))}onUnsubscribe(){var t;this.hasListeners()||((t=Z(this,$a))==null||t.call(this),Pe(this,$a,void 0))}setEventListener(t){var n;Pe(this,ld,t),(n=Z(this,$a))==null||n.call(this),Pe(this,$a,t(this.setOnline.bind(this)))}setOnline(t){Z(this,ad)!==t&&(Pe(this,ad,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return Z(this,ad)}},ad=new WeakMap,$a=new WeakMap,ld=new WeakMap,E5),Fd=new EJ;function e_(){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 RJ(e){return Math.min(1e3*2**e,3e4)}function aL(e){return(e??"online")==="online"?Fd.isOnline():!0}var lL=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Bw(e){return e instanceof lL}function cL(e){let t=!1,n=0,r=!1,i;const o=e_(),s=b=>{var v;r||(p(new lL(b)),(v=e.abort)==null||v.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>OE.isFocused()&&(e.networkMode==="always"||Fd.isOnline())&&e.canRun(),u=()=>aL(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 T;if(r)return;const w=e.retry??(Ic?0:3),_=e.retryDelay??RJ,R=typeof _=="function"?_(n,x):_,C=w===!0||typeof w=="number"&&n<w||typeof w=="function"&&w(n,x);if(t||!C){p(x);return}n++,(T=e.onFail)==null||T.call(e,n,x),xJ(R).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 PJ(){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 wr=PJ(),ac,R5,uL=(R5=class{constructor(){Ne(this,ac)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),KS(this.gcTime)&&Pe(this,ac,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ic?1/0:5*60*1e3))}clearGcTimeout(){Z(this,ac)&&(clearTimeout(Z(this,ac)),Pe(this,ac,void 0))}},ac=new WeakMap,R5),cd,ud,ao,Ar,og,lc,Mo,Ws,P5,TJ=(P5=class extends uL{constructor(t){super();Ne(this,Mo);Ne(this,cd);Ne(this,ud);Ne(this,ao);Ne(this,Ar);Ne(this,og);Ne(this,lc);Pe(this,lc,!1),Pe(this,og,t.defaultOptions),this.setOptions(t.options),this.observers=[],Pe(this,ao,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Pe(this,cd,OJ(this.options)),this.state=t.state??Z(this,cd),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=Z(this,Ar))==null?void 0:t.promise}setOptions(t){this.options={...Z(this,og),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Z(this,ao).remove(this)}setData(t,n){const r=ZS(this.state.data,t,this.options);return Lt(this,Mo,Ws).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Lt(this,Mo,Ws).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=Z(this,Ar))==null?void 0:r.promise;return(i=Z(this,Ar))==null||i.cancel(t),n?n.then(lo).catch(lo):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Z(this,cd))}isActive(){return this.observers.some(t=>Do(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===My||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||!oL(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=Z(this,Ar))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=Z(this,Ar))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),Z(this,ao).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(Z(this,Ar)&&(Z(this,lc)?Z(this,Ar).cancel({revert:!0}):Z(this,Ar).cancelRetry()),this.scheduleGc()),Z(this,ao).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Lt(this,Mo,Ws).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(Z(this,Ar))return Z(this,Ar).continueRetry(),Z(this,Ar).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:()=>(Pe(this,lc,!0),r.signal)})},o=()=>{const d=sL(this.options,n),p={queryKey:this.queryKey,meta:this.meta};return i(p),Pe(this,lc,!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),Pe(this,ud,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=s.fetchOptions)==null?void 0:c.meta))&&Lt(this,Mo,Ws).call(this,{type:"fetch",meta:(u=s.fetchOptions)==null?void 0:u.meta});const a=d=>{var p,h,m,b;Bw(d)&&d.silent||Lt(this,Mo,Ws).call(this,{type:"error",error:d}),Bw(d)||((h=(p=Z(this,ao).config).onError)==null||h.call(p,d,this),(b=(m=Z(this,ao).config).onSettled)==null||b.call(m,this.state.data,d,this)),this.scheduleGc()};return Pe(this,Ar,cL({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=Z(this,ao).config).onSuccess)==null||h.call(p,d,this),(b=(m=Z(this,ao).config).onSettled)==null||b.call(m,d,this.state.error,this),this.scheduleGc()},onError:a,onFail:(d,p)=>{Lt(this,Mo,Ws).call(this,{type:"failed",failureCount:d,error:p})},onPause:()=>{Lt(this,Mo,Ws).call(this,{type:"pause"})},onContinue:()=>{Lt(this,Mo,Ws).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0})),Z(this,Ar).start()}},cd=new WeakMap,ud=new WeakMap,ao=new WeakMap,Ar=new WeakMap,og=new WeakMap,lc=new WeakMap,Mo=new WeakSet,Ws=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,...dL(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 Bw(i)&&i.revert&&Z(this,ud)?{...Z(this,ud),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),wr.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),Z(this,ao).notify({query:this,type:"updated",action:t})})},P5);function dL(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:aL(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function OJ(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 es,T5,fL=(T5=class extends xg{constructor(t={}){super();Ne(this,es);this.config=t,Pe(this,es,new Map)}build(t,n,r){const i=n.queryKey,o=n.queryHash??TE(i,n);let s=this.get(o);return s||(s=new TJ({cache:this,queryKey:i,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(s)),s}add(t){Z(this,es).has(t.queryHash)||(Z(this,es).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=Z(this,es).get(t.queryHash);n&&(t.destroy(),n===t&&Z(this,es).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){wr.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return Z(this,es).get(t)}getAll(){return[...Z(this,es).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>VM(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>VM(t,r)):n}notify(t){wr.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){wr.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){wr.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},es=new WeakMap,T5),ts,Yr,cc,ns,Ia,O5,MJ=(O5=class extends uL{constructor(t){super();Ne(this,ns);Ne(this,ts);Ne(this,Yr);Ne(this,cc);this.mutationId=t.mutationId,Pe(this,Yr,t.mutationCache),Pe(this,ts,[]),this.state=t.state||AJ(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){Z(this,ts).includes(t)||(Z(this,ts).push(t),this.clearGcTimeout(),Z(this,Yr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Pe(this,ts,Z(this,ts).filter(n=>n!==t)),this.scheduleGc(),Z(this,Yr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){Z(this,ts).length||(this.state.status==="pending"?this.scheduleGc():Z(this,Yr).remove(this))}continue(){var t;return((t=Z(this,cc))==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,w,_,R,C,T,M;Pe(this,cc,cL({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(I,k)=>{Lt(this,ns,Ia).call(this,{type:"failed",failureCount:I,error:k})},onPause:()=>{Lt(this,ns,Ia).call(this,{type:"pause"})},onContinue:()=>{Lt(this,ns,Ia).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Z(this,Yr).canRun(this)}));const n=this.state.status==="pending",r=!Z(this,cc).canStart();try{if(!n){Lt(this,ns,Ia).call(this,{type:"pending",variables:t,isPaused:r}),await((o=(i=Z(this,Yr).config).onMutate)==null?void 0:o.call(i,t,this));const k=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));k!==this.state.context&&Lt(this,ns,Ia).call(this,{type:"pending",context:k,variables:t,isPaused:r})}const I=await Z(this,cc).start();return await((c=(l=Z(this,Yr).config).onSuccess)==null?void 0:c.call(l,I,t,this.state.context,this)),await((d=(u=this.options).onSuccess)==null?void 0:d.call(u,I,t,this.state.context)),await((h=(p=Z(this,Yr).config).onSettled)==null?void 0:h.call(p,I,null,this.state.variables,this.state.context,this)),await((b=(m=this.options).onSettled)==null?void 0:b.call(m,I,null,t,this.state.context)),Lt(this,ns,Ia).call(this,{type:"success",data:I}),I}catch(I){try{throw await((x=(v=Z(this,Yr).config).onError)==null?void 0:x.call(v,I,t,this.state.context,this)),await((_=(w=this.options).onError)==null?void 0:_.call(w,I,t,this.state.context)),await((C=(R=Z(this,Yr).config).onSettled)==null?void 0:C.call(R,void 0,I,this.state.variables,this.state.context,this)),await((M=(T=this.options).onSettled)==null?void 0:M.call(T,void 0,I,t,this.state.context)),I}finally{Lt(this,ns,Ia).call(this,{type:"error",error:I})}}finally{Z(this,Yr).runNext(this)}}},ts=new WeakMap,Yr=new WeakMap,cc=new WeakMap,ns=new WeakSet,Ia=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),wr.batch(()=>{Z(this,ts).forEach(r=>{r.onMutationUpdate(t)}),Z(this,Yr).notify({mutation:this,type:"updated",action:t})})},O5);function AJ(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Qs,Ao,sg,M5,DJ=(M5=class extends xg{constructor(t={}){super();Ne(this,Qs);Ne(this,Ao);Ne(this,sg);this.config=t,Pe(this,Qs,new Set),Pe(this,Ao,new Map),Pe(this,sg,0)}build(t,n,r){const i=new MJ({mutationCache:this,mutationId:++Um(this,sg)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){Z(this,Qs).add(t);const n=Ym(t);if(typeof n=="string"){const r=Z(this,Ao).get(n);r?r.push(t):Z(this,Ao).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(Z(this,Qs).delete(t)){const n=Ym(t);if(typeof n=="string"){const r=Z(this,Ao).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&Z(this,Ao).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Ym(t);if(typeof n=="string"){const r=Z(this,Ao).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=Ym(t);if(typeof n=="string"){const i=(r=Z(this,Ao).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(){wr.batch(()=>{Z(this,Qs).forEach(t=>{this.notify({type:"removed",mutation:t})}),Z(this,Qs).clear(),Z(this,Ao).clear()})}getAll(){return Array.from(Z(this,Qs))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>WM(n,r))}findAll(t={}){return this.getAll().filter(n=>WM(t,n))}notify(t){wr.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return wr.batch(()=>Promise.all(t.map(n=>n.continue().catch(lo))))}},Qs=new WeakMap,Ao=new WeakMap,sg=new WeakMap,M5);function Ym(e){var t;return(t=e.options.scope)==null?void 0:t.id}function qM(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=sL(t.options,t.fetchOptions),w=async(_,R,C)=>{if(b)return Promise.reject();if(R==null&&_.pages.length)return Promise.resolve(_);const T={queryKey:t.queryKey,pageParam:R,direction:C?"backward":"forward",meta:t.options.meta};v(T);const M=await x(T),{maxPages:I}=t.options,k=C?_J:SJ;return{pages:k(_.pages,M,I),pageParams:k(_.pageParams,R,I)}};if(i&&o.length){const _=i==="backward",R=_?IJ:YM,C={pages:o,pageParams:s},T=R(r,C);a=await w(C,T,_)}else{const _=e??o.length;do{const R=l===0?s[0]??r.initialPageParam:YM(r,a);if(l>0&&R==null)break;a=await w(a,R),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 YM(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 IJ(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 Ln,za,Ba,dd,fd,Ha,hd,pd,A5,kJ=(A5=class{constructor(e={}){Ne(this,Ln);Ne(this,za);Ne(this,Ba);Ne(this,dd);Ne(this,fd);Ne(this,Ha);Ne(this,hd);Ne(this,pd);Pe(this,Ln,e.queryCache||new fL),Pe(this,za,e.mutationCache||new DJ),Pe(this,Ba,e.defaultOptions||{}),Pe(this,dd,new Map),Pe(this,fd,new Map),Pe(this,Ha,0)}mount(){Um(this,Ha)._++,Z(this,Ha)===1&&(Pe(this,hd,OE.subscribe(async e=>{e&&(await this.resumePausedMutations(),Z(this,Ln).onFocus())})),Pe(this,pd,Fd.subscribe(async e=>{e&&(await this.resumePausedMutations(),Z(this,Ln).onOnline())})))}unmount(){var e,t;Um(this,Ha)._--,Z(this,Ha)===0&&((e=Z(this,hd))==null||e.call(this),Pe(this,hd,void 0),(t=Z(this,pd))==null||t.call(this),Pe(this,pd,void 0))}isFetching(e){return Z(this,Ln).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return Z(this,za).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=Z(this,Ln).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=Z(this,Ln).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(qu(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return Z(this,Ln).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=Z(this,Ln).get(r.queryHash),o=i==null?void 0:i.state.data,s=vJ(t,o);if(s!==void 0)return Z(this,Ln).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return wr.batch(()=>Z(this,Ln).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=Z(this,Ln).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=Z(this,Ln);wr.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=Z(this,Ln),r={type:"active",...e};return wr.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=wr.batch(()=>Z(this,Ln).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(lo).catch(lo)}invalidateQueries(e,t={}){return wr.batch(()=>{if(Z(this,Ln).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=wr.batch(()=>Z(this,Ln).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(lo)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(lo)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=Z(this,Ln).build(this,t);return n.isStaleByTime(qu(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(lo).catch(lo)}fetchInfiniteQuery(e){return e.behavior=qM(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(lo).catch(lo)}ensureInfiniteQueryData(e){return e.behavior=qM(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Fd.isOnline()?Z(this,za).resumePausedMutations():Promise.resolve()}getQueryCache(){return Z(this,Ln)}getMutationCache(){return Z(this,za)}getDefaultOptions(){return Z(this,Ba)}setDefaultOptions(e){Pe(this,Ba,e)}setQueryDefaults(e,t){Z(this,dd).set(up(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...Z(this,dd).values()],n={};return t.forEach(r=>{dp(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){Z(this,fd).set(up(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...Z(this,fd).values()];let n={};return t.forEach(r=>{dp(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...Z(this,Ba).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=TE(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===My&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...Z(this,Ba).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){Z(this,Ln).clear(),Z(this,za).clear()}},Ln=new WeakMap,za=new WeakMap,Ba=new WeakMap,dd=new WeakMap,fd=new WeakMap,Ha=new WeakMap,hd=new WeakMap,pd=new WeakMap,A5),bi,Ft,ag,Kr,uc,gd,Va,rs,lg,md,bd,dc,fc,Wa,yd,Zt,yh,t_,n_,r_,i_,o_,s_,a_,hL,D5,NJ=(D5=class extends xg{constructor(t,n){super();Ne(this,Zt);Ne(this,bi);Ne(this,Ft);Ne(this,ag);Ne(this,Kr);Ne(this,uc);Ne(this,gd);Ne(this,Va);Ne(this,rs);Ne(this,lg);Ne(this,md);Ne(this,bd);Ne(this,dc);Ne(this,fc);Ne(this,Wa);Ne(this,yd,new Set);this.options=n,Pe(this,bi,t),Pe(this,rs,null),Pe(this,Va,e_()),this.options.experimental_prefetchInRender||Z(this,Va).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&&(Z(this,Ft).addObserver(this),KM(Z(this,Ft),this.options)?Lt(this,Zt,yh).call(this):this.updateResult(),Lt(this,Zt,i_).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return l_(Z(this,Ft),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return l_(Z(this,Ft),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Lt(this,Zt,o_).call(this),Lt(this,Zt,s_).call(this),Z(this,Ft).removeObserver(this)}setOptions(t,n){const r=this.options,i=Z(this,Ft);if(this.options=Z(this,bi).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Do(this.options.enabled,Z(this,Ft))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Lt(this,Zt,a_).call(this),Z(this,Ft).setOptions(this.options),r._defaulted&&!QS(this.options,r)&&Z(this,bi).getQueryCache().notify({type:"observerOptionsUpdated",query:Z(this,Ft),observer:this});const o=this.hasListeners();o&&XM(Z(this,Ft),i,this.options,r)&&Lt(this,Zt,yh).call(this),this.updateResult(n),o&&(Z(this,Ft)!==i||Do(this.options.enabled,Z(this,Ft))!==Do(r.enabled,Z(this,Ft))||qu(this.options.staleTime,Z(this,Ft))!==qu(r.staleTime,Z(this,Ft)))&&Lt(this,Zt,t_).call(this);const s=Lt(this,Zt,n_).call(this);o&&(Z(this,Ft)!==i||Do(this.options.enabled,Z(this,Ft))!==Do(r.enabled,Z(this,Ft))||s!==Z(this,Wa))&&Lt(this,Zt,r_).call(this,s)}getOptimisticResult(t){const n=Z(this,bi).getQueryCache().build(Z(this,bi),t),r=this.createResult(n,t);return FJ(this,r)&&(Pe(this,Kr,r),Pe(this,gd,this.options),Pe(this,uc,Z(this,Ft).state)),r}getCurrentResult(){return Z(this,Kr)}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){Z(this,yd).add(t)}getCurrentQuery(){return Z(this,Ft)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=Z(this,bi).defaultQueryOptions(t),r=Z(this,bi).getQueryCache().build(Z(this,bi),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Lt(this,Zt,yh).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),Z(this,Kr)))}createResult(t,n){var I;const r=Z(this,Ft),i=this.options,o=Z(this,Kr),s=Z(this,uc),a=Z(this,gd),c=t!==r?t.state:Z(this,ag),{state:u}=t;let d={...u},p=!1,h;if(n._optimisticResults){const k=this.hasListeners(),L=!k&&KM(t,n),j=k&&XM(t,r,n,i);(L||j)&&(d={...d,...dL(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===Z(this,lg))h=Z(this,md);else try{Pe(this,lg,n.select),h=n.select(d.data),h=ZS(o==null?void 0:o.data,h,n),Pe(this,md,h),Pe(this,rs,null)}catch(k){Pe(this,rs,k)}else h=d.data;if(n.placeholderData!==void 0&&h===void 0&&v==="pending"){let k;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))k=o.data;else if(k=typeof n.placeholderData=="function"?n.placeholderData((I=Z(this,bd))==null?void 0:I.state.data,Z(this,bd)):n.placeholderData,n.select&&k!==void 0)try{k=n.select(k),Pe(this,rs,null)}catch(L){Pe(this,rs,L)}k!==void 0&&(v="success",h=ZS(o==null?void 0:o.data,k,n),p=!0)}Z(this,rs)&&(m=Z(this,rs),h=Z(this,md),b=Date.now(),v="error");const x=d.fetchStatus==="fetching",w=v==="pending",_=v==="error",R=w&&x,C=h!==void 0,M={status:v,fetchStatus:d.fetchStatus,isPending:w,isSuccess:v==="success",isError:_,isInitialLoading:R,isLoading:R,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&&!w,isLoadingError:_&&!C,isPaused:d.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:_&&C,isStale:ME(t,n),refetch:this.refetch,promise:Z(this,Va)};if(this.options.experimental_prefetchInRender){const k=$=>{M.status==="error"?$.reject(M.error):M.data!==void 0&&$.resolve(M.data)},L=()=>{const $=Pe(this,Va,M.promise=e_());k($)},j=Z(this,Va);switch(j.status){case"pending":t.queryHash===r.queryHash&&k(j);break;case"fulfilled":(M.status==="error"||M.data!==j.value)&&L();break;case"rejected":(M.status!=="error"||M.error!==j.reason)&&L();break}}return M}updateResult(t){const n=Z(this,Kr),r=this.createResult(Z(this,Ft),this.options);if(Pe(this,uc,Z(this,Ft).state),Pe(this,gd,this.options),Z(this,uc).data!==void 0&&Pe(this,bd,Z(this,Ft)),QS(r,n))return;Pe(this,Kr,r);const i={},o=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!Z(this,yd).size)return!0;const l=new Set(a??Z(this,yd));return this.options.throwOnError&&l.add("error"),Object.keys(Z(this,Kr)).some(c=>{const u=c;return Z(this,Kr)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&o()&&(i.listeners=!0),Lt(this,Zt,hL).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Lt(this,Zt,i_).call(this)}},bi=new WeakMap,Ft=new WeakMap,ag=new WeakMap,Kr=new WeakMap,uc=new WeakMap,gd=new WeakMap,Va=new WeakMap,rs=new WeakMap,lg=new WeakMap,md=new WeakMap,bd=new WeakMap,dc=new WeakMap,fc=new WeakMap,Wa=new WeakMap,yd=new WeakMap,Zt=new WeakSet,yh=function(t){Lt(this,Zt,a_).call(this);let n=Z(this,Ft).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(lo)),n},t_=function(){Lt(this,Zt,o_).call(this);const t=qu(this.options.staleTime,Z(this,Ft));if(Ic||Z(this,Kr).isStale||!KS(t))return;const r=oL(Z(this,Kr).dataUpdatedAt,t)+1;Pe(this,dc,setTimeout(()=>{Z(this,Kr).isStale||this.updateResult()},r))},n_=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Z(this,Ft)):this.options.refetchInterval)??!1},r_=function(t){Lt(this,Zt,s_).call(this),Pe(this,Wa,t),!(Ic||Do(this.options.enabled,Z(this,Ft))===!1||!KS(Z(this,Wa))||Z(this,Wa)===0)&&Pe(this,fc,setInterval(()=>{(this.options.refetchIntervalInBackground||OE.isFocused())&&Lt(this,Zt,yh).call(this)},Z(this,Wa)))},i_=function(){Lt(this,Zt,t_).call(this),Lt(this,Zt,r_).call(this,Lt(this,Zt,n_).call(this))},o_=function(){Z(this,dc)&&(clearTimeout(Z(this,dc)),Pe(this,dc,void 0))},s_=function(){Z(this,fc)&&(clearInterval(Z(this,fc)),Pe(this,fc,void 0))},a_=function(){const t=Z(this,bi).getQueryCache().build(Z(this,bi),this.options);if(t===Z(this,Ft))return;const n=Z(this,Ft);Pe(this,Ft,t),Pe(this,ag,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},hL=function(t){wr.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(Z(this,Kr))}),Z(this,bi).getQueryCache().notify({query:Z(this,Ft),type:"observerResultsUpdated"})})},D5);function LJ(e,t){return Do(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function KM(e,t){return LJ(e,t)||e.state.data!==void 0&&l_(e,t,t.refetchOnMount)}function l_(e,t,n){if(Do(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&ME(e,t)}return!1}function XM(e,t,n,r){return(e!==t||Do(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&ME(e,n)}function ME(e,t){return Do(t.enabled,e)!==!1&&e.isStaleByTime(qu(t.staleTime,e))}function FJ(e,t){return!QS(e.getCurrentResult(),t)}var AE=E.createContext(void 0),wg=e=>{const t=E.useContext(AE);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},jJ=({client:e,children:t})=>(E.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),y.jsx(AE.Provider,{value:e,children:t})),pL=E.createContext(!1),$J=()=>E.useContext(pL);pL.Provider;function zJ(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var BJ=E.createContext(zJ()),HJ=()=>E.useContext(BJ);function VJ(e,t){return typeof e=="function"?e(...t):!!e}function QM(){}var WJ=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},UJ=e=>{E.useEffect(()=>{e.clearReset()},[e])},GJ=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&VJ(n,[e.error,r]),qJ=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)))},YJ=(e,t)=>e.isLoading&&e.isFetching&&!t,KJ=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,JM=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function XJ(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=wg(n),i=$J(),o=HJ(),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",qJ(s),WJ(s,o),UJ(o);const a=!r.getQueryCache().get(s.queryHash),[l]=E.useState(()=>new t(r,s)),c=l.getOptimisticResult(s),u=!i&&e.subscribed!==!1;if(E.useSyncExternalStore(E.useCallback(v=>{const x=u?l.subscribe(wr.batchCalls(v)):QM;return l.updateResult(),x},[l,u]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),E.useEffect(()=>{l.setOptions(s,{listeners:!1})},[s,l]),KJ(s,c))throw JM(s,l,o);if(GJ({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&&!Ic&&YJ(c,i)){const v=a?JM(s,l,o):(b=r.getQueryCache().get(s.queryHash))==null?void 0:b.promise;v==null||v.catch(QM).finally(()=>{l.updateResult()})}return s.notifyOnChangeProps?c:l.trackResult(c)}function Sg(e,t){return XJ(e,NJ,t)}var lt={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return ZM(this.context.count)},getNextContextId(){return ZM(this.context.count++)}};function ZM(e){const t=String(e),n=t.length-1;return lt.context.id+(n?String.fromCharCode(96+n):"")+t}function vh(e){lt.context=e}var QJ=(e,t)=>e===t,Ay=Symbol("solid-proxy"),gL=typeof Proxy=="function",DE=Symbol("solid-track"),Dy={equals:QJ},mL=_L,ha=1,Iy=2,bL={owned:null,cleanups:null,context:null,owner:null},Hw={},Gt=null,Vw=null,JJ=null,ln=null,jr=null,sa=null,q0=0;function Ja(e,t){const n=ln,r=Gt,i=e.length===0,o=t===void 0?r:t,s=i?bL:{owned:null,cleanups:null,context:o?o.context:null,owner:o},a=i?e:()=>e(()=>pr(()=>fp(s)));Gt=s,ln=null;try{return gs(a,!0)}finally{ln=n,Gt=r}}function Fn(e,t){t=t?Object.assign({},Dy,t):Dy;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=i=>(typeof i=="function"&&(i=i(n.value)),SL(n,i));return[wL.bind(n),r]}function yL(e,t,n){const r=Y0(e,t,!0,ha);uf(r)}function Za(e,t,n){const r=Y0(e,t,!1,ha);uf(r)}function IE(e,t,n){mL=fZ;const r=Y0(e,t,!1,ha);(!n||!n.render)&&(r.user=!0),sa?sa.push(r):uf(r)}function ni(e,t,n){n=n?Object.assign({},Dy,n):Dy;const r=Y0(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,uf(r),wL.bind(r)}function ZJ(e){return e&&typeof e=="object"&&"then"in e}function eZ(e,t,n){let r,i,o;arguments.length===1?(r=!0,i=e,o={}):(r=e,i=t,o={});let s=null,a=Hw,l=null,c=!1,u="initialValue"in o,d=typeof r=="function"&&ni(r);const p=new Set,[h,m]=(o.storage||Fn)(o.initialValue),[b,v]=Fn(void 0),[x,w]=Fn(void 0,{equals:!1}),[_,R]=Fn(u?"ready":"unresolved");lt.context&&(l=lt.getNextContextId(),o.ssrLoadFrom==="initial"?a=o.initialValue:lt.load&<.has(l)&&(a=lt.load(l)));function C(k,L,j,$){return s===k&&(s=null,$!==void 0&&(u=!0),(k===a||L===a)&&o.onHydrated&&queueMicrotask(()=>o.onHydrated($,{value:L})),a=Hw,T(L,j)),L}function T(k,L){gs(()=>{L===void 0&&m(()=>k),R(L!==void 0?"errored":u?"ready":"unresolved"),v(L);for(const j of p.keys())j.decrement();p.clear()},!1)}function M(){const k=cZ,L=h(),j=b();if(j!==void 0&&!s)throw j;return ln&&ln.user,L}function I(k=!0){if(k!==!1&&c)return;c=!1;const L=d?d():r;if(L==null||L===!1){C(s,pr(h));return}const j=a!==Hw?a:pr(()=>i(L,{value:h(),refetching:k}));return ZJ(j)?(s=j,"value"in j?(j.status==="success"?C(s,j.value,void 0,L):C(s,void 0,c_(j.value),L),j):(c=!0,queueMicrotask(()=>c=!1),gs(()=>{R(u?"refreshing":"pending"),w()},!1),j.then($=>C(j,$,void 0,L),$=>C(j,void 0,c_($),L)))):(C(s,j,void 0,L),j)}return Object.defineProperties(M,{state:{get:()=>_()},error:{get:()=>b()},loading:{get(){const k=_();return k==="pending"||k==="refreshing"}},latest:{get(){if(!u)return M();const k=b();if(k&&!s)throw k;return h()}}}),d?yL(()=>I(!1)):I(!1),[M,{refetch:I,mutate:m}]}function tZ(e){return gs(e,!1)}function pr(e){if(ln===null)return e();const t=ln;ln=null;try{return e()}finally{ln=t}}function nZ(e,t,n){const r=Array.isArray(e);let i,o=n&&n.defer;return s=>{let a;if(r){a=Array(e.length);for(let c=0;c<e.length;c++)a[c]=e[c]()}else a=e();if(o)return o=!1,s;const l=pr(()=>t(a,i,s));return i=a,l}}function vL(e){IE(()=>pr(e))}function jd(e){return Gt===null||(Gt.cleanups===null?Gt.cleanups=[e]:Gt.cleanups.push(e)),e}function eA(){return Gt}function rZ(e,t){const n=Gt,r=ln;Gt=e,ln=null;try{return gs(t,!0)}catch(i){kE(i)}finally{Gt=n,ln=r}}function iZ(e){const t=ln,n=Gt;return Promise.resolve().then(()=>{ln=t,Gt=n;let r;return gs(e,!1),ln=Gt=null,r?r.done:void 0})}var[oZ,rIe]=Fn(!1);function sZ(){return[oZ,iZ]}function aZ(e,t){const n=Symbol("context");return{id:n,Provider:hZ(n),defaultValue:e}}function lZ(e){let t;return Gt&&Gt.context&&(t=Gt.context[e.id])!==void 0?t:e.defaultValue}function xL(e){const t=ni(e),n=ni(()=>u_(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}var cZ;function wL(){if(this.sources&&this.state)if(this.state===ha)uf(this);else{const e=jr;jr=null,gs(()=>Ny(this),!1),jr=e}if(ln){const e=this.observers?this.observers.length:0;ln.sources?(ln.sources.push(this),ln.sourceSlots.push(e)):(ln.sources=[this],ln.sourceSlots=[e]),this.observers?(this.observers.push(ln),this.observerSlots.push(ln.sources.length-1)):(this.observers=[ln],this.observerSlots=[ln.sources.length-1])}return this.value}function SL(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&gs(()=>{for(let i=0;i<e.observers.length;i+=1){const o=e.observers[i],s=Vw&&Vw.running;s&&Vw.disposed.has(o),(s?!o.tState:!o.state)&&(o.pure?jr.push(o):sa.push(o),o.observers&&CL(o)),s||(o.state=ha)}if(jr.length>1e6)throw jr=[],new Error},!1)),t}function uf(e){if(!e.fn)return;fp(e);const t=q0;uZ(e,e.value,t)}function uZ(e,t,n){let r;const i=Gt,o=ln;ln=Gt=e;try{r=e.fn(t)}catch(s){return e.pure&&(e.state=ha,e.owned&&e.owned.forEach(fp),e.owned=null),e.updatedAt=n+1,kE(s)}finally{ln=o,Gt=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?SL(e,r):e.value=r,e.updatedAt=n)}function Y0(e,t,n,r=ha,i){const o={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:Gt,context:Gt?Gt.context:null,pure:n};return Gt===null||Gt!==bL&&(Gt.owned?Gt.owned.push(o):Gt.owned=[o]),o}function ky(e){if(e.state===0)return;if(e.state===Iy)return Ny(e);if(e.suspense&&pr(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<q0);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===ha)uf(e);else if(e.state===Iy){const r=jr;jr=null,gs(()=>Ny(e,t[0]),!1),jr=r}}function gs(e,t){if(jr)return e();let n=!1;t||(jr=[]),sa?n=!0:sa=[],q0++;try{const r=e();return dZ(n),r}catch(r){n||(sa=null),jr=null,kE(r)}}function dZ(e){if(jr&&(_L(jr),jr=null),e)return;const t=sa;sa=null,t.length&&gs(()=>mL(t),!1)}function _L(e){for(let t=0;t<e.length;t++)ky(e[t])}function fZ(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:ky(r)}if(lt.context){if(lt.count){lt.effects||(lt.effects=[]),lt.effects.push(...e.slice(0,n));return}vh()}for(lt.effects&&(lt.done||!lt.count)&&(e=[...lt.effects,...e],n+=lt.effects.length,delete lt.effects),t=0;t<n;t++)ky(e[t])}function Ny(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const r=e.sources[n];if(r.sources){const i=r.state;i===ha?r!==t&&(!r.updatedAt||r.updatedAt<q0)&&ky(r):i===Iy&&Ny(r,t)}}}function CL(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=Iy,n.pure?jr.push(n):sa.push(n),n.observers&&CL(n))}}function fp(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),r=e.sourceSlots.pop(),i=n.observers;if(i&&i.length){const o=i.pop(),s=n.observerSlots.pop();r<i.length&&(o.sourceSlots[s]=r,i[r]=o,n.observerSlots[r]=s)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)fp(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)fp(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function c_(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function kE(e,t=Gt){throw c_(e)}function u_(e){if(typeof e=="function"&&!e.length)return u_(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=u_(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function hZ(e,t){return function(r){let i;return Za(()=>i=pr(()=>(Gt.context={...Gt.context,[e]:r.value},xL(()=>r.children))),void 0),i}}var d_=Symbol("fallback");function Ly(e){for(let t=0;t<e.length;t++)e[t]()}function pZ(e,t,n={}){let r=[],i=[],o=[],s=0,a=t.length>1?[]:null;return jd(()=>Ly(o)),()=>{let l=e()||[],c=l.length,u,d;return l[DE],pr(()=>{let h,m,b,v,x,w,_,R,C;if(c===0)s!==0&&(Ly(o),o=[],r=[],i=[],s=0,a&&(a=[])),n.fallback&&(r=[d_],i[0]=Ja(T=>(o[0]=T,n.fallback())),s=1);else if(s===0){for(i=new Array(c),d=0;d<c;d++)r[d]=l[d],i[d]=Ja(p);s=c}else{for(b=new Array(c),v=new Array(c),a&&(x=new Array(c)),w=0,_=Math.min(s,c);w<_&&r[w]===l[w];w++);for(_=s-1,R=c-1;_>=w&&R>=w&&r[_]===l[R];_--,R--)b[R]=i[_],v[R]=o[_],a&&(x[R]=a[_]);for(h=new Map,m=new Array(R+1),d=R;d>=w;d--)C=l[d],u=h.get(C),m[d]=u===void 0?-1:u,h.set(C,d);for(u=w;u<=_;u++)C=r[u],d=h.get(C),d!==void 0&&d!==-1?(b[d]=i[u],v[d]=o[u],a&&(x[d]=a[u]),d=m[d],h.set(C,d)):o[u]();for(d=w;d<c;d++)d in b?(i[d]=b[d],o[d]=v[d],a&&(a[d]=x[d],a[d](d))):i[d]=Ja(p);i=i.slice(0,s=c),r=l.slice(0)}return i});function p(h){if(o[d]=h,a){const[m,b]=Fn(d);return a[d]=b,t(l[d],m)}return t(l[d])}}}function gZ(e,t,n={}){let r=[],i=[],o=[],s=[],a=0,l;return jd(()=>Ly(o)),()=>{const c=e()||[],u=c.length;return c[DE],pr(()=>{if(u===0)return a!==0&&(Ly(o),o=[],r=[],i=[],a=0,s=[]),n.fallback&&(r=[d_],i[0]=Ja(p=>(o[0]=p,n.fallback())),a=1),i;for(r[0]===d_&&(o[0](),o=[],r=[],i=[],a=0),l=0;l<u;l++)l<r.length&&r[l]!==c[l]?s[l](()=>c[l]):l>=r.length&&(i[l]=Ja(d));for(;l<r.length;l++)o[l]();return a=s.length=o.length=u,r=c.slice(0),i=i.slice(0,a)});function d(p){o[l]=p;const[h,m]=Fn(c[l]);return s[l]=m,t(h,l)}}}function NE(e,t){return pr(()=>e(t||{}))}function Km(){return!0}var f_={get(e,t,n){return t===Ay?n:e.get(t)},has(e,t){return t===Ay?!0:e.has(t)},set:Km,deleteProperty:Km,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:Km,deleteProperty:Km}},ownKeys(e){return e.keys()}};function Ww(e){return(e=typeof e=="function"?e():e)?e:{}}function mZ(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function LE(...e){let t=!1;for(let s=0;s<e.length;s++){const a=e[s];t=t||!!a&&Ay in a,e[s]=typeof a=="function"?(t=!0,ni(a)):a}if(gL&&t)return new Proxy({get(s){for(let a=e.length-1;a>=0;a--){const l=Ww(e[a])[s];if(l!==void 0)return l}},has(s){for(let a=e.length-1;a>=0;a--)if(s in Ww(e[a]))return!0;return!1},keys(){const s=[];for(let a=0;a<e.length;a++)s.push(...Object.keys(Ww(e[a])));return[...new Set(s)]}},f_);const n={},r=Object.create(null);for(let s=e.length-1;s>=0;s--){const a=e[s];if(!a)continue;const l=Object.getOwnPropertyNames(a);for(let c=l.length-1;c>=0;c--){const u=l[c];if(u==="__proto__"||u==="constructor")continue;const d=Object.getOwnPropertyDescriptor(a,u);if(!r[u])r[u]=d.get?{enumerable:!0,configurable:!0,get:mZ.bind(n[u]=[d.get.bind(a)])}:d.value!==void 0?d:void 0;else{const p=n[u];p&&(d.get?p.push(d.get.bind(a)):d.value!==void 0&&p.push(()=>d.value))}}}const i={},o=Object.keys(r);for(let s=o.length-1;s>=0;s--){const a=o[s],l=r[a];l&&l.get?Object.defineProperty(i,a,l):i[a]=l?l.value:void 0}return i}function EL(e,...t){if(gL&&Ay in e){const i=new Set(t.length>1?t.flat():t[0]),o=t.map(s=>new Proxy({get(a){return s.includes(a)?e[a]:void 0},has(a){return s.includes(a)&&a in e},keys(){return s.filter(a=>a in e)}},f_));return o.push(new Proxy({get(s){return i.has(s)?void 0:e[s]},has(s){return i.has(s)?!1:s in e},keys(){return Object.keys(e).filter(s=>!i.has(s))}},f_)),o}const n={},r=t.map(()=>({}));for(const i of Object.getOwnPropertyNames(e)){const o=Object.getOwnPropertyDescriptor(e,i),s=!o.get&&!o.set&&o.enumerable&&o.writable&&o.configurable;let a=!1,l=0;for(const c of t)c.includes(i)&&(a=!0,s?r[l][i]=o.value:Object.defineProperty(r[l],i,o)),++l;a||(s?n[i]=o.value:Object.defineProperty(n,i,o))}return[...r,n]}function RL(e){let t,n;const r=i=>{const o=lt.context;if(o){const[a,l]=Fn();lt.count||(lt.count=0),lt.count++,(n||(n=e())).then(c=>{!lt.done&&vh(o),lt.count--,l(()=>c.default),vh()}),t=a}else if(!t){const[a]=eZ(()=>(n||(n=e())).then(l=>l.default));t=a}let s;return ni(()=>(s=t())?pr(()=>{if(!o||lt.done)return s(i);const a=lt.context;vh(o);const l=s(i);return vh(a),l}):"")};return r.preload=()=>n||((n=e()).then(i=>t=()=>i.default),n),r}var bZ=0;function yZ(){return lt.context?lt.getNextContextId():`cl-${bZ++}`}var PL=e=>`Stale read from <${e}>.`;function vZ(e){const t="fallback"in e&&{fallback:()=>e.fallback};return ni(pZ(()=>e.each,e.children,t||void 0))}function xZ(e){const t="fallback"in e&&{fallback:()=>e.fallback};return ni(gZ(()=>e.each,e.children,t||void 0))}function wZ(e){const t=e.keyed,n=ni(()=>e.when,void 0,{equals:(r,i)=>t?r===i:!r==!i});return ni(()=>{const r=n();if(r){const i=e.children;return typeof i=="function"&&i.length>0?pr(()=>i(t?r:()=>{if(!pr(n))throw PL("Show");return e.when})):i}return e.fallback},void 0,void 0)}function SZ(e){let t=!1;const n=(o,s)=>(t?o[1]===s[1]:!o[1]==!s[1])&&o[2]===s[2],r=xL(()=>e.children),i=ni(()=>{let o=r();Array.isArray(o)||(o=[o]);for(let s=0;s<o.length;s++){const a=o[s].when;if(a)return t=!!o[s].keyed,[s,a,o[s]]}return[-1]},void 0,{equals:n});return ni(()=>{const[o,s,a]=i();if(o<0)return e.fallback;const l=a.children;return typeof l=="function"&&l.length>0?pr(()=>l(t?s:()=>{if(pr(i)[0]!==o)throw PL("Match");return a.when})):l},void 0,void 0)}function _Z(e){return e}var CZ=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],EZ=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...CZ]),RZ=new Set(["innerHTML","textContent","innerText","children"]),PZ=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),TZ=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function OZ(e,t){const n=TZ[e];return typeof n=="object"?n[t]?n.$:void 0:n}var MZ=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),AZ=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","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","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),DZ={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function IZ(e,t,n){let r=n.length,i=t.length,o=r,s=0,a=0,l=t[i-1].nextSibling,c=null;for(;s<i||a<o;){if(t[s]===n[a]){s++,a++;continue}for(;t[i-1]===n[o-1];)i--,o--;if(i===s){const u=o<r?a?n[a-1].nextSibling:n[o-a]:l;for(;a<o;)e.insertBefore(n[a++],u)}else if(o===a)for(;s<i;)(!c||!c.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[o-1]&&n[a]===t[i-1]){const u=t[--i].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--o],u),t[i]=n[o]}else{if(!c){c=new Map;let d=a;for(;d<o;)c.set(n[d],d++)}const u=c.get(t[s]);if(u!=null)if(a<u&&u<o){let d=s,p=1,h;for(;++d<i&&d<o&&!((h=c.get(t[d]))==null||h!==u+p);)p++;if(p>u-a){const m=t[s];for(;a<u;)e.insertBefore(n[a++],m)}else e.replaceChild(n[a++],t[s++])}else s++;else t[s++].remove()}}}var $h="_$DX_DELEGATE";function TL(e,t,n,r={}){let i;return Ja(o=>{i=o,t===document?e():jy(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=""}}function kZ(e,t,n){let r;const i=()=>{const s=document.createElement("template");return s.innerHTML=e,s.content.firstChild},o=()=>(r||(r=i())).cloneNode(!0);return o.cloneNode=o,o}function OL(e,t=window.document){const n=t[$h]||(t[$h]=new Set);for(let r=0,i=e.length;r<i;r++){const o=e[r];n.has(o)||(n.add(o),t.addEventListener(o,kL))}}function NZ(e=window.document){if(e[$h]){for(let t of e[$h].keys())e.removeEventListener(t,kL);delete e[$h]}}function Fy(e,t,n){Yc(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function LZ(e,t,n,r){Yc(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function FZ(e,t,n){Yc(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function ML(e,t){Yc(e)||(t==null?e.removeAttribute("class"):e.className=t)}function AL(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const i=n[0];e.addEventListener(t,n[0]=o=>i.call(e,n[1],o))}else e.addEventListener(t,n,typeof n!="function"&&n)}function jZ(e,t,n={}){const r=Object.keys(t||{}),i=Object.keys(n);let o,s;for(o=0,s=i.length;o<s;o++){const a=i[o];!a||a==="undefined"||t[a]||(tA(e,a,!1),delete n[a])}for(o=0,s=r.length;o<s;o++){const a=r[o],l=!!t[a];!a||a==="undefined"||n[a]===l||!l||(tA(e,a,!0),n[a]=l)}return n}function $Z(e,t,n){if(!t)return n?Fy(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let i,o;for(o in n)t[o]==null&&r.removeProperty(o),delete n[o];for(o in t)i=t[o],i!==n[o]&&(r.setProperty(o,i),n[o]=i);return n}function DL(e,t={},n,r){const i={};return r||Za(()=>i.children=hp(e,t.children,i.children)),Za(()=>typeof t.ref=="function"&&IL(t.ref,e)),Za(()=>zZ(e,t,n,!0,i,!0)),i}function IL(e,t,n){return pr(()=>e(t,n))}function jy(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return hp(e,t,r,n);Za(i=>hp(e,t(),i,n),r)}function zZ(e,t,n,r,i={},o=!1){t||(t={});for(const s in i)if(!(s in t)){if(s==="children")continue;i[s]=nA(e,s,null,i[s],n,o,t)}for(const s in t){if(s==="children")continue;const a=t[s];i[s]=nA(e,s,a,i[s],n,o,t)}}function BZ(e){let t,n;return!Yc()||!(t=lt.registry.get(n=VZ()))?e():(lt.completed&<.completed.add(t),lt.registry.delete(n),t)}function Yc(e){return!!lt.context&&!lt.done&&(!e||e.isConnected)}function HZ(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function tA(e,t,n){const r=t.trim().split(/\s+/);for(let i=0,o=r.length;i<o;i++)e.classList.toggle(r[i],n)}function nA(e,t,n,r,i,o,s){let a,l,c,u,d;if(t==="style")return $Z(e,n,r);if(t==="classList")return jZ(e,n,r);if(n===r)return r;if(t==="ref")o||n(e);else if(t.slice(0,3)==="on:"){const p=t.slice(3);r&&e.removeEventListener(p,r,typeof r!="function"&&r),n&&e.addEventListener(p,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){const p=t.slice(10);r&&e.removeEventListener(p,r,!0),n&&e.addEventListener(p,n,!0)}else if(t.slice(0,2)==="on"){const p=t.slice(2).toLowerCase(),h=MZ.has(p);if(!h&&r){const m=Array.isArray(r)?r[0]:r;e.removeEventListener(p,m)}(h||n)&&(AL(e,p,n,h),h&&OL([p]))}else if(t.slice(0,5)==="attr:")Fy(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")FZ(e,t.slice(5),n);else if((d=t.slice(0,5)==="prop:")||(c=RZ.has(t))||!i&&((u=OZ(t,e.tagName))||(l=EZ.has(t)))||(a=e.nodeName.includes("-")||"is"in s)){if(d)t=t.slice(5),l=!0;else if(Yc(e))return n;t==="class"||t==="className"?ML(e,n):a&&!l&&!c?e[HZ(t)]=n:e[u||t]=n}else{const p=i&&t.indexOf(":")>-1&&DZ[t.split(":")[0]];p?LZ(e,p,t,n):Fy(e,PZ[t]||t,n)}return n}function kL(e){if(lt.registry&<.events&<.events.find(([l,c])=>c===e))return;let t=e.target;const n=`$$${e.type}`,r=e.target,i=e.currentTarget,o=l=>Object.defineProperty(e,"target",{configurable:!0,value:l}),s=()=>{const l=t[n];if(l&&!t.disabled){const c=t[`${n}Data`];if(c!==void 0?l.call(t,c,e):l.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&o(t.host),!0},a=()=>{for(;s()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),lt.registry&&!lt.done&&(lt.done=_$HY.done=!0),e.composedPath){const l=e.composedPath();o(l[0]);for(let c=0;c<l.length-2&&(t=l[c],!!s());c++){if(t._$host){t=t._$host,a();break}if(t.parentNode===i)break}}else a();o(r)}function hp(e,t,n,r,i){const o=Yc(e);if(o){!n&&(n=[...e.childNodes]);let l=[];for(let c=0;c<n.length;c++){const u=n[c];u.nodeType===8&&u.data.slice(0,2)==="!$"?u.remove():l.push(u)}n=l}for(;typeof n=="function";)n=n();if(t===n)return n;const s=typeof t,a=r!==void 0;if(e=a&&n[0]&&n[0].parentNode||e,s==="string"||s==="number"){if(o||s==="number"&&(t=t.toString(),t===n))return n;if(a){let l=n[0];l&&l.nodeType===3?l.data!==t&&(l.data=t):l=document.createTextNode(t),n=xu(e,n,r,l)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||s==="boolean"){if(o)return n;n=xu(e,n,r)}else{if(s==="function")return Za(()=>{let l=t();for(;typeof l=="function";)l=l();n=hp(e,l,n,r)}),()=>n;if(Array.isArray(t)){const l=[],c=n&&Array.isArray(n);if(h_(l,t,n,i))return Za(()=>n=hp(e,l,n,r,!0)),()=>n;if(o){if(!l.length)return n;if(r===void 0)return n=[...e.childNodes];let u=l[0];if(u.parentNode!==e)return n;const d=[u];for(;(u=u.nextSibling)!==r;)d.push(u);return n=d}if(l.length===0){if(n=xu(e,n,r),a)return n}else c?n.length===0?rA(e,l,r):IZ(e,n,l):(n&&xu(e),rA(e,l));n=l}else if(t.nodeType){if(o&&t.parentNode)return n=a?[t]:t;if(Array.isArray(n)){if(a)return n=xu(e,n,r,t);xu(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function h_(e,t,n,r){let i=!1;for(let o=0,s=t.length;o<s;o++){let a=t[o],l=n&&n[e.length],c;if(!(a==null||a===!0||a===!1))if((c=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))i=h_(e,a,l)||i;else if(c==="function")if(r){for(;typeof a=="function";)a=a();i=h_(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||i}else e.push(a),i=!0;else{const u=String(a);l&&l.nodeType===3&&l.data===u?e.push(l):e.push(document.createTextNode(u))}}return i}function rA(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function xu(e,t,n,r){if(n===void 0)return e.textContent="";const i=r||document.createTextNode("");if(t.length){let o=!1;for(let s=t.length-1;s>=0;s--){const a=t[s];if(i!==a){const l=a.parentNode===e;!o&&!s?l?e.replaceChild(i,a):e.insertBefore(i,n):l&&a.remove()}else o=!0}}else e.insertBefore(i,n);return[i]}function VZ(){return lt.getNextContextId()}var WZ="http://www.w3.org/2000/svg";function NL(e,t=!1){return t?document.createElementNS(WZ,e):document.createElement(e)}function UZ(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,i=eA();let o,s=!!lt.context;return IE(()=>{s&&(eA().user=s=!1),o||(o=rZ(i,()=>ni(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[l,c]=Fn(!1),u=()=>c(!0);Ja(d=>jy(a,()=>l()?d():o(),null)),jd(u)}else{const l=NL(e.isSVG?"g":"div",e.isSVG),c=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return n.parentNode},configurable:!0}),jy(c,o),a.appendChild(l),e.ref&&e.ref(l),jd(()=>a.removeChild(l))}},void 0,{render:!s}),n}function GZ(e){const[t,n]=EL(e,["component"]),r=ni(()=>t.component);return ni(()=>{const i=r();switch(typeof i){case"function":return pr(()=>i(n));case"string":const o=AZ.has(i),s=lt.context?BZ():NL(i,o);return DL(s,n,o),s}})}var qZ=class{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(e,t){this.keyToValue.set(e,t),this.valueToKey.set(t,e)}getByKey(e){return this.keyToValue.get(e)}getByValue(e){return this.valueToKey.get(e)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}},LL=class{constructor(t){this.generateIdentifier=t,this.kv=new qZ}register(t,n){this.kv.getByValue(t)||(n||(n=this.generateIdentifier(t)),this.kv.set(n,t))}clear(){this.kv.clear()}getIdentifier(t){return this.kv.getByValue(t)}getValue(t){return this.kv.getByKey(t)}},YZ=class extends LL{constructor(){super(e=>e.name),this.classToAllowedProps=new Map}register(e,t){typeof t=="object"?(t.allowProps&&this.classToAllowedProps.set(e,t.allowProps),super.register(e,t.identifier)):super.register(e,t)}getAllowedProps(e){return this.classToAllowedProps.get(e)}};function KZ(e){if("values"in Object)return Object.values(e);const t=[];for(const n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t}function XZ(e,t){const n=KZ(e);if("find"in n)return n.find(t);const r=n;for(let i=0;i<r.length;i++){const o=r[i];if(t(o))return o}}function $d(e,t){Object.entries(e).forEach(([n,r])=>t(r,n))}function sy(e,t){return e.indexOf(t)!==-1}function iA(e,t){for(let n=0;n<e.length;n++){const r=e[n];if(t(r))return r}}var QZ=class{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return XZ(this.transfomers,t=>t.isApplicable(e))}findByName(e){return this.transfomers[e]}},JZ=e=>Object.prototype.toString.call(e).slice(8,-1),FL=e=>typeof e>"u",ZZ=e=>e===null,pp=e=>typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,p_=e=>pp(e)&&Object.keys(e).length===0,rl=e=>Array.isArray(e),eee=e=>typeof e=="string",tee=e=>typeof e=="number"&&!isNaN(e),nee=e=>typeof e=="boolean",ree=e=>e instanceof RegExp,gp=e=>e instanceof Map,mp=e=>e instanceof Set,jL=e=>JZ(e)==="Symbol",iee=e=>e instanceof Date&&!isNaN(e.valueOf()),oee=e=>e instanceof Error,oA=e=>typeof e=="number"&&isNaN(e),see=e=>nee(e)||ZZ(e)||FL(e)||tee(e)||eee(e)||jL(e),aee=e=>typeof e=="bigint",lee=e=>e===1/0||e===-1/0,cee=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),uee=e=>e instanceof URL,$L=e=>e.replace(/\./g,"\\."),Uw=e=>e.map(String).map($L).join("."),zh=e=>{const t=[];let n="";for(let i=0;i<e.length;i++){let o=e.charAt(i);if(o==="\\"&&e.charAt(i+1)==="."){n+=".",i++;continue}if(o==="."){t.push(n),n="";continue}n+=o}const r=n;return t.push(r),t};function Yo(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var zL=[Yo(FL,"undefined",()=>null,()=>{}),Yo(aee,"bigint",e=>e.toString(),e=>typeof BigInt<"u"?BigInt(e):e),Yo(iee,"Date",e=>e.toISOString(),e=>new Date(e)),Yo(oee,"Error",(e,t)=>{const n={name:e.name,message:e.message};return t.allowedErrorProps.forEach(r=>{n[r]=e[r]}),n},(e,t)=>{const n=new Error(e.message);return n.name=e.name,n.stack=e.stack,t.allowedErrorProps.forEach(r=>{n[r]=e[r]}),n}),Yo(ree,"regexp",e=>""+e,e=>{const t=e.slice(1,e.lastIndexOf("/")),n=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,n)}),Yo(mp,"set",e=>[...e.values()],e=>new Set(e)),Yo(gp,"map",e=>[...e.entries()],e=>new Map(e)),Yo(e=>oA(e)||lee(e),"number",e=>oA(e)?"NaN":e>0?"Infinity":"-Infinity",Number),Yo(e=>e===0&&1/e===-1/0,"number",()=>"-0",Number),Yo(uee,"URL",e=>e.toString(),e=>new URL(e))];function K0(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var BL=K0((e,t)=>jL(e)?!!t.symbolRegistry.getIdentifier(e):!1,(e,t)=>["symbol",t.symbolRegistry.getIdentifier(e)],e=>e.description,(e,t,n)=>{const r=n.symbolRegistry.getValue(t[1]);if(!r)throw new Error("Trying to deserialize unknown symbol");return r}),dee=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),HL=K0(cee,e=>["typed-array",e.constructor.name],e=>[...e],(e,t)=>{const n=dee[t[1]];if(!n)throw new Error("Trying to deserialize unknown typed array");return new n(e)});function VL(e,t){return e!=null&&e.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}var WL=K0(VL,(e,t)=>["class",t.classRegistry.getIdentifier(e.constructor)],(e,t)=>{const n=t.classRegistry.getAllowedProps(e.constructor);if(!n)return{...e};const r={};return n.forEach(i=>{r[i]=e[i]}),r},(e,t,n)=>{const r=n.classRegistry.getValue(t[1]);if(!r)throw new Error("Trying to deserialize unknown class - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564");return Object.assign(Object.create(r.prototype),e)}),UL=K0((e,t)=>!!t.customTransformerRegistry.findApplicable(e),(e,t)=>["custom",t.customTransformerRegistry.findApplicable(e).name],(e,t)=>t.customTransformerRegistry.findApplicable(e).serialize(e),(e,t,n)=>{const r=n.customTransformerRegistry.findByName(t[1]);if(!r)throw new Error("Trying to deserialize unknown custom value");return r.deserialize(e)}),fee=[WL,BL,UL,HL],sA=(e,t)=>{const n=iA(fee,i=>i.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};const r=iA(zL,i=>i.isApplicable(e,t));if(r)return{value:r.transform(e,t),type:r.annotation}},GL={};zL.forEach(e=>{GL[e.annotation]=e});var hee=(e,t,n)=>{if(rl(t))switch(t[0]){case"symbol":return BL.untransform(e,t,n);case"class":return WL.untransform(e,t,n);case"custom":return UL.untransform(e,t,n);case"typed-array":return HL.untransform(e,t,n);default:throw new Error("Unknown transformation: "+t)}else{const r=GL[t];if(!r)throw new Error("Unknown transformation: "+t);return r.untransform(e,n)}},Fu=(e,t)=>{const n=e.keys();for(;t>0;)n.next(),t--;return n.next().value};function qL(e){if(sy(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(sy(e,"prototype"))throw new Error("prototype is not allowed as a property");if(sy(e,"constructor"))throw new Error("constructor is not allowed as a property")}var pee=(e,t)=>{qL(t);for(let n=0;n<t.length;n++){const r=t[n];if(mp(e))e=Fu(e,+r);else if(gp(e)){const i=+r,o=+t[++n]==0?"key":"value",s=Fu(e,i);switch(o){case"key":e=s;break;case"value":e=e.get(s);break}}else e=e[r]}return e},g_=(e,t,n)=>{if(qL(t),t.length===0)return n(e);let r=e;for(let o=0;o<t.length-1;o++){const s=t[o];if(rl(r)){const a=+s;r=r[a]}else if(pp(r))r=r[s];else if(mp(r)){const a=+s;r=Fu(r,a)}else if(gp(r)){if(o===t.length-2)break;const l=+s,c=+t[++o]==0?"key":"value",u=Fu(r,l);switch(c){case"key":r=u;break;case"value":r=r.get(u);break}}}const i=t[t.length-1];if(rl(r)?r[+i]=n(r[+i]):pp(r)&&(r[i]=n(r[i])),mp(r)){const o=Fu(r,+i),s=n(o);o!==s&&(r.delete(o),r.add(s))}if(gp(r)){const o=+t[t.length-2],s=Fu(r,o);switch(+i==0?"key":"value"){case"key":{const l=n(s);r.set(l,r.get(s)),l!==s&&r.delete(s);break}case"value":{r.set(s,n(r.get(s)));break}}}return e};function m_(e,t,n=[]){if(!e)return;if(!rl(e)){$d(e,(o,s)=>m_(o,t,[...n,...zh(s)]));return}const[r,i]=e;i&&$d(i,(o,s)=>{m_(o,t,[...n,...zh(s)])}),t(r,n)}function gee(e,t,n){return m_(t,(r,i)=>{e=g_(e,i,o=>hee(o,r,n))}),e}function mee(e,t){function n(r,i){const o=pee(e,zh(i));r.map(zh).forEach(s=>{e=g_(e,s,()=>o)})}if(rl(t)){const[r,i]=t;r.forEach(o=>{e=g_(e,zh(o),()=>e)}),i&&$d(i,n)}else $d(t,n);return e}var bee=(e,t)=>pp(e)||rl(e)||gp(e)||mp(e)||VL(e,t);function yee(e,t,n){const r=n.get(e);r?r.push(t):n.set(e,[t])}function vee(e,t){const n={};let r;return e.forEach(i=>{if(i.length<=1)return;t||(i=i.map(a=>a.map(String)).sort((a,l)=>a.length-l.length));const[o,...s]=i;o.length===0?r=s.map(Uw):n[Uw(o)]=s.map(Uw)}),r?p_(n)?[r]:[r,n]:p_(n)?void 0:n}var YL=(e,t,n,r,i=[],o=[],s=new Map)=>{const a=see(e);if(!a){yee(e,i,t);const h=s.get(e);if(h)return r?{transformedValue:null}:h}if(!bee(e,n)){const h=sA(e,n),m=h?{transformedValue:h.value,annotations:[h.type]}:{transformedValue:e};return a||s.set(e,m),m}if(sy(o,e))return{transformedValue:null};const l=sA(e,n),c=(l==null?void 0:l.value)??e,u=rl(c)?[]:{},d={};$d(c,(h,m)=>{if(m==="__proto__"||m==="constructor"||m==="prototype")throw new Error(`Detected property ${m}. This is a prototype pollution risk, please remove it from your object.`);const b=YL(h,t,n,r,[...i,m],[...o,e],s);u[m]=b.transformedValue,rl(b.annotations)?d[m]=b.annotations:pp(b.annotations)&&$d(b.annotations,(v,x)=>{d[$L(m)+"."+x]=v})});const p=p_(d)?{transformedValue:u,annotations:l?[l.type]:void 0}:{transformedValue:u,annotations:l?[l.type,d]:d};return a||s.set(e,p),p};function KL(e){return Object.prototype.toString.call(e).slice(8,-1)}function aA(e){return KL(e)==="Array"}function xee(e){if(KL(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function wee(e,t,n,r,i){const o={}.propertyIsEnumerable.call(r,t)?"enumerable":"nonenumerable";o==="enumerable"&&(e[t]=n),i&&o==="nonenumerable"&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function b_(e,t={}){if(aA(e))return e.map(i=>b_(i,t));if(!xee(e))return e;const n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertySymbols(e);return[...n,...r].reduce((i,o)=>{if(aA(t.props)&&!t.props.includes(o))return i;const s=e[o],a=b_(s,t);return wee(i,o,a,e,t.nonenumerable),i},{})}var un=class{constructor({dedupe:e=!1}={}){this.classRegistry=new YZ,this.symbolRegistry=new LL(t=>t.description??""),this.customTransformerRegistry=new QZ,this.allowedErrorProps=[],this.dedupe=e}serialize(e){const t=new Map,n=YL(e,t,this,this.dedupe),r={json:n.transformedValue};n.annotations&&(r.meta={...r.meta,values:n.annotations});const i=vee(t,this.dedupe);return i&&(r.meta={...r.meta,referentialEqualities:i}),r}deserialize(e){const{json:t,meta:n}=e;let r=b_(t);return n!=null&&n.values&&(r=gee(r,n.values,this)),n!=null&&n.referentialEqualities&&(r=mee(r,n.referentialEqualities)),r}stringify(e){return JSON.stringify(this.serialize(e))}parse(e){return this.deserialize(JSON.parse(e))}registerClass(e,t){this.classRegistry.register(e,t)}registerSymbol(e,t){this.symbolRegistry.register(e,t)}registerCustom(e,t){this.customTransformerRegistry.register({name:t,...e})}allowErrorProps(...e){this.allowedErrorProps.push(...e)}};un.defaultInstance=new un;un.serialize=un.defaultInstance.serialize.bind(un.defaultInstance);un.deserialize=un.defaultInstance.deserialize.bind(un.defaultInstance);un.stringify=un.defaultInstance.stringify.bind(un.defaultInstance);un.parse=un.defaultInstance.parse.bind(un.defaultInstance);un.registerClass=un.defaultInstance.registerClass.bind(un.defaultInstance);un.registerSymbol=un.defaultInstance.registerSymbol.bind(un.defaultInstance);un.registerCustom=un.defaultInstance.registerCustom.bind(un.defaultInstance);un.allowErrorProps=un.defaultInstance.allowErrorProps.bind(un.defaultInstance);var XL=un.serialize,See=un.stringify;function _ee(e){return e.state.fetchStatus==="fetching"?"fetching":e.getObserversCount()?e.state.fetchStatus==="paused"?"paused":e.isStale()?"stale":"fresh":"inactive"}function Cee(e,t){return`${e}${t.charAt(0).toUpperCase()+t.slice(1)}`}function Eee({queryState:e,observerCount:t,isStale:n}){return e.fetchStatus==="fetching"?"blue":t?e.fetchStatus==="paused"?"purple":n?"yellow":"green":"gray"}function Ree({status:e,isPaused:t}){return t?"purple":e==="error"?"red":e==="pending"?"yellow":e==="success"?"green":"gray"}function Pee(e){return e==="fresh"?"green":e==="stale"?"yellow":e==="paused"?"purple":e==="inactive"?"gray":"blue"}var Tee=(e,t=!1)=>{const{json:n}=XL(e);return JSON.stringify(n,null,t?2:void 0)},Xm=e=>e.state.fetchStatus!=="idle"?0:e.getObserversCount()?e.isStale()?2:1:3,Oee=(e,t)=>e.queryHash.localeCompare(t.queryHash),QL=(e,t)=>e.state.dataUpdatedAt<t.state.dataUpdatedAt?1:-1,Mee=(e,t)=>Xm(e)===Xm(t)?QL(e,t):Xm(e)>Xm(t)?1:-1,Aee={status:Mee,"query hash":Oee,"last updated":QL},Qm=e=>e.state.isPaused?0:e.state.status==="error"?2:e.state.status==="pending"?1:3,JL=(e,t)=>e.state.submittedAt<t.state.submittedAt?1:-1,Dee=(e,t)=>Qm(e)===Qm(t)?JL(e,t):Qm(e)>Qm(t)?1:-1,Iee={status:Dee,"last updated":JL},kee=e=>e*parseFloat(getComputedStyle(document.documentElement).fontSize),Nee=()=>{const[e,t]=Fn("dark");return vL(()=>{const n=window.matchMedia("(prefers-color-scheme: dark)");t(n.matches?"dark":"light");const r=i=>{t(i.matches?"dark":"light")};n.addEventListener("change",r),jd(()=>n.removeEventListener("change",r))}),e},xh=(e,t,n)=>{if(t.length===0)return n;if(e instanceof Map){const r=new Map(e);if(t.length===1)return r.set(t[0],n),r;const[i,...o]=t;return r.set(i,xh(r.get(i),o,n)),r}if(e instanceof Set){const r=xh(Array.from(e),t,n);return new Set(r)}if(Array.isArray(e)){const r=[...e];if(t.length===1)return r[t[0]]=n,r;const[i,...o]=t;return r[i]=xh(r[i],o,n),r}if(e instanceof Object){const r={...e};if(t.length===1)return r[t[0]]=n,r;const[i,...o]=t;return r[i]=xh(r[i],o,n),r}return e},wh=(e,t)=>{if(e instanceof Map){const n=new Map(e);if(t.length===1)return n.delete(t[0]),n;const[r,...i]=t;return n.set(r,wh(n.get(r),i)),n}if(e instanceof Set){const n=wh(Array.from(e),t);return new Set(n)}if(Array.isArray(e)){const n=[...e];if(t.length===1)return n.filter((o,s)=>s.toString()!==t[0]);const[r,...i]=t;return n[r]=wh(n[r],i),n}if(e instanceof Object){const n={...e};if(t.length===1)return delete n[t[0]],n;const[r,...i]=t;return n[r]=wh(n[r],i),n}return e},ZL=(e,t)=>{if(!e||document.querySelector("#_goober")||(t==null?void 0:t.querySelector("#_goober")))return;const r=document.createElement("style"),i=document.createTextNode("");r.appendChild(i),r.id="_goober",r.setAttribute("nonce",e),t?t.appendChild(r):document.head.appendChild(r)},vd,cg,ug,dg,hc,fg,xd,wd,Sd,_d,Cd,Ed,hg,I5,Lee=(I5=class{constructor(e){Ne(this,vd);Ne(this,cg);Ne(this,ug);Ne(this,dg);Ne(this,hc,!1);Ne(this,fg);Ne(this,xd);Ne(this,wd);Ne(this,Sd);Ne(this,_d);Ne(this,Cd);Ne(this,Ed);Ne(this,hg);const{client:t,queryFlavor:n,version:r,onlineManager:i,buttonPosition:o,position:s,initialIsOpen:a,errorTypes:l,styleNonce:c,shadowDOMTarget:u}=e;Pe(this,vd,Fn(t)),Pe(this,ug,n),Pe(this,dg,r),Pe(this,cg,i),Pe(this,fg,c),Pe(this,xd,u),Pe(this,wd,Fn(o)),Pe(this,Sd,Fn(s)),Pe(this,_d,Fn(a)),Pe(this,Cd,Fn(l))}setButtonPosition(e){Z(this,wd)[1](e)}setPosition(e){Z(this,Sd)[1](e)}setInitialIsOpen(e){Z(this,_d)[1](e)}setErrorTypes(e){Z(this,Cd)[1](e)}setClient(e){Z(this,vd)[1](e)}mount(e){if(Z(this,hc))throw new Error("Devtools is already mounted");const t=TL(()=>{const n=this,[r]=Z(this,wd),[i]=Z(this,Sd),[o]=Z(this,_d),[s]=Z(this,Cd),[a]=Z(this,vd);let l;return Z(this,Ed)?l=Z(this,Ed):(l=RL(()=>Promise.resolve().then(()=>require("./HO4MOOFI-XrF2yHxb.js"))),Pe(this,Ed,l)),ZL(Z(this,fg),Z(this,xd)),NE(l,LE({get queryFlavor(){return Z(n,ug)},get version(){return Z(n,dg)},get onlineManager(){return Z(n,cg)},get shadowDOMTarget(){return Z(n,xd)}},{get client(){return a()},get buttonPosition(){return r()},get position(){return i()},get initialIsOpen(){return o()},get errorTypes(){return s()}}))},e);Pe(this,hc,!0),Pe(this,hg,t)}unmount(){var e;if(!Z(this,hc))throw new Error("Devtools is not mounted");(e=Z(this,hg))==null||e.call(this),Pe(this,hc,!1)}},vd=new WeakMap,cg=new WeakMap,ug=new WeakMap,dg=new WeakMap,hc=new WeakMap,fg=new WeakMap,xd=new WeakMap,wd=new WeakMap,Sd=new WeakMap,_d=new WeakMap,Cd=new WeakMap,Ed=new WeakMap,hg=new WeakMap,I5),Rd,pg,gg,mg,pc,bg,Pd,Td,Od,Md,Ad,Dd,Id,yg,k5,Fee=(k5=class{constructor(e){Ne(this,Rd);Ne(this,pg);Ne(this,gg);Ne(this,mg);Ne(this,pc,!1);Ne(this,bg);Ne(this,Pd);Ne(this,Td);Ne(this,Od);Ne(this,Md);Ne(this,Ad);Ne(this,Dd);Ne(this,Id);Ne(this,yg);const{client:t,queryFlavor:n,version:r,onlineManager:i,buttonPosition:o,position:s,initialIsOpen:a,errorTypes:l,styleNonce:c,shadowDOMTarget:u,onClose:d}=e;Pe(this,Rd,Fn(t)),Pe(this,gg,n),Pe(this,mg,r),Pe(this,pg,i),Pe(this,bg,c),Pe(this,Pd,u),Pe(this,Td,Fn(o)),Pe(this,Od,Fn(s)),Pe(this,Md,Fn(a)),Pe(this,Ad,Fn(l)),Pe(this,Dd,Fn(d))}setButtonPosition(e){Z(this,Td)[1](e)}setPosition(e){Z(this,Od)[1](e)}setInitialIsOpen(e){Z(this,Md)[1](e)}setErrorTypes(e){Z(this,Ad)[1](e)}setClient(e){Z(this,Rd)[1](e)}setOnClose(e){Z(this,Dd)[1](()=>e)}mount(e){if(Z(this,pc))throw new Error("Devtools is already mounted");const t=TL(()=>{const n=this,[r]=Z(this,Td),[i]=Z(this,Od),[o]=Z(this,Md),[s]=Z(this,Ad),[a]=Z(this,Rd),[l]=Z(this,Dd);let c;return Z(this,Id)?c=Z(this,Id):(c=RL(()=>Promise.resolve().then(()=>require("./HUY7CZI3-BZLAkw5U.js"))),Pe(this,Id,c)),ZL(Z(this,bg),Z(this,Pd)),NE(c,LE({get queryFlavor(){return Z(n,gg)},get version(){return Z(n,mg)},get onlineManager(){return Z(n,pg)},get shadowDOMTarget(){return Z(n,Pd)}},{get client(){return a()},get buttonPosition(){return r()},get position(){return i()},get initialIsOpen(){return o()},get errorTypes(){return s()},get onClose(){return l()}}))},e);Pe(this,pc,!0),Pe(this,yg,t)}unmount(){var e;if(!Z(this,pc))throw new Error("Devtools is not mounted");(e=Z(this,yg))==null||e.call(this),Pe(this,pc,!1)}},Rd=new WeakMap,pg=new WeakMap,gg=new WeakMap,mg=new WeakMap,pc=new WeakMap,bg=new WeakMap,Pd=new WeakMap,Td=new WeakMap,Od=new WeakMap,Md=new WeakMap,Ad=new WeakMap,Dd=new WeakMap,Id=new WeakMap,yg=new WeakMap,k5);function jee(e){const t=wg(e.client),n=E.useRef(null),{buttonPosition:r,position:i,initialIsOpen:o,errorTypes:s,styleNonce:a,shadowDOMTarget:l}=e,[c]=E.useState(new Lee({client:t,queryFlavor:"React Query",version:"5",onlineManager:Fd,buttonPosition:r,position:i,initialIsOpen:o,errorTypes:s,styleNonce:a,shadowDOMTarget:l}));return E.useEffect(()=>{c.setClient(t)},[t,c]),E.useEffect(()=>{r&&c.setButtonPosition(r)},[r,c]),E.useEffect(()=>{i&&c.setPosition(i)},[i,c]),E.useEffect(()=>{c.setInitialIsOpen(o||!1)},[o,c]),E.useEffect(()=>{c.setErrorTypes(s||[])},[s,c]),E.useEffect(()=>(n.current&&c.mount(n.current),()=>{c.unmount()}),[c]),y.jsx("div",{className:"tsqd-parent-container",ref:n})}function $ee(e){const t=wg(e.client),n=E.useRef(null),{errorTypes:r,styleNonce:i,shadowDOMTarget:o}=e,[s]=E.useState(new Fee({client:t,queryFlavor:"React Query",version:"5",onlineManager:Fd,buttonPosition:"bottom-left",position:"bottom",initialIsOpen:!0,errorTypes:r,styleNonce:i,shadowDOMTarget:o,onClose:e.onClose}));return E.useEffect(()=>{s.setClient(t)},[t,s]),E.useEffect(()=>{s.setOnClose(e.onClose??(()=>{}))},[e.onClose,s]),E.useEffect(()=>{s.setErrorTypes(r||[])},[r,s]),E.useEffect(()=>(n.current&&s.mount(n.current),()=>{s.unmount()}),[s]),y.jsx("div",{style:{height:"500px",...e.style},className:"tsqd-parent-container",ref:n})}var zee=process.env.NODE_ENV!=="development"?function(){return null}:jee;process.env.NODE_ENV;function Bee(){const e=P.useContext(AE);if(e&&e.isSemaphorClient)return e}function e4({children:e}){const{setIsSessionExpired:t}=hr(),n=Bee(),[r]=P.useState(()=>{const i=new kJ({queryCache:new fL({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.jsxs(jJ,{client:r,children:[e,y.jsx(zee,{initialIsOpen:!1})]})}const Kc=P.forwardRef(({children:e,className:t,...n},r)=>y.jsx("div",{className:be("semaphor-scope",t),ref:r,...n,children:e})),Hee={id:"",authToken:void 0},t4=P.createContext(Hee),n4=({children:e,dashboardProps:t})=>y.jsx(e4,{children:y.jsx(t4.Provider,{value:t,children:y.jsx(Kc,{style:{height:"100%"},children:e})})});function vo(){const e=P.useContext(t4);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function Vee(){const{authToken:e,version:t}=vo(),n=ve(a=>a.selectedLensId),{data:r,isLoading:i,isFetching:o,isError:s}=Sg({queryKey:["dashboard",n,e==null?void 0:e.accessToken],queryFn:()=>NQ(e==null?void 0:e.accessToken,{lensId:n,version:t})});return{data:r,isLoading:i,isFetching:o,isError:s}}function r4(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function lA(e,t){const n=r4(e);return n==="dark"?gc.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function Wee({customStyle:e,currentTheme:t,onSave:n,onEvent:r,defaultFilterValues:i,onFilterValuesChange:o}){const{authToken:s}=vo(),a=ve(F=>F.selectedLensId),{data:l,isLoading:c,isFetching:u,isError:d}=Vee(),[p,h]=P.useState(i||[]),{theme:m,setTheme:b}=iL(),v=ve(F=>F.dashboard.globalStyle),{setDashboard:x,setDashboardWithFilterValues:w,setSelectedSheetId:_,setStyle:R,setOnSaveFunction:C,setLenses:T,setSelectedLensId:M,setInitStore:I}=ve(F=>F.actions);ve(F=>F.actions.setCustomCards);const k=ve(F=>F.actions.setFilterValues),L=ve(F=>F.filterValues),j=ve(F=>F.actions.setThemeStyle),$=ve(F=>F.actions.setDashboardTheme),X=ve(F=>F.actions.setOnEvent);P.useEffect(()=>{s&&I()},[s,I]),P.useEffect(()=>{if(m){const F=r4(m);$(F)}},[m,$]),P.useEffect(()=>{t&&b(t)},[t,b]);const H=P.useCallback(()=>{const F=gc.cloneDeep(Ty),G=gc.merge(F,v);if(e){const B=gc.merge(G,e),W=lA(m,B);j(W),R(B)}else{const B=lA(m,G);j(B),R(Ty)}},[m,e,v,j,R]);return P.useEffect(()=>{l&&l.dashboard&&H()},[m,e,v,H,l]),P.useEffect(()=>{var Y,U;function F(A,te){const q=A.filters||[],se=[];for(const J of te){const ee=q.find(ae=>ae.id===J.filterId);ee&&se.push({filterId:J.filterId,connectionType:ee.database==="NA"?"api":"database",name:ee.column,operation:ee.operation,valueType:Gu(ee),values:J.values})}return se}if(!l||!l.dashboard)return;const{dashboard:G,filterValues:B,defaultLensId:W,lenses:K}=l,D=F(G,p||[]);w(G,(!B||(B==null?void 0:B.length)===0?D:B)||[]),W&&M(W),K&&T(K),_(((U=(Y=G==null?void 0:G.sheets)==null?void 0:Y[0])==null?void 0:U.id)||null)},[l,x,_,k,a,T,w,M,p]),P.useEffect(()=>{o&&L&&o(L)},[L,o]),P.useEffect(()=>{n&&C(n),r&&X(r)},[n,C,r,X]),{isFetching:u,isLoading:c,isError:d}}function Yu({className:e,...t}){return y.jsx("div",{className:be("animate-pulse rounded-md bg-muted",e),...t})}const i4=E.forwardRef(({className:e,...t},n)=>y.jsx("div",{ref:n,className:be("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));i4.displayName="Card";const X0=E.forwardRef(({className:e,...t},n)=>y.jsx("div",{ref:n,className:be("flex flex-col space-y-1.5 p-6",e),...t}));X0.displayName="CardHeader";const df=E.forwardRef(({className:e,...t},n)=>y.jsx("h3",{ref:n,className:be("text-2xl font-semibold leading-none tracking-tight",e),...t}));df.displayName="CardTitle";const FE=E.forwardRef(({className:e,...t},n)=>y.jsx("p",{ref:n,className:be("text-sm text-muted-foreground",e),...t}));FE.displayName="CardDescription";const Q0=E.forwardRef(({className:e,...t},n)=>y.jsx("div",{ref:n,className:be("px-6 pt-0",e),...t}));Q0.displayName="CardContent";const o4=E.forwardRef(({className:e,...t},n)=>y.jsx("div",{ref:n,className:be("flex items-center p-6 pt-0",e),...t}));o4.displayName="CardFooter";function s4({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}){ve(T=>T.selectedSheetId);const{placeholders:v}=vo(),x=ve(T=>T.themeStyle),w=ve(T=>T.isSessionExpired),{isLoading:_,isError:R,isFetching:C}=Wee({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(Yu,{className:"h-1 w-full dark:h-[2px]"})})):R?(r==null||r({type:"error",message:"Error fetching dashboard"}),o?(console.log("Error fetching dashboard"),y.jsx(o,{})):y.jsx("div",{children:"Error"})):w?(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(df,{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 Uee(e,t){const n=E.createContext(t),r=o=>{const{children:s,...a}=o,l=E.useMemo(()=>a,Object.values(a));return y.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function i(o){const s=E.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 or(e,t=[]){let n=[];function r(o,s){const a=E.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=E.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=E.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=>E.createContext(s));return function(a){const l=(a==null?void 0:a[e])||o;return E.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,Gee(i,...t)]}function Gee(...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 E.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function cA(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function J0(...e){return t=>{let n=!1;const r=e.map(i=>{const o=cA(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():cA(e[i],null)}}}}function rt(...e){return E.useCallback(J0(...e),e)}var ca=E.forwardRef((e,t)=>{const{children:n,...r}=e,i=E.Children.toArray(n),o=i.find(qee);if(o){const s=o.props.children,a=i.map(l=>l===o?E.Children.count(s)>1?E.Children.only(null):E.isValidElement(s)?s.props.children:null:l);return y.jsx(y_,{...r,ref:t,children:E.isValidElement(s)?E.cloneElement(s,void 0,a):null})}return y.jsx(y_,{...r,ref:t,children:n})});ca.displayName="Slot";var y_=E.forwardRef((e,t)=>{const{children:n,...r}=e;if(E.isValidElement(n)){const i=Kee(n);return E.cloneElement(n,{...Yee(r,n.props),ref:t?J0(t,i):i})}return E.Children.count(n)>1?E.Children.only(null):null});y_.displayName="SlotClone";var jE=({children:e})=>y.jsx(y.Fragment,{children:e});function qee(e){return E.isValidElement(e)&&e.type===jE}function Yee(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 Kee(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 Z0(e){const t=e+"CollectionProvider",[n,r]=or(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),w=rt(m,x.collectionRef);return y.jsx(ca,{ref:w,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,w=P.useRef(null),_=rt(m,w),R=o(c,b);return P.useEffect(()=>(R.itemMap.set(w,{ref:w,...x}),()=>void R.itemMap.delete(w))),y.jsx(ca,{[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((R,C)=>x.indexOf(R.ref.current)-x.indexOf(C.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:s,Slot:l,ItemSlot:d},p,r]}var Sr=globalThis!=null&&globalThis.document?E.useLayoutEffect:()=>{},Xee=E.useId||(()=>{}),Qee=0;function Qn(e){const[t,n]=E.useState(Xee());return Sr(()=>{e||n(r=>r??String(Qee++))},[e]),e||(t?`radix-${t}`:"")}var Jee=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Fe=Jee.reduce((e,t)=>{const n=E.forwardRef((r,i)=>{const{asChild:o,...s}=r,a=o?ca: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 a4(e,t){e&&Mc.flushSync(()=>e.dispatchEvent(t))}function ir(e){const t=E.useRef(e);return E.useEffect(()=>{t.current=e}),E.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function $r({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=Zee({defaultProp:t,onChange:n}),o=e!==void 0,s=o?e:r,a=ir(n),l=E.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 Zee({defaultProp:e,onChange:t}){const n=E.useState(e),[r]=n,i=E.useRef(r),o=ir(t);return E.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}var ete=E.createContext(void 0);function Xc(e){const t=E.useContext(ete);return e||t||"ltr"}var Gw="rovingFocusGroup.onEntryFocus",tte={bubbles:!1,cancelable:!0},ev="RovingFocusGroup",[v_,l4,nte]=Z0(ev),[rte,ff]=or(ev,[nte]),[ite,ote]=rte(ev),c4=E.forwardRef((e,t)=>y.jsx(v_.Provider,{scope:e.__scopeRovingFocusGroup,children:y.jsx(v_.Slot,{scope:e.__scopeRovingFocusGroup,children:y.jsx(ste,{...e,ref:t})})}));c4.displayName=ev;var ste=E.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=E.useRef(null),h=rt(t,p),m=Xc(o),[b=null,v]=$r({prop:s,defaultProp:a,onChange:l}),[x,w]=E.useState(!1),_=ir(c),R=l4(n),C=E.useRef(!1),[T,M]=E.useState(0);return E.useEffect(()=>{const I=p.current;if(I)return I.addEventListener(Gw,_),()=>I.removeEventListener(Gw,_)},[_]),y.jsx(ite,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:b,onItemFocus:E.useCallback(I=>v(I),[v]),onItemShiftTab:E.useCallback(()=>w(!0),[]),onFocusableItemAdd:E.useCallback(()=>M(I=>I+1),[]),onFocusableItemRemove:E.useCallback(()=>M(I=>I-1),[]),children:y.jsx(Fe.div,{tabIndex:x||T===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,I=>{const k=!C.current;if(I.target===I.currentTarget&&k&&!x){const L=new CustomEvent(Gw,tte);if(I.currentTarget.dispatchEvent(L),!L.defaultPrevented){const j=R().filter(G=>G.focusable),$=j.find(G=>G.active),X=j.find(G=>G.id===b),F=[$,X,...j].filter(Boolean).map(G=>G.ref.current);f4(F,u)}}C.current=!1}),onBlur:Re(e.onBlur,()=>w(!1))})})}),u4="RovingFocusGroupItem",d4=E.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,...s}=e,a=Qn(),l=o||a,c=ote(u4,n),u=c.currentTabStopId===l,d=l4(n),{onFocusableItemAdd:p,onFocusableItemRemove:h}=c;return E.useEffect(()=>{if(r)return p(),()=>h()},[r,p,h]),y.jsx(v_.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:y.jsx(Fe.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=cte(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(w=>w.focusable).map(w=>w.ref.current);if(b==="last")x.reverse();else if(b==="prev"||b==="next"){b==="prev"&&x.reverse();const w=x.indexOf(m.currentTarget);x=c.loop?ute(x,w+1):x.slice(w+1)}setTimeout(()=>f4(x))}})})})});d4.displayName=u4;var ate={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function lte(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function cte(e,t,n){const r=lte(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return ate[r]}function f4(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function ute(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var $E=c4,zE=d4;function dte(e,t){return E.useReducer((n,r)=>t[n][r]??n,e)}var Jn=e=>{const{present:t,children:n}=e,r=fte(t),i=typeof n=="function"?n({present:r.isPresent}):E.Children.only(n),o=rt(r.ref,hte(i));return typeof n=="function"||r.isPresent?E.cloneElement(i,{ref:o}):null};Jn.displayName="Presence";function fte(e){const[t,n]=E.useState(),r=E.useRef({}),i=E.useRef(e),o=E.useRef("none"),s=e?"mounted":"unmounted",[a,l]=dte(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return E.useEffect(()=>{const c=Jm(r.current);o.current=a==="mounted"?c:"none"},[a]),Sr(()=>{const c=r.current,u=i.current;if(u!==e){const p=o.current,h=Jm(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]),Sr(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,d=h=>{const b=Jm(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=Jm(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:E.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Jm(e){return(e==null?void 0:e.animationName)||"none"}function hte(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 BE="Tabs",[pte,oIe]=or(BE,[ff]),h4=ff(),[gte,HE]=pte(BE),p4=E.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=Xc(a),[d,p]=$r({prop:r,onChange:i,defaultProp:o});return y.jsx(gte,{scope:n,baseId:Qn(),value:d,onValueChange:p,orientation:s,dir:u,activationMode:l,children:y.jsx(Fe.div,{dir:u,"data-orientation":s,...c,ref:t})})});p4.displayName=BE;var g4="TabsList",m4=E.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=HE(g4,n),s=h4(n);return y.jsx($E,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:r,children:y.jsx(Fe.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});m4.displayName=g4;var b4="TabsTrigger",y4=E.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,s=HE(b4,n),a=h4(n),l=w4(s.baseId,r),c=S4(s.baseId,r),u=r===s.value;return y.jsx(zE,{asChild:!0,...a,focusable:!i,active:u,children:y.jsx(Fe.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)})})})});y4.displayName=b4;var v4="TabsContent",x4=E.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...s}=e,a=HE(v4,n),l=w4(a.baseId,r),c=S4(a.baseId,r),u=r===a.value,d=E.useRef(u);return E.useEffect(()=>{const p=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(p)},[]),y.jsx(Jn,{present:i||u,children:({present:p})=>y.jsx(Fe.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})})});x4.displayName=v4;function w4(e,t){return`${e}-trigger-${t}`}function S4(e,t){return`${e}-content-${t}`}var mte=p4,_4=m4,C4=y4,E4=x4;const VE=mte,tv=E.forwardRef(({className:e,...t},n)=>y.jsx(_4,{ref:n,className:be("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));tv.displayName=_4.displayName;const nv=E.forwardRef(({className:e,...t},n)=>y.jsx(C4,{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}));nv.displayName=C4.displayName;const WE=E.forwardRef(({className:e,...t},n)=>y.jsx(E4,{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}));WE.displayName=E4.displayName;var R4={exports:{}},_g={},x_={exports:{}};(function(e,t){(function(n,r){r(t)})(La,function(n){function r(ee){return function(ce,ge,oe,pe,de,Ee,De){return ee(ce,ge,De)}}function i(ee){return function(ce,ge,oe,pe){if(!ce||!ge||typeof ce!="object"||typeof ge!="object")return ee(ce,ge,oe,pe);var de=pe.get(ce),Ee=pe.get(ge);if(de&&Ee)return de===ge&&Ee===ce;pe.set(ce,ge),pe.set(ge,ce);var De=ee(ce,ge,oe,pe);return pe.delete(ce),pe.delete(ge),De}}function o(ee,ae){var ce={};for(var ge in ee)ce[ge]=ee[ge];for(var ge in ae)ce[ge]=ae[ge];return ce}function s(ee){return ee.constructor===Object||ee.constructor==null}function a(ee){return typeof ee.then=="function"}function l(ee,ae){return ee===ae||ee!==ee&&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]",w=Object.prototype.toString;function _(ee){var ae=ee.areArraysEqual,ce=ee.areDatesEqual,ge=ee.areMapsEqual,oe=ee.areObjectsEqual,pe=ee.areRegExpsEqual,de=ee.areSetsEqual,Ee=ee.createIsNestedEqual,De=Ee(ze);function ze(Oe,Be,vt){if(Oe===Be)return!0;if(!Oe||!Be||typeof Oe!="object"||typeof Be!="object")return Oe!==Oe&&Be!==Be;if(s(Oe)&&s(Be))return oe(Oe,Be,De,vt);var Mt=Array.isArray(Oe),xn=Array.isArray(Be);if(Mt||xn)return Mt===xn&&ae(Oe,Be,De,vt);var At=w.call(Oe);return At!==w.call(Be)?!1:At===d?ce(Oe,Be,De,vt):At===p?pe(Oe,Be,De,vt):At===h?ge(Oe,Be,De,vt):At===v?de(Oe,Be,De,vt):At===b||At===c?a(Oe)||a(Be)?!1:oe(Oe,Be,De,vt):At===u||At===m||At===x?l(Oe.valueOf(),Be.valueOf()):!1}return ze}function R(ee,ae,ce,ge){var oe=ee.length;if(ae.length!==oe)return!1;for(;oe-- >0;)if(!ce(ee[oe],ae[oe],oe,oe,ee,ae,ge))return!1;return!0}var C=i(R);function T(ee,ae){return l(ee.valueOf(),ae.valueOf())}function M(ee,ae,ce,ge){var oe=ee.size===ae.size;if(!oe)return!1;if(!ee.size)return!0;var pe={},de=0;return ee.forEach(function(Ee,De){if(oe){var ze=!1,Oe=0;ae.forEach(function(Be,vt){!ze&&!pe[Oe]&&(ze=ce(De,vt,de,Oe,ee,ae,ge)&&ce(Ee,Be,De,vt,ee,ae,ge))&&(pe[Oe]=!0),Oe++}),de++,oe=ze}}),oe}var I=i(M),k="_owner",L=Object.prototype.hasOwnProperty;function j(ee,ae,ce,ge){var oe=Object.keys(ee),pe=oe.length;if(Object.keys(ae).length!==pe)return!1;for(var de;pe-- >0;){if(de=oe[pe],de===k){var Ee=!!ee.$$typeof,De=!!ae.$$typeof;if((Ee||De)&&Ee!==De)return!1}if(!L.call(ae,de)||!ce(ee[de],ae[de],de,de,ee,ae,ge))return!1}return!0}var $=i(j);function X(ee,ae){return ee.source===ae.source&&ee.flags===ae.flags}function H(ee,ae,ce,ge){var oe=ee.size===ae.size;if(!oe)return!1;if(!ee.size)return!0;var pe={};return ee.forEach(function(de,Ee){if(oe){var De=!1,ze=0;ae.forEach(function(Oe,Be){!De&&!pe[ze]&&(De=ce(de,Oe,Ee,Be,ee,ae,ge))&&(pe[ze]=!0),ze++}),oe=De}}),oe}var F=i(H),G=Object.freeze({areArraysEqual:R,areDatesEqual:T,areMapsEqual:M,areObjectsEqual:j,areRegExpsEqual:X,areSetsEqual:H,createIsNestedEqual:r}),B=Object.freeze({areArraysEqual:C,areDatesEqual:T,areMapsEqual:I,areObjectsEqual:$,areRegExpsEqual:X,areSetsEqual:F,createIsNestedEqual:r}),W=_(G);function K(ee,ae){return W(ee,ae,void 0)}var D=_(o(G,{createIsNestedEqual:function(){return l}}));function Y(ee,ae){return D(ee,ae,void 0)}var U=_(B);function A(ee,ae){return U(ee,ae,new WeakMap)}var te=_(o(B,{createIsNestedEqual:function(){return l}}));function q(ee,ae){return te(ee,ae,new WeakMap)}function se(ee){return _(o(G,ee(G)))}function J(ee){var ae=_(o(B,ee(B)));return function(ce,ge,oe){return oe===void 0&&(oe=new WeakMap),ae(ce,ge,oe)}}n.circularDeepEqual=A,n.circularShallowEqual=q,n.createCustomCircularEqual=J,n.createCustomEqual=se,n.deepEqual=K,n.sameValueZeroEqual=l,n.shallowEqual=Y,Object.defineProperty(n,"__esModule",{value:!0})})})(x_,x_.exports);var UE=x_.exports;const GE=bE(GX);var Et={},bte=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(Et,"__esModule",{value:!0});Et.bottom=qE;Et.childrenEqual=wte;Et.cloneLayout=P4;Et.cloneLayoutItem=mc;Et.collides=rv;Et.compact=O4;Et.compactItem=M4;Et.compactType=kte;Et.correctBounds=A4;Et.fastPositionEqual=Ste;Et.fastRGLPropsEqual=void 0;Et.getAllCollisions=D4;Et.getFirstCollision=Jl;Et.getLayoutItem=YE;Et.getStatics=KE;Et.modifyLayout=T4;Et.moveElement=_h;Et.moveElementAwayFromCollision=S_;Et.noop=void 0;Et.perc=Cte;Et.resizeItemInDirection=Mte;Et.setTopLeft=Dte;Et.setTransform=Ate;Et.sortLayoutItems=tR;Et.sortLayoutItemsByColRow=F4;Et.sortLayoutItemsByRowCol=L4;Et.synchronizeLayoutWithChildren=Ite;Et.validateLayout=j4;Et.withLayoutItem=xte;var uA=UE,Sh=yte(P);function yte(e){return e&&e.__esModule?e:{default:e}}const vte=process.env.NODE_ENV==="production";function qE(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 P4(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=mc(e[n]);return t}function T4(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 xte(e,t,n){let r=YE(e,t);return r?(r=n(mc(r)),e=T4(e,r),[e,r]):[e,null]}function mc(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 wte(e,t){return(0,uA.deepEqual)(Sh.default.Children.map(e,n=>n==null?void 0:n.key),Sh.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,uA.deepEqual)(Sh.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),Sh.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}Et.fastRGLPropsEqual=bte;function Ste(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function rv(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 O4(e,t,n,r){const i=KE(e),o=tR(e,t),s=Array(e.length);for(let a=0,l=o.length;a<l;a++){let c=mc(o[a]);c.static||(c=M4(i,c,t,n,o,r),i.push(c)),s[e.indexOf(o[a])]=c,c.moved=!1}return s}const _te={x:"w",y:"h"};function w_(e,t,n,r){const i=_te[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;rv(t,a)&&w_(e,a,n+t[i],r)}}t[r]=n}function M4(e,t,n,r,i,o){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(qE(e),t.y);t.y>0&&!Jl(e,t);)t.y--;else if(a)for(;t.x>0&&!Jl(e,t);)t.x--;let l;for(;(l=Jl(e,t))&&!(n===null&&o);)if(a?w_(i,t,l.x+l.w,"x"):w_(i,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!Jl(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function A4(e,t){const n=KE(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(;Jl(n,o);)o.y++}return e}function YE(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function Jl(e,t){for(let n=0,r=e.length;n<r;n++)if(rv(e[n],t))return e[n]}function D4(e,t){return e.filter(n=>rv(n,t))}function KE(e){return e.filter(t=>t.static)}function _h(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=tR(e,s);(s==="vertical"&&typeof r=="number"?u>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(d=d.reverse());const h=D4(d,t),m=h.length>0;if(m&&l)return P4(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=S_(e,x,t,i,s):e=S_(e,t,x,i,s))}return e}function S_(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=Jl(e,d),h=p&&p.y+p.h>t.y,m=p&&t.x+t.w>p.x;if(p){if(h&&a)return _h(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 _h(e,t,n.x,void 0,r,l,i)}else return`${n.i}${d.x}${d.y}`,_h(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:_h(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,i)}function Cte(e){return e*100+"%"}const I4=(e,t,n,r)=>e+n>r?t:n,k4=(e,t,n)=>e<0?t:n,N4=e=>Math.max(0,e),XE=e=>Math.max(0,e),QE=(e,t,n)=>{let{left:r,height:i,width:o}=t;const s=e.top-(i-e.height);return{left:r,width:o,height:k4(s,e.height,i),top:XE(s)}},JE=(e,t,n)=>{let{top:r,left:i,height:o,width:s}=t;return{top:r,height:o,width:I4(e.left,e.width,s,n),left:N4(i)}},ZE=(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:I4(e.left,e.width,o,n),top:XE(r),left:N4(s)}},eR=(e,t,n)=>{let{top:r,left:i,height:o,width:s}=t;return{width:s,left:i,height:k4(r,e.height,o),top:XE(r)}},Ete=function(){return QE(arguments.length<=0?void 0:arguments[0],JE(...arguments))},Rte=function(){return QE(arguments.length<=0?void 0:arguments[0],ZE(...arguments))},Pte=function(){return eR(arguments.length<=0?void 0:arguments[0],JE(...arguments))},Tte=function(){return eR(arguments.length<=0?void 0:arguments[0],ZE(...arguments))},Ote={n:QE,ne:Ete,e:JE,se:Pte,s:eR,sw:Tte,w:ZE,nw:Rte};function Mte(e,t,n,r){const i=Ote[e];return i?i(t,{...t,...n},r):n}function Ate(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 Dte(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 tR(e,t){return t==="horizontal"?F4(e):t==="vertical"?L4(e):e}function L4(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 F4(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 Ite(e,t,n,r,i){e=e||[];const o=[];Sh.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=YE(e,String(a.key)),c=a.props["data-grid"];l&&c==null?o.push(mc(l)):c?(vte||j4([c],"ReactGridLayout.children"),o.push(mc({...c,i:a.key}))):o.push(mc({w:1,h:1,x:0,y:qE(o),i:String(a.key)}))});const s=A4(o,{cols:n});return i?s:O4(s,r,n)}function j4(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 kte(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const Nte=()=>{};Et.noop=Nte;var _s={};Object.defineProperty(_s,"__esModule",{value:!0});_s.calcGridColWidth=iv;_s.calcGridItemPosition=Lte;_s.calcGridItemWHPx=__;_s.calcWH=jte;_s.calcXY=Fte;_s.clamp=Zl;function iv(e){const{margin:t,containerPadding:n,containerWidth:r,cols:i}=e;return(r-t[0]*(i-1)-n[0]*2)/i}function __(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function Lte(e,t,n,r,i,o){const{margin:s,containerPadding:a,rowHeight:l}=e,c=iv(e),u={};return o&&o.resizing?(u.width=Math.round(o.resizing.width),u.height=Math.round(o.resizing.height)):(u.width=__(r,c,s[0]),u.height=__(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 Fte(e,t,n,r,i){const{margin:o,containerPadding:s,cols:a,rowHeight:l,maxRows:c}=e,u=iv(e);let d=Math.round((n-s[0])/(u+o[0])),p=Math.round((t-s[1])/(l+o[1]));return d=Zl(d,0,a-r),p=Zl(p,0,c-i),{x:d,y:p}}function jte(e,t,n,r,i,o){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,u=iv(e);let d=Math.round((t+s[0])/(u+s[0])),p=Math.round((n+s[1])/(c+s[1])),h=Zl(d,0,l-r),m=Zl(p,0,a-i);return["sw","w","nw"].indexOf(o)!==-1&&(h=Zl(d,0,l)),["nw","n","ne"].indexOf(o)!==-1&&(m=Zl(p,0,a)),{w:h,h:m}}function Zl(e,t,n){return Math.max(Math.min(e,n),t)}var ov={},C_={exports:{}},Zm={exports:{}},Xt={};/** @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 dA;function $te(){if(dA)return Xt;dA=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,w=e?Symbol.for("react.scope"):60119;function _(C){if(typeof C=="object"&&C!==null){var T=C.$$typeof;switch(T){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 T}}case n:return T}}}function R(C){return _(C)===c}return Xt.AsyncMode=l,Xt.ConcurrentMode=c,Xt.ContextConsumer=a,Xt.ContextProvider=s,Xt.Element=t,Xt.ForwardRef=u,Xt.Fragment=r,Xt.Lazy=m,Xt.Memo=h,Xt.Portal=n,Xt.Profiler=o,Xt.StrictMode=i,Xt.Suspense=d,Xt.isAsyncMode=function(C){return R(C)||_(C)===l},Xt.isConcurrentMode=R,Xt.isContextConsumer=function(C){return _(C)===a},Xt.isContextProvider=function(C){return _(C)===s},Xt.isElement=function(C){return typeof C=="object"&&C!==null&&C.$$typeof===t},Xt.isForwardRef=function(C){return _(C)===u},Xt.isFragment=function(C){return _(C)===r},Xt.isLazy=function(C){return _(C)===m},Xt.isMemo=function(C){return _(C)===h},Xt.isPortal=function(C){return _(C)===n},Xt.isProfiler=function(C){return _(C)===o},Xt.isStrictMode=function(C){return _(C)===i},Xt.isSuspense=function(C){return _(C)===d},Xt.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===w||C.$$typeof===b)},Xt.typeOf=_,Xt}var Qt={};/** @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 fA;function zte(){return fA||(fA=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,w=e?Symbol.for("react.scope"):60119;function _(oe){return typeof oe=="string"||typeof oe=="function"||oe===r||oe===c||oe===o||oe===i||oe===d||oe===p||typeof oe=="object"&&oe!==null&&(oe.$$typeof===m||oe.$$typeof===h||oe.$$typeof===s||oe.$$typeof===a||oe.$$typeof===u||oe.$$typeof===v||oe.$$typeof===x||oe.$$typeof===w||oe.$$typeof===b)}function R(oe){if(typeof oe=="object"&&oe!==null){var pe=oe.$$typeof;switch(pe){case t:var de=oe.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 pe}}case n:return pe}}}var C=l,T=c,M=a,I=s,k=t,L=u,j=r,$=m,X=h,H=n,F=o,G=i,B=d,W=!1;function K(oe){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.")),D(oe)||R(oe)===l}function D(oe){return R(oe)===c}function Y(oe){return R(oe)===a}function U(oe){return R(oe)===s}function A(oe){return typeof oe=="object"&&oe!==null&&oe.$$typeof===t}function te(oe){return R(oe)===u}function q(oe){return R(oe)===r}function se(oe){return R(oe)===m}function J(oe){return R(oe)===h}function ee(oe){return R(oe)===n}function ae(oe){return R(oe)===o}function ce(oe){return R(oe)===i}function ge(oe){return R(oe)===d}Qt.AsyncMode=C,Qt.ConcurrentMode=T,Qt.ContextConsumer=M,Qt.ContextProvider=I,Qt.Element=k,Qt.ForwardRef=L,Qt.Fragment=j,Qt.Lazy=$,Qt.Memo=X,Qt.Portal=H,Qt.Profiler=F,Qt.StrictMode=G,Qt.Suspense=B,Qt.isAsyncMode=K,Qt.isConcurrentMode=D,Qt.isContextConsumer=Y,Qt.isContextProvider=U,Qt.isElement=A,Qt.isForwardRef=te,Qt.isFragment=q,Qt.isLazy=se,Qt.isMemo=J,Qt.isPortal=ee,Qt.isProfiler=ae,Qt.isStrictMode=ce,Qt.isSuspense=ge,Qt.isValidElementType=_,Qt.typeOf=R}()),Qt}var hA;function $4(){return hA||(hA=1,process.env.NODE_ENV==="production"?Zm.exports=$te():Zm.exports=zte()),Zm.exports}/*
|
|
106
|
+
object-assign
|
|
107
|
+
(c) Sindre Sorhus
|
|
108
|
+
@license MIT
|
|
109
|
+
*/var qw,pA;function Bte(){if(pA)return qw;pA=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 qw=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},qw}var Yw,gA;function nR(){if(gA)return Yw;gA=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Yw=e,Yw}var Kw,mA;function z4(){return mA||(mA=1,Kw=Function.call.bind(Object.prototype.hasOwnProperty)),Kw}var Xw,bA;function Hte(){if(bA)return Xw;bA=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=nR(),n={},r=z4();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={})},Xw=i,Xw}var Qw,yA;function Vte(){if(yA)return Qw;yA=1;var e=$4(),t=Bte(),n=nR(),r=z4(),i=Hte(),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 Qw=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function d(D){var Y=D&&(c&&D[c]||D[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:w(),arrayOf:_,element:R(),elementType:C(),instanceOf:T,node:L(),objectOf:I,oneOf:M,oneOfType:k,shape:$,exact:X};function m(D,Y){return D===Y?D!==0||1/D===1/Y:D!==D&&Y!==Y}function b(D,Y){this.message=D,this.data=Y&&typeof Y=="object"?Y:{},this.stack=""}b.prototype=Error.prototype;function v(D){if(process.env.NODE_ENV!=="production")var Y={},U=0;function A(q,se,J,ee,ae,ce,ge){if(ee=ee||p,ce=ce||J,ge!==n){if(l){var oe=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 oe.name="Invariant Violation",oe}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var pe=ee+":"+J;!Y[pe]&&U<3&&(o("You are manually calling a React.PropTypes validation function for the `"+ce+"` prop on `"+ee+"`. 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[pe]=!0,U++)}}return se[J]==null?q?se[J]===null?new b("The "+ae+" `"+ce+"` is marked as required "+("in `"+ee+"`, but its value is `null`.")):new b("The "+ae+" `"+ce+"` is marked as required in "+("`"+ee+"`, but its value is `undefined`.")):null:D(se,J,ee,ae,ce)}var te=A.bind(null,!1);return te.isRequired=A.bind(null,!0),te}function x(D){function Y(U,A,te,q,se,J){var ee=U[A],ae=G(ee);if(ae!==D){var ce=B(ee);return new b("Invalid "+q+" `"+se+"` of type "+("`"+ce+"` supplied to `"+te+"`, expected ")+("`"+D+"`."),{expectedType:D})}return null}return v(Y)}function w(){return v(s)}function _(D){function Y(U,A,te,q,se){if(typeof D!="function")return new b("Property `"+se+"` of component `"+te+"` has invalid PropType notation inside arrayOf.");var J=U[A];if(!Array.isArray(J)){var ee=G(J);return new b("Invalid "+q+" `"+se+"` of type "+("`"+ee+"` supplied to `"+te+"`, expected an array."))}for(var ae=0;ae<J.length;ae++){var ce=D(J,ae,te,q,se+"["+ae+"]",n);if(ce instanceof Error)return ce}return null}return v(Y)}function R(){function D(Y,U,A,te,q){var se=Y[U];if(!a(se)){var J=G(se);return new b("Invalid "+te+" `"+q+"` of type "+("`"+J+"` supplied to `"+A+"`, expected a single ReactElement."))}return null}return v(D)}function C(){function D(Y,U,A,te,q){var se=Y[U];if(!e.isValidElementType(se)){var J=G(se);return new b("Invalid "+te+" `"+q+"` of type "+("`"+J+"` supplied to `"+A+"`, expected a single ReactElement type."))}return null}return v(D)}function T(D){function Y(U,A,te,q,se){if(!(U[A]instanceof D)){var J=D.name||p,ee=K(U[A]);return new b("Invalid "+q+" `"+se+"` of type "+("`"+ee+"` supplied to `"+te+"`, expected ")+("instance of `"+J+"`."))}return null}return v(Y)}function M(D){if(!Array.isArray(D))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(U,A,te,q,se){for(var J=U[A],ee=0;ee<D.length;ee++)if(m(J,D[ee]))return null;var ae=JSON.stringify(D,function(ge,oe){var pe=B(oe);return pe==="symbol"?String(oe):oe});return new b("Invalid "+q+" `"+se+"` of value `"+String(J)+"` "+("supplied to `"+te+"`, expected one of "+ae+"."))}return v(Y)}function I(D){function Y(U,A,te,q,se){if(typeof D!="function")return new b("Property `"+se+"` of component `"+te+"` has invalid PropType notation inside objectOf.");var J=U[A],ee=G(J);if(ee!=="object")return new b("Invalid "+q+" `"+se+"` of type "+("`"+ee+"` supplied to `"+te+"`, expected an object."));for(var ae in J)if(r(J,ae)){var ce=D(J,ae,te,q,se+"."+ae,n);if(ce instanceof Error)return ce}return null}return v(Y)}function k(D){if(!Array.isArray(D))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var Y=0;Y<D.length;Y++){var U=D[Y];if(typeof U!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+W(U)+" at index "+Y+"."),s}function A(te,q,se,J,ee){for(var ae=[],ce=0;ce<D.length;ce++){var ge=D[ce],oe=ge(te,q,se,J,ee,n);if(oe==null)return null;oe.data&&r(oe.data,"expectedType")&&ae.push(oe.data.expectedType)}var pe=ae.length>0?", expected one of type ["+ae.join(", ")+"]":"";return new b("Invalid "+J+" `"+ee+"` supplied to "+("`"+se+"`"+pe+"."))}return v(A)}function L(){function D(Y,U,A,te,q){return H(Y[U])?null:new b("Invalid "+te+" `"+q+"` supplied to "+("`"+A+"`, expected a ReactNode."))}return v(D)}function j(D,Y,U,A,te){return new b((D||"React class")+": "+Y+" type `"+U+"."+A+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+te+"`.")}function $(D){function Y(U,A,te,q,se){var J=U[A],ee=G(J);if(ee!=="object")return new b("Invalid "+q+" `"+se+"` of type `"+ee+"` "+("supplied to `"+te+"`, expected `object`."));for(var ae in D){var ce=D[ae];if(typeof ce!="function")return j(te,q,se,ae,B(ce));var ge=ce(J,ae,te,q,se+"."+ae,n);if(ge)return ge}return null}return v(Y)}function X(D){function Y(U,A,te,q,se){var J=U[A],ee=G(J);if(ee!=="object")return new b("Invalid "+q+" `"+se+"` of type `"+ee+"` "+("supplied to `"+te+"`, expected `object`."));var ae=t({},U[A],D);for(var ce in ae){var ge=D[ce];if(r(D,ce)&&typeof ge!="function")return j(te,q,se,ce,B(ge));if(!ge)return new b("Invalid "+q+" `"+se+"` key `"+ce+"` supplied to `"+te+"`.\nBad object: "+JSON.stringify(U[A],null," ")+`
|
|
110
|
+
Valid keys: `+JSON.stringify(Object.keys(D),null," "));var oe=ge(J,ce,te,q,se+"."+ce,n);if(oe)return oe}return null}return v(Y)}function H(D){switch(typeof D){case"number":case"string":case"undefined":return!0;case"boolean":return!D;case"object":if(Array.isArray(D))return D.every(H);if(D===null||a(D))return!0;var Y=d(D);if(Y){var U=Y.call(D),A;if(Y!==D.entries){for(;!(A=U.next()).done;)if(!H(A.value))return!1}else for(;!(A=U.next()).done;){var te=A.value;if(te&&!H(te[1]))return!1}}else return!1;return!0;default:return!1}}function F(D,Y){return D==="symbol"?!0:Y?Y["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&Y instanceof Symbol:!1}function G(D){var Y=typeof D;return Array.isArray(D)?"array":D instanceof RegExp?"object":F(Y,D)?"symbol":Y}function B(D){if(typeof D>"u"||D===null)return""+D;var Y=G(D);if(Y==="object"){if(D instanceof Date)return"date";if(D instanceof RegExp)return"regexp"}return Y}function W(D){var Y=B(D);switch(Y){case"array":case"object":return"an "+Y;case"boolean":case"date":case"regexp":return"a "+Y;default:return Y}}function K(D){return!D.constructor||!D.constructor.name?p:D.constructor.name}return h.checkPropTypes=i,h.resetWarningCache=i.resetWarningCache,h.PropTypes=h,h},Qw}var Jw,vA;function Wte(){if(vA)return Jw;vA=1;var e=nR();function t(){}function n(){}return n.resetWarningCache=t,Jw=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},Jw}if(process.env.NODE_ENV!=="production"){var Ute=$4(),Gte=!0;C_.exports=Vte()(Ute.isElement,Gte)}else C_.exports=Wte()();var gl=C_.exports,sv={exports:{}},B4={};function H4(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=H4(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function xA(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=H4(e))&&(r&&(r+=" "),r+=t);return r}const qte=Object.freeze(Object.defineProperty({__proto__:null,clsx:xA,default:xA},Symbol.toStringTag,{value:"Module"})),Yte=bE(qte);var zn={},Cs={};Object.defineProperty(Cs,"__esModule",{value:!0});Cs.dontSetMe=Zte;Cs.findInArray=Kte;Cs.int=Jte;Cs.isFunction=Xte;Cs.isNum=Qte;function Kte(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function Xte(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function Qte(e){return typeof e=="number"&&!isNaN(e)}function Jte(e){return parseInt(e,10)}function Zte(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 Qc={};Object.defineProperty(Qc,"__esModule",{value:!0});Qc.browserPrefixToKey=W4;Qc.browserPrefixToStyle=ene;Qc.default=void 0;Qc.getPrefix=V4;const Zw=["Moz","Webkit","O","ms"];function V4(){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<Zw.length;r++)if(W4(t,Zw[r])in n)return Zw[r];return""}function W4(e,t){return t?"".concat(t).concat(tne(e)):e}function ene(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function tne(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}Qc.default=V4();Object.defineProperty(zn,"__esModule",{value:!0});zn.addClassName=q4;zn.addEvent=ine;zn.addUserSelectStyles=gne;zn.createCSSTransform=dne;zn.createSVGTransform=fne;zn.getTouch=hne;zn.getTouchIdentifier=pne;zn.getTranslation=rR;zn.innerHeight=lne;zn.innerWidth=cne;zn.matchesSelector=G4;zn.matchesSelectorAndParentsTo=rne;zn.offsetXYFromParent=une;zn.outerHeight=sne;zn.outerWidth=ane;zn.removeClassName=Y4;zn.removeEvent=one;zn.removeUserSelectStyles=mne;var Hi=Cs,wA=nne(Qc);function U4(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(U4=function(r){return r?n:t})(e)}function nne(e,t){if(e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=U4(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 eb="";function G4(e,t){return eb||(eb=(0,Hi.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,Hi.isFunction)(e[n])})),(0,Hi.isFunction)(e[eb])?e[eb](t):!1}function rne(e,t,n){let r=e;do{if(G4(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function ine(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 one(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 sne(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Hi.int)(n.borderTopWidth),t+=(0,Hi.int)(n.borderBottomWidth),t}function ane(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Hi.int)(n.borderLeftWidth),t+=(0,Hi.int)(n.borderRightWidth),t}function lne(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Hi.int)(n.paddingTop),t-=(0,Hi.int)(n.paddingBottom),t}function cne(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Hi.int)(n.paddingLeft),t-=(0,Hi.int)(n.paddingRight),t}function une(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 dne(e,t){const n=rR(e,t,"px");return{[(0,wA.browserPrefixToKey)("transform",wA.default)]:n}}function fne(e,t){return rR(e,t,"")}function rR(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 hne(e,t){return e.targetTouches&&(0,Hi.findInArray)(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&(0,Hi.findInArray)(e.changedTouches,n=>t===n.identifier)}function pne(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function gne(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&&q4(e.body,"react-draggable-transparent-selection")}function mne(e){if(e)try{if(e.body&&Y4(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 q4(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function Y4(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var Es={};Object.defineProperty(Es,"__esModule",{value:!0});Es.canDragX=vne;Es.canDragY=xne;Es.createCoreData=Sne;Es.createDraggableData=_ne;Es.getBoundPosition=bne;Es.getControlPosition=wne;Es.snapToGrid=yne;var ki=Cs,ju=zn;function bne(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:Cne(r);const i=iR(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,ki.int)(u.paddingLeft)+(0,ki.int)(c.marginLeft),top:-i.offsetTop+(0,ki.int)(u.paddingTop)+(0,ki.int)(c.marginTop),right:(0,ju.innerWidth)(l)-(0,ju.outerWidth)(i)-i.offsetLeft+(0,ki.int)(u.paddingRight)-(0,ki.int)(c.marginRight),bottom:(0,ju.innerHeight)(l)-(0,ju.outerHeight)(i)-i.offsetTop+(0,ki.int)(u.paddingBottom)-(0,ki.int)(c.marginBottom)}}return(0,ki.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,ki.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,ki.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,ki.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function yne(e,t,n){const r=Math.round(t/e[0])*e[0],i=Math.round(n/e[1])*e[1];return[r,i]}function vne(e){return e.props.axis==="both"||e.props.axis==="x"}function xne(e){return e.props.axis==="both"||e.props.axis==="y"}function wne(e,t,n){const r=typeof t=="number"?(0,ju.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const i=iR(n),o=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return(0,ju.offsetXYFromParent)(r||e,o,n.props.scale)}function Sne(e,t,n){const r=!(0,ki.isNum)(e.lastX),i=iR(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 _ne(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 Cne(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function iR(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var av={},lv={};Object.defineProperty(lv,"__esModule",{value:!0});lv.default=Ene;function Ene(){}Object.defineProperty(av,"__esModule",{value:!0});av.default=void 0;var e1=Pne(P),di=oR(gl),Rne=oR(kr),Tr=zn,Oa=Es,t1=Cs,Yf=oR(lv);function oR(e){return e&&e.__esModule?e:{default:e}}function K4(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(K4=function(r){return r?n:t})(e)}function Pne(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=K4(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 qr(e,t,n){return t=Tne(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tne(e){var t=One(e,"string");return typeof t=="symbol"?t:String(t)}function One(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 Po={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let Ma=Po.mouse,cv=class extends e1.Component{constructor(){super(...arguments),qr(this,"dragging",!1),qr(this,"lastX",NaN),qr(this,"lastY",NaN),qr(this,"touchIdentifier",null),qr(this,"mounted",!1),qr(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,Tr.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,Tr.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const i=(0,Tr.getTouchIdentifier)(t);this.touchIdentifier=i;const o=(0,Oa.getControlPosition)(t,i,this);if(o==null)return;const{x:s,y:a}=o,l=(0,Oa.createCoreData)(this,s,a);(0,Yf.default)("DraggableCore: handleDragStart: %j",l),(0,Yf.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,Tr.addUserSelectStyles)(r),this.dragging=!0,this.lastX=s,this.lastY=a,(0,Tr.addEvent)(r,Ma.move,this.handleDrag),(0,Tr.addEvent)(r,Ma.stop,this.handleDragStop))}),qr(this,"handleDrag",t=>{const n=(0,Oa.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,Oa.snapToGrid)(this.props.grid,a,l),!a&&!l)return;r=this.lastX+a,i=this.lastY+l}const o=(0,Oa.createCoreData)(this,r,i);if((0,Yf.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}),qr(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,Oa.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,Oa.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,i=this.lastY+c}const o=(0,Oa.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,Tr.removeUserSelectStyles)(a.ownerDocument),(0,Yf.default)("DraggableCore: handleDragStop: %j",o),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,Yf.default)("DraggableCore: Removing handlers"),(0,Tr.removeEvent)(a.ownerDocument,Ma.move,this.handleDrag),(0,Tr.removeEvent)(a.ownerDocument,Ma.stop,this.handleDragStop))}),qr(this,"onMouseDown",t=>(Ma=Po.mouse,this.handleDragStart(t))),qr(this,"onMouseUp",t=>(Ma=Po.mouse,this.handleDragStop(t))),qr(this,"onTouchStart",t=>(Ma=Po.touch,this.handleDragStart(t))),qr(this,"onTouchEnd",t=>(Ma=Po.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,Tr.addEvent)(t,Po.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,Tr.removeEvent)(n,Po.mouse.move,this.handleDrag),(0,Tr.removeEvent)(n,Po.touch.move,this.handleDrag),(0,Tr.removeEvent)(n,Po.mouse.stop,this.handleDragStop),(0,Tr.removeEvent)(n,Po.touch.stop,this.handleDragStop),(0,Tr.removeEvent)(t,Po.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,Tr.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:Rne.default.findDOMNode(this)}render(){return e1.cloneElement(e1.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};av.default=cv;qr(cv,"displayName","DraggableCore");qr(cv,"propTypes",{allowAnyClick:di.default.bool,children:di.default.node.isRequired,disabled:di.default.bool,enableUserSelectHack:di.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:di.default.arrayOf(di.default.number),handle:di.default.string,cancel:di.default.string,nodeRef:di.default.object,onStart:di.default.func,onDrag:di.default.func,onStop:di.default.func,onMouseDown:di.default.func,scale:di.default.number,className:t1.dontSetMe,style:t1.dontSetMe,transform:t1.dontSetMe});qr(cv,"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(gl),r=u(kr),i=u(Yte),o=zn,s=Es,a=Cs,l=u(av),c=u(lv);function u(w){return w&&w.__esModule?w:{default:w}}function d(w){if(typeof WeakMap!="function")return null;var _=new WeakMap,R=new WeakMap;return(d=function(C){return C?R:_})(w)}function p(w,_){if(w&&w.__esModule)return w;if(w===null||typeof w!="object"&&typeof w!="function")return{default:w};var R=d(_);if(R&&R.has(w))return R.get(w);var C={},T=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var M in w)if(M!=="default"&&Object.prototype.hasOwnProperty.call(w,M)){var I=T?Object.getOwnPropertyDescriptor(w,M):null;I&&(I.get||I.set)?Object.defineProperty(C,M,I):C[M]=w[M]}return C.default=w,R&&R.set(w,C),C}function h(){return h=Object.assign?Object.assign.bind():function(w){for(var _=1;_<arguments.length;_++){var R=arguments[_];for(var C in R)Object.prototype.hasOwnProperty.call(R,C)&&(w[C]=R[C])}return w},h.apply(this,arguments)}function m(w,_,R){return _=b(_),_ in w?Object.defineProperty(w,_,{value:R,enumerable:!0,configurable:!0,writable:!0}):w[_]=R,w}function b(w){var _=v(w,"string");return typeof _=="symbol"?_:String(_)}function v(w,_){if(typeof w!="object"||w===null)return w;var R=w[Symbol.toPrimitive];if(R!==void 0){var C=R.call(w,_||"default");if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(_==="string"?String:Number)(w)}class x extends t.Component{static getDerivedStateFromProps(_,R){let{position:C}=_,{prevPropsPosition:T}=R;return C&&(!T||C.x!==T.x||C.y!==T.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:C,prevPropsPosition:T}),{x:C.x,y:C.y,prevPropsPosition:{...C}}):null}constructor(_){super(_),m(this,"onDragStart",(R,C)=>{if((0,c.default)("Draggable: onDragStart: %j",C),this.props.onStart(R,(0,s.createDraggableData)(this,C))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),m(this,"onDrag",(R,C)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",C);const T=(0,s.createDraggableData)(this,C),M={x:T.x,y:T.y,slackX:0,slackY:0};if(this.props.bounds){const{x:k,y:L}=M;M.x+=this.state.slackX,M.y+=this.state.slackY;const[j,$]=(0,s.getBoundPosition)(this,M.x,M.y);M.x=j,M.y=$,M.slackX=this.state.slackX+(k-M.x),M.slackY=this.state.slackY+(L-M.y),T.x=M.x,T.y=M.y,T.deltaX=M.x-this.state.x,T.deltaY=M.y-this.state.y}if(this.props.onDrag(R,T)===!1)return!1;this.setState(M)}),m(this,"onDragStop",(R,C)=>{if(!this.state.dragging||this.props.onStop(R,(0,s.createDraggableData)(this,C))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",C);const M={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:k,y:L}=this.props.position;M.x=k,M.y=L}this.setState(M)}),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 _,R;return(_=(R=this.props)===null||R===void 0||(R=R.nodeRef)===null||R===void 0?void 0:R.current)!==null&&_!==void 0?_:r.default.findDOMNode(this)}render(){const{axis:_,bounds:R,children:C,defaultPosition:T,defaultClassName:M,defaultClassNameDragging:I,defaultClassNameDragged:k,position:L,positionOffset:j,scale:$,...X}=this.props;let H={},F=null;const B=!!!L||this.state.dragging,W=L||T,K={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?F=(0,o.createSVGTransform)(K,j):H=(0,o.createCSSTransform)(K,j);const D=(0,i.default)(C.props.className||"",M,{[I]:this.state.dragging,[k]: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:D,style:{...C.props.style,...H},transform:F}))}}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})})(B4);const{default:X4,DraggableCore:Mne}=B4;sv.exports=X4;sv.exports.default=X4;sv.exports.DraggableCore=Mne;var Q4=sv.exports,uv={exports:{}},Cg={},sR={};sR.__esModule=!0;sR.cloneElement=Lne;var Ane=Dne(P);function Dne(e){return e&&e.__esModule?e:{default:e}}function SA(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 _A(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SA(Object(n),!0).forEach(function(r){Ine(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ine(e,t,n){return t=kne(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kne(e){var t=Nne(e,"string");return typeof t=="symbol"?t:String(t)}function Nne(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 Lne(e,t){return t.style&&e.props.style&&(t.style=_A(_A({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),Ane.default.cloneElement(e,t)}var Eg={};Eg.__esModule=!0;Eg.resizableProps=void 0;var pt=Fne(gl);function Fne(e){return e&&e.__esModule?e:{default:e}}var jne={axis:pt.default.oneOf(["both","x","y","none"]),className:pt.default.string,children:pt.default.element.isRequired,draggableOpts:pt.default.shape({allowAnyClick:pt.default.bool,cancel:pt.default.string,children:pt.default.node,disabled:pt.default.bool,enableUserSelectHack:pt.default.bool,offsetParent:pt.default.node,grid:pt.default.arrayOf(pt.default.number),handle:pt.default.string,nodeRef:pt.default.object,onStart:pt.default.func,onDrag:pt.default.func,onStop:pt.default.func,onMouseDown:pt.default.func,scale:pt.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=pt.default.number).isRequired.apply(o,n)}return pt.default.number.apply(pt.default,n)},handle:pt.default.oneOfType([pt.default.node,pt.default.func]),handleSize:pt.default.arrayOf(pt.default.number),lockAspectRatio:pt.default.bool,maxConstraints:pt.default.arrayOf(pt.default.number),minConstraints:pt.default.arrayOf(pt.default.number),onResizeStop:pt.default.func,onResizeStart:pt.default.func,onResize:pt.default.func,resizeHandles:pt.default.arrayOf(pt.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:pt.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=pt.default.number).isRequired.apply(o,n)}return pt.default.number.apply(pt.default,n)}};Eg.resizableProps=jne;Cg.__esModule=!0;Cg.default=void 0;var Kf=Vne(P),$ne=Q4,zne=sR,Bne=Eg,Hne=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function J4(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(J4=function(i){return i?n:t})(e)}function Vne(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=J4(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 E_(){return E_=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},E_.apply(this,arguments)}function Wne(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 CA(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 n1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CA(Object(n),!0).forEach(function(r){Une(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Une(e,t,n){return t=Gne(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gne(e){var t=qne(e,"string");return typeof t=="symbol"?t:String(t)}function qne(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 Yne(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,R_(e,t)}function R_(e,t){return R_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},R_(e,t)}var aR=function(e){Yne(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 w=v.top-s.lastHandleRect.top;d+=w}}s.lastHandleRect=v,b==="w"&&(u=-u),m==="n"&&(d=-d);var _=s.props.width+(p?u/s.props.transformScale:0),R=s.props.height+(h?d/s.props.transformScale:0),C=s.runConstraints(_,R);_=C[0],R=C[1];var T=_!==s.props.width||R!==s.props.height,M=typeof s.props[i]=="function"?s.props[i]:null,I=i==="onResize"&&!T;M&&!I&&(a.persist==null||a.persist(),M(a,{node:c,size:{width:_,height:R},handle:o})),i==="onResizeStop"&&s.resetData()}}},n.renderResizeHandle=function(i,o){var s=this.props.handle;if(!s)return Kf.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=n1({ref:o},a?{}:{handleAxis:i});return Kf.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=Wne(o,Hne);return(0,zne.cloneElement)(s,n1(n1({},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]=Kf.createRef();return Kf.createElement($ne.DraggableCore,E_({},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}(Kf.Component);Cg.default=aR;aR.propTypes=Bne.resizableProps;aR.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var dv={};dv.__esModule=!0;dv.default=void 0;var r1=Zne(P),Kne=Z4(gl),Xne=Z4(Cg),Qne=Eg,Jne=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function Z4(e){return e&&e.__esModule?e:{default:e}}function e3(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(e3=function(i){return i?n:t})(e)}function Zne(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=e3(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 P_(){return P_=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},P_.apply(this,arguments)}function EA(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 $y(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?EA(Object(n),!0).forEach(function(r){ere(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ere(e,t,n){return t=tre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tre(e){var t=nre(e,"string");return typeof t=="symbol"?t:String(t)}function nre(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 rre(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 ire(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,T_(e,t)}function T_(e,t){return T_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},T_(e,t)}var t3=function(e){ire(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=rre(i,Jne);return r1.createElement(Xne.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},r1.createElement("div",P_({},x,{style:$y($y({},b),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(r1.Component);dv.default=t3;t3.propTypes=$y($y({},Qne.resizableProps),{},{children:Kne.default.element});uv.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};uv.exports.Resizable=Cg.default;uv.exports.ResizableBox=dv.default;var ore=uv.exports,aa={};Object.defineProperty(aa,"__esModule",{value:!0});aa.resizeHandleType=aa.resizeHandleAxesType=aa.default=void 0;var bt=n3(gl),sre=n3(P);function n3(e){return e&&e.__esModule?e:{default:e}}const are=aa.resizeHandleAxesType=bt.default.arrayOf(bt.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),lre=aa.resizeHandleType=bt.default.oneOfType([bt.default.node,bt.default.func]);aa.default={className:bt.default.string,style:bt.default.object,width:bt.default.number,autoSize:bt.default.bool,cols:bt.default.number,draggableCancel:bt.default.string,draggableHandle:bt.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:bt.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&Et.validateLayout(t,"layout")},margin:bt.default.arrayOf(bt.default.number),containerPadding:bt.default.arrayOf(bt.default.number),rowHeight:bt.default.number,maxRows:bt.default.number,isBounded:bt.default.bool,isDraggable:bt.default.bool,isResizable:bt.default.bool,allowOverlap:bt.default.bool,preventCollision:bt.default.bool,useCSSTransforms:bt.default.bool,transformScale:bt.default.number,isDroppable:bt.default.bool,resizeHandles:are,resizeHandle:lre,onLayoutChange:bt.default.func,onDragStart:bt.default.func,onDrag:bt.default.func,onDragStop:bt.default.func,onResizeStart:bt.default.func,onResize:bt.default.func,onResizeStop:bt.default.func,onDrop:bt.default.func,droppingItem:bt.default.shape({i:bt.default.string.isRequired,w:bt.default.number.isRequired,h:bt.default.number.isRequired}),children:function(e,t){const n=e[t],r={};sre.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:bt.default.any};Object.defineProperty(ov,"__esModule",{value:!0});ov.default=void 0;var wu=lR(P),Ut=lR(gl),cre=Q4,ure=ore,Su=Et,vr=_s,RA=aa,dre=lR(GE);function lR(e){return e&&e.__esModule?e:{default:e}}function Xo(e,t,n){return t=fre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fre(e){var t=hre(e,"string");return typeof t=="symbol"?t:String(t)}function hre(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 cR extends wu.default.Component{constructor(){super(...arguments),Xo(this,"state",{resizing:null,dragging:null,className:""}),Xo(this,"elementRef",wu.default.createRef()),Xo(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,vr.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})}),Xo(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:w}=r;if(w){const{margin:_,rowHeight:R,containerPadding:C}=this.props,T=w.clientHeight-(0,vr.calcGridItemWHPx)(p,R,_[1]);a=(0,vr.clamp)(a-C[1],0,T);const M=(0,vr.calcGridColWidth)(m),I=h-(0,vr.calcGridItemWHPx)(d,M,_[0]);l=(0,vr.clamp)(l-C[0],0,I)}}const b={top:a,left:l};this.setState({dragging:b});const{x:v,y:x}=(0,vr.calcXY)(m,a,l,d,p);return s.call(this,u,v,x,{e:t,node:r,newPosition:b})}),Xo(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,vr.calcXY)(this.getPositionParams(),c,l,o,s);return i.call(this,a,d,p,{e:t,node:r,newPosition:u})}),Xo(this,"onResizeStop",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStop")),Xo(this,"onResizeStart",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStart")),Xo(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,vr.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),i=(0,vr.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,Su.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,Su.setTransform)(t):(o=(0,Su.setTopLeft)(t),n&&(o.left=(0,Su.perc)(t.left/r),o.width=(0,Su.perc)(t.width/r))),o}mixinDraggable(t,n){return wu.default.createElement(cre.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,vr.calcGridItemPosition)(p,0,0,i,0).width,m=(0,vr.calcGridItemPosition)(p,0,0,o,s),b=(0,vr.calcGridItemPosition)(p,0,0,a,l),v=[m.width,m.height],x=[Math.min(b.width,h),Math.min(b.height,1/0)];return wu.default.createElement(ure.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,Su.resizeItemInDirection)(a,r,s,m),this.setState({resizing:i==="onResizeStop"?null:x}));let{w,h:_}=(0,vr.calcWH)(this.getPositionParams(),x.width,x.height,c,u,a);w=(0,vr.clamp)(w,Math.max(b,1),v),_=(0,vr.clamp)(_,h,p),l.call(this,d,w,_,{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,vr.calcGridItemPosition)(this.getPositionParams(),t,n,r,i,this.state),u=wu.default.Children.only(this.props.children);let d=wu.default.cloneElement(u,{ref:this.elementRef,className:(0,dre.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}}ov.default=cR;Xo(cR,"propTypes",{children:Ut.default.element,cols:Ut.default.number.isRequired,containerWidth:Ut.default.number.isRequired,rowHeight:Ut.default.number.isRequired,margin:Ut.default.array.isRequired,maxRows:Ut.default.number.isRequired,containerPadding:Ut.default.array.isRequired,x:Ut.default.number.isRequired,y:Ut.default.number.isRequired,w:Ut.default.number.isRequired,h:Ut.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:Ut.default.string.isRequired,resizeHandles:RA.resizeHandleAxesType,resizeHandle:RA.resizeHandleType,onDragStop:Ut.default.func,onDragStart:Ut.default.func,onDrag:Ut.default.func,onResizeStop:Ut.default.func,onResizeStart:Ut.default.func,onResize:Ut.default.func,isDraggable:Ut.default.bool.isRequired,isResizable:Ut.default.bool.isRequired,isBounded:Ut.default.bool.isRequired,static:Ut.default.bool,useCSSTransforms:Ut.default.bool.isRequired,transformScale:Ut.default.number,className:Ut.default.string,handle:Ut.default.string,cancel:Ut.default.string,droppingPosition:Ut.default.shape({e:Ut.default.object.isRequired,left:Ut.default.number.isRequired,top:Ut.default.number.isRequired})});Xo(cR,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1});Object.defineProperty(_g,"__esModule",{value:!0});_g.default=void 0;var Il=bre(P),i1=UE,pre=uR(GE),tt=Et,gre=_s,PA=uR(ov),mre=uR(aa);function uR(e){return e&&e.__esModule?e:{default:e}}function r3(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(r3=function(r){return r?n:t})(e)}function bre(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=r3(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 Mr(e,t,n){return t=yre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yre(e){var t=vre(e,"string");return typeof t=="symbol"?t:String(t)}function vre(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 TA="react-grid-layout";let i3=!1;try{i3=/firefox/i.test(navigator.userAgent)}catch{}class fv extends Il.Component{constructor(){super(...arguments),Mr(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:[]}),Mr(this,"dragEnterCounter",0),Mr(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)}),Mr(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})}),Mr(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)}),Mr(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))}),Mr(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[w,_]=(0,tt.withLayoutItem)(u,t,C=>{let T;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&&(T=(0,tt.getAllCollisions)(u,{...C,w:n,h:r,x:v,y:x}).filter(I=>I.i!==C.i).length>0,T&&(x=C.y,r=C.h,v=C.x,n=C.w,m=!1)),C.w=n,C.h=r,C});if(!_)return;b=w,m&&(b=(0,tt.moveElement)(w,_,v,x,!0,this.props.preventCollision,(0,tt.compactType)(this.props),d,h));const R={w:_.w,h:_.h,x:_.x,y:_.y,static:!0,i:t};this.props.onResize(b,c,_,R,o,s),this.setState({layout:h?b:(0,tt.compact)(b,(0,tt.compactType)(this.props),d),activeDrag:R})}),Mr(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)}),Mr(this,"onDragOver",t=>{var w;if(t.preventDefault(),t.stopPropagation(),i3&&!((w=t.nativeEvent.target)!=null&&w.classList.contains(TA)))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:R}=this.state.droppingPosition;(_!=b||R!=v)&&this.setState({droppingPosition:x})}}else{const _={cols:o,margin:i,maxRows:a,rowHeight:s,containerWidth:l,containerPadding:c||i},R=(0,gre.calcXY)(_,v,b,p.w,p.h);this.setState({droppingDOMNode:Il.createElement("div",{key:p.i}),droppingPosition:x,layout:[...h,{...p,x:R.x,y:R.y,static:!1,isDraggable:!0}]})}}),Mr(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})}),Mr(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),Mr(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),Mr(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,i1.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,i1.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,i1.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 Il.createElement(PA.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},Il.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:w}=this.props,{mounted:_,droppingPosition:R}=this.state,C=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&u,T=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&d,M=r.resizeHandles||x,I=C&&p&&r.isBounded!==!1;return Il.createElement(PA.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:T,isBounded:I,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?R:void 0,resizeHandles:M,resizeHandle:w},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:i}=this.props,o=(0,pre.default)(TA,t),s={height:this.containerHeight(),...n};return Il.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},Il.Children.map(this.props.children,a=>this.processGridItem(a)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}_g.default=fv;Mr(fv,"displayName","ReactGridLayout");Mr(fv,"propTypes",mre.default);Mr(fv,"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 hv={},Jc={};Object.defineProperty(Jc,"__esModule",{value:!0});Jc.findOrGenerateResponsiveLayout=Sre;Jc.getBreakpointFromWidth=xre;Jc.getColsFromBreakpoint=wre;Jc.sortBreakpoints=dR;var tb=Et;function xre(e,t){const n=dR(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 wre(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function Sre(e,t,n,r,i,o){if(e[n])return(0,tb.cloneLayout)(e[n]);let s=e[r];const a=dR(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,tb.cloneLayout)(s||[]),(0,tb.compact)((0,tb.correctBounds)(s,{cols:i}),o,i)}function dR(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(hv,"__esModule",{value:!0});hv.default=void 0;var OA=Cre(P),fi=o3(gl),o1=UE,Ku=Et,kl=Jc,_re=o3(_g);function o3(e){return e&&e.__esModule?e:{default:e}}function s3(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(s3=function(r){return r?n:t})(e)}function Cre(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=s3(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 O_(){return O_=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},O_.apply(this,arguments)}function zy(e,t,n){return t=Ere(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ere(e){var t=Rre(e,"string");return typeof t=="symbol"?t:String(t)}function Rre(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 MA=e=>Object.prototype.toString.call(e);function nb(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class fR extends OA.Component{constructor(){super(...arguments),zy(this,"state",this.generateInitialState()),zy(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,kl.getBreakpointFromWidth)(n,t),s=(0,kl.getColsFromBreakpoint)(o,i),a=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,kl.findOrGenerateResponsiveLayout)(r,n,o,o,s,a),breakpoint:o,cols:s}}static getDerivedStateFromProps(t,n){if(!(0,o1.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:i}=n;return{layout:(0,kl.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,o1.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,o1.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,kl.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),a=this.state.breakpoint,l=(0,kl.getColsFromBreakpoint)(s,r),c={...i};if(a!==s||t.breakpoints!==n||t.cols!==r){a in c||(c[a]=(0,Ku.cloneLayout)(this.state.layout));let p=(0,kl.findOrGenerateResponsiveLayout)(c,n,s,a,l,o);p=(0,Ku.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=nb(this.props.margin,s),d=nb(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 OA.createElement(_re.default,O_({},u,{margin:nb(o,this.state.breakpoint),containerPadding:nb(s,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}hv.default=fR;zy(fR,"propTypes",{breakpoint:fi.default.string,breakpoints:fi.default.object,allowOverlap:fi.default.bool,cols:fi.default.object,margin:fi.default.oneOfType([fi.default.array,fi.default.object]),containerPadding:fi.default.oneOfType([fi.default.array,fi.default.object]),layouts(e,t){if(MA(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+MA(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,Ku.validateLayout)(e.layouts[n],"layouts."+n)})},width:fi.default.number.isRequired,onBreakpointChange:fi.default.func,onLayoutChange:fi.default.func,onWidthChange:fi.default.func});zy(fR,"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:Ku.noop,onLayoutChange:Ku.noop,onWidthChange:Ku.noop});var hR={},a3=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}()}(),M_=typeof window<"u"&&typeof document<"u"&&window.document===document,By=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")()}(),Pre=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(By):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),Tre=2;function Ore(e,t){var n=!1,r=!1,i=0;function o(){n&&(n=!1,e()),r&&a()}function s(){Pre(o)}function a(){var l=Date.now();if(n){if(l-i<Tre)return;r=!0}else n=!0,r=!1,setTimeout(s,t);i=l}return a}var Mre=20,Are=["top","right","bottom","left","width","height","size","weight"],Dre=typeof MutationObserver<"u",Ire=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=Ore(this.refresh.bind(this),Mre)}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(){!M_||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Dre?(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(){!M_||!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=Are.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}(),l3=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},zd=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||By},c3=pv(0,0,0,0);function Hy(e){return parseFloat(e)||0}function AA(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+Hy(o)},0)}function kre(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]=Hy(s)}return n}function Nre(e){var t=e.getBBox();return pv(0,0,t.width,t.height)}function Lre(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return c3;var r=zd(e).getComputedStyle(e),i=kre(r),o=i.left+i.right,s=i.top+i.bottom,a=Hy(r.width),l=Hy(r.height);if(r.boxSizing==="border-box"&&(Math.round(a+o)!==t&&(a-=AA(r,"left","right")+o),Math.round(l+s)!==n&&(l-=AA(r,"top","bottom")+s)),!jre(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 pv(i.left,i.top,a,l)}var Fre=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof zd(e).SVGGraphicsElement}:function(e){return e instanceof zd(e).SVGElement&&typeof e.getBBox=="function"}}();function jre(e){return e===zd(e).document.documentElement}function $re(e){return M_?Fre(e)?Nre(e):Lre(e):c3}function zre(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 l3(s,{x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:i+n,left:t}),s}function pv(e,t,n,r){return{x:e,y:t,width:n,height:r}}var Bre=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=pv(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=$re(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}(),Hre=function(){function e(t,n){var r=zre(n);l3(this,{target:t,contentRect:r})}return e}(),Vre=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new a3,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 zd(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new Bre(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 zd(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 Hre(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}(),u3=typeof WeakMap<"u"?new WeakMap:new a3,d3=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=Ire.getInstance(),r=new Vre(t,n,this);u3.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){d3.prototype[e]=function(){var t;return(t=u3.get(this))[e].apply(t,arguments)}});var Wre=function(){return typeof By.ResizeObserver<"u"?By.ResizeObserver:d3}();const Ure=Object.freeze(Object.defineProperty({__proto__:null,default:Wre},Symbol.toStringTag,{value:"Module"})),Gre=bE(Ure);Object.defineProperty(hR,"__esModule",{value:!0});hR.default=eie;var rb=Xre(P),qre=pR(gl),Yre=pR(Gre),Kre=pR(GE);function pR(e){return e&&e.__esModule?e:{default:e}}function f3(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(f3=function(r){return r?n:t})(e)}function Xre(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=f3(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 A_(){return A_=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},A_.apply(this,arguments)}function _u(e,t,n){return t=Qre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qre(e){var t=Jre(e,"string");return typeof t=="symbol"?t:String(t)}function Jre(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 Zre="react-grid-layout";function eie(e){var t;return t=class extends rb.Component{constructor(){super(...arguments),_u(this,"state",{width:1280}),_u(this,"elementRef",rb.createRef()),_u(this,"mounted",!1),_u(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new Yre.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?rb.createElement("div",{className:(0,Kre.default)(this.props.className,Zre),style:this.props.style,ref:this.elementRef}):rb.createElement(e,A_({innerRef:this.elementRef},i,this.state))}},_u(t,"defaultProps",{measureBeforeMount:!1}),_u(t,"propTypes",{measureBeforeMount:qre.default.bool}),t}(function(e){e.exports=_g.default,e.exports.utils=Et,e.exports.calculateUtils=_s,e.exports.Responsive=hv.default,e.exports.Responsive.utils=Jc,e.exports.WidthProvider=hR.default})(R4);var DA=R4.exports;function Ei(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 tie=["color"],nie=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Ei(e,tie);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"}))}),rie=["color"],h3=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Ei(e,rie);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"}))}),iie=["color"],oie=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Ei(e,iie);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"}))}),sie=["color"],aie=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Ei(e,sie);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"}))}),lie=["color"],p3=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Ei(e,lie);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"}))}),cie=["color"],uie=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Ei(e,cie);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}))}),die=["color"],fie=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Ei(e,die);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"}))}),hie=["color"],pie=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Ei(e,hie);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"}))}),gie=["color"],g3=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Ei(e,gie);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"}))}),mie=["color"],bie=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Ei(e,mie);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"}))}),yie=["color"],vie=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Ei(e,yie);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"}))}),xie=["color"],wie=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Ei(e,xie);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"}))}),Sie=["color"],m3=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Ei(e,Sie);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}))}),_ie=["color"],b3=P.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Ei(e,_ie);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 ib;const Cie=new Uint8Array(16);function Eie(){if(!ib&&(ib=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ib))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ib(Cie)}const xr=[];for(let e=0;e<256;++e)xr.push((e+256).toString(16).slice(1));function Rie(e,t=0){return xr[e[t+0]]+xr[e[t+1]]+xr[e[t+2]]+xr[e[t+3]]+"-"+xr[e[t+4]]+xr[e[t+5]]+"-"+xr[e[t+6]]+xr[e[t+7]]+"-"+xr[e[t+8]]+xr[e[t+9]]+"-"+xr[e[t+10]]+xr[e[t+11]]+xr[e[t+12]]+xr[e[t+13]]+xr[e[t+14]]+xr[e[t+15]]}const Pie=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),IA={randomUUID:Pie};function il(e,t,n){if(IA.randomUUID&&!e)return IA.randomUUID();e=e||{};const r=e.random||(e.rng||Eie)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Rie(r)}const Jr=V5()(X5((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:il(),title:"Editor Card",description:"Description",type:"bar",data:[]},frame:{id:il(),cards:[],activeCardId:""},actions:{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})}}}))),gv=()=>Jr(e=>e.actions);function Tie(e){return/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/.test(e)}function Oie(e,t=1){if(!Tie(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 Mie(e,t,n,r=1){var c,u,d,p;const i=n==null?void 0:n.datasetOptions,o=ve.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 R;const b=i==null?void 0:i.find(C=>C.idx===m),v=Oie(s==null?void 0:s[m%s.length],r),x=a==null?void 0:a[m%a.length],w=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:Aie((R=b==null?void 0:b.datalabels)==null?void 0:R.align,v)},backgroundColor:v,pointBackgroundColor:x,borderColor:w}})}function Aie(e,t){return Ld(e==="end"||e==="start"?cp():t)}function Die(e){var a,l,c,u;const{metricKeys:t,dimensionKeys:n}=ur(e);let r=[];const i=ve.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 Iie(e){var c,u,d,p;const{dimensionKeys:t,metricKeys:n}=ur(e),r=ve.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 kie(e,t){var s,a,l,c;const n=ve.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 Nie(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 ur(e){if(!e||e.length===0)return{keys:[],dimensionKeys:[],metricKeys:[]};const t=Nie(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 Ch(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 Lie(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 Vy({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=Lie(s,i)),s}function co(e,t){var s;const n=ve.getState().themeStyle,r=(s=n==null?void 0:n.chart)==null?void 0:s.options,i=gc.cloneDeep(r);return gc.merge(i,e,t)}function D_(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 Fie=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),y3=(...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 jie={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 v3=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,...jie,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:y3("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 fn=(e,t)=>{const n=P.forwardRef(({className:r,...i},o)=>P.createElement(v3,{ref:o,iconNode:t,className:y3(`lucide-${Fie(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 I_=fn("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 x3=fn("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 Rg=fn("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 mv=fn("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 gR=fn("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 bv=fn("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 w3=fn("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 mR=fn("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 S3=fn("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"}]]);/**
|
|
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 bR=fn("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"}]]);/**
|
|
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 _3=fn("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
|
|
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 C3=fn("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"}]]);/**
|
|
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 E3=fn("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
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 R3=fn("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"}]]);/**
|
|
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 P3=fn("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"}]]);/**
|
|
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 T3=fn("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"}]]);/**
|
|
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 O3=fn("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"}]]);/**
|
|
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 yR=fn("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
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 M3=fn("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"}]]);/**
|
|
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 A3=fn("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"}]]);/**
|
|
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 D3=fn("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
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 I3=fn("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"}]]);/**
|
|
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 k3=fn("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"}]]);/**
|
|
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 N3=fn("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"}]]);/**
|
|
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 L3=fn("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);/**
|
|
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 hf=fn("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),$ie=({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(`
|
|
263
|
+
`),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(S3,{onClick:n,className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})};var Bd=1e3,Hd=Bd*60,Vd=Hd*60,kc=Vd*24,zie=kc*7,Bie=kc*365.25,Hie=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return Vie(e);if(n==="number"&&isFinite(e))return t.long?Uie(e):Wie(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Vie(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*Bie;case"weeks":case"week":case"w":return n*zie;case"days":case"day":case"d":return n*kc;case"hours":case"hour":case"hrs":case"hr":case"h":return n*Vd;case"minutes":case"minute":case"mins":case"min":case"m":return n*Hd;case"seconds":case"second":case"secs":case"sec":case"s":return n*Bd;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function Wie(e){var t=Math.abs(e);return t>=kc?Math.round(e/kc)+"d":t>=Vd?Math.round(e/Vd)+"h":t>=Hd?Math.round(e/Hd)+"m":t>=Bd?Math.round(e/Bd)+"s":e+"ms"}function Uie(e){var t=Math.abs(e);return t>=kc?ob(e,t,kc,"day"):t>=Vd?ob(e,t,Vd,"hour"):t>=Hd?ob(e,t,Hd,"minute"):t>=Bd?ob(e,t,Bd,"second"):e+" ms"}function ob(e,t,n,r){var i=t>=n*1.5;return Math.round(e/n)+" "+r+(i?"s":"")}const Gie=qc(Hie);function qie(e){const t=ve(d=>d.selectedSheetId),n=ve(d=>d.selectedLensId),r=ve(d=>d.dashboard.baseQueries),i=ve(d=>d.dashboard.filters),o=ve(d=>d.filterValues),s=i==null?void 0:i.filter(d=>d.sheetId===t||!d.sheetId),a=o==null?void 0:o.filter(d=>(s==null?void 0:s.some(p=>p.id===d.filterId))||d.filterId.endsWith(t)),l=DQ(e.sql,r),c=Yie(e.python||"");return{queryKey:["query",e.id,e.title,l,c,n||"",JSON.stringify(a)],sql:l,sheetFilterValues:a}}function Yie(e){const t=BigInt("0x100000001b3");let r=BigInt("0xcbf29ce484222325");for(let i=0;i<e.length;i++)r^=BigInt(e.charCodeAt(i)),r=r*t%BigInt(2)**BigInt(64);return r.toString(16).padStart(16,"0")}function ol(e,t){const{authToken:n}=vo(),r=ve(d=>d.isVisualEditing),i=ve(d=>d.authToken),o=Gie((e==null?void 0:e.refreshInterval)||"0"),{queryKey:s,sql:a,sheetFilterValues:l}=qie(e);return{...Sg({queryKey:s,queryFn:()=>z0("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===eL?"":e.python,active_filters:l,cache_config:PE()}),refetchInterval:o,placeholderData:wJ,enabled:!!e.connectionId&&!!e.sql&&!0&&!r}),queryKey:s}}function F3({frame:e}){var R;const t=ve(C=>C.isDashboardEditing),n=ve(C=>C.filterValues),r=ve(C=>C.isVisualEditing),i=ve(C=>C.selectedSheetId);ve(C=>C.currentBreakpoint);const{removeFrame:o}=ve(C=>C.actions),s=ve(C=>C.actions.setIsVisualEditing),a=Jr(C=>C.actions.setFilterValues),l=Jr(C=>C.actions.setApplyFilters),{setCard:c,setFrame:u,setQueryResultColumns:d}=Jr(C=>C.actions),p=Jr(C=>C.actions.setSelectedConnectionId),h=Jr(C=>C.actions.setSelectedDatamodelId),m=Jr(C=>C.actions.setSelectedDatabaseName),b=Jr(C=>C.actions.setSelectedSchemaName),v=Jr(C=>C.actions.setSelectedTableName),x=e.cards.find(C=>C.id===e.activeCardId),{data:w}=ol(x);function _(){s(!r),c(x);const{dimensionKeys:C}=ur((w==null?void 0:w.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(fie,{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(pie,{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(p3,{className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})}),((R=x.preferences)==null?void 0:R.allowDownload)===!0&&y.jsx($ie,{data:(w==null?void 0:w.records)||[],filename:x.title})]})})}function Kie(e,t){ve(s=>s.selectedSheetId);const n=ve(s=>s.selectedFrameId),r=ve(s=>s.isDashboardEditing),i=ve(s=>s.isVisualEditing);ve(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 Xie=P.createContext(null),s1={didCatch:!1,error:null};class yv extends P.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=s1}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(s1)}}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&&Qie(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(s1)}}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(Xie.Provider,{value:{didCatch:o,error:s,resetErrorBoundary:this.resetErrorBoundary}},a)}}function Qie(){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 vR({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 Jie({error:e,frame:t}){return y.jsxs("div",{className:"flex h-full flex-col items-center justify-center border",role:"alert",children:[y.jsx(F3,{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 Zie({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 la({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 xR(e,t){if(!t)return"";const n=t.find(r=>e>=r.start&&e<=r.end);return(n==null?void 0:n.color)||""}function j3(e){try{const n=new Function("getDatalabelColor",e)(YS);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 eoe(e){const t=getComputedStyle(document.documentElement).getPropertyValue(e);return $3(t)}function $3(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 Nl({data:e,cfg:t,customCfg:n,preferences:r,cardType:i}){ve.getState().themeStyle;const o=i==="radar"?.2:1,{dimensionKeys:s,metricKeys:a}=ur(e),l=Mie(a,e,r,o),c=Ch(l,n),u=s[0],d=D_(e,u);wR(r,t),z3(r);const{options:p,plugins:h}=H3({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 wR(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 z3(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 B3(e,t){var o,s,a,l,c,u,d,p,h,m,b,v;const n=wR(t,e),r=z3(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 w,_,R,C;return la({number:Number(x),decimalPlaces:((w=t==null?void 0:t.numberAxisFormat)==null?void 0:w.decimalPlaces)||0,useSuffix:!!((_=t==null?void 0:t.numberAxisFormat)!=null&&_.suffix),customSuffix:"",locale:((R=t==null?void 0:t.numberAxisFormat)==null?void 0:R.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 w,_,R,C;return la({number:Number(x),decimalPlaces:((w=t==null?void 0:t.numberAxisFormat)==null?void 0:w.decimalPlaces)||0,useSuffix:!!((_=t==null?void 0:t.numberAxisFormat)!=null&&_.suffix),customSuffix:"",locale:((R=t==null?void 0:t.numberAxisFormat)==null?void 0:R.locale)||"",currency:((C=t==null?void 0:t.numberAxisFormat)==null?void 0:C.currency)||""})}}}}}function H3({cfg:e,preferences:t,customCfg:n}){var p,h,m,b,v,x,w,_,R,C,T,M,I,k,L,j,$,X,H,F,G,B,W,K,D,Y,U,A,te;const r=ve.getState().themeStyle,i=B3(e,t),o=co((e==null?void 0:e.options)||{},t==null?void 0:t.chartOptions),s=co(i,o),a=co(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:(_=(w=(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:w.grid)==null?void 0:_.color}},y:{...(R=a==null?void 0:a.scales)==null?void 0:R.y,grid:{...(T=(C=a==null?void 0:a.scales)==null?void 0:C.y)==null?void 0:T.grid,color:(j=(L=(k=(I=(M=r==null?void 0:r.chart)==null?void 0:M.options)==null?void 0:I.scales)==null?void 0:k.y)==null?void 0:L.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:(G=(F=(H=(X=r==null?void 0:r.chart)==null?void 0:X.options)==null?void 0:H.plugins)==null?void 0:F.tooltip)==null?void 0:G.backgroundColor,bodyColor:(D=(K=(W=(B=r==null?void 0:r.chart)==null?void 0:B.options)==null?void 0:W.plugins)==null?void 0:K.tooltip)==null?void 0:D.bodyColor,titleColor:(te=(A=(U=(Y=r==null?void 0:r.chart)==null?void 0:Y.options)==null?void 0:U.plugins)==null?void 0:A.tooltip)==null?void 0:te.titleColor}}},{plugins:c,options:u}=j3((t==null?void 0:t.customVisualCode)||"");return{options:co(l,u),plugins:c}}/*!
|
|
264
|
+
* @kurkle/color v0.3.4
|
|
265
|
+
* https://github.com/kurkle/color#readme
|
|
266
|
+
* (c) 2024 Jukka Kurkela
|
|
267
|
+
* Released under the MIT License
|
|
268
|
+
*/function Pg(e){return e+.5|0}const Ua=(e,t,n)=>Math.max(Math.min(e,n),t);function Eh(e){return Ua(Pg(e*2.55),0,255)}function el(e){return Ua(Pg(e*255),0,255)}function Xs(e){return Ua(Pg(e/2.55)/100,0,1)}function kA(e){return Ua(Pg(e*100),0,100)}const so={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},k_=[..."0123456789ABCDEF"],toe=e=>k_[e&15],noe=e=>k_[(e&240)>>4]+k_[e&15],sb=e=>(e&240)>>4===(e&15),roe=e=>sb(e.r)&&sb(e.g)&&sb(e.b)&&sb(e.a);function ioe(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&so[e[1]]*17,g:255&so[e[2]]*17,b:255&so[e[3]]*17,a:t===5?so[e[4]]*17:255}:(t===7||t===9)&&(n={r:so[e[1]]<<4|so[e[2]],g:so[e[3]]<<4|so[e[4]],b:so[e[5]]<<4|so[e[6]],a:t===9?so[e[7]]<<4|so[e[8]]:255})),n}const ooe=(e,t)=>e<255?t(e):"";function soe(e){var t=roe(e)?toe:noe;return e?"#"+t(e.r)+t(e.g)+t(e.b)+ooe(e.a,t):void 0}const aoe=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function V3(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 loe(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 coe(e,t,n){const r=V3(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 uoe(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 SR(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=uoe(n,r,i,u,o),l=l*60+.5),[l|0,c||0,a]}function _R(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(el)}function CR(e,t,n){return _R(V3,e,t,n)}function doe(e,t,n){return _R(coe,e,t,n)}function foe(e,t,n){return _R(loe,e,t,n)}function W3(e){return(e%360+360)%360}function hoe(e){const t=aoe.exec(e);let n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?Eh(+t[5]):el(+t[5]));const i=W3(+t[2]),o=+t[3]/100,s=+t[4]/100;return t[1]==="hwb"?r=doe(i,o,s):t[1]==="hsv"?r=foe(i,o,s):r=CR(i,o,s),{r:r[0],g:r[1],b:r[2],a:n}}function poe(e,t){var n=SR(e);n[0]=W3(n[0]+t),n=CR(n),e.r=n[0],e.g=n[1],e.b=n[2]}function goe(e){if(!e)return;const t=SR(e),n=t[0],r=kA(t[1]),i=kA(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${i}%, ${Xs(e.a)})`:`hsl(${n}, ${r}%, ${i}%)`}const NA={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"},LA={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 moe(){const e={},t=Object.keys(LA),n=Object.keys(NA);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,NA[o]);o=parseInt(LA[s],16),e[a]=[o>>16&255,o>>8&255,o&255]}return e}let ab;function boe(e){ab||(ab=moe(),ab.transparent=[0,0,0,0]);const t=ab[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const yoe=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function voe(e){const t=yoe.exec(e);let n=255,r,i,o;if(t){if(t[7]!==r){const s=+t[7];n=t[8]?Eh(s):Ua(s*255,0,255)}return r=+t[1],i=+t[3],o=+t[5],r=255&(t[2]?Eh(r):Ua(r,0,255)),i=255&(t[4]?Eh(i):Ua(i,0,255)),o=255&(t[6]?Eh(o):Ua(o,0,255)),{r,g:i,b:o,a:n}}}function xoe(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Xs(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const a1=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Cu=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function woe(e,t,n){const r=Cu(Xs(e.r)),i=Cu(Xs(e.g)),o=Cu(Xs(e.b));return{r:el(a1(r+n*(Cu(Xs(t.r))-r))),g:el(a1(i+n*(Cu(Xs(t.g))-i))),b:el(a1(o+n*(Cu(Xs(t.b))-o))),a:e.a+n*(t.a-e.a)}}function lb(e,t,n){if(e){let r=SR(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=CR(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function U3(e,t){return e&&Object.assign(t||{},e)}function FA(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=el(e[3]))):(t=U3(e,{r:0,g:0,b:0,a:1}),t.a=el(t.a)),t}function Soe(e){return e.charAt(0)==="r"?voe(e):hoe(e)}let G3=class N_{constructor(t){if(t instanceof N_)return t;const n=typeof t;let r;n==="object"?r=FA(t):n==="string"&&(r=ioe(t)||boe(t)||Soe(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var t=U3(this._rgb);return t&&(t.a=Xs(t.a)),t}set rgb(t){this._rgb=FA(t)}rgbString(){return this._valid?xoe(this._rgb):void 0}hexString(){return this._valid?soe(this._rgb):void 0}hslString(){return this._valid?goe(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=woe(this._rgb,t._rgb,n)),this}clone(){return new N_(this.rgb)}alpha(t){return this._rgb.a=el(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=Pg(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 lb(this._rgb,2,t),this}darken(t){return lb(this._rgb,2,-t),this}saturate(t){return lb(this._rgb,1,t),this}desaturate(t){return lb(this._rgb,1,-t),this}rotate(t){return poe(this._rgb,t),this}};/*!
|
|
269
|
+
* Chart.js v4.4.7
|
|
270
|
+
* https://www.chartjs.org
|
|
271
|
+
* (c) 2024 Chart.js Contributors
|
|
272
|
+
* Released under the MIT License
|
|
273
|
+
*/function Bs(){}const _oe=(()=>{let e=0;return()=>e++})();function Ct(e){return e==null}function Rn(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 Ot(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function $n(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Li(e,t){return $n(e)?e:t}function nt(e,t){return typeof e>"u"?t:e}const Coe=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,q3=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function an(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function Jt(e,t,n,r){let i,o,s;if(Rn(e))for(o=e.length,i=0;i<o;i++)t.call(n,e[i],i);else if(Ot(e))for(s=Object.keys(e),o=s.length,i=0;i<o;i++)t.call(n,e[s[i]],s[i])}function Wy(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 Uy(e){if(Rn(e))return e.map(Uy);if(Ot(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let i=0;for(;i<r;++i)t[n[i]]=Uy(e[n[i]]);return t}return e}function Y3(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function Eoe(e,t,n,r){if(!Y3(e))return;const i=t[e],o=n[e];Ot(i)&&Ot(o)?gr(i,o,r):t[e]=Uy(o)}function gr(e,t,n){const r=Rn(t)?t:[t],i=r.length;if(!Ot(e))return e;n=n||{};const o=n.merger||Eoe;let s;for(let a=0;a<i;++a){if(s=r[a],!Ot(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 Bh(e,t){return gr(e,t,{merger:Roe})}function Roe(e,t,n){if(!Y3(e))return;const r=t[e],i=n[e];Ot(r)&&Ot(i)?Bh(r,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Uy(i))}const jA={"":e=>e,x:e=>e.x,y:e=>e.y};function Poe(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 Toe(e){const t=Poe(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function sl(e,t){return(jA[t]||(jA[t]=Toe(t)))(e)}function ER(e){return e.charAt(0).toUpperCase()+e.slice(1)}const bp=e=>typeof e<"u",al=e=>typeof e=="function",$A=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function Ooe(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const On=Math.PI,Pn=2*On,Moe=Pn+On,Gy=Number.POSITIVE_INFINITY,Aoe=On/180,Gn=On/2,Ll=On/4,zA=On*2/3,Ga=Math.log10,us=Math.sign;function Hh(e,t,n){return Math.abs(e-t)<n}function BA(e){const t=Math.round(e);e=Hh(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(Ga(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function Doe(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 Wd(e){return!isNaN(parseFloat(e))&&isFinite(e)}function Ioe(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function K3(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 ko(e){return e*(On/180)}function RR(e){return e*(180/On)}function HA(e){if(!$n(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function X3(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*On&&(o+=Pn),{angle:o,distance:i}}function L_(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function koe(e,t){return(e-t+Moe)%Pn-On}function $i(e){return(e%Pn+Pn)%Pn}function yp(e,t,n,r){const i=$i(e),o=$i(t),s=$i(n),a=$i(o-i),l=$i(s-i),c=$i(i-o),u=$i(i-s);return i===o||i===s||r&&o===s||a>l&&c<u}function fr(e,t,n){return Math.max(t,Math.min(n,e))}function Noe(e){return fr(e,-32768,32767)}function na(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function PR(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 ra=(e,t,n,r)=>PR(e,n,r?i=>{const o=e[i][t];return o<n||o===n&&e[i+1][t]===n}:i=>e[i][t]<n),Loe=(e,t,n)=>PR(e,n,r=>e[r][t]>=n);function Foe(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 Q3=["push","pop","shift","splice","unshift"];function joe(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Q3.forEach(n=>{const r="_onData"+ER(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 VA(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)&&(Q3.forEach(o=>{delete e[o]}),delete e._chartjs)}function J3(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const Z3=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function eF(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,Z3.call(window,()=>{r=!1,e.apply(t,n)}))}}function $oe(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const TR=e=>e==="start"?"left":e==="end"?"right":"center",Dr=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,zoe=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function tF(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=fr(Math.min(ra(a,l,c).lo,n?r:ra(t,l,s.getPixelForValue(c)).lo),0,r-1)),p?o=fr(Math.max(ra(a,s.axis,u,!0).hi+1,n?0:ra(t,l,s.getPixelForValue(u),!0).hi+1),i,r)-i:o=r-i}return{start:i,count:o}}function nF(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 cb=e=>e===0||e===1,WA=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Pn/n)),UA=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Pn/n)+1,Vh={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*Gn)+1,easeOutSine:e=>Math.sin(e*Gn),easeInOutSine:e=>-.5*(Math.cos(On*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=>cb(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=>cb(e)?e:WA(e,.075,.3),easeOutElastic:e=>cb(e)?e:UA(e,.075,.3),easeInOutElastic(e){return cb(e)?e:e<.5?.5*WA(e*2,.1125,.45):.5+.5*UA(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-Vh.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?Vh.easeInBounce(e*2)*.5:Vh.easeOutBounce(e*2-1)*.5+.5};function OR(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function GA(e){return OR(e)?e:new G3(e)}function l1(e){return OR(e)?e:new G3(e).saturate(.5).darken(.1).hexString()}const Boe=["x","y","borderWidth","radius","tension"],Hoe=["color","borderColor","backgroundColor"];function Voe(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:Hoe},numbers:{type:"number",properties:Boe}}),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 Woe(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const qA=new Map;function Uoe(e,t){t=t||{};const n=e+JSON.stringify(t);let r=qA.get(n);return r||(r=new Intl.NumberFormat(e,t),qA.set(n,r)),r}function Tg(e,t,n){return Uoe(t,n).format(e)}const rF={values(e){return Rn(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=Goe(e,n)}const s=Ga(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),Tg(e,r,l)},logarithmic(e,t,n){if(e===0)return"0";const r=n[t].significand||e/Math.pow(10,Math.floor(Ga(e)));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?rF.numeric.call(this,e,t,n):""}};function Goe(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 vv={formatters:rF};function qoe(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:vv.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 Nc=Object.create(null),F_=Object.create(null);function Wh(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 c1(e,t,n){return typeof t=="string"?gr(Wh(e,t),n):gr(Wh(e,""),t)}class Yoe{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)=>l1(i.backgroundColor),this.hoverBorderColor=(r,i)=>l1(i.borderColor),this.hoverColor=(r,i)=>l1(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 c1(this,t,n)}get(t){return Wh(this,t)}describe(t,n){return c1(F_,t,n)}override(t,n){return c1(Nc,t,n)}route(t,n,r,i){const o=Wh(this,t),s=Wh(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 Ot(l)?Object.assign({},c,l):nt(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var Tn=new Yoe({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Voe,Woe,qoe]);function Koe(e){return!e||Ct(e.size)||Ct(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function qy(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 Xoe(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&&!Rn(d))s=qy(e,i,o,s,d);else if(Rn(d))for(c=0,u=d.length;c<u;c++)p=d[c],p!=null&&!Rn(p)&&(s=qy(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 Fl(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 YA(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Yy(e,t,n,r){iF(e,t,n,r,null)}function iF(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)*Aoe;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,Pn):e.arc(n,r,b,0,Pn),e.closePath();break;case"triangle":u=i?i/2:b,e.moveTo(n+Math.sin(v)*u,r-Math.cos(v)*b),v+=zA,e.lineTo(n+Math.sin(v)*u,r-Math.cos(v)*b),v+=zA,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+Ll)*l,d=Math.cos(v+Ll)*(i?i/2-c:l),a=Math.sin(v+Ll)*l,p=Math.sin(v+Ll)*(i?i/2-c:l),e.arc(n-d,r-a,c,v-On,v-Gn),e.arc(n+p,r-s,c,v-Gn,v),e.arc(n+d,r+a,c,v,v+Gn),e.arc(n-p,r+s,c,v+Gn,v+On),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+=Ll;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+=Ll;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+=Ll,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 ia(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 bc(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function yc(e){e.restore()}function Qoe(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 Joe(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 Zoe(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),Ct(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 ese(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 tse(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Lc(e,t,n,r,i,o={}){const s=Rn(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(e.save(),e.font=i.string,Zoe(e,o),l=0;l<s.length;++l)c=s[l],o.backdrop&&tse(e,o.backdrop),a&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),Ct(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(c,n,r,o.maxWidth)),e.fillText(c,n,r,o.maxWidth),ese(e,n,r,c,o),r+=Number(i.lineHeight);e.restore()}function vp(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*On,On,!0),e.lineTo(n,r+o-s.bottomLeft),e.arc(n+s.bottomLeft,r+o-s.bottomLeft,s.bottomLeft,On,Gn,!0),e.lineTo(n+i-s.bottomRight,r+o),e.arc(n+i-s.bottomRight,r+o-s.bottomRight,s.bottomRight,Gn,0,!0),e.lineTo(n+i,r+s.topRight),e.arc(n+i-s.topRight,r+s.topRight,s.topRight,0,-Gn,!0),e.lineTo(n+s.topLeft,r)}const nse=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,rse=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function ise(e,t){const n=(""+e).match(nse);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 ose=e=>+e||0;function MR(e,t){const n={},r=Ot(t),i=r?Object.keys(t):t,o=Ot(e)?r?s=>nt(e[s],e[t[s]]):s=>e[s]:()=>e;for(const s of i)n[s]=ose(o(s));return n}function oF(e){return MR(e,{top:"y",right:"x",bottom:"y",left:"x"})}function vc(e){return MR(e,["topLeft","topRight","bottomLeft","bottomRight"])}function _r(e){const t=oF(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Xn(e,t){e=e||{},t=t||Tn.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(rse)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const i={family:nt(e.family,t.family),lineHeight:ise(nt(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:nt(e.weight,t.weight),string:""};return i.string=Koe(i),i}function Cn(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&&Rn(s)&&(s=s[n%s.length]),s!==void 0))return s}function sse(e,t,n){const{min:r,max:i}=e,o=q3(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 ml(e,t){return Object.assign(Object.create(e),t)}function AR(e,t=[""],n,r,i=()=>e[0]){const o=n||e;typeof r>"u"&&(r=cF("_fallback",e));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:r,_getTarget:i,override:a=>AR([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 aF(a,l,()=>pse(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return XA(a).includes(l)},ownKeys(a){return XA(a)},set(a,l,c){const u=a._storage||(a._storage=i());return a[l]=u[l]=c,delete a._keys,!0}})}function Ud(e,t,n,r){const i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:sF(e,r),setContext:o=>Ud(e,o,n,r),override:o=>Ud(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 aF(o,s,()=>lse(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 sF(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:al(n)?n:()=>n,isIndexable:al(r)?r:()=>r}}const ase=(e,t)=>e?e+ER(t):t,DR=(e,t)=>Ot(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function aF(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const r=n();return e[t]=r,r}function lse(e,t,n){const{_proxy:r,_context:i,_subProxy:o,_descriptors:s}=e;let a=r[t];return al(a)&&s.isScriptable(t)&&(a=cse(t,a,e,n)),Rn(a)&&a.length&&(a=use(t,a,e,s.isIndexable)),DR(t,a)&&(a=Ud(a,i,o&&o[t],s)),a}function cse(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),DR(e,l)&&(l=IR(i._scopes,i,e,l)),l}function use(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(Ot(t[0])){const l=t,c=i._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=IR(c,i,e,u);t.push(Ud(d,o,s&&s[e],a))}}return t}function lF(e,t,n){return al(e)?e(t,n):e}const dse=(e,t)=>e===!0?t:typeof e=="string"?sl(t,e):void 0;function fse(e,t,n,r,i){for(const o of t){const s=dse(n,o);if(s){e.add(s);const a=lF(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 IR(e,t,n,r){const i=t._rootScopes,o=lF(t._fallback,n,r),s=[...e,...i],a=new Set;a.add(r);let l=KA(a,s,n,o||n,r);return l===null||typeof o<"u"&&o!==n&&(l=KA(a,s,o,l,r),l===null)?!1:AR(Array.from(a),[""],i,o,()=>hse(t,n,r))}function KA(e,t,n,r,i){for(;n;)n=fse(e,t,n,r,i);return n}function hse(e,t,n){const r=e._getTarget();t in r||(r[t]={});const i=r[t];return Rn(i)&&Ot(n)?n:i||{}}function pse(e,t,n,r){let i;for(const o of t)if(i=cF(ase(o,e),n),typeof i<"u")return DR(e,i)?IR(n,r,e,i):i}function cF(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function XA(e){let t=e._keys;return t||(t=e._keys=gse(e._scopes)),t}function gse(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 uF(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(sl(u,o),c)};return s}const mse=Number.EPSILON||1e-14,Gd=(e,t)=>t<e.length&&!e[t].skip&&e[t],dF=e=>e==="x"?"y":"x";function bse(e,t,n,r){const i=e.skip?t:e,o=t,s=n.skip?t:n,a=L_(o,i),l=L_(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 yse(e,t,n){const r=e.length;let i,o,s,a,l,c=Gd(e,0);for(let u=0;u<r-1;++u)if(l=c,c=Gd(e,u+1),!(!l||!c)){if(Hh(t[u],0,mse)){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 vse(e,t,n="x"){const r=dF(n),i=e.length;let o,s,a,l=Gd(e,0);for(let c=0;c<i;++c){if(s=a,a=l,l=Gd(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 xse(e,t="x"){const n=dF(t),r=e.length,i=Array(r).fill(0),o=Array(r);let s,a,l,c=Gd(e,0);for(s=0;s<r;++s)if(a=l,l=c,c=Gd(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?us(i[s-1])!==us(i[s])?0:(i[s-1]+i[s])/2:i[s-1]:i[s]}yse(e,i,o),vse(e,o,t)}function ub(e,t,n){return Math.max(Math.min(e,n),t)}function wse(e,t){let n,r,i,o,s,a=ia(e[0],t);for(n=0,r=e.length;n<r;++n)s=o,o=a,a=n<r-1&&ia(e[n+1],t),o&&(i=e[n],s&&(i.cp1x=ub(i.cp1x,t.left,t.right),i.cp1y=ub(i.cp1y,t.top,t.bottom)),a&&(i.cp2x=ub(i.cp2x,t.left,t.right),i.cp2y=ub(i.cp2y,t.top,t.bottom)))}function Sse(e,t,n,r,i){let o,s,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")xse(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=bse(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&&wse(e,n)}function kR(){return typeof window<"u"&&typeof document<"u"}function NR(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Ky(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 xv=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function _se(e,t){return xv(e).getPropertyValue(t)}const Cse=["top","right","bottom","left"];function xc(e,t,n){const r={};n=n?"-"+n:"";for(let i=0;i<4;i++){const o=Cse[i];r[o]=parseFloat(e[t+"-"+o+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const Ese=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function Rse(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:o}=r;let s=!1,a,l;if(Ese(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 Vl(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,i=xv(n),o=i.boxSizing==="border-box",s=xc(i,"padding"),a=xc(i,"border","width"),{x:l,y:c,box:u}=Rse(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 Pse(e,t,n){let r,i;if(t===void 0||n===void 0){const o=e&&NR(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{const s=o.getBoundingClientRect(),a=xv(o),l=xc(a,"border","width"),c=xc(a,"padding");t=s.width-c.width-l.width,n=s.height-c.height-l.height,r=Ky(a.maxWidth,o,"clientWidth"),i=Ky(a.maxHeight,o,"clientHeight")}}return{width:t,height:n,maxWidth:r||Gy,maxHeight:i||Gy}}const db=e=>Math.round(e*10)/10;function Tse(e,t,n,r){const i=xv(e),o=xc(i,"margin"),s=Ky(i.maxWidth,e,"clientWidth")||Gy,a=Ky(i.maxHeight,e,"clientHeight")||Gy,l=Pse(e,t,n);let{width:c,height:u}=l;if(i.boxSizing==="content-box"){const p=xc(i,"border","width"),h=xc(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=db(Math.min(c,s,l.maxWidth)),u=db(Math.min(u,a,l.maxHeight)),c&&!u&&(u=db(c/2)),(t!==void 0||n!==void 0)&&r&&l.height&&u>l.height&&(u=l.height,c=db(Math.floor(u*r))),{width:c,height:u}}function QA(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 Ose=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};kR()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function JA(e,t){const n=_se(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function Wl(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function Mse(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 Ase(e,t,n,r){const i={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},s=Wl(e,i,n),a=Wl(i,o,n),l=Wl(o,t,n),c=Wl(s,a,n),u=Wl(a,l,n);return Wl(c,u,n)}const Dse=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}}},Ise=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Xu(e,t,n){return e?Dse(t,n):Ise()}function fF(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 hF(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function pF(e){return e==="angle"?{between:yp,compare:koe,normalize:$i}:{between:na,compare:(t,n)=>t-n,normalize:t=>t}}function ZA({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 kse(e,t,n){const{property:r,start:i,end:o}=n,{between:s,normalize:a}=pF(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 gF(e,t,n){if(!n)return[e];const{property:r,start:i,end:o}=n,s=t.length,{compare:a,between:l,normalize:c}=pF(r),{start:u,end:d,loop:p,style:h}=kse(e,t,n),m=[];let b=!1,v=null,x,w,_;const R=()=>l(i,_,x)&&a(i,_)!==0,C=()=>a(o,x)===0||l(o,_,x),T=()=>b||R(),M=()=>!b||C();for(let I=u,k=u;I<=d;++I)w=t[I%s],!w.skip&&(x=c(w[r]),x!==_&&(b=l(x,i,o),v===null&&T()&&(v=a(x,i)===0?I:k),v!==null&&M()&&(m.push(ZA({start:v,end:I,loop:p,count:s,style:h})),v=null),k=I,_=x));return v!==null&&m.push(ZA({start:v,end:d,loop:p,count:s,style:h})),m}function mF(e,t){const n=[],r=e.segments;for(let i=0;i<r.length;i++){const o=gF(r[i],e.points,t);o.length&&n.push(...o)}return n}function Nse(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 Lse(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 Fse(e,t){const n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];const o=!!e._loop,{start:s,end:a}=Nse(n,i,o,r);if(r===!0)return eD(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 eD(e,Lse(n,s,l,c),n,t)}function eD(e,t,n,r){return!r||!r.setContext||!n?t:jse(e,t,n,r)}function jse(e,t,n,r){const i=e._chart.getContext(),o=tD(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 w=a?-1:1;if(m!==b){for(m+=l;n[m%l].skip;)m-=w;for(;n[b%l].skip;)b+=w;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=tD(r.setContext(ml(i,{type:"segment",p0:b,p1:x,p0DataIndex:(p-1)%l,p1DataIndex:p%l,datasetIndex:s}))),$se(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 tD(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function $se(e,t){if(!t)return!1;const n=[],r=function(i,o){return OR(o)?(n.includes(o)||n.push(o),n.indexOf(o)):o};return JSON.stringify(e,r)!==JSON.stringify(t,r)}/*!
|
|
274
|
+
* Chart.js v4.4.7
|
|
275
|
+
* https://www.chartjs.org
|
|
276
|
+
* (c) 2024 Chart.js Contributors
|
|
277
|
+
* Released under the MIT License
|
|
278
|
+
*/class zse{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=Z3.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 Us=new zse;const nD="transparent",Bse={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=GA(e||nD),i=r.valid&&GA(t||nD);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class Hse{constructor(t,n,r,i){const o=n[r];i=Cn([t.to,i,o,t.from]);const s=Cn([t.from,o,i]);this._active=!0,this._fn=t.fn||Bse[t.type||typeof s],this._easing=Vh[t.easing]||Vh.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=Cn([t.to,n,i,t.from]),this._from=Cn([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 bF{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Ot(t))return;const n=Object.keys(Tn.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const o=t[i];if(!Ot(o))return;const s={};for(const a of n)s[a]=o[a];(Rn(o.properties)&&o.properties||[i]).forEach(a=>{(a===i||!r.has(a))&&r.set(a,s)})})}_animateOptions(t,n){const r=n.options,i=Wse(t,r);if(!i)return[];const o=this._createAnimations(i,r);return r.$shared&&Vse(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 Hse(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 Us.add(this._chart,r),!0}}function Vse(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 Wse(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 rD(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 Use(e,t,n){if(n===!1)return!1;const r=rD(e,n),i=rD(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function Gse(e){let t,n,r,i;return Ot(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 yF(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 iD(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],$n(c)&&(o||t===0||us(t)===us(c))&&(t+=c)}return!u&&!r.all?0:t}function qse(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 u1(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function Yse(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function Kse(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 Xse(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function oD(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 sD(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=Yse(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]=Xse(i,u,b),p[a]=v,p._top=oD(p,s,!0,r.type),p._bottom=oD(p,s,!1,r.type);const w=p._visualValues||(p._visualValues={});w[a]=v}}function d1(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function Qse(e,t){return ml(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Jse(e,t,n){return ml(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function Xf(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 f1=e=>e==="reset"||e==="none",aD=(e,t)=>t?e:Object.assign({},e),Zse=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:yF(n,!0),values:null};class go{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=u1(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&&Xf(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,d1(t,"x")),s=n.yAxisID=nt(r.yAxisID,d1(t,"y")),a=n.rAxisID=nt(r.rAxisID,d1(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&&VA(this._data,this),t._stacked&&Xf(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(Ot(n)){const i=this._cachedMeta;this._data=qse(n,i)}else if(r!==n){if(r){VA(r,this);const i=this._cachedMeta;Xf(i),i._parsed=[]}n&&Object.isExtensible(n)&&joe(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=u1(n.vScale,n),n.stack!==r.stack&&(i=!0,Xf(n),n.stack=r.stack),this._resyncElements(t),(i||o!==n._stacked)&&(sD(this,n._parsed),n._stacked=u1(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{Rn(i[t])?p=this.parseArrayData(r,i,t,n):Ot(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&&sD(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(sl(h,a),p),y:s.parse(sl(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:yF(i,!0),values:n._stacks[t.axis]._visualValues};return iD(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=iD(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=Zse(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=Kse(a);let p,h;function m(){h=i[p];const b=h[a.axis];return!$n(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],$n(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=Gse(nt(this.options.clip,Use(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=Jse(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=Qse(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&&bp(r);if(a)return aD(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(Tn.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(aD(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 bF(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||f1(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){f1(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!f1(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&&Xf(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(go,"defaults",{}),Me(go,"datasetElementType",null),Me(go,"dataElementType",null);function eae(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=J3(r.sort((i,o)=>i-o))}return e._cache.$bar}function tae(e){const t=e.iScale,n=eae(t,e.type);let r=t._length,i,o,s,a;const l=()=>{s===32767||s===-32768||(bp(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 nae(e,t,n,r){const i=n.barThickness;let o,s;return Ct(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 rae(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 iae(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 vF(e,t,n,r){return Rn(e)?iae(e,t,n,r):t[n.axis]=n.parse(e,r),t}function lD(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(vF(p,d,o,c));return l}function h1(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function oae(e,t,n){return e!==0?us(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function sae(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 aae(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}=sae(e);i==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?i=c:(n._bottom||0)===r?i=u:(o[cD(u,s,a,l)]=!0,i=c)),o[cD(i,s,a,l)]=!0,e.borderSkipped=o}function cD(e,t,n,r){return r?(e=lae(e,t,n),e=uD(e,n,t)):e=uD(e,t,n),e}function lae(e,t,n){return e===t?n:e===n?t:e}function uD(e,t,n){return e==="start"?t:e==="end"?n:e}function cae(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class ay extends go{parsePrimitiveData(t,n,r,i){return lD(t,n,r,i)}parseArrayData(t,n,r,i){return lD(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(sl(b,c),p),d.push(vF(sl(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=h1(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||Ct(m[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(h),v=this._calculateBarIndexPixels(h,u),x=(m._stacks||{})[a.axis],w={horizontal:c,base:b.base,enableBorderRadius:!x||h1(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&&(w.options=d||this.resolveDataElementOptions(h,t[h].active?"active":i));const _=w.options||t[h].options;aae(w,_,x,s),cae(w,_,u.ratio),this.updateElement(t[h],h,w,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(Ct(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||tae(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=h1(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&&us(d)!==us(c.barEnd)&&(p=0),p+=d);const v=!Ct(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=oae(b,n,a)*s,d===a&&(x-=b/2);const w=n.getPixelForDecimal(0),_=n.getPixelForDecimal(1),R=Math.min(w,_),C=Math.max(w,_);x=Math.max(Math.min(x,C),R),m=x+b,r&&!u&&(l._stacks[n.axis]._visualValues[i]=n.getValueForPixel(m)-n.getValueForPixel(x))}if(x===n.getPixelForValue(a)){const w=us(b)*n.getLineWidthForValue(a)/2;x+=w,b-=w}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"?rae(t,n,i,c):nae(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(ay,"id","bar"),Me(ay,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),Me(ay,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class ly extends go{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(ly,"id","bubble"),Me(ly,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),Me(ly,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function uae(e,t,n){let r=1,i=1,o=0,s=0;if(t<Pn){const a=e,l=a+t,c=Math.cos(a),u=Math.sin(a),d=Math.cos(l),p=Math.sin(l),h=(_,R,C)=>yp(_,a,l,!0)?1:Math.max(R,R*n,C,C*n),m=(_,R,C)=>yp(_,a,l,!0)?-1:Math.min(R,R*n,C,C*n),b=h(0,c,d),v=h(Gn,u,p),x=m(On,c,d),w=m(On+Gn,u,p);r=(b-x)/2,i=(v-w)/2,o=-(b+x)/2,s=-(v+w)/2}return{ratioX:r,ratioY:i,offsetX:o,offsetY:s}}class ec extends go{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(Ot(r[t])){const{key:l="value"}=this._parsing;o=c=>+sl(r[c],l)}let s,a;for(s=t,a=t+n;s<a;++s)i._parsed[s]=o(s)}}_getRotation(){return ko(this.options.rotation-90)}_getCircumference(){return ko(this.options.circumference)}_getRotationExtents(){let t=Pn,n=-Pn;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(Coe(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:p,ratioY:h,offsetX:m,offsetY:b}=uae(d,u,l),v=(r.width-s)/p,x=(r.height-s)/h,w=Math.max(Math.min(v,x)/2,0),_=q3(this.options.radius,w),R=Math.max(_*l,0),C=(_-R)/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/Pn)}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(),w;for(w=0;w<n;++w)x+=this._circumference(w,o);for(w=n;w<n+r;++w){const _=this._circumference(w,o),R=t[w],C={x:u+this.offsetX,y:d+this.offsetY,startAngle:x,endAngle:x+_,circumference:_,outerRadius:m,innerRadius:h};v&&(C.options=b||this.resolveDataElementOptions(w,R.active?"active":i)),x+=_,this.updateElement(R,w,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)?Pn*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,i=r.data.labels||[],o=Tg(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(ec,"id","doughnut"),Me(ec,"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(ec,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),Me(ec,"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 cy extends go{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}=tF(n,i,s);this._drawStart=a,this._drawCount=l,nF(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=Wd(m)?m:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||i==="none",w=n+r,_=t.length;let R=n>0&&this.getParsed(n-1);for(let C=0;C<_;++C){const T=t[C],M=x?T:{};if(C<n||C>=w){M.skip=!0;continue}const I=this.getParsed(C),k=Ct(I[h]),L=M[p]=s.getPixelForValue(I[p],C),j=M[h]=o||k?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,I,l):I[h],C);M.skip=isNaN(L)||isNaN(j)||k,M.stop=C>0&&Math.abs(I[p]-R[p])>v,b&&(M.parsed=I,M.raw=c.data[C]),d&&(M.options=u||this.resolveDataElementOptions(C,T.active?"active":i)),x||this.updateElement(T,C,M,i),R=I}}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(cy,"id","line"),Me(cy,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Me(cy,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Uh extends go{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=Tg(n._parsed[t].r,r.options.locale);return{label:i[t]||"",value:o}}parseObjectData(t,n,r,i){return uF.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*On;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,w=h+this._computeAngle(m,i,b),_=s.getDataVisibility(m)?c.getDistanceFromCenterForValue(this.getParsed(m).r):0;h=w,o&&(l.animateScale&&(_=0),l.animateRotate&&(x=w=p));const R={x:u,y:d,innerRadius:0,outerRadius:_,startAngle:x,endAngle:w,options:this.resolveDataElementOptions(m,v.active?"active":i)};this.updateElement(v,m,R,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)?ko(this.resolveDataElementOptions(t,n).angle||r):0}}Me(Uh,"id","polarArea"),Me(Uh,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),Me(Uh,"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 j_ extends ec{}Me(j_,"id","pie"),Me(j_,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class uy extends go{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 uF.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(uy,"id","radar"),Me(uy,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),Me(uy,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class dy extends go{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}=tF(n,r,i);if(this._drawStart=o,this._drawCount=s,nF(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=Wd(b)?b:Number.POSITIVE_INFINITY,w=this.chart._animationsDisabled||o||i==="none";let _=n>0&&this.getParsed(n-1);for(let R=n;R<n+r;++R){const C=t[R],T=this.getParsed(R),M=w?C:{},I=Ct(T[m]),k=M[h]=s.getPixelForValue(T[h],R),L=M[m]=o||I?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,T,l):T[m],R);M.skip=isNaN(k)||isNaN(L)||I,M.stop=R>0&&Math.abs(T[h]-_[h])>x,v&&(M.parsed=T,M.raw=c.data[R]),p&&(M.options=d||this.resolveDataElementOptions(R,C.active?"active":i)),w||this.updateElement(C,R,M,i),_=T}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(dy,"id","scatter"),Me(dy,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),Me(dy,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var dae=Object.freeze({__proto__:null,BarController:ay,BubbleController:ly,DoughnutController:ec,LineController:cy,PieController:j_,PolarAreaController:Uh,RadarController:uy,ScatterController:dy});function jl(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class LR{constructor(t){Me(this,"options");this.options=t||{}}static override(t){Object.assign(LR.prototype,t)}init(){}formats(){return jl()}parse(){return jl()}format(){return jl()}add(){return jl()}diff(){return jl()}startOf(){return jl()}endOf(){return jl()}}var fae={_date:LR};function hae(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?Loe:ra;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 Og(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}=hae(o[a],t,s,i);for(let h=d;h<=p;++h){const m=u[h];m.skip||r(m,c,h)}}}function pae(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 p1(e,t,n,r,i){const o=[];return!i&&!e.isPointInArea(t)||Og(e,n,t,function(a,l,c){!i&&!ia(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function gae(e,t,n,r){let i=[];function o(s,a,l){const{startAngle:c,endAngle:u}=s.getProps(["startAngle","endAngle"],r),{angle:d}=X3(s,{x:t.x,y:t.y});yp(d,c,u)&&i.push({element:s,datasetIndex:a,index:l})}return Og(e,n,t,o),i}function mae(e,t,n,r,i,o){let s=[];const a=pae(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 Og(e,n,t,c),s}function g1(e,t,n,r,i,o){return!o&&!e.isPointInArea(t)?[]:n==="r"&&!r?gae(e,t,n,i):mae(e,t,n,r,i,o)}function dD(e,t,n,r,i){const o=[],s=n==="x"?"inXRange":"inYRange";let a=!1;return Og(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 bae={evaluateInteractionItems:Og,modes:{index(e,t,n,r){const i=Vl(t,e),o=n.axis||"x",s=n.includeInvisible||!1,a=n.intersect?p1(e,i,o,r,s):g1(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=Vl(t,e),o=n.axis||"xy",s=n.includeInvisible||!1;let a=n.intersect?p1(e,i,o,r,s):g1(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=Vl(t,e),o=n.axis||"xy",s=n.includeInvisible||!1;return p1(e,i,o,r,s)},nearest(e,t,n,r){const i=Vl(t,e),o=n.axis||"xy",s=n.includeInvisible||!1;return g1(e,i,o,n.intersect,r,s)},x(e,t,n,r){const i=Vl(t,e);return dD(e,i,"x",n.intersect,r)},y(e,t,n,r){const i=Vl(t,e);return dD(e,i,"y",n.intersect,r)}}};const xF=["left","top","right","bottom"];function Qf(e,t){return e.filter(n=>n.pos===t)}function fD(e,t){return e.filter(n=>xF.indexOf(n.pos)===-1&&n.box.axis===t)}function Jf(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 yae(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 vae(e){const t={};for(const n of e){const{stack:r,pos:i,stackWeight:o}=n;if(!r||!xF.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 xae(e,t){const n=vae(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 wae(e){const t=yae(e),n=Jf(t.filter(c=>c.box.fullSize),!0),r=Jf(Qf(t,"left"),!0),i=Jf(Qf(t,"right")),o=Jf(Qf(t,"top"),!0),s=Jf(Qf(t,"bottom")),a=fD(t,"x"),l=fD(t,"y");return{fullSize:n,leftAndTop:r.concat(o),rightAndBottom:i.concat(l).concat(s).concat(a),chartArea:Qf(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:o.concat(s).concat(a)}}function hD(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function wF(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 Sae(e,t,n,r){const{pos:i,box:o}=n,s=e.maxPadding;if(!Ot(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&&wF(s,o.getPadding());const a=Math.max(0,t.outerWidth-hD(s,e,"left","right")),l=Math.max(0,t.outerHeight-hD(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 _ae(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 Cae(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 Rh(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,Cae(a.horizontal,t));const{same:d,other:p}=Sae(t,n,a,r);c|=d&&i.length,u=u||p,l.fullSize||i.push(a)}return c&&Rh(i,t,n,r)||u}function fb(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 pD(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;bp(c.start)&&(s=c.start),l.fullSize?fb(l,i.left,s,n.outerWidth-i.right-i.left,p):fb(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;bp(c.start)&&(o=c.start),l.fullSize?fb(l,o,i.top,p,n.outerHeight-i.bottom-i.top):fb(l,o,t.top+c.placed,p,d),c.start=o,c.placed+=d,o=l.right}}t.x=o,t.y=s}var Nr={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=_r(e.options.layout.padding),o=Math.max(t-i.width,0),s=Math.max(n-i.height,0),a=wae(e.boxes),l=a.vertical,c=a.horizontal;Jt(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);wF(p,_r(r));const h=Object.assign({maxPadding:p,w:o,h:s,x:i.left,y:i.top},i),m=xae(l.concat(c),d);Rh(a.fullSize,h,d,m),Rh(l,h,d,m),Rh(c,h,d,m)&&Rh(l,h,d,m),_ae(h),pD(a.leftAndTop,h,d,m),h.x+=h.w,h.y+=h.h,pD(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},Jt(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 SF{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 Eae extends SF{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const fy="$chartjs",Rae={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},gD=e=>e===null||e==="";function Pae(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[fy]={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",gD(i)){const o=JA(e,"width");o!==void 0&&(e.width=o)}if(gD(r))if(e.style.height==="")e.height=e.width/(t||2);else{const o=JA(e,"height");o!==void 0&&(e.height=o)}return e}const _F=Ose?{passive:!0}:!1;function Tae(e,t,n){e&&e.addEventListener(t,n,_F)}function Oae(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,_F)}function Mae(e,t){const n=Rae[e.type]||e.type,{x:r,y:i}=Vl(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function Xy(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function Aae(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let s=!1;for(const a of o)s=s||Xy(a.addedNodes,r),s=s&&!Xy(a.removedNodes,r);s&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function Dae(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let s=!1;for(const a of o)s=s||Xy(a.removedNodes,r),s=s&&!Xy(a.addedNodes,r);s&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const xp=new Map;let mD=0;function CF(){const e=window.devicePixelRatio;e!==mD&&(mD=e,xp.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function Iae(e,t){xp.size||window.addEventListener("resize",CF),xp.set(e,t)}function kae(e){xp.delete(e),xp.size||window.removeEventListener("resize",CF)}function Nae(e,t,n){const r=e.canvas,i=r&&NR(r);if(!i)return;const o=eF((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),Iae(e,o),s}function m1(e,t,n){n&&n.disconnect(),t==="resize"&&kae(e)}function Lae(e,t,n){const r=e.canvas,i=eF(o=>{e.ctx!==null&&n(Mae(o,e))},e);return Tae(r,t,i),i}class Fae extends SF{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(Pae(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[fy])return!1;const r=n[fy].initial;["height","width"].forEach(o=>{const s=r[o];Ct(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[fy],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),s={attach:Aae,detach:Dae,resize:Nae}[n]||Lae;i[n]=s(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:m1,detach:m1,resize:m1}[n]||Oae)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return Tse(t,n,r,i)}isAttached(t){const n=t&&NR(t);return!!(n&&n.isConnected)}}function jae(e){return!kR()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?Eae:Fae}var oy;let Rs=(oy=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 Wd(this.x)&&Wd(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(oy,"defaults",{}),Me(oy,"defaultRoutes"),oy);function $ae(e,t){const n=e.options.ticks,r=zae(e),i=Math.min(n.maxTicksLimit||r,r),o=n.major.enabled?Hae(t):[],s=o.length,a=o[0],l=o[s-1],c=[];if(s>i)return Vae(t,c,o,s/i),c;const u=Bae(o,t,i);if(s>0){let d,p;const h=s>1?Math.round((l-a)/(s-1)):null;for(hb(t,c,u,Ct(h)?0:a-h,a),d=0,p=s-1;d<p;d++)hb(t,c,u,o[d],o[d+1]);return hb(t,c,u,l,Ct(h)?t.length:l+h),c}return hb(t,c,u),c}function zae(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 Bae(e,t,n){const r=Wae(e),i=t.length/n;if(!r)return Math.max(i,1);const o=Doe(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 Hae(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function Vae(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 hb(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 Wae(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 Uae=e=>e==="left"?"right":e==="right"?"left":e,bD=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,yD=(e,t)=>Math.min(t||e,e);function vD(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 Gae(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 qae(e,t){Jt(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 Zf(e){return e.drawTicks?e.tickLength:0}function xD(e,t){if(!e.display)return 0;const n=Xn(e.font,t),r=_r(e.padding);return(Rn(e.text)?e.text.length:1)*n.lineHeight+r.height}function Yae(e,t){return ml(e,{scale:t,type:"scale"})}function Kae(e,t,n){return ml(e,{tick:n,index:t,type:"tick"})}function Xae(e,t,n){let r=TR(e);return(n&&t!=="right"||!n&&t==="right")&&(r=Uae(r)),r}function Qae(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=Dr(r,o,a),Ot(n)){const x=Object.keys(n)[0],w=n[x];m=u[x].getPixelForValue(w)+b-t}else n==="center"?m=(c.bottom+c.top)/2+b-t:m=bD(e,n,t);p=a-o}else{if(Ot(n)){const x=Object.keys(n)[0],w=n[x];h=u[x].getPixelForValue(w)-v+t}else n==="center"?h=(c.left+c.right)/2-v+t:h=bD(e,n,t);m=Dr(r,s,i),d=n==="left"?-Gn:Gn}return{titleX:h,titleY:m,maxWidth:p,rotation:d}}class bl extends Rs{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=Li(t,Number.POSITIVE_INFINITY),n=Li(n,Number.NEGATIVE_INFINITY),r=Li(r,Number.POSITIVE_INFINITY),i=Li(i,Number.NEGATIVE_INFINITY),{min:Li(t,r),max:Li(n,i),minDefined:$n(t),maxDefined:$n(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:Li(n,Li(r,n)),max:Li(r,Li(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(){an(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=sse(this,o,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?vD(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=$ae(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(){an(this.options.afterUpdate,[this])}beforeSetDimensions(){an(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(){an(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),an(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){an(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=an(n.callback,[o.value,r,t],this)}afterTickToLabelConversion(){an(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){an(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=yD(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=fr(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-Zf(t.grid)-n.padding-xD(t.title,this.chart.options.font),c=Math.sqrt(d*d+p*p),s=RR(Math.min(Math.asin(fr((u.highest.height+6)/a,-1,1)),Math.asin(fr(l/c,-1,1))-Math.asin(fr(p/c,-1,1)))),s=Math.max(i,Math.min(o,s))),this.labelRotation=s}afterCalculateLabelRotation(){an(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){an(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=xD(i,n.options.font);if(a?(t.width=this.maxWidth,t.height=Zf(o)+l):(t.height=this.maxHeight,t.width=Zf(o)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:p}=this._getLabelSizes(),h=r.padding*2,m=ko(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(){an(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++)Ct(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=vD(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/yD(n,r));let c=0,u=0,d,p,h,m,b,v,x,w,_,R,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:[]},w=b.lineHeight,_=R=0,!Ct(m)&&!Rn(m))_=qy(i,x.data,x.gc,_,m),R=w;else if(Rn(m))for(p=0,h=m.length;p<h;++p)C=m[p],!Ct(C)&&!Rn(C)&&(_=qy(i,x.data,x.gc,_,C),R+=w);s.push(_),a.push(R),c=Math.max(_,c),u=Math.max(R,u)}qae(o,n);const T=s.indexOf(c),M=a.indexOf(u),I=k=>({width:s[k]||0,height:a[k]||0});return{first:I(0),last:I(n-1),widest:I(T),highest:I(M),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 Noe(this._alignToPixels?Fl(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=Kae(this.getContext(),t,r))}return this.$context||(this.$context=Yae(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=ko(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=Zf(o),h=[],m=a.setContext(this.getContext()),b=m.display?m.width:0,v=b/2,x=function(G){return Fl(r,G,b)};let w,_,R,C,T,M,I,k,L,j,$,X;if(s==="top")w=x(this.bottom),M=this.bottom-p,k=w-v,j=x(t.top)+v,X=t.bottom;else if(s==="bottom")w=x(this.top),j=t.top,X=x(t.bottom)-v,M=w+v,k=this.top+p;else if(s==="left")w=x(this.right),T=this.right-p,I=w-v,L=x(t.left)+v,$=t.right;else if(s==="right")w=x(this.left),L=t.left,$=x(t.right)-v,T=w+v,I=this.left+p;else if(n==="x"){if(s==="center")w=x((t.top+t.bottom)/2+.5);else if(Ot(s)){const G=Object.keys(s)[0],B=s[G];w=x(this.chart.scales[G].getPixelForValue(B))}j=t.top,X=t.bottom,M=w+v,k=M+p}else if(n==="y"){if(s==="center")w=x((t.left+t.right)/2);else if(Ot(s)){const G=Object.keys(s)[0],B=s[G];w=x(this.chart.scales[G].getPixelForValue(B))}T=w-v,I=T-p,L=t.left,$=t.right}const H=nt(i.ticks.maxTicksLimit,d),F=Math.max(1,Math.ceil(d/H));for(_=0;_<d;_+=F){const G=this.getContext(_),B=o.setContext(G),W=a.setContext(G),K=B.lineWidth,D=B.color,Y=W.dash||[],U=W.dashOffset,A=B.tickWidth,te=B.tickColor,q=B.tickBorderDash||[],se=B.tickBorderDashOffset;R=Gae(this,_,l),R!==void 0&&(C=Fl(r,R,K),c?T=I=L=$=C:M=k=j=X=C,h.push({tx1:T,ty1:M,tx2:I,ty2:k,x1:L,y1:j,x2:$,y2:X,width:K,color:D,borderDash:Y,borderDashOffset:U,tickWidth:A,tickColor:te,tickBorderDash:q,tickBorderDashOffset:se}))}return this._ticksLength=d,this._borderValue=w,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=Zf(r.grid),h=p+u,m=d?-u:h,b=-ko(this.labelRotation),v=[];let x,w,_,R,C,T,M,I,k,L,j,$,X="middle";if(i==="top")T=this.bottom-m,M=this._getXAxisLabelAlignment();else if(i==="bottom")T=this.top+m,M=this._getXAxisLabelAlignment();else if(i==="left"){const F=this._getYAxisLabelAlignment(p);M=F.textAlign,C=F.x}else if(i==="right"){const F=this._getYAxisLabelAlignment(p);M=F.textAlign,C=F.x}else if(n==="x"){if(i==="center")T=(t.top+t.bottom)/2+h;else if(Ot(i)){const F=Object.keys(i)[0],G=i[F];T=this.chart.scales[F].getPixelForValue(G)+h}M=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")C=(t.left+t.right)/2-h;else if(Ot(i)){const F=Object.keys(i)[0],G=i[F];C=this.chart.scales[F].getPixelForValue(G)}M=this._getYAxisLabelAlignment(p).textAlign}n==="y"&&(l==="start"?X="top":l==="end"&&(X="bottom"));const H=this._getLabelSizes();for(x=0,w=a.length;x<w;++x){_=a[x],R=_.label;const F=o.setContext(this.getContext(x));I=this.getPixelForTick(x)+o.labelOffset,k=this._resolveTickFontOptions(x),L=k.lineHeight,j=Rn(R)?R.length:1;const G=j/2,B=F.color,W=F.textStrokeColor,K=F.textStrokeWidth;let D=M;s?(C=I,M==="inner"&&(x===w-1?D=this.options.reverse?"left":"right":x===0?D=this.options.reverse?"right":"left":D="center"),i==="top"?c==="near"||b!==0?$=-j*L+L/2:c==="center"?$=-H.highest.height/2-G*L+L:$=-H.highest.height+L/2:c==="near"||b!==0?$=L/2:c==="center"?$=H.highest.height/2-G*L:$=H.highest.height-j*L,d&&($*=-1),b!==0&&!F.showLabelBackdrop&&(C+=L/2*Math.sin(b))):(T=I,$=(1-j)*L/2);let Y;if(F.showLabelBackdrop){const U=_r(F.backdropPadding),A=H.heights[x],te=H.widths[x];let q=$-U.top,se=0-U.left;switch(X){case"middle":q-=A/2;break;case"bottom":q-=A;break}switch(M){case"center":se-=te/2;break;case"right":se-=te;break;case"inner":x===w-1?se-=te:x>0&&(se-=te/2);break}Y={left:se,top:q,width:te+U.width,height:A+U.height,color:F.backdropColor}}v.push({label:R,font:k,textOffset:$,options:{rotation:b,color:B,strokeColor:W,strokeWidth:K,textAlign:D,textBaseline:X,translation:[C,T],backdrop:Y}})}return v}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-ko(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=Fl(t,this.left,s)-s/2,u=Fl(t,this.right,a)+a/2,d=p=l):(d=Fl(t,this.top,s)-s/2,p=Fl(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&&bc(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;Lc(r,c,0,u,l,a)}i&&yc(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const o=Xn(r.font),s=_r(r.padding),a=r.align;let l=o.lineHeight/2;n==="bottom"||n==="center"||Ot(n)?(l+=s.bottom,Rn(r.text)&&(l+=o.lineHeight*(r.text.length-1))):l+=s.top;const{titleX:c,titleY:u,maxWidth:d,rotation:p}=Qae(this,l,n,a);Lc(t,r.text,0,0,o,{color:r.color,maxWidth:d,rotation:p,textAlign:Xae(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!==bl.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 Xn(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class pb{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;ele(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,Jae(t,s,r),this.override&&Tn.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 Tn[i]&&(delete Tn[i][r],this.override&&delete Nc[r])}}function Jae(e,t,n){const r=gr(Object.create(null),[n?Tn.get(n):{},Tn.get(t),e.defaults]);Tn.set(t,r),e.defaultRoutes&&Zae(t,e.defaultRoutes),e.descriptors&&Tn.describe(t,e.descriptors)}function Zae(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(".");Tn.route(o,i,l,a)})}function ele(e){return"id"in e&&"defaults"in e}class tle{constructor(){this.controllers=new pb(go,"datasets",!0),this.elements=new pb(Rs,"elements"),this.plugins=new pb(Object,"plugins"),this.scales=new pb(bl,"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):Jt(i,s=>{const a=r||this._getRegistryForType(s);this._exec(t,a,s)})})}_exec(t,n,r){const i=ER(t);an(r["before"+i],[],r),n[t](r),an(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 Zr=new tle;class nle{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(an(a,l,s)===!1&&i.cancelable)return!1}return!0}invalidate(){Ct(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=rle(r);return i===!1&&!n?[]:ole(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 rle(e){const t={},n=[],r=Object.keys(Zr.plugins.items);for(let o=0;o<r.length;o++)n.push(Zr.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 ile(e,t){return!t&&e===!1?null:e===!0?{}:e}function ole(e,{plugins:t,localIds:n},r,i){const o=[],s=e.getContext();for(const a of t){const l=a.id,c=ile(r[l],i);c!==null&&o.push({plugin:a,options:sle(e.config,{plugin:a,local:n[l]},c,s)})}return o}function sle(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 $_(e,t){const n=Tn.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function ale(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function lle(e,t){return e===t?"_index_":"_value_"}function wD(e){if(e==="x"||e==="y"||e==="r")return e}function cle(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function z_(e,...t){if(wD(e))return e;for(const n of t){const r=n.axis||cle(n.position)||e.length>1&&wD(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function SD(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function ule(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 SD(e,"x",n[0])||SD(e,"y",n[0])}return{}}function dle(e,t){const n=Nc[e.type]||{scales:{}},r=t.scales||{},i=$_(e.type,t),o=Object.create(null);return Object.keys(r).forEach(s=>{const a=r[s];if(!Ot(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=z_(s,a,ule(s,e),Tn.scales[a.type]),c=lle(l,i),u=n.scales||{};o[s]=Bh(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(s=>{const a=s.type||e.type,l=s.indexAxis||$_(a,t),u=(Nc[a]||{}).scales||{};Object.keys(u).forEach(d=>{const p=ale(d,l),h=s[p+"AxisID"]||p;o[h]=o[h]||Object.create(null),Bh(o[h],[{axis:p},r[h],u[d]])})}),Object.keys(o).forEach(s=>{const a=o[s];Bh(a,[Tn.scales[a.type],Tn.scale])}),o}function EF(e){const t=e.options||(e.options={});t.plugins=nt(t.plugins,{}),t.scales=dle(e,t)}function RF(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function fle(e){return e=e||{},e.data=RF(e.data),EF(e),e}const _D=new Map,PF=new Set;function gb(e,t){let n=_D.get(e);return n||(n=t(),_D.set(e,n),PF.add(n)),n}const eh=(e,t,n)=>{const r=sl(t,n);r!==void 0&&e.add(r)};class hle{constructor(t){this._config=fle(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=RF(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(),EF(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return gb(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return gb(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return gb(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return gb(`${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=>eh(l,t,d))),u.forEach(d=>eh(l,i,d)),u.forEach(d=>eh(l,Nc[o]||{},d)),u.forEach(d=>eh(l,Tn,d)),u.forEach(d=>eh(l,F_,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),PF.has(n)&&s.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Nc[n]||{},Tn.datasets[n]||{},{type:n},Tn,F_]}resolveNamedOptions(t,n,r,i=[""]){const o={$shared:!0},{resolver:s,subPrefixes:a}=CD(this._resolverCache,t,i);let l=s;if(gle(s,n)){o.$shared=!1,r=al(r)?r():r;const c=this.createResolver(t,r,a);l=Ud(s,r,c)}for(const c of n)o[c]=l[c];return o}createResolver(t,n,r=[""],i){const{resolver:o}=CD(this._resolverCache,t,r);return Ot(n)?Ud(o,n,void 0,i):o}}function CD(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:AR(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(i,o)),o}const ple=e=>Ot(e)&&Object.getOwnPropertyNames(e).some(t=>al(e[t]));function gle(e,t){const{isScriptable:n,isIndexable:r}=sF(e);for(const i of t){const o=n(i),s=r(i),a=(s||o)&&e[i];if(o&&(al(a)||ple(a))||s&&Rn(a))return!0}return!1}var mle="4.4.7";const ble=["top","bottom","left","right","chartArea"];function ED(e,t){return e==="top"||e==="bottom"||ble.indexOf(e)===-1&&t==="x"}function RD(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function PD(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),an(n&&n.onComplete,[e],t)}function yle(e){const t=e.chart,n=t.options.animation;an(n&&n.onProgress,[e],t)}function TF(e){return kR()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const hy={},TD=e=>{const t=TF(e);return Object.values(hy).filter(n=>n.canvas===t).pop()};function vle(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 xle(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}function mb(e,t,n){return e.options.clip?e[n]:t[n]}function wle(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:mb(n,t,"left"),right:mb(n,t,"right"),top:mb(r,t,"top"),bottom:mb(r,t,"bottom")}:t}class In{static register(...t){Zr.add(...t),OD()}static unregister(...t){Zr.remove(...t),OD()}constructor(t,n){const r=this.config=new hle(n),i=TF(t),o=TD(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||jae(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=_oe(),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 nle,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=$oe(d=>this.update(d),s.resizeDelay||0),this._dataChanges=[],hy[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Us.listen(this,"complete",PD),Us.listen(this,"progress",yle),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:i,_aspectRatio:o}=this;return Ct(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 Zr}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():QA(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return YA(this.canvas,this.ctx),this}stop(){return Us.stop(this),this}resize(t,n){Us.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,QA(this,a,!0)&&(this.notifyPlugins("resize",{size:s}),an(r.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Jt(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=z_(s,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Jt(o,s=>{const a=s.options,l=a.id,c=z_(l,a),u=nt(a.type,s.dtype);(a.position===void 0||ED(a.position,c)!==ED(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=Zr.getScale(u);d=new p({id:l,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(a,t)}),Jt(i,(s,a)=>{s||delete r[a]}),Jt(r,s=>{Nr.configure(this,s,s.options),Nr.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(RD("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||$_(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=Zr.getController(a),{datasetElementType:c,dataElementType:u}=Tn.datasets[a];Object.assign(l,{dataElementType:Zr.getElement(u),datasetElementType:c&&Zr.getElement(c)}),s.controller=new l(this,r),t.push(s.controller)}}return this._updateMetasets(),t}_resetElements(){Jt(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||Jt(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(RD("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Jt(this.scales,t=>{Nr.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!$A(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;vle(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(!$A(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;Nr.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Jt(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,al(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&&(Us.has(this)?this.attached&&!Us.running(this)&&Us.start(this):(this.draw(),PD({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=wle(t,this.chartArea),s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(i&&bc(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&&yc(n),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return ia(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const o=bae.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=ml(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);bp(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(),Us.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(),YA(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete hy[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)};Jt(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(){Jt(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Jt(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}});!Wy(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=Ooe(t),c=xle(t,this._lastEvent,r,l);r&&(this._lastEvent=null,an(o.onHover,[t,a,this],this),l&&an(o.onClick,[t,a,this],this));const u=!Wy(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(In,"defaults",Tn),Me(In,"instances",hy),Me(In,"overrides",Nc),Me(In,"registry",Zr),Me(In,"version",mle),Me(In,"getChart",TD);function OD(){return Jt(In.instances,e=>e._plugins.invalidate())}function Sle(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+Gn,r-Gn),e.closePath(),e.clip()}function _le(e){return MR(e,["outerStart","outerEnd","innerStart","innerEnd"])}function Cle(e,t,n,r){const i=_le(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 fr(l,0,Math.min(o,c))};return{outerStart:a(i.outerStart),outerEnd:a(i.outerEnd),innerStart:fr(i.innerStart,0,s),innerEnd:fr(i.innerEnd,0,s)}}function Eu(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function Qy(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 F=u>0?u-r:0,G=d>0?d-r:0,B=(F+G)/2,W=B!==0?m*B/(B+r):m;h=(m-W)/2}const b=Math.max(.001,m*d-n/On)/d,v=(m-b)/2,x=l+v+h,w=i-v-h,{outerStart:_,outerEnd:R,innerStart:C,innerEnd:T}=Cle(t,p,d,w-x),M=d-_,I=d-R,k=x+_/M,L=w-R/I,j=p+C,$=p+T,X=x+C/j,H=w-T/$;if(e.beginPath(),o){const F=(k+L)/2;if(e.arc(s,a,d,k,F),e.arc(s,a,d,F,L),R>0){const K=Eu(I,L,s,a);e.arc(K.x,K.y,R,L,w+Gn)}const G=Eu($,w,s,a);if(e.lineTo(G.x,G.y),T>0){const K=Eu($,H,s,a);e.arc(K.x,K.y,T,w+Gn,H+Math.PI)}const B=(w-T/p+(x+C/p))/2;if(e.arc(s,a,p,w-T/p,B,!0),e.arc(s,a,p,B,x+C/p,!0),C>0){const K=Eu(j,X,s,a);e.arc(K.x,K.y,C,X+Math.PI,x-Gn)}const W=Eu(M,x,s,a);if(e.lineTo(W.x,W.y),_>0){const K=Eu(M,k,s,a);e.arc(K.x,K.y,_,x-Gn,k)}}else{e.moveTo(s,a);const F=Math.cos(k)*d+s,G=Math.sin(k)*d+a;e.lineTo(F,G);const B=Math.cos(L)*d+s,W=Math.sin(L)*d+a;e.lineTo(B,W)}e.closePath()}function Ele(e,t,n,r,i){const{fullCircles:o,startAngle:s,circumference:a}=t;let l=t.endAngle;if(o){Qy(e,t,n,r,l,i);for(let c=0;c<o;++c)e.fill();isNaN(a)||(l=s+(a%Pn||Pn))}return Qy(e,t,n,r,l,i),e.fill(),l}function Rle(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){Qy(e,t,n,r,m,i);for(let b=0;b<o;++b)e.stroke();isNaN(a)||(m=s+(a%Pn||Pn))}h&&Sle(e,t,m),o||(Qy(e,t,n,r,m,i),e.stroke())}class $u extends Rs{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}=X3(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=yp(s,l,c)&&l!==c,v=m>=Pn||b,x=na(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>Pn?Math.floor(i/Pn):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(On,i||0)),u=o*c;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,Ele(n,this,u,s,a),Rle(n,this,u,s,a),n.restore()}}Me($u,"id","arc"),Me($u,"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($u,"defaultRoutes",{backgroundColor:"backgroundColor"}),Me($u,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function OF(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 Ple(e,t,n){e.lineTo(n.x,n.y)}function Tle(e){return e.stepped?Qoe:e.tension||e.cubicInterpolationMode==="monotone"?Joe:Ple}function MF(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 Ole(e,t,n,r){const{points:i,options:o}=t,{count:s,start:a,loop:l,ilen:c}=MF(i,n,r),u=Tle(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 Mle(e,t,n,r){const i=t.points,{count:o,start:s,ilen:a}=MF(i,n,r),{move:l=!0,reverse:c}=r||{};let u=0,d=0,p,h,m,b,v,x;const w=R=>(s+(c?a-R:R))%o,_=()=>{b!==v&&(e.lineTo(u,v),e.lineTo(u,b),e.lineTo(u,x))};for(l&&(h=i[w(0)],e.moveTo(h.x,h.y)),p=0;p<=a;++p){if(h=i[w(p)],h.skip)continue;const R=h.x,C=h.y,T=R|0;T===m?(C<b?b=C:C>v&&(v=C),u=(d*u+R)/++d):(_(),e.lineTo(R,C),m=T,d=0,b=v=C),x=C}_()}function B_(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?Mle:Ole}function Ale(e){return e.stepped?Mse:e.tension||e.cubicInterpolationMode==="monotone"?Ase:Wl}function Dle(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),OF(e,t.options),e.stroke(i)}function Ile(e,t,n,r){const{segments:i,options:o}=t,s=B_(t);for(const a of i)OF(e,o,a.style),e.beginPath(),s(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const kle=typeof Path2D=="function";function Nle(e,t,n,r){kle&&!t.options.segment?Dle(e,t,n,r):Ile(e,t,n,r)}class qa extends Rs{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;Sse(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=Fse(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=mF(this,{property:n,start:i,end:i});if(!s.length)return;const a=[],l=Ale(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 B_(this)(t,this,n,r)}path(t,n,r){const i=this.segments,o=B_(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(),Nle(t,this,r,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}Me(qa,"id","line"),Me(qa,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),Me(qa,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),Me(qa,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function MD(e,t,n,r){const i=e.options,{[n]:o}=e.getProps([n],r);return Math.abs(t-o)<i.radius+i.hitRadius}class wc extends Rs{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 MD(this,n,"x",r)}inYRange(n,r){return MD(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||!ia(this,r,this.size(i)/2)||(n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.fillStyle=i.backgroundColor,Yy(n,i,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}Me(wc,"id","point"),Me(wc,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),Me(wc,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function AF(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 Ya(e,t,n,r){return e?0:fr(t,n,r)}function Lle(e,t,n){const r=e.options.borderWidth,i=e.borderSkipped,o=oF(r);return{t:Ya(i.top,o.top,0,n),r:Ya(i.right,o.right,0,t),b:Ya(i.bottom,o.bottom,0,n),l:Ya(i.left,o.left,0,t)}}function Fle(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),i=e.options.borderRadius,o=vc(i),s=Math.min(t,n),a=e.borderSkipped,l=r||Ot(i);return{topLeft:Ya(!l||a.top||a.left,o.topLeft,0,s),topRight:Ya(!l||a.top||a.right,o.topRight,0,s),bottomLeft:Ya(!l||a.bottom||a.left,o.bottomLeft,0,s),bottomRight:Ya(!l||a.bottom||a.right,o.bottomRight,0,s)}}function jle(e){const t=AF(e),n=t.right-t.left,r=t.bottom-t.top,i=Lle(e,n/2,r/2),o=Fle(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 b1(e,t,n,r){const i=t===null,o=n===null,a=e&&!(i&&o)&&AF(e,r);return a&&(i||na(t,a.left,a.right))&&(o||na(n,a.top,a.bottom))}function $le(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function zle(e,t){e.rect(t.x,t.y,t.w,t.h)}function y1(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 Sc extends Rs{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}=jle(this),a=$le(s.radius)?vp:zle;t.save(),(s.w!==o.w||s.h!==o.h)&&(t.beginPath(),a(t,y1(s,n,o)),t.clip(),a(t,y1(o,-n,s)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),a(t,y1(o,n)),t.fillStyle=i,t.fill(),t.restore()}inRange(t,n,r){return b1(this,t,n,r)}inXRange(t,n){return b1(this,t,null,n)}inYRange(t,n){return b1(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(Sc,"id","bar"),Me(Sc,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),Me(Sc,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var Ble=Object.freeze({__proto__:null,ArcElement:$u,BarElement:Sc,LineElement:qa,PointElement:wc});const H_=["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)"],AD=H_.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function DF(e){return H_[e%H_.length]}function IF(e){return AD[e%AD.length]}function Hle(e,t){return e.borderColor=DF(t),e.backgroundColor=IF(t),++t}function Vle(e,t){return e.backgroundColor=e.data.map(()=>DF(t++)),t}function Wle(e,t){return e.backgroundColor=e.data.map(()=>IF(t++)),t}function Ule(e){let t=0;return(n,r)=>{const i=e.getDatasetMeta(r).controller;i instanceof ec?t=Vle(n,t):i instanceof Uh?t=Wle(n,t):i&&(t=Hle(n,t))}}function DD(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function Gle(e){return e&&(e.borderColor||e.backgroundColor)}function qle(){return Tn.borderColor!=="rgba(0,0,0,0.1)"||Tn.backgroundColor!=="rgba(0,0,0,0.1)"}var Yle={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=DD(r)||Gle(i)||o&&DD(o)||qle();if(!n.forceOverride&&s)return;const a=Ule(e);r.forEach(a)}};function Kle(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,w;const _=Math.floor((d+1)*a)+1+t,R=Math.min(Math.floor((d+2)*a)+1,n)+t,C=R-_;for(w=_;w<R;w++)v+=e[w].x,x+=e[w].y;v/=C,x/=C;const T=Math.floor(d*a)+1+t,M=Math.min(Math.floor((d+1)*a)+1,n)+t,{x:I,y:k}=e[u];for(h=m=-1,w=T;w<M;w++)m=.5*Math.abs((I-v)*(e[w].y-k)-(I-e[w].x)*(x-k)),m>h&&(h=m,p=e[w],b=w);s[l++]=p,u=b}return s[l++]=e[c],s}function Xle(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,w=e[t].x,R=e[x].x-w;for(s=t;s<t+n;++s){a=e[s],l=(a.x-w)/R*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 T=s-1;if(!Ct(d)&&!Ct(p)){const M=Math.min(d,p),I=Math.max(d,p);M!==h&&M!==T&&v.push({...e[M],x:i}),I!==h&&I!==T&&v.push({...e[I],x:i})}s>0&&T!==h&&v.push(e[T]),v.push(a),u=C,o=0,m=b=c,d=p=h=s}}return v}function kF(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 ID(e){e.data.datasets.forEach(t=>{kF(t)})}function Qle(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=fr(ra(t,o.axis,s).lo,0,n-1)),c?i=fr(ra(t,o.axis,a).hi+1,r,n)-r:i=n-r,{start:r,count:i}}var Jle={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){ID(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(Cn([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}=Qle(l,c);const h=n.threshold||4*r;if(p<=h){kF(i);return}Ct(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=Kle(c,d,p,r,n);break;case"min-max":m=Xle(c,d,p,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}i._decimated=m})},destroy(e){ID(e)}};function Zle(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=FR(l,c,i);const u=V_(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=mF(t,u);for(const p of d){const h=V_(n,o[p.start],o[p.end],p.loop),m=gF(a,i,h);for(const b of m)s.push({source:b,target:p,start:{[n]:kD(u,h,"start",Math.max)},end:{[n]:kD(u,h,"end",Math.min)}})}}return s}function V_(e,t,n,r){if(r)return;let i=t[e],o=n[e];return e==="angle"&&(i=$i(i),o=$i(o)),{property:e,start:i,end:o}}function ece(e,t){const{x:n=null,y:r=null}=e||{},i=t.points,o=[];return t.segments.forEach(({start:s,end:a})=>{a=FR(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 FR(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function kD(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function NF(e,t){let n=[],r=!1;return Rn(e)?(r=!0,n=e):n=ece(e,t),n.length?new qa({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function ND(e){return e&&e.fill!==!1}function tce(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(!$n(i))return i;if(s=e[i],!s)return!1;if(s.visible)return i;o.push(i),i=s.fill}return!1}function nce(e,t,n){const r=sce(e);if(Ot(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return $n(i)&&Math.floor(i)===i?rce(r[0],t,i,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function rce(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function ice(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:Ot(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function oce(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:Ot(e)?r=e.value:r=t.getBaseValue(),r}function sce(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 ace(e){const{scale:t,index:n,line:r}=e,i=[],o=r.segments,s=r.points,a=lce(t,n);a.push(NF({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++)cce(i,s[u],a)}return new qa({points:i,options:{}})}function lce(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 cce(e,t,n){const r=[];for(let i=0;i<n.length;i++){const o=n[i],{first:s,last:a,point:l}=uce(o,t,"x");if(!(!l||s&&a)){if(s)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function uce(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(na(i,d,p)){a=i===d,l=i===p;break}}return{first:a,last:l,point:r}}class LF{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:Pn},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 dce(e){const{chart:t,fill:n,line:r}=e;if($n(n))return fce(t,n);if(n==="stack")return ace(e);if(n==="shape")return!0;const i=hce(e);return i instanceof LF?i:NF(i,r)}function fce(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function hce(e){return(e.scale||{}).getPointPositionForValue?gce(e):pce(e)}function pce(e){const{scale:t={},fill:n}=e,r=ice(n,t);if($n(r)){const i=t.isHorizontal();return{x:i?r:null,y:i?null:r}}return null}function gce(e){const{scale:t,fill:n}=e,r=t.options,i=t.getLabels().length,o=r.reverse?t.max:t.min,s=oce(n,t,o),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,o);return new LF({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 v1(e,t,n){const r=dce(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&&(bc(e,n),mce(e,{line:i,target:r,above:u,below:d,area:n,scale:o,axis:s}),yc(e))}function mce(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&&(LD(e,r,s.top),FD(e,{line:n,target:r,color:i,scale:a,property:l}),e.restore(),e.save(),LD(e,r,s.bottom)),FD(e,{line:n,target:r,color:o,scale:a,property:l}),e.restore()}function LD(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[FR(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 FD(e,t){const{line:n,target:r,property:i,color:o,scale:s}=t,a=Zle(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,bce(e,s,h&&V_(i,u,d)),e.beginPath();const m=!!n.pathSegment(e,l);let b;if(h){m?e.closePath():jD(e,r,d,i);const v=!!r.pathSegment(e,c,{move:m,reverse:!0});b=m&&v,b||jD(e,r,u,i)}e.closePath(),e.fill(b?"evenodd":"nonzero"),e.restore()}}function bce(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 jD(e,t,n,r){const i=t.interpolate(n,r);i&&e.lineTo(i.x,i.y)}var yce={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 qa&&(l={visible:e.isDatasetVisible(s),index:s,fill:nce(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=tce(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&&v1(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;ND(o)&&v1(e.ctx,o,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!ND(r)||n.drawTime!=="beforeDatasetDraw"||v1(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const $D=(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)}},vce=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class zD extends Rs{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=an(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=Xn(r.font),o=i.size,s=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=$D(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:w,itemHeight:_}=xce(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:w,height:_},p=Math.max(p,w),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=Xu(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=Dr(r,this.left+i,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=Dr(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=Dr(r,this.top+t+i,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=Dr(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;bc(t,this),this._draw(),yc(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:o,labels:s}=t,a=Tn.color,l=Xu(t.rtl,this.left,this.width),c=Xn(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}=$D(s,d),x=function(T,M,I){if(isNaN(m)||m<=0||isNaN(b)||b<0)return;i.save();const k=nt(I.lineWidth,1);if(i.fillStyle=nt(I.fillStyle,a),i.lineCap=nt(I.lineCap,"butt"),i.lineDashOffset=nt(I.lineDashOffset,0),i.lineJoin=nt(I.lineJoin,"miter"),i.lineWidth=k,i.strokeStyle=nt(I.strokeStyle,a),i.setLineDash(nt(I.lineDash,[])),s.usePointStyle){const L={radius:b*Math.SQRT2/2,pointStyle:I.pointStyle,rotation:I.rotation,borderWidth:k},j=l.xPlus(T,m/2),$=M+p;iF(i,L,j,$,s.pointStyleWidth&&m)}else{const L=M+Math.max((d-b)/2,0),j=l.leftForLtr(T,m),$=vc(I.borderRadius);i.beginPath(),Object.values($).some(X=>X!==0)?vp(i,{x:j,y:L,w:m,h:b,radius:$}):i.rect(j,L,m,b),i.fill(),k!==0&&i.stroke()}i.restore()},w=function(T,M,I){Lc(i,I.text,T,M+v/2,c,{strikethrough:I.hidden,textAlign:l.textAlign(I.textAlign)})},_=this.isHorizontal(),R=this._computeTitleHeight();_?h={x:Dr(o,this.left+u,this.right-r[0]),y:this.top+u+R,line:0}:h={x:this.left+u,y:Dr(o,this.top+R+u,this.bottom-n[0].height),line:0},fF(this.ctx,t.textDirection);const C=v+u;this.legendItems.forEach((T,M)=>{i.strokeStyle=T.fontColor,i.fillStyle=T.fontColor;const I=i.measureText(T.text).width,k=l.textAlign(T.textAlign||(T.textAlign=s.textAlign)),L=m+p+I;let j=h.x,$=h.y;l.setWidth(this.width),_?M>0&&j+L+u>this.right&&($=h.y+=C,h.line++,j=h.x=Dr(o,this.left+u,this.right-r[h.line])):M>0&&$+C>this.bottom&&(j=h.x=j+n[h.line].width+u,h.line++,$=h.y=Dr(o,this.top+R+u,this.bottom-n[h.line].height));const X=l.x(j);if(x(X,$,T),j=zoe(k,j+m+p,_?j+L:this.right,t.rtl),w(l.x(j),$,T),_)h.x+=L+u;else if(typeof T.text!="string"){const H=c.lineHeight;h.y+=FF(T,H)+u}else h.y+=C}),hF(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=Xn(n.font),i=_r(n.padding);if(!n.display)return;const o=Xu(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=Dr(t.align,d,this.right-p);else{const m=this.columnSizes.reduce((b,v)=>Math.max(b,v.height),0);u=c+Dr(t.align,this.top,this.bottom-m-t.labels.padding-this._computeTitleHeight())}const h=Dr(a,d,d+p);s.textAlign=o.textAlign(TR(a)),s.textBaseline="middle",s.strokeStyle=n.color,s.fillStyle=n.color,s.font=r.string,Lc(s,n.text,h,u,r)}_computeTitleHeight(){const t=this.options.title,n=Xn(t.font),r=_r(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,i,o;if(na(t,this.left,this.right)&&na(n,this.top,this.bottom)){for(o=this.legendHitBoxes,r=0;r<o.length;++r)if(i=o[r],na(t,i.left,i.left+i.width)&&na(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!_ce(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,o=vce(i,r);i&&!o&&an(n.onLeave,[t,i,this],this),this._hoveredItem=r,r&&!o&&an(n.onHover,[t,r,this],this)}else r&&an(n.onClick,[t,r,this],this)}}function xce(e,t,n,r,i){const o=wce(r,e,t,n),s=Sce(i,r,t.lineHeight);return{itemWidth:o,itemHeight:s}}function wce(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 Sce(e,t,n){let r=e;return typeof t.text!="string"&&(r=FF(t,n)),r}function FF(e,t){const n=e.text?e.text.length:0;return t*n}function _ce(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var Cce={id:"legend",_element:zD,start(e,t,n){const r=e.legend=new zD({ctx:e.ctx,options:n,chart:e});Nr.configure(e,r,n),Nr.addBox(e,r)},stop(e){Nr.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;Nr.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=_r(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 jR=class extends Rs{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=Rn(r.text)?r.text.length:1;this._padding=_r(r.padding);const o=i*Xn(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=Dr(a,r,o),d=n+t,c=o-r):(s.position==="left"?(u=r+t,d=Dr(a,i,n),l=On*-.5):(u=o-t,d=Dr(a,n,i),l=On*.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=Xn(n.font),o=r.lineHeight/2+this._padding.top,{titleX:s,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);Lc(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:TR(n.align),textBaseline:"middle",translation:[s,a]})}};function Ece(e,t){const n=new jR({ctx:e.ctx,options:t,chart:e});Nr.configure(e,n,t),Nr.addBox(e,n),e.titleBlock=n}var Rce={id:"title",_element:jR,start(e,t,n){Ece(e,n)},stop(e){const t=e.titleBlock;Nr.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;Nr.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 bb=new WeakMap;var Pce={id:"subtitle",start(e,t,n){const r=new jR({ctx:e.ctx,options:n,chart:e});Nr.configure(e,r,n),Nr.addBox(e,r),bb.set(e,r)},stop(e){Nr.removeBox(e,bb.get(e)),bb.delete(e)},beforeUpdate(e,t,n){const r=bb.get(e);Nr.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 Ph={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=L_(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 Ko(e,t){return t&&(Rn(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Gs(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
279
|
+
`)>-1?e.split(`
|
|
280
|
+
`):e}function Tce(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 BD(e,t){const n=e.chart.ctx,{body:r,footer:i,title:o}=e,{boxWidth:s,boxHeight:a}=t,l=Xn(t.bodyFont),c=Xn(t.titleFont),u=Xn(t.footerFont),d=o.length,p=i.length,h=r.length,m=_r(t.padding);let b=m.height,v=0,x=r.reduce((R,C)=>R+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 R=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;b+=h*R+(x-h)*l.lineHeight+(x-1)*t.bodySpacing}p&&(b+=t.footerMarginTop+p*u.lineHeight+(p-1)*t.footerSpacing);let w=0;const _=function(R){v=Math.max(v,n.measureText(R).width+w)};return n.save(),n.font=c.string,Jt(e.title,_),n.font=l.string,Jt(e.beforeBody.concat(e.afterBody),_),w=t.displayColors?s+2+t.boxPadding:0,Jt(r,R=>{Jt(R.before,_),Jt(R.lines,_),Jt(R.after,_)}),w=0,n.font=u.string,Jt(e.footer,_),n.restore(),v+=m.width,{width:v,height:b}}function Oce(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function Mce(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 Ace(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"),Mce(c,e,t,n)&&(c="center"),c}function HD(e,t,n){const r=n.yAlign||t.yAlign||Oce(e,n);return{xAlign:n.xAlign||t.xAlign||Ace(e,t,n,r),yAlign:r}}function Dce(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function Ice(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function VD(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}=vc(s);let m=Dce(t,a);const b=Ice(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:fr(m,0,r.width-t.width),y:fr(b,0,r.height-t.height)}}function yb(e,t,n){const r=_r(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function WD(e){return Ko([],Gs(e))}function kce(e,t,n){return ml(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function UD(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const jF={beforeTitle:Bs,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:Bs,beforeBody:Bs,beforeLabel:Bs,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 Ct(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:Bs,afterBody:Bs,beforeFooter:Bs,footer:Bs,afterFooter:Bs};function hi(e,t,n,r){const i=e[t].call(n,r);return typeof i>"u"?jF[t].call(n,r):i}var LS;let GD=(LS=class extends Rs{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 bF(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=kce(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=hi(r,"beforeTitle",this,t),o=hi(r,"title",this,t),s=hi(r,"afterTitle",this,t);let a=[];return a=Ko(a,Gs(i)),a=Ko(a,Gs(o)),a=Ko(a,Gs(s)),a}getBeforeBody(t,n){return WD(hi(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return Jt(t,o=>{const s={before:[],lines:[],after:[]},a=UD(r,o);Ko(s.before,Gs(hi(a,"beforeLabel",this,o))),Ko(s.lines,hi(a,"label",this,o)),Ko(s.after,Gs(hi(a,"afterLabel",this,o))),i.push(s)}),i}getAfterBody(t,n){return WD(hi(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=hi(r,"beforeFooter",this,t),o=hi(r,"footer",this,t),s=hi(r,"afterFooter",this,t);let a=[];return a=Ko(a,Gs(i)),a=Ko(a,Gs(o)),a=Ko(a,Gs(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(Tce(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))),Jt(a,u=>{const d=UD(t.callbacks,u);i.push(hi(d,"labelColor",this,u)),o.push(hi(d,"labelPointStyle",this,u)),s.push(hi(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=Ph[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=BD(this,r),c=Object.assign({},a,l),u=HD(this.chart,r,c),d=VD(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}=vc(a),{x:p,y:h}=t,{width:m,height:b}=n;let v,x,w,_,R,C;return o==="center"?(R=h+b/2,i==="left"?(v=p,x=v-s,_=R+s,C=R-s):(v=p+m,x=v+s,_=R-s,C=R+s),w=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,R=_-s,v=x-s,w=x+s):(_=h+b,R=_+s,v=x+s,w=x-s),C=_),{x1:v,x2:x,x3:w,y1:_,y2:R,y3:C}}drawTitle(t,n,r){const i=this.title,o=i.length;let s,a,l;if(o){const c=Xu(r.rtl,this.x,this.width);for(t.x=yb(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",s=Xn(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=Xn(o.bodyFont),d=yb(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,Yy(t,b,v,x),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,Yy(t,b,v,x)}else{t.lineWidth=Ot(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=vc(s.borderRadius);Object.values(x).some(w=>w!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,vp(t,{x:b,y:m,w:c,h:l,radius:x}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),vp(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=Xn(r.bodyFont);let p=d.lineHeight,h=0;const m=Xu(r.rtl,this.x,this.width),b=function(I){n.fillText(I,m.x(t.x+h),t.y+p/2),t.y+=p+o},v=m.textAlign(s);let x,w,_,R,C,T,M;for(n.textAlign=s,n.textBaseline="middle",n.font=d.string,t.x=yb(this,v,r),n.fillStyle=r.bodyColor,Jt(this.beforeBody,b),h=a&&v!=="right"?s==="center"?c/2+u:c+2+u:0,R=0,T=i.length;R<T;++R){for(x=i[R],w=this.labelTextColors[R],n.fillStyle=w,Jt(x.before,b),_=x.lines,a&&_.length&&(this._drawColorBox(n,t,R,m,r),p=Math.max(d.lineHeight,l)),C=0,M=_.length;C<M;++C)b(_[C]),p=d.lineHeight;Jt(x.after,b)}h=0,p=d.lineHeight,Jt(this.afterBody,b),t.y-=o}drawFooter(t,n,r){const i=this.footer,o=i.length;let s,a;if(o){const l=Xu(r.rtl,this.x,this.width);for(t.x=yb(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",s=Xn(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}=vc(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=Ph[t.position].call(this,this._active,this._eventPosition);if(!s)return;const a=this._size=BD(this,t),l=Object.assign({},s,this._size),c=HD(n,t,l),u=VD(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=_r(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),fF(t,n.textDirection),o.y+=s.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),hF(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=!Wy(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||!Wy(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=Ph[o.position].call(this,t,n);return s!==!1&&(r!==s.x||i!==s.y)}},Me(LS,"positioners",Ph),LS);var $F={id:"tooltip",_element:GD,positioners:Ph,afterInit(e,t,n){n&&(e.tooltip=new GD({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:jF},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"]},Nce=Object.freeze({__proto__:null,Colors:Yle,Decimation:Jle,Filler:yce,Legend:Cce,SubTitle:Pce,Title:Rce,Tooltip:$F});const Lce=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function Fce(e,t,n,r){const i=e.indexOf(t);if(i===-1)return Lce(e,t,n,r);const o=e.lastIndexOf(t);return i!==o?n:i}const jce=(e,t)=>e===null?null:fr(Math.round(e),0,t);function qD(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Jy extends bl{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(Ct(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:Fce(r,t,nt(n,t),this._addedLabels),jce(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 qD.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(Jy,"id","category"),Me(Jy,"defaults",{ticks:{callback:qD}});function $ce(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=!Ct(s),w=!Ct(a),_=!Ct(c),R=(v-b)/(d+1);let C=BA((v-b)/m/h)*h,T,M,I,k;if(C<1e-14&&!x&&!w)return[{value:b},{value:v}];k=Math.ceil(v/C)-Math.floor(b/C),k>m&&(C=BA(k*C/m/h)*h),Ct(l)||(T=Math.pow(10,l),C=Math.ceil(C*T)/T),i==="ticks"?(M=Math.floor(b/C)*C,I=Math.ceil(v/C)*C):(M=b,I=v),x&&w&&o&&Ioe((a-s)/o,C/1e3)?(k=Math.round(Math.min((a-s)/C,u)),C=(a-s)/k,M=s,I=a):_?(M=x?s:M,I=w?a:I,k=c-1,C=(I-M)/k):(k=(I-M)/C,Hh(k,Math.round(k),C/1e3)?k=Math.round(k):k=Math.ceil(k));const L=Math.max(HA(C),HA(M));T=Math.pow(10,Ct(l)?L:l),M=Math.round(M*T)/T,I=Math.round(I*T)/T;let j=0;for(x&&(p&&M!==s?(n.push({value:s}),M<s&&j++,Hh(Math.round((M+j*C)*T)/T,s,YD(s,R,e))&&j++):M<s&&j++);j<k;++j){const $=Math.round((M+j*C)*T)/T;if(w&&$>a)break;n.push({value:$})}return w&&p&&I!==a?n.length&&Hh(n[n.length-1].value,a,YD(a,R,e))?n[n.length-1].value=a:n.push({value:a}):(!w||I===a)&&n.push({value:I}),n}function YD(e,t,{horizontal:n,minRotation:r}){const i=ko(r),o=(n?Math.sin(i):Math.cos(i))||.001,s=.75*t*(""+e).length;return Math.min(t/o,s)}class Zy extends bl{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 Ct(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=us(i),c=us(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=$ce(i,o);return t.bounds==="ticks"&&K3(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 Tg(t,this.chart.options.locale,this.options.ticks.format)}}class qd extends Zy{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=$n(t)?t:0,this.max=$n(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=ko(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(qd,"id","linear"),Me(qd,"defaults",{ticks:{callback:vv.formatters.numeric}});const wp=e=>Math.floor(Ga(e)),$l=(e,t)=>Math.pow(10,wp(e)+t);function KD(e){return e/Math.pow(10,wp(e))===1}function XD(e,t,n){const r=Math.pow(10,n),i=Math.floor(e/r);return Math.ceil(t/r)-i}function zce(e,t){const n=t-e;let r=wp(n);for(;XD(e,t,r)>10;)r++;for(;XD(e,t,r)<10;)r--;return Math.min(r,wp(e))}function Bce(e,{min:t,max:n}){t=Li(e.min,t);const r=[],i=wp(t);let o=zce(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=Li(e.min,Math.round((l+u+d*Math.pow(10,o))*s)/s);for(;p<n;)r.push({value:p,major:KD(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=Li(e.max,p);return r.push({value:h,major:KD(h),significand:d}),r}class Yd extends bl{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=Zy.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return $n(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=$n(t)?Math.max(0,t):null,this.max=$n(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!$n(this._userMin)&&(this.min=t===$l(this.min,0)?$l(this.min,-1):$l(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($l(r,-1)),s($l(i,1)))),r<=0&&o($l(i,-1)),i<=0&&s($l(r,1)),this.min=r,this.max=i}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=Bce(n,this);return t.bounds==="ticks"&&K3(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":Tg(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Ga(t),this._valueRange=Ga(this.max)-Ga(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Ga(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}Me(Yd,"id","logarithmic"),Me(Yd,"defaults",{ticks:{callback:vv.formatters.logarithmic,major:{enabled:!0}}});function W_(e){const t=e.ticks;if(t.display&&e.display){const n=_r(t.backdropPadding);return nt(t.font&&t.font.size,Tn.font.size)+n.height}return 0}function Hce(e,t,n){return n=Rn(n)?n:[n],{w:Xoe(e,t.string,n),h:n.length*t.lineHeight}}function QD(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 Vce(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?On/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=Xn(c.font),p=Hce(e.ctx,d,e._pointLabels[l]);r[l]=p;const h=$i(e.getIndexAngle(l)+a),m=Math.round(RR(h)),b=QD(m,u.x,p.w,0,180),v=QD(m,u.y,p.h,90,270);Wce(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=qce(e,r,i)}function Wce(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 Uce(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(RR($i(l.angle+Gn))),u=Xce(l.y,a.h,c),d=Yce(c),p=Kce(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 Gce(e,t){if(!t)return!0;const{left:n,top:r,right:i,bottom:o}=e;return!(ia({x:n,y:r},t)||ia({x:n,y:o},t)||ia({x:i,y:r},t)||ia({x:i,y:o},t))}function qce(e,t,n){const r=[],i=e._pointLabels.length,o=e.options,{centerPointLabels:s,display:a}=o.pointLabels,l={extra:W_(o)/2,additionalAngle:s?On/i:0};let c;for(let u=0;u<i;u++){l.padding=n[u],l.size=t[u];const d=Uce(e,u,l);r.push(d),a==="auto"&&(d.visible=Gce(d,c),d.visible&&(c=d))}return r}function Yce(e){return e===0||e===180?"center":e<180?"left":"right"}function Kce(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function Xce(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function Qce(e,t,n){const{left:r,top:i,right:o,bottom:s}=n,{backdropColor:a}=t;if(!Ct(a)){const l=vc(t.borderRadius),c=_r(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(),vp(e,{x:u,y:d,w:p,h,radius:l}),e.fill()):e.fillRect(u,d,p,h)}}function Jce(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));Qce(n,s,o);const a=Xn(s.font),{x:l,y:c,textAlign:u}=o;Lc(n,e._pointLabels[i],l,c+a.lineHeight/2,a,{color:s.color,textAlign:u,textBaseline:"middle"})}}function zF(e,t,n,r){const{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,Pn);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 Zce(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(),zF(e,n,s,r),o.closePath(),o.stroke(),o.restore())}function eue(e,t,n){return ml(e,{label:n,index:t,type:"pointLabel"})}class Th extends Zy{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=_r(W_(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=$n(t)&&!isNaN(t)?t:0,this.max=$n(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/W_(this.options))}generateTickLabels(t){Zy.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const i=an(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?Vce(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=Pn/(this._pointLabels.length||1),r=this.options.startAngle||0;return $i(t*n+ko(r))}getDistanceFromCenterForValue(t){if(Ct(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(Ct(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 eue(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const i=this.getIndexAngle(t)-Gn+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(),zF(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&&Jce(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);Zce(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=Xn(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=_r(c.backdropPadding);t.fillRect(-s/2-d.left,-o-u.size/2-d.top,s+d.width,u.size+d.height)}Lc(t,a.label,0,-o,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}Me(Th,"id","radialLinear"),Me(Th,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:vv.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),Me(Th,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),Me(Th,"descriptors",{angleLines:{_fallback:"grid"}});const wv={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}},xi=Object.keys(wv);function JD(e,t){return e-t}function ZD(e,t){if(Ct(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)),$n(s)||(s=typeof r=="string"?n.parse(s,r):n.parse(s)),s===null?null:(i&&(s=i==="week"&&(Wd(o)||o===!0)?n.startOf(s,"isoWeek",o):n.startOf(s,i)),+s)}function eI(e,t,n,r){const i=xi.length;for(let o=xi.indexOf(e);o<i-1;++o){const s=wv[xi[o]],a=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((n-t)/(a*s.size))<=r)return xi[o]}return xi[i-1]}function tue(e,t,n,r,i){for(let o=xi.length-1;o>=xi.indexOf(n);o--){const s=xi[o];if(wv[s].common&&e._adapter.diff(i,r,s)>=t-1)return s}return xi[n?xi.indexOf(n):0]}function nue(e){for(let t=xi.indexOf(e)+1,n=xi.length;t<n;++t)if(wv[xi[t]].common)return xi[t]}function tI(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=PR(n,t),o=n[r]>=t?n[r]:n[i];e[o]=!0}}function rue(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 nI(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:rue(e,r,i,n)}class Sp extends bl{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 fae._date(t.adapters.date);i.init(n),Bh(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:ZD(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=$n(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),o=$n(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=Foe(i,o,s);return this._unit=n.unit||(r.autoSkip?eI(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):tue(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:nue(this._unit),this.initOffsets(i),t.reverse&&a.reverse(),nI(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=fr(n,0,s),r=fr(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||eI(o.minUnit,n,r,this._getLabelCapacity(n)),a=nt(i.ticks.stepSize,1),l=s==="week"?o.isoWeekday:!1,c=Wd(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++)tI(u,p,m);return(p===r||i.bounds==="ticks"||h===1)&&tI(u,p,m),Object.keys(u).sort(JD).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 an(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=ko(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,nI(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(ZD(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return J3(t.sort(JD))}}Me(Sp,"id","time"),Me(Sp,"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 vb(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}=ra(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}=ra(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 U_ extends Sp{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=vb(n,this.min),this._tableRange=vb(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(vb(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return vb(this._table,r*this._tableRange+this._minPos,!0)}}Me(U_,"id","timeseries"),Me(U_,"defaults",Sp.defaults);var iue=Object.freeze({__proto__:null,CategoryScale:Jy,LinearScale:qd,LogarithmicScale:Yd,RadialLinearScale:Th,TimeScale:Sp,TimeSeriesScale:U_});const oue=[dae,Ble,Nce,iue];class ll{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*sue(e){for(const t of e)yield*t}function BF(e){return Array.from(sue(e))}function zu(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 Qe=1e-6,HF=1e-12,_t=Math.PI,jn=_t/2,rI=_t/4,Gi=_t*2,Xr=180/_t,cn=_t/180,zt=Math.abs,pf=Math.atan,ms=Math.atan2,ut=Math.cos,xb=Math.ceil,VF=Math.exp,e0=Math.log,x1=Math.pow,it=Math.sin,po=Math.sign||function(e){return e>0?1:e<0?-1:0},ri=Math.sqrt,$R=Math.tan;function WF(e){return e>1?0:e<-1?_t:Math.acos(e)}function bo(e){return e>1?jn:e<-1?-jn:Math.asin(e)}function dr(){}function t0(e,t){e&&oI.hasOwnProperty(e.type)&&oI[e.type](e,t)}var iI={Feature:function(e,t){t0(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)t0(n[r].geometry,t)}},oI={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){G_(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)G_(n[r],t,0)},Polygon:function(e,t){sI(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)sI(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)t0(n[r],t)}};function G_(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 sI(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)G_(e[n],t,1);t.polygonEnd()}function ql(e,t){e&&iI.hasOwnProperty(e.type)?iI[e.type](e,t):t0(e,t)}function q_(e){return[ms(e[1],e[0]),bo(e[2])]}function Kd(e){var t=e[0],n=e[1],r=ut(n);return[r*ut(t),r*it(t),it(n)]}function wb(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function n0(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 w1(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Sb(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Y_(e){var t=ri(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function K_(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 X_(e,t){return zt(e)>_t&&(e-=Math.round(e/Gi)*Gi),[e,t]}X_.invert=X_;function UF(e,t,n){return(e%=Gi)?t||n?K_(lI(e),cI(t,n)):lI(e):t||n?cI(t,n):X_}function aI(e){return function(t,n){return t+=e,zt(t)>_t&&(t-=Math.round(t/Gi)*Gi),[t,n]}}function lI(e){var t=aI(e);return t.invert=aI(-e),t}function cI(e,t){var n=ut(e),r=it(e),i=ut(t),o=it(t);function s(a,l){var c=ut(l),u=ut(a)*c,d=it(a)*c,p=it(l),h=p*n+u*r;return[ms(d*i-h*o,u*n-p*r),bo(h*i+d*o)]}return s.invert=function(a,l){var c=ut(l),u=ut(a)*c,d=it(a)*c,p=it(l),h=p*i-d*o;return[ms(d*i+p*o,u*n+h*r),bo(h*n-u*r)]},s}function aue(e){e=UF(e[0]*cn,e[1]*cn,e.length>2?e[2]*cn:0);function t(n){return n=e(n[0]*cn,n[1]*cn),n[0]*=Xr,n[1]*=Xr,n}return t.invert=function(n){return n=e.invert(n[0]*cn,n[1]*cn),n[0]*=Xr,n[1]*=Xr,n},t}function lue(e,t,n,r,i,o){if(n){var s=ut(t),a=it(t),l=r*n;i==null?(i=t+r*Gi,o=t-l/2):(i=uI(s,i),o=uI(s,o),(r>0?i<o:i>o)&&(i+=r*Gi));for(var c,u=i;r>0?u>o:u<o;u-=l)c=q_([s,-a*ut(u),-a*it(u)]),e.point(c[0],c[1])}}function uI(e,t){t=Kd(t),t[0]-=e,Y_(t);var n=WF(-t[1]);return((-t[2]<0?-n:n)+Gi-Qe)%Gi}function GF(){var e=[],t;return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:dr,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function py(e,t){return zt(e[0]-t[0])<Qe&&zt(e[1]-t[1])<Qe}function _b(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 qF(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],w;if(py(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*Qe}o.push(w=new _b(v,m,null,!0)),s.push(w.o=new _b(v,null,w,!1)),o.push(w=new _b(x,m,null,!1)),s.push(w.o=new _b(x,null,w,!0))}}),!!o.length){for(s.sort(t),dI(o),dI(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 dI(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 S1(e){return zt(e[0])<=_t?e[0]:po(e[0])*((zt(e[0])+_t)%Gi-_t)}function YF(e,t){var n=S1(t),r=t[1],i=it(r),o=[it(n),-ut(n),0],s=0,a=0,l=new ll;i===1?r=jn+Qe:i===-1&&(r=-jn-Qe);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=S1(h),b=h[1]/2+rI,v=it(b),x=ut(b),w=0;w<p;++w,m=R,v=T,x=M,h=_){var _=d[w],R=S1(_),C=_[1]/2+rI,T=it(C),M=ut(C),I=R-m,k=I>=0?1:-1,L=k*I,j=L>_t,$=v*T;if(l.add(ms($*k*it(L),x*M+$*ut(L))),s+=j?I+k*Gi:I,j^m>=n^R>=n){var X=n0(Kd(h),Kd(_));Y_(X);var H=n0(o,X);Y_(H);var F=(j^I>=0?-1:1)*bo(H[2]);(r>F||r===F&&(X[0]||X[1]))&&(a+=j^I>=0?1:-1)}}return(s<-1e-6||s<Qe&&l<-1e-12)^a&1}function KF(e,t,n,r){return function(i){var o=t(i),s=GF(),a=t(s),l=!1,c,u,d,p={point:h,lineStart:b,lineEnd:v,polygonStart:function(){p.point=x,p.lineStart=w,p.lineEnd=_,u=[],c=[]},polygonEnd:function(){p.point=h,p.lineStart=b,p.lineEnd=v,u=BF(u);var R=YF(c,r);u.length?(l||(i.polygonStart(),l=!0),qF(u,uue,R,n,i)):R&&(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(R,C){e(R,C)&&i.point(R,C)}function m(R,C){o.point(R,C)}function b(){p.point=m,o.lineStart()}function v(){p.point=h,o.lineEnd()}function x(R,C){d.push([R,C]),a.point(R,C)}function w(){a.lineStart(),d=[]}function _(){x(d[0][0],d[0][1]),a.lineEnd();var R=a.clean(),C=s.result(),T,M=C.length,I,k,L;if(d.pop(),c.push(d),d=null,!!M){if(R&1){if(k=C[0],(I=k.length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),T=0;T<I;++T)i.point((L=k[T])[0],L[1]);i.lineEnd()}return}M>1&&R&2&&C.push(C.pop().concat(C.shift())),u.push(C.filter(cue))}}return p}}function cue(e){return e.length>1}function uue(e,t){return((e=e.x)[0]<0?e[1]-jn-Qe:jn-e[1])-((t=t.x)[0]<0?t[1]-jn-Qe:jn-t[1])}const fI=KF(function(){return!0},due,hue,[-_t,-jn]);function due(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(o,s){var a=o>0?_t:-_t,l=zt(o-t);zt(l-_t)<Qe?(e.point(t,n=(n+s)/2>0?jn:-jn),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(a,n),e.point(o,n),i=0):r!==a&&l>=_t&&(zt(t-r)<Qe&&(t-=r*Qe),zt(o-a)<Qe&&(o-=a*Qe),n=fue(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 fue(e,t,n,r){var i,o,s=it(e-n);return zt(s)>Qe?pf((it(t)*(o=ut(r))*it(n)-it(r)*(i=ut(t))*it(e))/(i*o*s)):(t+r)/2}function hue(e,t,n,r){var i;if(e==null)i=n*jn,r.point(-_t,i),r.point(0,i),r.point(_t,i),r.point(_t,0),r.point(_t,-i),r.point(0,-i),r.point(-_t,-i),r.point(-_t,0),r.point(-_t,i);else if(zt(e[0]-t[0])>Qe){var o=e[0]<t[0]?_t:-_t;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(t[0],t[1])}function pue(e){var t=ut(e),n=2*cn,r=t>0,i=zt(t)>Qe;function o(u,d,p,h){lue(h,e,n,p,u,d)}function s(u,d){return ut(u)*ut(d)>t}function a(u){var d,p,h,m,b;return{lineStart:function(){m=h=!1,b=1},point:function(v,x){var w=[v,x],_,R=s(v,x),C=r?R?0:c(v,x):R?c(v+(v<0?_t:-_t),x):0;if(!d&&(m=h=R)&&u.lineStart(),R!==h&&(_=l(d,w),(!_||py(d,_)||py(w,_))&&(w[2]=1)),R!==h)b=0,R?(u.lineStart(),_=l(w,d),u.point(_[0],_[1])):(_=l(d,w),u.point(_[0],_[1],2),u.lineEnd()),d=_;else if(i&&d&&r^R){var T;!(C&p)&&(T=l(w,d,!0))&&(b=0,r?(u.lineStart(),u.point(T[0][0],T[0][1]),u.point(T[1][0],T[1][1]),u.lineEnd()):(u.point(T[1][0],T[1][1]),u.lineEnd(),u.lineStart(),u.point(T[0][0],T[0][1],3)))}R&&(!d||!py(d,w))&&u.point(w[0],w[1]),d=w,h=R,p=C},lineEnd:function(){h&&u.lineEnd(),d=null},clean:function(){return b|(m&&h)<<1}}}function l(u,d,p){var h=Kd(u),m=Kd(d),b=[1,0,0],v=n0(h,m),x=wb(v,v),w=v[0],_=x-w*w;if(!_)return!p&&u;var R=t*x/_,C=-t*w/_,T=n0(b,v),M=Sb(b,R),I=Sb(v,C);w1(M,I);var k=T,L=wb(M,k),j=wb(k,k),$=L*L-j*(wb(M,M)-1);if(!($<0)){var X=ri($),H=Sb(k,(-L-X)/j);if(w1(H,M),H=q_(H),!p)return H;var F=u[0],G=d[0],B=u[1],W=d[1],K;G<F&&(K=F,F=G,G=K);var D=G-F,Y=zt(D-_t)<Qe,U=Y||D<Qe;if(!Y&&W<B&&(K=B,B=W,W=K),U?Y?B+W>0^H[1]<(zt(H[0]-F)<Qe?B:W):B<=H[1]&&H[1]<=W:D>_t^(F<=H[0]&&H[0]<=G)){var A=Sb(k,(-L+X)/j);return w1(A,M),[H,q_(A)]}}}function c(u,d){var p=r?e:_t-e,h=0;return u<-p?h|=1:u>p&&(h|=2),d<-p?h|=4:d>p&&(h|=8),h}return KF(s,a,o,r?[0,-e]:[-_t,e-_t])}function gue(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 Cb=1e9,Eb=-1e9;function mue(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)<Qe?u>0?0:3:zt(c[0]-n)<Qe?u>0?2:1:zt(c[1]-t)<Qe?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=GF(),p,h,m,b,v,x,w,_,R,C,T,M={point:I,lineStart:$,lineEnd:X,polygonStart:L,polygonEnd:j};function I(F,G){i(F,G)&&u.point(F,G)}function k(){for(var F=0,G=0,B=h.length;G<B;++G)for(var W=h[G],K=1,D=W.length,Y=W[0],U,A,te=Y[0],q=Y[1];K<D;++K)U=te,A=q,Y=W[K],te=Y[0],q=Y[1],A<=r?q>r&&(te-U)*(r-A)>(q-A)*(e-U)&&++F:q<=r&&(te-U)*(r-A)<(q-A)*(e-U)&&--F;return F}function L(){u=d,p=[],h=[],T=!0}function j(){var F=k(),G=T&&F,B=(p=BF(p)).length;(G||B)&&(c.polygonStart(),G&&(c.lineStart(),o(null,null,1,c),c.lineEnd()),B&&qF(p,a,F,o,c),c.polygonEnd()),u=c,p=h=m=null}function $(){M.point=H,h&&h.push(m=[]),C=!0,R=!1,w=_=NaN}function X(){p&&(H(b,v),x&&R&&d.rejoin(),p.push(d.result())),M.point=I,R&&u.lineEnd()}function H(F,G){var B=i(F,G);if(h&&m.push([F,G]),C)b=F,v=G,x=B,C=!1,B&&(u.lineStart(),u.point(F,G));else if(B&&R)u.point(F,G);else{var W=[w=Math.max(Eb,Math.min(Cb,w)),_=Math.max(Eb,Math.min(Cb,_))],K=[F=Math.max(Eb,Math.min(Cb,F)),G=Math.max(Eb,Math.min(Cb,G))];gue(W,K,e,t,n,r)?(R||(u.lineStart(),u.point(W[0],W[1])),u.point(K[0],K[1]),B||u.lineEnd(),T=!1):B&&(u.lineStart(),u.point(F,G),T=!1)}w=F,_=G,R=B}return M}}var Q_,J_,gy,my,Xd={sphere:dr,point:dr,lineStart:bue,lineEnd:dr,polygonStart:dr,polygonEnd:dr};function bue(){Xd.point=vue,Xd.lineEnd=yue}function yue(){Xd.point=Xd.lineEnd=dr}function vue(e,t){e*=cn,t*=cn,J_=e,gy=it(t),my=ut(t),Xd.point=xue}function xue(e,t){e*=cn,t*=cn;var n=it(t),r=ut(t),i=zt(e-J_),o=ut(i),s=it(i),a=r*s,l=my*n-gy*r*o,c=gy*n+my*r*o;Q_.add(ms(ri(a*a+l*l),c)),J_=e,gy=n,my=r}function wue(e){return Q_=new ll,ql(e,Xd),+Q_}var Z_=[null,null],Sue={type:"LineString",coordinates:Z_};function eC(e,t){return Z_[0]=e,Z_[1]=t,wue(Sue)}var hI={Feature:function(e,t){return r0(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)if(r0(n[r].geometry,t))return!0;return!1}},pI={Sphere:function(){return!0},Point:function(e,t){return gI(e.coordinates,t)},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(gI(n[r],t))return!0;return!1},LineString:function(e,t){return mI(e.coordinates,t)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(mI(n[r],t))return!0;return!1},Polygon:function(e,t){return bI(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(bI(n[r],t))return!0;return!1},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)if(r0(n[r],t))return!0;return!1}};function r0(e,t){return e&&pI.hasOwnProperty(e.type)?pI[e.type](e,t):!1}function gI(e,t){return eC(e,t)===0}function mI(e,t){for(var n,r,i,o=0,s=e.length;o<s;o++){if(r=eC(e[o],t),r===0||o>0&&(i=eC(e[o],e[o-1]),i>0&&n<=i&&r<=i&&(n+r-i)*(1-Math.pow((n-r)/i,2))<HF*i))return!0;n=r}return!1}function bI(e,t){return!!YF(e.map(_ue),XF(t))}function _ue(e){return e=e.map(XF),e.pop(),e}function XF(e){return[e[0]*cn,e[1]*cn]}function Cue(e,t){return(e&&hI.hasOwnProperty(e.type)?hI[e.type]:r0)(e,t)}function yI(e,t,n){var r=zu(e,t-Qe,n).concat(t);return function(i){return r.map(function(o){return[i,o]})}}function vI(e,t,n){var r=zu(e,t-Qe,n).concat(t);return function(i){return r.map(function(o){return[o,i]})}}function QF(){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:w()}}function w(){return zu(xb(r/u)*u,n,u).map(m).concat(zu(xb(a/d)*d,s,d).map(b)).concat(zu(xb(t/l)*l,e,l).filter(function(_){return zt(_%u)>Qe}).map(p)).concat(zu(xb(o/c)*c,i,c).filter(function(_){return zt(_%d)>Qe}).map(h))}return x.lines=function(){return w().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=yI(o,i,90),h=vI(t,e,v),m=yI(a,s,90),b=vI(r,n,v),x):v},x.extentMajor([[-180,-90+Qe],[180,90-Qe]]).extentMinor([[-180,-80-Qe],[180,80+Qe]])}function Eue(){return QF()()}const tC=e=>e;var _1=new ll,nC=new ll,JF,ZF,rC,iC,Js={point:dr,lineStart:dr,lineEnd:dr,polygonStart:function(){Js.lineStart=Rue,Js.lineEnd=Tue},polygonEnd:function(){Js.lineStart=Js.lineEnd=Js.point=dr,_1.add(zt(nC)),nC=new ll},result:function(){var e=_1/2;return _1=new ll,e}};function Rue(){Js.point=Pue}function Pue(e,t){Js.point=e6,JF=rC=e,ZF=iC=t}function e6(e,t){nC.add(iC*e-rC*t),rC=e,iC=t}function Tue(){e6(JF,ZF)}var Qd=1/0,i0=Qd,_p=-Qd,o0=_p,s0={point:Oue,lineStart:dr,lineEnd:dr,polygonStart:dr,polygonEnd:dr,result:function(){var e=[[Qd,i0],[_p,o0]];return _p=o0=-(i0=Qd=1/0),e}};function Oue(e,t){e<Qd&&(Qd=e),e>_p&&(_p=e),t<i0&&(i0=t),t>o0&&(o0=t)}var oC=0,sC=0,Oh=0,a0=0,l0=0,Bu=0,aC=0,lC=0,Mh=0,t6,n6,is,os,ho={point:Fc,lineStart:xI,lineEnd:wI,polygonStart:function(){ho.lineStart=Due,ho.lineEnd=Iue},polygonEnd:function(){ho.point=Fc,ho.lineStart=xI,ho.lineEnd=wI},result:function(){var e=Mh?[aC/Mh,lC/Mh]:Bu?[a0/Bu,l0/Bu]:Oh?[oC/Oh,sC/Oh]:[NaN,NaN];return oC=sC=Oh=a0=l0=Bu=aC=lC=Mh=0,e}};function Fc(e,t){oC+=e,sC+=t,++Oh}function xI(){ho.point=Mue}function Mue(e,t){ho.point=Aue,Fc(is=e,os=t)}function Aue(e,t){var n=e-is,r=t-os,i=ri(n*n+r*r);a0+=i*(is+e)/2,l0+=i*(os+t)/2,Bu+=i,Fc(is=e,os=t)}function wI(){ho.point=Fc}function Due(){ho.point=kue}function Iue(){r6(t6,n6)}function kue(e,t){ho.point=r6,Fc(t6=is=e,n6=os=t)}function r6(e,t){var n=e-is,r=t-os,i=ri(n*n+r*r);a0+=i*(is+e)/2,l0+=i*(os+t)/2,Bu+=i,i=os*e-is*t,aC+=i*(is+e),lC+=i*(os+t),Mh+=i*3,Fc(is=e,os=t)}function i6(e){this._context=e}i6.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,Gi);break}}},result:dr};var cC=new ll,C1,o6,s6,Ah,Dh,Cp={point:dr,lineStart:function(){Cp.point=Nue},lineEnd:function(){C1&&a6(o6,s6),Cp.point=dr},polygonStart:function(){C1=!0},polygonEnd:function(){C1=null},result:function(){var e=+cC;return cC=new ll,e}};function Nue(e,t){Cp.point=a6,o6=Ah=e,s6=Dh=t}function a6(e,t){Ah-=e,Dh-=t,cC.add(ri(Ah*Ah+Dh*Dh)),Ah=e,Dh=t}let SI,c0,_I,CI;class EI{constructor(t){this._append=t==null?l6:Lue(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!==_I||this._append!==c0){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`,_I=r,c0=this._append,CI=this._,this._=i}this._+=CI;break}}}result(){const t=this._;return this._="",t.length?t:null}}function l6(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Lue(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return l6;if(t!==SI){const n=10**t;SI=t,c0=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 c0}function RI(e,t){let n=3,r=4.5,i,o;function s(a){return a&&(typeof r=="function"&&o.pointRadius(+r.apply(this,arguments)),ql(a,i(o))),o.result()}return s.area=function(a){return ql(a,i(Js)),Js.result()},s.measure=function(a){return ql(a,i(Cp)),Cp.result()},s.bounds=function(a){return ql(a,i(s0)),s0.result()},s.centroid=function(a){return ql(a,i(ho)),ho.result()},s.projection=function(a){return arguments.length?(i=a==null?(e=null,tC):(e=a).stream,s):e},s.context=function(a){return arguments.length?(o=a==null?(t=null,new EI(n)):new i6(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 EI(n)),s},s.projection(e).digits(n).context(t)}function zR(e){return function(t){var n=new uC;for(var r in e)n[r]=e[r];return n.stream=t,n}}function uC(){}uC.prototype={constructor:uC,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 BR(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),ql(n,e.stream(s0)),t(s0.result()),r!=null&&e.clipExtent(r),e}function HR(e,t,n){return BR(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 c6(e,t,n){return HR(e,[[0,0],t],n)}function u6(e,t,n){return BR(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 d6(e,t,n){return BR(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 PI=16,Fue=ut(30*cn);function TI(e,t){return+t?$ue(e,t):jue(e)}function jue(e){return zR({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function $ue(e,t){function n(r,i,o,s,a,l,c,u,d,p,h,m,b,v){var x=c-r,w=u-i,_=x*x+w*w;if(_>4*t&&b--){var R=s+p,C=a+h,T=l+m,M=ri(R*R+C*C+T*T),I=bo(T/=M),k=zt(zt(T)-1)<Qe||zt(o-d)<Qe?(o+d)/2:ms(C,R),L=e(k,I),j=L[0],$=L[1],X=j-r,H=$-i,F=w*X-x*H;(F*F/_>t||zt((x*X+w*H)/_-.5)>.3||s*p+a*h+l*m<Fue)&&(n(r,i,o,s,a,l,j,$,k,R/=M,C/=M,T,b,v),v.point(j,$),n(j,$,k,R,C,T,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:w,lineEnd:R,polygonStart:function(){r.polygonStart(),v.lineStart=C},polygonEnd:function(){r.polygonEnd(),v.lineStart=w}};function x(I,k){I=e(I,k),r.point(I[0],I[1])}function w(){d=NaN,v.point=_,r.lineStart()}function _(I,k){var L=Kd([I,k]),j=e(I,k);n(d,p,u,h,m,b,d=j[0],p=j[1],u=I,h=L[0],m=L[1],b=L[2],PI,r),r.point(d,p)}function R(){v.point=x,r.lineEnd()}function C(){w(),v.point=T,v.lineEnd=M}function T(I,k){_(i=I,k),o=d,s=p,a=h,l=m,c=b,v.point=_}function M(){n(d,p,u,h,m,b,o,s,i,a,l,c,PI,r),v.lineEnd=R,R()}return v}}var zue=zR({point:function(e,t){this.stream.point(e*cn,t*cn)}});function Bue(e){return zR({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function Hue(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 OI(e,t,n,r,i,o){if(!o)return Hue(e,t,n,r,i);var s=ut(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 pa(e){return f6(function(){return e})()}function f6(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=fI,v=null,x,w,_,R=tC,C=.5,T,M,I,k,L;function j(F){return I(F[0]*cn,F[1]*cn)}function $(F){return F=I.invert(F[0],F[1]),F&&[F[0]*Xr,F[1]*Xr]}j.stream=function(F){return k&&L===F?k:k=zue(Bue(u)(b(T(R(L=F)))))},j.preclip=function(F){return arguments.length?(b=F,m=void 0,H()):b},j.postclip=function(F){return arguments.length?(R=F,v=x=w=_=null,H()):R},j.clipAngle=function(F){return arguments.length?(b=+F?pue(m=F*cn):(m=null,fI),H()):m*Xr},j.clipExtent=function(F){return arguments.length?(R=F==null?(v=x=w=_=null,tC):mue(v=+F[0][0],x=+F[0][1],w=+F[1][0],_=+F[1][1]),H()):v==null?null:[[v,x],[w,_]]},j.scale=function(F){return arguments.length?(n=+F,X()):n},j.translate=function(F){return arguments.length?(r=+F[0],i=+F[1],X()):[r,i]},j.center=function(F){return arguments.length?(o=F[0]%360*cn,s=F[1]%360*cn,X()):[o*Xr,s*Xr]},j.rotate=function(F){return arguments.length?(a=F[0]%360*cn,l=F[1]%360*cn,c=F.length>2?F[2]%360*cn:0,X()):[a*Xr,l*Xr,c*Xr]},j.angle=function(F){return arguments.length?(d=F%360*cn,X()):d*Xr},j.reflectX=function(F){return arguments.length?(p=F?-1:1,X()):p<0},j.reflectY=function(F){return arguments.length?(h=F?-1:1,X()):h<0},j.precision=function(F){return arguments.length?(T=TI(M,C=F*F),H()):ri(C)},j.fitExtent=function(F,G){return HR(j,F,G)},j.fitSize=function(F,G){return c6(j,F,G)},j.fitWidth=function(F,G){return u6(j,F,G)},j.fitHeight=function(F,G){return d6(j,F,G)};function X(){var F=OI(n,0,0,p,h,d).apply(null,t(o,s)),G=OI(n,r-F[0],i-F[1],p,h,d);return u=UF(a,l,c),M=K_(t,G),I=K_(u,M),T=TI(M,C),H()}function H(){return k=L=null,j}return function(){return t=e.apply(this,arguments),j.invert=t.invert&&$,X()}}function VR(e){var t=0,n=_t/3,r=f6(e),i=r(t,n);return i.parallels=function(o){return arguments.length?r(t=o[0]*cn,n=o[1]*cn):[t*Xr,n*Xr]},i}function Vue(e){var t=ut(e);function n(r,i){return[r*t,it(i)/t]}return n.invert=function(r,i){return[r/t,bo(i*t)]},n}function Wue(e,t){var n=it(e),r=(n+it(t))/2;if(zt(r)<Qe)return Vue(e);var i=1+n*(2*r-n),o=ri(i)/r;function s(a,l){var c=ri(i-2*r*it(l))/r;return[c*it(a*=r),o-c*ut(a)]}return s.invert=function(a,l){var c=o-l,u=ms(a,zt(c))*po(c);return c*r<0&&(u-=_t*po(a)*po(c)),[u/r,bo((i-(a*a+c*c)*r*r)/(2*r))]},s}function u0(){return VR(Wue).scale(155.424).center([0,33.6442])}function h6(){return u0().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Uue(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 Gue(){var e,t,n=h6(),r,i=u0().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o,s=u0().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=Uue([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+Qe,b+.12*h+Qe],[m-.214*h-Qe,b+.234*h-Qe]]).stream(c),a=s.translate([m-.205*h,b+.212*h]).clipExtent([[m-.214*h+Qe,b+.166*h+Qe],[m-.115*h-Qe,b+.234*h-Qe]]).stream(c),d()},u.fitExtent=function(p,h){return HR(u,p,h)},u.fitSize=function(p,h){return c6(u,p,h)},u.fitWidth=function(p,h){return u6(u,p,h)},u.fitHeight=function(p,h){return d6(u,p,h)};function d(){return e=t=null,u}return u.scale(1070)}function p6(e){return function(t,n){var r=ut(t),i=ut(n),o=e(r*i);return o===1/0?[2,0]:[o*i*it(t),o*it(n)]}}function Mg(e){return function(t,n){var r=ri(t*t+n*n),i=e(r),o=it(i),s=ut(i);return[ms(t*o,r*s),bo(r&&n*o/r)]}}var g6=p6(function(e){return ri(2/(1+e))});g6.invert=Mg(function(e){return 2*bo(e/2)});function que(){return pa(g6).scale(124.75).clipAngle(180-.001)}var m6=p6(function(e){return(e=WF(e))&&e/it(e)});m6.invert=Mg(function(e){return e});function Yue(){return pa(m6).scale(79.4188).clipAngle(180-.001)}function Sv(e,t){return[e,e0($R((jn+t)/2))]}Sv.invert=function(e,t){return[e,2*pf(VF(t))-jn]};function Kue(){return b6(Sv).scale(961/Gi)}function b6(e){var t=pa(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=_t*r(),p=t(aue(t.rotate()).invert([0,0]));return o(s==null?[[p[0]-d,p[1]-d],[p[0]+d,p[1]+d]]:e===Sv?[[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 Rb(e){return $R((jn+e)/2)}function Xue(e,t){var n=ut(e),r=e===t?it(e):e0(n/ut(t))/e0(Rb(t)/Rb(e)),i=n*x1(Rb(e),r)/r;if(!r)return Sv;function o(s,a){i>0?a<-jn+Qe&&(a=-jn+Qe):a>jn-Qe&&(a=jn-Qe);var l=i/x1(Rb(a),r);return[l*it(r*s),i-l*ut(r*s)]}return o.invert=function(s,a){var l=i-a,c=po(r)*ri(s*s+l*l),u=ms(s,zt(l))*po(l);return l*r<0&&(u-=_t*po(s)*po(l)),[u/r,2*pf(x1(i/c,1/r))-jn]},o}function Que(){return VR(Xue).scale(109.5).parallels([30,30])}function d0(e,t){return[e,t]}d0.invert=d0;function Jue(){return pa(d0).scale(152.63)}function Zue(e,t){var n=ut(e),r=e===t?it(e):(n-ut(t))/(t-e),i=n/r+e;if(zt(r)<Qe)return d0;function o(s,a){var l=i-a,c=r*s;return[l*it(c),i-l*ut(c)]}return o.invert=function(s,a){var l=i-a,c=ms(s,zt(l))*po(l);return l*r<0&&(c-=_t*po(s)*po(l)),[c/r,i-po(r)*ri(s*s+l*l)]},o}function ede(){return VR(Zue).scale(131.154).center([0,13.9389])}var Gh=1.340264,qh=-.081106,Yh=893e-6,Kh=.003796,f0=ri(3)/2,tde=12;function y6(e,t){var n=bo(f0*it(t)),r=n*n,i=r*r*r;return[e*ut(n)/(f0*(Gh+3*qh*r+i*(7*Yh+9*Kh*r))),n*(Gh+qh*r+i*(Yh+Kh*r))]}y6.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,o=0,s,a,l;o<tde&&(a=n*(Gh+qh*r+i*(Yh+Kh*r))-t,l=Gh+3*qh*r+i*(7*Yh+9*Kh*r),n-=s=a/l,r=n*n,i=r*r*r,!(zt(s)<HF));++o);return[f0*e*(Gh+3*qh*r+i*(7*Yh+9*Kh*r))/ut(n),bo(it(n)/f0)]};function nde(){return pa(y6).scale(177.158)}function v6(e,t){var n=ut(t),r=ut(e)*n;return[n*it(e)/r,it(t)/r]}v6.invert=Mg(pf);function rde(){return pa(v6).scale(144.049).clipAngle(60)}function x6(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)))]}x6.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)>Qe&&--r>0);return[e/(.8707+(o=n*n)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),n]};function ide(){return pa(x6).scale(175.295)}function w6(e,t){return[ut(t)*it(e),it(t)]}w6.invert=Mg(bo);function ode(){return pa(w6).scale(249.5).clipAngle(90+Qe)}function S6(e,t){var n=ut(t),r=1+ut(e)*n;return[n*it(e)/r,it(t)/r]}S6.invert=Mg(function(e){return 2*pf(e)});function sde(){return pa(S6).scale(250).clipAngle(142)}function _6(e,t){return[e0($R((jn+t)/2)),-e]}_6.invert=function(e,t){return[-t,2*pf(VF(e))-jn]};function ade(){var e=b6(_6),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 Yt(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 _v(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function WR(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function gf(){}var jc=.7,Jd=1/jc,Qu="\\s*([+-]?\\d+)\\s*",Ep="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ds="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",lde=/^#([0-9a-f]{3,8})$/,cde=new RegExp(`^rgb\\(${Qu},${Qu},${Qu}\\)$`),ude=new RegExp(`^rgb\\(${ds},${ds},${ds}\\)$`),dde=new RegExp(`^rgba\\(${Qu},${Qu},${Qu},${Ep}\\)$`),fde=new RegExp(`^rgba\\(${ds},${ds},${ds},${Ep}\\)$`),hde=new RegExp(`^hsl\\(${Ep},${ds},${ds}\\)$`),pde=new RegExp(`^hsla\\(${Ep},${ds},${ds},${Ep}\\)$`),MI={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};_v(gf,UR,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:AI,formatHex:AI,formatHex8:gde,formatHsl:mde,formatRgb:DI,toString:DI});function AI(){return this.rgb().formatHex()}function gde(){return this.rgb().formatHex8()}function mde(){return E6(this).formatHsl()}function DI(){return this.rgb().formatRgb()}function UR(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=lde.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?II(t):n===3?new Lr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Pb(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Pb(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=cde.exec(e))?new Lr(t[1],t[2],t[3],1):(t=ude.exec(e))?new Lr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=dde.exec(e))?Pb(t[1],t[2],t[3],t[4]):(t=fde.exec(e))?Pb(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=hde.exec(e))?LI(t[1],t[2]/100,t[3]/100,1):(t=pde.exec(e))?LI(t[1],t[2]/100,t[3]/100,t[4]):MI.hasOwnProperty(e)?II(MI[e]):e==="transparent"?new Lr(NaN,NaN,NaN,0):null}function II(e){return new Lr(e>>16&255,e>>8&255,e&255,1)}function Pb(e,t,n,r){return r<=0&&(e=t=n=NaN),new Lr(e,t,n,r)}function C6(e){return e instanceof gf||(e=UR(e)),e?(e=e.rgb(),new Lr(e.r,e.g,e.b,e.opacity)):new Lr}function Rp(e,t,n,r){return arguments.length===1?C6(e):new Lr(e,t,n,r??1)}function Lr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}_v(Lr,Rp,WR(gf,{brighter(e){return e=e==null?Jd:Math.pow(Jd,e),new Lr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?jc:Math.pow(jc,e),new Lr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Lr(_c(this.r),_c(this.g),_c(this.b),h0(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:kI,formatHex:kI,formatHex8:bde,formatRgb:NI,toString:NI}));function kI(){return`#${tc(this.r)}${tc(this.g)}${tc(this.b)}`}function bde(){return`#${tc(this.r)}${tc(this.g)}${tc(this.b)}${tc((isNaN(this.opacity)?1:this.opacity)*255)}`}function NI(){const e=h0(this.opacity);return`${e===1?"rgb(":"rgba("}${_c(this.r)}, ${_c(this.g)}, ${_c(this.b)}${e===1?")":`, ${e})`}`}function h0(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function _c(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function tc(e){return e=_c(e),(e<16?"0":"")+e.toString(16)}function LI(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Io(e,t,n,r)}function E6(e){if(e instanceof Io)return new Io(e.h,e.s,e.l,e.opacity);if(e instanceof gf||(e=UR(e)),!e)return new Io;if(e instanceof Io)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 Io(s,a,l,e.opacity)}function yde(e,t,n,r){return arguments.length===1?E6(e):new Io(e,t,n,r??1)}function Io(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}_v(Io,yde,WR(gf,{brighter(e){return e=e==null?Jd:Math.pow(Jd,e),new Io(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?jc:Math.pow(jc,e),new Io(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 Lr(E1(e>=240?e-240:e+120,i,r),E1(e,i,r),E1(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Io(FI(this.h),Tb(this.s),Tb(this.l),h0(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=h0(this.opacity);return`${e===1?"hsl(":"hsla("}${FI(this.h)}, ${Tb(this.s)*100}%, ${Tb(this.l)*100}%${e===1?")":`, ${e})`}`}}));function FI(e){return e=(e||0)%360,e<0?e+360:e}function Tb(e){return Math.max(0,Math.min(1,e||0))}function E1(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 vde=Math.PI/180,xde=180/Math.PI;var R6=-.14861,GR=1.78277,qR=-.29227,Cv=-.90649,Pp=1.97294,jI=Pp*Cv,$I=Pp*GR,zI=GR*qR-Cv*R6;function wde(e){if(e instanceof Cc)return new Cc(e.h,e.s,e.l,e.opacity);e instanceof Lr||(e=C6(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(zI*r+jI*t-$I*n)/(zI+jI-$I),o=r-i,s=(Pp*(n-i)-qR*o)/Cv,a=Math.sqrt(s*s+o*o)/(Pp*i*(1-i)),l=a?Math.atan2(s,o)*xde-120:NaN;return new Cc(l<0?l+360:l,a,i,e.opacity)}function bs(e,t,n,r){return arguments.length===1?wde(e):new Cc(e,t,n,r??1)}function Cc(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}_v(Cc,bs,WR(gf,{brighter(e){return e=e==null?Jd:Math.pow(Jd,e),new Cc(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?jc:Math.pow(jc,e),new Cc(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*vde,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new Lr(255*(t+n*(R6*r+GR*i)),255*(t+n*(qR*r+Cv*i)),255*(t+n*(Pp*r)),this.opacity)}}));function Sde(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 _de(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 Sde((n-r/t)*t,s,i,o,a)}}const YR=e=>()=>e;function P6(e,t){return function(n){return e+n*t}}function Cde(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 Ede(e,t){var n=t-e;return n?P6(e,n>180||n<-180?n-360*Math.round(n/360):n):YR(isNaN(e)?t:e)}function Rde(e){return(e=+e)==1?Ju:function(t,n){return n-t?Cde(t,n,e):YR(isNaN(t)?n:t)}}function Ju(e,t){var n=t-e;return n?P6(e,n):YR(isNaN(e)?t:e)}(function e(t){var n=Rde(t);function r(i,o){var s=n((i=Rp(i)).r,(o=Rp(o)).r),a=n(i.g,o.g),l=n(i.b,o.b),c=Ju(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 Pde(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=Rp(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 Tde=Pde(_de);function T6(e){return function t(n){n=+n;function r(i,o){var s=e((i=bs(i)).h,(o=bs(o)).h),a=Ju(i.s,o.s),l=Ju(i.l,o.l),c=Ju(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)}T6(Ede);var KR=T6(Ju);const hn=e=>Tde(e[e.length-1]);var Ode=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(Yt);const Mde=hn(Ode);var Ade=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(Yt);const Dde=hn(Ade);var Ide=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(Yt);const kde=hn(Ide);var Nde=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(Yt);const Lde=hn(Nde);var Fde=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(Yt);const jde=hn(Fde);var $de=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(Yt);const zde=hn($de);var Bde=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(Yt);const Hde=hn(Bde);var Vde=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(Yt);const Wde=hn(Vde);var Ude=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(Yt);const Gde=hn(Ude);var qde=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(Yt);const Yde=hn(qde);var Kde=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(Yt);const Xde=hn(Kde);var Qde=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(Yt);const Jde=hn(Qde);var Zde=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(Yt);const efe=hn(Zde);var tfe=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(Yt);const nfe=hn(tfe);var rfe=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(Yt);const ife=hn(rfe);var ofe=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(Yt);const sfe=hn(ofe);var afe=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(Yt);const lfe=hn(afe);var cfe=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(Yt);const ufe=hn(cfe);var dfe=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(Yt);const ffe=hn(dfe);var hfe=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(Yt);const pfe=hn(hfe);var gfe=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(Yt);const mfe=hn(gfe);var bfe=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(Yt);const yfe=hn(bfe);var vfe=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(Yt);const xfe=hn(vfe);var wfe=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(Yt);const Sfe=hn(wfe);var _fe=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(Yt);const Cfe=hn(_fe);var Efe=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(Yt);const Rfe=hn(Efe);var Pfe=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(Yt);const Tfe=hn(Pfe);function Ofe(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 Mfe=KR(bs(300,.5,0),bs(-240,.5,1));var Afe=KR(bs(-100,.75,.35),bs(80,1.5,.8)),Dfe=KR(bs(260,.75,.35),bs(80,1.5,.8)),Ob=bs();function Ife(e){(e<0||e>1)&&(e-=Math.floor(e));var t=Math.abs(e-.5);return Ob.h=360*e-100,Ob.s=1.5-1.5*t,Ob.l=.8-.9*t,Ob+""}var Mb=Rp(),kfe=Math.PI/3,Nfe=Math.PI*2/3;function Lfe(e){var t;return e=(.5-e)*Math.PI,Mb.r=255*(t=Math.sin(e))*t,Mb.g=255*(t=Math.sin(e+kfe))*t,Mb.b=255*(t=Math.sin(e+Nfe))*t,Mb+""}function Ffe(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 Ev(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}const jfe=Ev(Yt("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var $fe=Ev(Yt("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),zfe=Ev(Yt("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),Bfe=Ev(Yt("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function Hfe(e){return e}function Vfe(e){if(e==null)return Hfe;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 Wfe(e,t){for(var n,r=e.length,i=r-t;i<--r;)n=e[i],e[i++]=e[r],e[r]=n}function Ufe(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return BI(e,n)})}:BI(e,t)}function BI(e,t){var n=t.id,r=t.bbox,i=t.properties==null?{}:t.properties,o=Gfe(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 Gfe(e,t){var n=Vfe(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&&Wfe(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 Xh={geoAzimuthalEqualArea:que,geoAzimuthalEquidistant:Yue,geoGnomonic:rde,geoOrthographic:ode,geoStereographic:sde,geoEqualEarth:nde,geoAlbers:h6,geoAlbersUsa:Gue,geoConicConformal:Que,geoConicEqualArea:u0,geoConicEquidistant:ede,geoEquirectangular:Jue,geoMercator:Kue,geoTransverseMercator:ade,geoNaturalEarth1:ide};Object.keys(Xh).forEach(e=>{Xh[`${e.charAt(3).toLowerCase()}${e.slice(4)}`]=Xh[e]});class Zc extends bl{constructor(t){super(t),this.outlineBounds=null,this.oldChartBounds=null,this.geoPath=RI()}init(t){t.position="chartArea",super.init(t),typeof t.projection=="function"?this.projection=t.projection:this.projection=(Xh[t.projection]||Xh.albersUsa)(),this.geoPath.projection(this.projection),this.outlineBounds=null,this.oldChartBounds=null}computeBounds(t){const n=RI(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}}Zc.id="projection";Zc.defaults={projection:"albersUsa",projectionScale:1,projectionOffset:[0,0],padding:0};Zc.descriptors={_scriptable:e=>e!=="projection",_indexable:e=>e!=="projectionOffset"};const Rv={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 qfe(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 Yfe(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=qfe(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 Hu extends qd{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=Yfe(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 O6 extends Yd{constructor(){super(...arguments),this.legendSize={w:0,h:0}}init(t){Hu.prototype.init.call(this,t)}parse(t,n){return Hu.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 Hu.prototype.update.call(this,t,n,r)}_computeLabelArea(){}draw(t){return Hu.prototype.draw.call(this,t)}_drawIndicator(){}}const Zs={interpolateBlues:yfe,interpolateBrBG:Mde,interpolateBuGn:Yde,interpolateBuPu:Xde,interpolateCividis:Ofe,interpolateCool:Dfe,interpolateCubehelixDefault:Mfe,interpolateGnBu:Jde,interpolateGreens:xfe,interpolateGreys:Sfe,interpolateInferno:zfe,interpolateMagma:$fe,interpolateOrRd:efe,interpolateOranges:Tfe,interpolatePRGn:Dde,interpolatePiYG:kde,interpolatePlasma:Bfe,interpolatePuBu:ife,interpolatePuBuGn:nfe,interpolatePuOr:Lde,interpolatePuRd:sfe,interpolatePurples:Cfe,interpolateRainbow:Ife,interpolateRdBu:jde,interpolateRdGy:zde,interpolateRdPu:lfe,interpolateRdYlBu:Hde,interpolateRdYlGn:Wde,interpolateReds:Rfe,interpolateSinebow:Lfe,interpolateSpectral:Gde,interpolateTurbo:Ffe,interpolateViridis:jfe,interpolateWarm:Afe,interpolateYlGn:ffe,interpolateYlGnBu:ufe,interpolateYlOrBr:pfe,interpolateYlOrRd:mfe};Object.keys(Zs).forEach(e=>{Zs[`${e.charAt(11).toLowerCase()}${e.slice(12)}`]=Zs[e],Zs[e.slice(11)]=Zs[e]});function M6(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 A6={interpolate:"blues",missing:"transparent",quantize:0};class cl extends Hu{get interpolate(){const t=this.options;return t?typeof t.interpolate=="function"?t.interpolate:Zs[t.interpolate]||Zs.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=M6(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)}}}}cl.id="color";cl.defaults=gr({},[qd.defaults,Rv,A6]);cl.descriptors={_scriptable:e=>e!=="interpolate",_indexable:!1};class XR extends O6{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=Zs[t.interpolate]||Zs.blues}getColorForValue(t){return cl.prototype.getColorForValue.call(this,t)}getColor(t){let n=t;return this.options.quantize>0&&(n=M6(n,this.options.quantize)),this.interpolate(n)}_drawIndicator(){return cl.prototype._drawIndicator.call(this)}}XR.id="colorLogarithmic";XR.defaults=gr({},[Yd.defaults,Rv,A6]);XR.descriptors={_scriptable:e=>e!=="interpolate",_indexable:!1};const D6={missing:1,mode:"area",range:[2,20],legend:{align:"bottom",length:90,width:70,indicatorWidth:42}};class ul extends Hu{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};Yy(t,h,d,p)})}}ul.id="size";ul.defaults=gr({},[qd.defaults,Rv,D6]);ul.descriptors={_scriptable:!0,_indexable:e=>e!=="range"};class I6 extends O6{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 ul.prototype.getSizeImpl.call(this,t)}_drawIndicator(){ul.prototype._drawIndicator.call(this)}}I6.id="sizeLogarithmic";I6.defaults=gr({},[Yd.defaults,Rv,D6]);function Kfe(e,t){return[[e[0][0]-t,e[0][1]-t],[e[1][0]+t,e[1][1]+t]]}class ua extends Rs{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&&Cue(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=Kfe(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())}}ua.id="geoFeature";ua.defaults={...Sc.defaults,outlineBackgroundColor:null,outlineBorderWidth:0,graticuleBorderColor:"#CCCCCC",graticuleBorderWidth:0};ua.defaultRoutes={outlineBorderColor:"borderColor",...Sc.defaultRoutes||{}};const k6={showOutline:!1,showGraticule:!1,clipMap:!0},N6={scales:{projection:{axis:"x",type:Zc.id,position:"chartArea",display:!1}}};function HI(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 L6 extends go{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=HI(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=HI(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(Eue());else{const s=QF();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,bc(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||bc(t.ctx,t.chartArea):r&&(r=!1,yc(t.ctx)),this.showGraticule(),n===!0||n==="items"?r||bc(t.ctx,t.chartArea):r&&(r=!1,yc(t.ctx)),this.getMeta().data.forEach(i=>i.draw.call(i,t.ctx,t.chartArea)),r&&(r=!1,yc(t.ctx))}}function F6(e,t,n,r=[],i=[]){Zr.addControllers(n),Array.isArray(r)?Zr.addElements(...r):Zr.addElements(r),Array.isArray(i)?Zr.addScales(...i):Zr.addScales(i);const o=t;return o.type=e,o}class mf extends L6{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])}}mf.id="choropleth";mf.defaults=gr({},[k6,{datasetElementType:ua.id,dataElementType:ua.id}]);mf.overrides=gr({},[N6,{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:cl.id,axis:"x"}},elements:{geoFeature:{backgroundColor(e){return e.dataIndex==null?null:e.chart.getDatasetMeta(e.datasetIndex).controller.indexToColor(e.dataIndex)}}}}]);class Xfe extends In{constructor(t,n){super(t,F6("choropleth",n,mf,ua,[cl,Zc]))}}Xfe.id=mf.id;class bf extends L6{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])}}bf.id="bubbleMap";bf.defaults=gr({},[k6,{dataElementType:wc.id,datasetElementType:ua.id,showOutline:!0,clipMap:"outline+graticule"}]);bf.overrides=gr({},[N6,{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:ul.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 Qfe extends In{constructor(t,n){super(t,F6("bubbleMap",n,bf,ua,[ul,Zc]))}}Qfe.id=bf.id;function Jfe(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 Zfe(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 ehe(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 the(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 nhe(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 rhe(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 ihe(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 ohe(e){var r,i;const t=ve.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:jt.slate[800]},angleLines:{color:jt.slate[800]},ticks:{color:jt.slate[800],showLabelBackdrop:!1}}}}}),n}function QR({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 w=(l=s==null?void 0:s.mapVisualOptions)==null?void 0:l.objectKey;if(!w)return null;const _=Ufe(a,(c=a==null?void 0:a.objects)==null?void 0:c[w]).features;if(!_)return null;const R={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}=ur(e),T=_.map($=>{var G;const X=C==null?void 0:C[0],H=C==null?void 0:C[1],F=(G=e.find(B=>(B==null?void 0:B[X])===$.properties.NAME||(B==null?void 0:B[X])===$.properties.name))==null?void 0:G[H];return{feature:$,value:F}}),I=Ch([{label:w,data:T,borderColor:"lightgray"}],r),k={type:"choropleth",data:{labels:_.map($=>$.properties.NAME||$.properties.name),datasets:I},options:R},{options:L}=H3({cfg:k,preferences:s,customCfg:r});return{...k,options:L}}if(t==="bar"){const w=ehe(n);return Nl({data:e,cfg:w,customCfg:r,cardType:t,userSettings:o,provider:i,preferences:s})}if(t==="horizontalBar"){const w=Jfe(n);return Nl({data:e,cfg:w,customCfg:r,cardType:t,userSettings:o,provider:i,preferences:s})}if(t==="pyramid"){const w=Zfe(n),{dimensionKeys:_,metricKeys:R}=ur(e),C=Vy({dataArray:e,groupKey:_[0],pivotKey:_[1],valueKey:R[0]}),T=Nl({data:C,cfg:w,customCfg:r,cardType:t,userSettings:o,provider:i,preferences:s}),M="x2";return{...T,data:{...T.data,datasets:T.data.datasets.map((k,L)=>L===1?{...k,xAxisID:M}:k)},options:{...T.options,scales:{...(m=T==null?void 0:T.options)==null?void 0:m.scales,[M]:{beginAtZero:!0,stack:1}}}}}if(t==="stackedBar"||t==="stackedLine"){const w=nhe(n,t),{dimensionKeys:_,metricKeys:R}=ur(e),C=Vy({dataArray:e,groupKey:_[0],pivotKey:_[1],valueKey:R[0],sortChart:s==null?void 0:s.sortChart});return Nl({data:C,cfg:w,customCfg:r,cardType:t,userSettings:o,provider:i,preferences:s})}if(t==="line"){const w=rhe(n);return Nl({data:e,cfg:w,customCfg:r,cardType:t,userSettings:o,provider:i,preferences:s})}if(t==="range"){const w=the(n),_=Iie(e),R=Ch(_,r),{plugins:C,options:T}=j3((s==null?void 0:s.customVisualCode)||""),M=co(w==null?void 0:w.options,(n==null?void 0:n.options)||{}),I=co(M,(s==null?void 0:s.chartOptions)||{}),k=co(I,(r==null?void 0:r.options)||{}),L=co(k,T),j=B3(n,s),$=co(L,j),X={...$,plugins:{...$==null?void 0:$.plugins,datalabels:{...(b=$==null?void 0:$.plugins)==null?void 0:b.datalabels,formatter:(W,K)=>W.map(Y=>{var U,A,te,q;return la({number:Number(Y),decimalPlaces:((U=s==null?void 0:s.numberAxisFormat)==null?void 0:U.decimalPlaces)||0,useSuffix:!!((A=s==null?void 0:s.numberAxisFormat)!=null&&A.suffix),customSuffix:"",locale:((te=s==null?void 0:s.numberAxisFormat)==null?void 0:te.locale)||"",currency:((q=s==null?void 0:s.numberAxisFormat)==null?void 0:q.currency)||""})}).slice(0,2).join(" - ")}}},{dimensionKeys:H}=ur(e),F=H[0];return{type:"bar",data:{labels:[...new Set(D_(e,F))],datasets:R},options:X,plugins:[...C]}}if(t==="pie"||t==="doughnut"||t==="polarArea"){const w=ihe(t,n),{dimensionKeys:_,metricKeys:R}=ur(e),C=kie(R,e),T=Ch(C,r),M=_[0],I=D_(e,M),k=co(w==null?void 0:w.options,(r==null?void 0:r.options)||{}),L=co(k,(s==null?void 0:s.chartOptions)||{}),j={...L,plugins:{...L.plugins,datalabels:{...(v=L.plugins)==null?void 0:v.datalabels,formatter:(H,F)=>{var G,B,W,K;return la({number:Number(H),decimalPlaces:((G=s==null?void 0:s.numberAxisFormat)==null?void 0:G.decimalPlaces)||0,useSuffix:!!((B=s==null?void 0:s.numberAxisFormat)!=null&&B.suffix),customSuffix:"",locale:((W=s==null?void 0:s.numberAxisFormat)==null?void 0:W.locale)||"",currency:((K=s==null?void 0:s.numberAxisFormat)==null?void 0:K.currency)||""})}},tooltip:{...(x=L.plugins)==null?void 0:x.tooltip,callbacks:{label:function(H){let F=H.dataset.label||"";F&&(F+=": ");const B=H.dataset.data.reduce((D,Y)=>D+Y,0),K=(H.parsed/B*100).toFixed(2);return F+=K+"%",F+` (${H.formattedValue})`}}}}};return{type:t,data:{labels:I,datasets:T},options:j,plugins:[t==="doughnut"?{id:"doughnutLabel",beforeDatasetsDraw:function(H,F,G){var q,se,J,ee;const{ctx:B,data:W}=H;B.save();const K=H.getDatasetMeta(0).data[0].x,D=H.getDatasetMeta(0).data[0].y,Y=Ld(cp()),U=window.getComputedStyle(B.canvas).fontFamily;B.font=`1em ${U}`,B.fontWeight="bolder",B.fillStyle=Y,B.textAlign="center",B.textBaseline="middle";const A=W.datasets[0].data.reduce((ae,ce)=>ae+ce,0),te=la({number:Number(A),decimalPlaces:((q=s==null?void 0:s.numberAxisFormat)==null?void 0:q.decimalPlaces)||0,useSuffix:!!((se=s==null?void 0:s.numberAxisFormat)!=null&&se.suffix),customSuffix:"",locale:((J=s==null?void 0:s.numberAxisFormat)==null?void 0:J.locale)||"",currency:((ee=s==null?void 0:s.numberAxisFormat)==null?void 0:ee.currency)||""});B.fillText(te,K,D)}}:""]}}if(t==="radar"){const w=ohe(n);return Nl({data:e,cfg:w,customCfg:r,cardType:t,userSettings:o,provider:i,preferences:s})}if(t==="bubble"||t==="scatter"){const{metricKeys:w}=ur(e);if(w.length<3){console.log("Bubble charts require 3 numeric columns");return}const _=Die(e),R=Ch(_,r),C={plugins:{datalabels:{display:!0}},scales:{x:{title:{display:!0,text:w[0]},beginAtZero:!0,ticks:{precision:0}},y:{title:{display:!0,text:w[1]},beginAtZero:!0,ticks:{precision:0}}}},T=co(C,(r==null?void 0:r.options)||{});return{type:t,data:{datasets:R},options:T}}return Nl({data:e,cfg:n,customCfg:r,cardType:t,userSettings:o,provider:i,preferences:s})}function she({chart:e,elementIndex:t,datasetIndex:n,cardType:r,cfg:i,apply:o}){const s=ve.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)&&lhe(e,t,i,o,a),["pie","doughnut","polarArea"].includes(r)&&che(e,t,i,o,a),["stackedBar","pyramid"].includes(r)&&ahe({chart:e,elementIndex:t,datasetIndex:n,cfg:i,apply:o,blurColor:a})}function ahe(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,w;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((w=(x=(v=i==null?void 0:i.data)==null?void 0:v.datasets)==null?void 0:x[p])==null?void 0:w.borderColor)}),t==null||t.update()}function lhe(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 che(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,w;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((_,R)=>{var C;return(C=n.data.datasets[u].backgroundColor)==null?void 0:C[R]}),c.borderColor=(w=c==null?void 0:c.borderColor)==null?void 0:w.map((_,R)=>{var C;return(C=n.data.datasets[u].borderColor)==null?void 0:C[R]})}),e==null||e.update()}function uhe({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}=ur(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=Vy({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:w}=ur(m),_=w[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 dhe(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,eoe("--semaphor-background")),c})}));return{...e,data:{...e.data,datasets:o}}}return e}function j6(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}=Sg({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 fhe(e){var s,a;const[t]=P.useState({id:"",title:"",type:"bar"}),{getCard:n}=hr(),r=n(e),i=$6(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 $6(e){var X,H,F,G;const{onChartElementClicked:t}=vo(),[n,r]=P.useState(0);((X=e==null?void 0:e.preferences)==null?void 0:X.filterOnClickColumnIndex)===void 0||(H=e.preferences)==null||H.filterOnClickColumnIndex;const i=ve(B=>B.isVisualEditing),o=ve(B=>B.filteringCards),s=ve(B=>B.selectedSheetId),a=ve(B=>B.selectedLensId);ve(B=>B.selectedCardId),ve(B=>B.dashboard),ve(B=>B.isDashboardEditing),ve(B=>B.themeStyle);const l=ve(B=>B.filterValues),c=P.useRef(l),u=(F=e==null?void 0:e.preferences)==null?void 0:F.onClickFilter,{addFilteringCard:d,getCardFrame:p,addOrUpdateFilterValues:h,removeFilterValue:m,removeFilteringCard:b}=hr(),{data:v,isLoading:x,isFetching:w,isError:_,queryKey:R}=ol(e),{data:C}=j6(e),T=o==null?void 0:o.find(B=>B.id===e.id),M=p(e.id),I=(M==null?void 0:M.cards)||[],k=(I==null?void 0:I.length)==1;let L;v&&v.records&&((G=v.records)==null?void 0:G.length)>0&&e.type!=="custom"&&(L=QR({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||w||T&&k||i||r(B=>B+1)},[v==null?void 0:v.records,x,w,T,k,i]),P.useEffect(()=>{e.connectionId&&!T&&(c.current=l)},[l,a,e.connectionId,T]),P.useEffect(()=>{var W;T&&(j.current.filteringCards=[...o||[]]),!T&&((W=j.current.filteringCards)==null?void 0:W.find(K=>K.id===e.id))&&k&&r(K=>K+1)},[T,k,e.id,o]);function $(B,W,K,D){var A;let Y=!1;if(!(v!=null&&v.records))return;const U=uhe({card:e,data:v==null?void 0:v.records,datasetIndex:W,clickIndex:K,value:D});if(console.log("fieldValues",U),t==null||t(e,U),!!(((A=e==null?void 0:e.preferences)==null?void 0:A.onClickFilter)??[]).length){if(T){const te=e.id;m(te),b(e)}else{if(Y=!0,!U)return;const te=[];U.forEach((q,se)=>{const J=u==null?void 0:u.find(ae=>ae.columnIndex===se);if(!J)return;const ee={filterId:e.id+"-"+q.columnName+"-"+s,connectionId:e==null?void 0:e.connectionId,tableName:e.lastSelectedTable,name:q.columnName,expression:J.expression,valueType:G0(U[J.columnIndex].columnValue),operation:"=",values:[U[J.columnIndex].columnValue]};te.push(ee)}),h(te),d(e)}she({chart:B,elementIndex:K,datasetIndex:W,cardType:e.type,cfg:L,apply:Y})}}return{isError:_,isLoading:x,isFetching:w,data:v,visualKey:n,handleDatapointClick:$,cfg:L,queryKey:R}}function fs({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=ve(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 z6(e){const{authToken:t}=vo(),n=AQ(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 p0({card:e,data:t}){var w,_,R,C,T,M,I,k,L,j,$,X,H,F,G,B;const n=ve(W=>W.actions.setCardTitle),r=ve(W=>W.actions.setCardDescription),i=ve(W=>W.isVisualEditing),o=Jr(W=>W.card),s=Jr(W=>W.actions.setCard);Jr(W=>W.actions.setNumberFormat);const{getCurrency:a,getLocale:l}=z6(e),c=ve(W=>W.selectedSheetId),u=(_=(w=e.preferences)==null?void 0:w.formatNumber)==null?void 0:_.colorRanges,{metricKeys:d}=ur(t),p=(R=t==null?void 0:t[0])==null?void 0:R[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(X0,{className:"grow pb-3",children:[y.jsx(fs,{text:i?o.title:e.title,onSave:b,children:y.jsx("div",{className:"flex items-center gap-2",children:y.jsx(df,{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:xR(p,u)},className:"text-3xl font-semibold",children:la({number:p,decimalPlaces:((M=(T=e.preferences)==null?void 0:T.formatNumber)==null?void 0:M.decimalPlaces)||0,useSuffix:!!((k=(I=e.preferences)==null?void 0:I.formatNumber)!=null&&k.suffix),customSuffix:((j=(L=e.preferences)==null?void 0:L.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 ",la({number:h,decimalPlaces:((X=($=e.preferences)==null?void 0:$.formatNumber)==null?void 0:X.decimalPlaces)||0,useSuffix:!!((F=(H=e.preferences)==null?void 0:H.formatNumber)!=null&&F.suffix),customSuffix:((B=(G=e.preferences)==null?void 0:G.formatNumber)==null?void 0:B.suffix)||"",locale:l()||"",currency:a()||""})]})]})]}),x&&y.jsxs(Q0,{className:"grow items-start gap-1 pb-4 text-sm",children:[y.jsx(B6,{children:x}),y.jsxs("div",{className:"flex gap-1 text-muted-foreground",children:[x>0?"up ":"down ",y.jsx(fs,{text:e.description||"",onSave:v,children:e.description})]})]})]})}function B6({children:e,className:t}){var o,s;const n=ve(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 hhe=["top","right","bottom","left"],da=Math.min,Ir=Math.max,Tp=Math.round,Ab=Math.floor,hs=e=>({x:e,y:e}),phe={left:"right",right:"left",bottom:"top",top:"bottom"},ghe={start:"end",end:"start"};function dC(e,t,n){return Ir(e,da(t,n))}function ys(e,t){return typeof e=="function"?e(t):e}function fa(e){return e.split("-")[0]}function yf(e){return e.split("-")[1]}function JR(e){return e==="x"?"y":"x"}function ZR(e){return e==="y"?"height":"width"}function dl(e){return["top","bottom"].includes(fa(e))?"y":"x"}function e2(e){return JR(dl(e))}function mhe(e,t,n){n===void 0&&(n=!1);const r=yf(e),i=e2(e),o=ZR(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=g0(s)),[s,g0(s)]}function bhe(e){const t=g0(e);return[fC(e),t,fC(t)]}function fC(e){return e.replace(/start|end/g,t=>ghe[t])}function yhe(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 vhe(e,t,n,r){const i=yf(e);let o=yhe(fa(e),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),t&&(o=o.concat(o.map(fC)))),o}function g0(e){return e.replace(/left|right|bottom|top/g,t=>phe[t])}function xhe(e){return{top:0,right:0,bottom:0,left:0,...e}}function H6(e){return typeof e!="number"?xhe(e):{top:e,right:e,bottom:e,left:e}}function m0(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 VI(e,t,n){let{reference:r,floating:i}=e;const o=dl(t),s=e2(t),a=ZR(s),l=fa(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(yf(t)){case"start":h[s]-=p*(n&&c?-1:1);break;case"end":h[s]+=p*(n&&c?-1:1);break}return h}const whe=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}=VI(c,r,l),p=r,h={},m=0;for(let b=0;b<a.length;b++){const{name:v,fn:x}=a[b],{x:w,y:_,data:R,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=w??u,d=_??d,h={...h,[v]:{...h[v],...R}},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}=VI(c,p,l)),b=-1)}return{x:u,y:d,placement:p,strategy:i,middlewareData:h}};async function Zd(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}=ys(t,e),m=H6(h),v=a[p?d==="floating"?"reference":"floating":d],x=m0(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})),w=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)),R=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=m0(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:_,strategy:l}):w);return{top:(x.top-C.top+m.top)/R.y,bottom:(C.bottom-x.bottom+m.bottom)/R.y,left:(x.left-C.left+m.left)/R.x,right:(C.right-x.right+m.right)/R.x}}const She=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}=ys(e,t)||{};if(c==null)return{};const d=H6(u),p={x:n,y:r},h=e2(i),m=ZR(h),b=await s.getDimensions(c),v=h==="y",x=v?"top":"left",w=v?"bottom":"right",_=v?"clientHeight":"clientWidth",R=o.reference[m]+o.reference[h]-p[h]-o.floating[m],C=p[h]-o.reference[h],T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let M=T?T[_]:0;(!M||!await(s.isElement==null?void 0:s.isElement(T)))&&(M=a.floating[_]||o.floating[m]);const I=R/2-C/2,k=M/2-b[m]/2-1,L=da(d[x],k),j=da(d[w],k),$=L,X=M-b[m]-j,H=M/2-b[m]/2+I,F=dC($,H,X),G=!l.arrow&&yf(i)!=null&&H!==F&&o.reference[m]/2-(H<$?L:j)-b[m]/2<0,B=G?H<$?H-$:H-X:0;return{[h]:p[h]+B,data:{[h]:F,centerOffset:H-F-B,...G&&{alignmentOffset:B}},reset:G}}}),_he=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}=ys(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const x=fa(i),w=dl(a),_=fa(a)===a,R=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=p||(_||!b?[g0(a)]:bhe(a)),T=m!=="none";!p&&T&&C.push(...vhe(a,b,m,R));const M=[a,...C],I=await Zd(t,v),k=[];let L=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&k.push(I[x]),d){const H=mhe(i,s,R);k.push(I[H[0]],I[H[1]])}if(L=[...L,{placement:i,overflows:k}],!k.every(H=>H<=0)){var j,$;const H=(((j=o.flip)==null?void 0:j.index)||0)+1,F=M[H];if(F)return{data:{index:H,overflows:L},reset:{placement:F}};let G=($=L.filter(B=>B.overflows[0]<=0).sort((B,W)=>B.overflows[1]-W.overflows[1])[0])==null?void 0:$.placement;if(!G)switch(h){case"bestFit":{var X;const B=(X=L.filter(W=>{if(T){const K=dl(W.placement);return K===w||K==="y"}return!0}).map(W=>[W.placement,W.overflows.filter(K=>K>0).reduce((K,D)=>K+D,0)]).sort((W,K)=>W[1]-K[1])[0])==null?void 0:X[0];B&&(G=B);break}case"initialPlacement":G=a;break}if(i!==G)return{reset:{placement:G}}}return{}}}};function WI(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function UI(e){return hhe.some(t=>e[t]>=0)}const Che=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=ys(e,t);switch(r){case"referenceHidden":{const o=await Zd(t,{...i,elementContext:"reference"}),s=WI(o,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:UI(s)}}}case"escaped":{const o=await Zd(t,{...i,altBoundary:!0}),s=WI(o,n.floating);return{data:{escapedOffsets:s,escaped:UI(s)}}}default:return{}}}}};async function Ehe(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=fa(n),a=yf(n),l=dl(n)==="y",c=["left","top"].includes(s)?-1:1,u=o&&l?-1:1,d=ys(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 Rhe=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 Ehe(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}}}}},Phe=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:w}=v;return{x,y:w}}},...l}=ys(e,t),c={x:n,y:r},u=await Zd(t,l),d=dl(fa(i)),p=JR(d);let h=c[p],m=c[d];if(o){const v=p==="y"?"top":"left",x=p==="y"?"bottom":"right",w=h+u[v],_=h-u[x];h=dC(w,h,_)}if(s){const v=d==="y"?"top":"left",x=d==="y"?"bottom":"right",w=m+u[v],_=m-u[x];m=dC(w,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}}}}}},The=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}=ys(e,t),u={x:n,y:r},d=dl(i),p=JR(d);let h=u[p],m=u[d];const b=ys(a,t),v=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(l){const _=p==="y"?"height":"width",R=o.reference[p]-o.floating[_]+v.mainAxis,C=o.reference[p]+o.reference[_]-v.mainAxis;h<R?h=R:h>C&&(h=C)}if(c){var x,w;const _=p==="y"?"width":"height",R=["top","left"].includes(fa(i)),C=o.reference[d]-o.floating[_]+(R&&((x=s.offset)==null?void 0:x[d])||0)+(R?0:v.crossAxis),T=o.reference[d]+o.reference[_]+(R?0:((w=s.offset)==null?void 0:w[d])||0)-(R?v.crossAxis:0);m<C?m=C:m>T&&(m=T)}return{[p]:h,[d]:m}}}},Ohe=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}=ys(e,t),u=await Zd(t,c),d=fa(i),p=yf(i),h=dl(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 w=b-u.top-u.bottom,_=m-u.left-u.right,R=da(b-u[v],w),C=da(m-u[x],_),T=!t.middlewareData.shift;let M=R,I=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(I=_),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(M=w),T&&!p){const L=Ir(u.left,0),j=Ir(u.right,0),$=Ir(u.top,0),X=Ir(u.bottom,0);h?I=m-2*(L!==0||j!==0?L+j:Ir(u.left,u.right)):M=b-2*($!==0||X!==0?$+X:Ir(u.top,u.bottom))}await l({...t,availableWidth:I,availableHeight:M});const k=await s.getDimensions(a.floating);return m!==k.width||b!==k.height?{reset:{rects:!0}}:{}}}};function Pv(){return typeof window<"u"}function vf(e){return V6(e)?(e.nodeName||"").toLowerCase():"#document"}function Vi(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ps(e){var t;return(t=(V6(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function V6(e){return Pv()?e instanceof Node||e instanceof Vi(e).Node:!1}function Fr(e){return Pv()?e instanceof Element||e instanceof Vi(e).Element:!1}function vs(e){return Pv()?e instanceof HTMLElement||e instanceof Vi(e).HTMLElement:!1}function GI(e){return!Pv()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Vi(e).ShadowRoot}function Ag(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=$o(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function Mhe(e){return["table","td","th"].includes(vf(e))}function Tv(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function t2(e){const t=n2(),n=Fr(e)?$o(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 Ahe(e){let t=fl(e);for(;vs(t)&&!ef(t);){if(t2(t))return t;if(Tv(t))return null;t=fl(t)}return null}function n2(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ef(e){return["html","body","#document"].includes(vf(e))}function $o(e){return Vi(e).getComputedStyle(e)}function Ov(e){return Fr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function fl(e){if(vf(e)==="html")return e;const t=e.assignedSlot||e.parentNode||GI(e)&&e.host||Ps(e);return GI(t)?t.host:t}function W6(e){const t=fl(e);return ef(t)?e.ownerDocument?e.ownerDocument.body:e.body:vs(t)&&Ag(t)?t:W6(t)}function Op(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=W6(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=Vi(i);if(o){const a=hC(s);return t.concat(s,s.visualViewport||[],Ag(i)?i:[],a&&n?Op(a):[])}return t.concat(i,Op(i,[],n))}function hC(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function U6(e){const t=$o(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=vs(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=Tp(n)!==o||Tp(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function r2(e){return Fr(e)?e:e.contextElement}function Zu(e){const t=r2(e);if(!vs(t))return hs(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=U6(t);let s=(o?Tp(n.width):n.width)/r,a=(o?Tp(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Dhe=hs(0);function G6(e){const t=Vi(e);return!n2()||!t.visualViewport?Dhe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ihe(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Vi(e)?!1:t}function $c(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=r2(e);let s=hs(1);t&&(r?Fr(r)&&(s=Zu(r)):s=Zu(e));const a=Ihe(o,n,r)?G6(o):hs(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=Vi(o),h=r&&Fr(r)?Vi(r):r;let m=p,b=hC(m);for(;b&&r&&h!==m;){const v=Zu(b),x=b.getBoundingClientRect(),w=$o(b),_=x.left+(b.clientLeft+parseFloat(w.paddingLeft))*v.x,R=x.top+(b.clientTop+parseFloat(w.paddingTop))*v.y;l*=v.x,c*=v.y,u*=v.x,d*=v.y,l+=_,c+=R,m=Vi(b),b=hC(m)}}return m0({width:u,height:d,x:l,y:c})}function i2(e,t){const n=Ov(e).scrollLeft;return t?t.left+n:$c(Ps(e)).left+n}function q6(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-(n?0:i2(e,r)),o=r.top+t.scrollTop;return{x:i,y:o}}function khe(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",s=Ps(r),a=t?Tv(t.floating):!1;if(r===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},c=hs(1);const u=hs(0),d=vs(r);if((d||!d&&!o)&&((vf(r)!=="body"||Ag(s))&&(l=Ov(r)),vs(r))){const h=$c(r);c=Zu(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const p=s&&!d&&!o?q6(s,l,!0):hs(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 Nhe(e){return Array.from(e.getClientRects())}function Lhe(e){const t=Ps(e),n=Ov(e),r=e.ownerDocument.body,i=Ir(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Ir(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+i2(e);const a=-n.scrollTop;return $o(r).direction==="rtl"&&(s+=Ir(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}function Fhe(e,t){const n=Vi(e),r=Ps(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=n2();(!c||c&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a,y:l}}function jhe(e,t){const n=$c(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=vs(e)?Zu(e):hs(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 qI(e,t,n){let r;if(t==="viewport")r=Fhe(e,n);else if(t==="document")r=Lhe(Ps(e));else if(Fr(t))r=jhe(t,n);else{const i=G6(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return m0(r)}function Y6(e,t){const n=fl(e);return n===t||!Fr(n)||ef(n)?!1:$o(n).position==="fixed"||Y6(n,t)}function $he(e,t){const n=t.get(e);if(n)return n;let r=Op(e,[],!1).filter(a=>Fr(a)&&vf(a)!=="body"),i=null;const o=$o(e).position==="fixed";let s=o?fl(e):e;for(;Fr(s)&&!ef(s);){const a=$o(s),l=t2(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Ag(s)&&!l&&Y6(e,s))?r=r.filter(u=>u!==s):i=a,s=fl(s)}return t.set(e,r),r}function zhe(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?Tv(t)?[]:$he(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const d=qI(t,u,i);return c.top=Ir(d.top,c.top),c.right=da(d.right,c.right),c.bottom=da(d.bottom,c.bottom),c.left=Ir(d.left,c.left),c},qI(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Bhe(e){const{width:t,height:n}=U6(e);return{width:t,height:n}}function Hhe(e,t,n){const r=vs(t),i=Ps(t),o=n==="fixed",s=$c(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=hs(0);if(r||!r&&!o)if((vf(t)!=="body"||Ag(i))&&(a=Ov(t)),r){const p=$c(t,!0,o,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else i&&(l.x=i2(i));const c=i&&!r&&!o?q6(i,a):hs(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 R1(e){return $o(e).position==="static"}function YI(e,t){if(!vs(e)||$o(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ps(e)===n&&(n=n.ownerDocument.body),n}function K6(e,t){const n=Vi(e);if(Tv(e))return n;if(!vs(e)){let i=fl(e);for(;i&&!ef(i);){if(Fr(i)&&!R1(i))return i;i=fl(i)}return n}let r=YI(e,t);for(;r&&Mhe(r)&&R1(r);)r=YI(r,t);return r&&ef(r)&&R1(r)&&!t2(r)?n:r||Ahe(e)||n}const Vhe=async function(e){const t=this.getOffsetParent||K6,n=this.getDimensions,r=await n(e.floating);return{reference:Hhe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Whe(e){return $o(e).direction==="rtl"}const Uhe={convertOffsetParentRelativeRectToViewportRelativeRect:khe,getDocumentElement:Ps,getClippingRect:zhe,getOffsetParent:K6,getElementRects:Vhe,getClientRects:Nhe,getDimensions:Bhe,getScale:Zu,isElement:Fr,isRTL:Whe};function X6(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ghe(e,t){let n=null,r;const i=Ps(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=Ab(d),b=Ab(i.clientWidth-(u+p)),v=Ab(i.clientHeight-(d+h)),x=Ab(u),_={rootMargin:-m+"px "+-b+"px "+-v+"px "+-x+"px",threshold:Ir(0,da(1,l))||1};let R=!0;function C(T){const M=T[0].intersectionRatio;if(M!==l){if(!R)return s();M?s(!1,M):r=setTimeout(()=>{s(!1,1e-7)},1e3)}M===1&&!X6(c,e.getBoundingClientRect())&&s(),R=!1}try{n=new IntersectionObserver(C,{..._,root:i.ownerDocument})}catch{n=new IntersectionObserver(C,_)}n.observe(e)}return s(!0),o}function Q6(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=r2(e),u=i||o?[...c?Op(c):[],...Op(t)]:[];u.forEach(x=>{i&&x.addEventListener("scroll",n,{passive:!0}),o&&x.addEventListener("resize",n)});const d=c&&a?Ghe(c,n):null;let p=-1,h=null;s&&(h=new ResizeObserver(x=>{let[w]=x;w&&w.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?$c(e):null;l&&v();function v(){const x=$c(e);b&&!X6(b,x)&&n(),b=x,m=requestAnimationFrame(v)}return n(),()=>{var x;u.forEach(w=>{i&&w.removeEventListener("scroll",n),o&&w.removeEventListener("resize",n)}),d==null||d(),(x=h)==null||x.disconnect(),h=null,l&&cancelAnimationFrame(m)}}const P1=Zd,qhe=Rhe,Yhe=Phe,Khe=_he,Xhe=Ohe,Qhe=Che,KI=She,Jhe=The,Zhe=(e,t,n)=>{const r=new Map,i={platform:Uhe,...n},o={...i.platform,_c:r};return whe(e,t,{...i,platform:o})};var by=typeof document<"u"?P.useLayoutEffect:P.useEffect;function b0(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(!b0(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)&&!b0(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function J6(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function XI(e,t){const n=J6(e);return Math.round(t*n)/n}function T1(e){const t=E.useRef(e);return by(()=>{t.current=e}),t}function Z6(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]=E.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=E.useState(r);b0(p,r)||h(r);const[m,b]=E.useState(null),[v,x]=E.useState(null),w=E.useCallback(W=>{W!==T.current&&(T.current=W,b(W))},[]),_=E.useCallback(W=>{W!==M.current&&(M.current=W,x(W))},[]),R=o||m,C=s||v,T=E.useRef(null),M=E.useRef(null),I=E.useRef(u),k=l!=null,L=T1(l),j=T1(i),$=T1(c),X=E.useCallback(()=>{if(!T.current||!M.current)return;const W={placement:t,strategy:n,middleware:p};j.current&&(W.platform=j.current),Zhe(T.current,M.current,W).then(K=>{const D={...K,isPositioned:$.current!==!1};H.current&&!b0(I.current,D)&&(I.current=D,Mc.flushSync(()=>{d(D)}))})},[p,t,n,j,$]);by(()=>{c===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,d(W=>({...W,isPositioned:!1})))},[c]);const H=E.useRef(!1);by(()=>(H.current=!0,()=>{H.current=!1}),[]),by(()=>{if(R&&(T.current=R),C&&(M.current=C),R&&C){if(L.current)return L.current(R,C,X);X()}},[R,C,X,L,k]);const F=E.useMemo(()=>({reference:T,floating:M,setReference:w,setFloating:_}),[w,_]),G=E.useMemo(()=>({reference:R,floating:C}),[R,C]),B=E.useMemo(()=>{const W={position:n,left:0,top:0};if(!G.floating)return W;const K=XI(G.floating,u.x),D=XI(G.floating,u.y);return a?{...W,transform:"translate("+K+"px, "+D+"px)",...J6(G.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:K,top:D}},[n,a,G.floating,u.x,u.y]);return E.useMemo(()=>({...u,update:X,refs:F,elements:G,floatingStyles:B}),[u,X,F,G,B])}const epe=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?KI({element:r.current,padding:i}).fn(n):{}:r?KI({element:r,padding:i}).fn(n):{}}}},o2=(e,t)=>({...qhe(e),options:[e,t]}),e8=(e,t)=>({...Yhe(e),options:[e,t]}),tpe=(e,t)=>({...Jhe(e),options:[e,t]}),t8=(e,t)=>({...Khe(e),options:[e,t]}),n8=(e,t)=>({...Xhe(e),options:[e,t]}),npe=(e,t)=>({...Qhe(e),options:[e,t]}),rpe=(e,t)=>({...epe(e),options:[e,t]});var ipe="Arrow",r8=E.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return y.jsx(Fe.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"})})});r8.displayName=ipe;var ope=r8;function Mv(e){const[t,n]=E.useState(void 0);return Sr(()=>{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 s2="Popper",[i8,Ts]=or(s2),[spe,o8]=i8(s2),s8=e=>{const{__scopePopper:t,children:n}=e,[r,i]=E.useState(null);return y.jsx(spe,{scope:t,anchor:r,onAnchorChange:i,children:n})};s8.displayName=s2;var a8="PopperAnchor",l8=E.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=o8(a8,n),s=E.useRef(null),a=rt(t,s);return E.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:y.jsx(Fe.div,{...i,ref:a})});l8.displayName=a8;var a2="PopperContent",[ape,lpe]=i8(a2),c8=E.forwardRef((e,t)=>{var J,ee,ae,ce,ge,oe;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=o8(a2,n),[x,w]=E.useState(null),_=rt(t,pe=>w(pe)),[R,C]=E.useState(null),T=Mv(R),M=(T==null?void 0:T.width)??0,I=(T==null?void 0:T.height)??0,k=r+(o!=="center"?"-"+o:""),L=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},j=Array.isArray(c)?c:[c],$=j.length>0,X={padding:L,boundary:j.filter(upe),altBoundary:$},{refs:H,floatingStyles:F,placement:G,isPositioned:B,middlewareData:W}=Z6({strategy:"fixed",placement:k,whileElementsMounted:(...pe)=>Q6(...pe,{animationFrame:h==="always"}),elements:{reference:v.anchor},middleware:[o2({mainAxis:i+I,alignmentAxis:s}),l&&e8({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?tpe():void 0,...X}),l&&t8({...X}),n8({...X,apply:({elements:pe,rects:de,availableWidth:Ee,availableHeight:De})=>{const{width:ze,height:Oe}=de.reference,Be=pe.floating.style;Be.setProperty("--radix-popper-available-width",`${Ee}px`),Be.setProperty("--radix-popper-available-height",`${De}px`),Be.setProperty("--radix-popper-anchor-width",`${ze}px`),Be.setProperty("--radix-popper-anchor-height",`${Oe}px`)}}),R&&rpe({element:R,padding:a}),dpe({arrowWidth:M,arrowHeight:I}),p&&npe({strategy:"referenceHidden",...X})]}),[K,D]=f8(G),Y=ir(m);Sr(()=>{B&&(Y==null||Y())},[B,Y]);const U=(J=W.arrow)==null?void 0:J.x,A=(ee=W.arrow)==null?void 0:ee.y,te=((ae=W.arrow)==null?void 0:ae.centerOffset)!==0,[q,se]=E.useState();return Sr(()=>{x&&se(window.getComputedStyle(x).zIndex)},[x]),y.jsx("div",{ref:H.setFloating,"data-radix-popper-content-wrapper":"",style:{...F,transform:B?F.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:q,"--radix-popper-transform-origin":[(ce=W.transformOrigin)==null?void 0:ce.x,(ge=W.transformOrigin)==null?void 0:ge.y].join(" "),...((oe=W.hide)==null?void 0:oe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:y.jsx(ape,{scope:n,placedSide:K,onArrowChange:C,arrowX:U,arrowY:A,shouldHideArrow:te,children:y.jsx(Fe.div,{"data-side":K,"data-align":D,...b,ref:_,style:{...b.style,animation:B?void 0:"none"}})})})});c8.displayName=a2;var u8="PopperArrow",cpe={top:"bottom",right:"left",bottom:"top",left:"right"},d8=E.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=lpe(u8,r),s=cpe[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(ope,{...i,ref:n,style:{...i.style,display:"block"}})})});d8.displayName=u8;function upe(e){return e!==null}var dpe=e=>({name:"transformOrigin",options:e,fn(t){var v,x,w;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]=f8(n),d={start:"0%",center:"50%",end:"100%"}[u],p=(((x=i.arrow)==null?void 0:x.x)??0)+a/2,h=(((w=i.arrow)==null?void 0:w.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 f8(e){const[t,n="center"]=e.split("-");return[t,n]}var Dg=s8,xf=l8,Ig=c8,kg=d8,fpe="Portal",Ng=E.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[i,o]=E.useState(!1);Sr(()=>o(!0),[]);const s=n||i&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?kr.createPortal(y.jsx(Fe.div,{...r,ref:t}),s):null});Ng.displayName=fpe;function hpe(e,t=globalThis==null?void 0:globalThis.document){const n=ir(e);E.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 ppe="DismissableLayer",pC="dismissableLayer.update",gpe="dismissableLayer.pointerDownOutside",mpe="dismissableLayer.focusOutside",QI,h8=E.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),eu=E.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,onDismiss:a,...l}=e,c=E.useContext(h8),[u,d]=E.useState(null),p=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=E.useState({}),m=rt(t,M=>d(M)),b=Array.from(c.layers),[v]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),x=b.indexOf(v),w=u?b.indexOf(u):-1,_=c.layersWithOutsidePointerEventsDisabled.size>0,R=w>=x,C=vpe(M=>{const I=M.target,k=[...c.branches].some(L=>L.contains(I));!R||k||(i==null||i(M),s==null||s(M),M.defaultPrevented||a==null||a())},p),T=xpe(M=>{const I=M.target;[...c.branches].some(L=>L.contains(I))||(o==null||o(M),s==null||s(M),M.defaultPrevented||a==null||a())},p);return hpe(M=>{w===c.layers.size-1&&(r==null||r(M),!M.defaultPrevented&&a&&(M.preventDefault(),a()))},p),E.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(QI=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),JI(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=QI)}},[u,p,n,c]),E.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),JI())},[u,c]),E.useEffect(()=>{const M=()=>h({});return document.addEventListener(pC,M),()=>document.removeEventListener(pC,M)},[]),y.jsx(Fe.div,{...l,ref:m,style:{pointerEvents:_?R?"auto":"none":void 0,...e.style},onFocusCapture:Re(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Re(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Re(e.onPointerDownCapture,C.onPointerDownCapture)})});eu.displayName=ppe;var bpe="DismissableLayerBranch",ype=E.forwardRef((e,t)=>{const n=E.useContext(h8),r=E.useRef(null),i=rt(t,r);return E.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),y.jsx(Fe.div,{...e,ref:i})});ype.displayName=bpe;function vpe(e,t=globalThis==null?void 0:globalThis.document){const n=ir(e),r=E.useRef(!1),i=E.useRef(()=>{});return E.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let l=function(){p8(gpe,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 xpe(e,t=globalThis==null?void 0:globalThis.document){const n=ir(e),r=E.useRef(!1);return E.useEffect(()=>{const i=o=>{o.target&&!r.current&&p8(mpe,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 JI(){const e=new CustomEvent(pC);document.dispatchEvent(e)}function p8(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?a4(i,o):i.dispatchEvent(o)}var O1,l2="HoverCard",[g8,dIe]=or(l2,[Ts]),Av=Ts(),[wpe,c2]=g8(l2),m8=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:i,onOpenChange:o,openDelay:s=700,closeDelay:a=300}=e,l=Av(t),c=E.useRef(0),u=E.useRef(0),d=E.useRef(!1),p=E.useRef(!1),[h=!1,m]=$r({prop:r,defaultProp:i,onChange:o}),b=E.useCallback(()=>{clearTimeout(u.current),c.current=window.setTimeout(()=>m(!0),s)},[s,m]),v=E.useCallback(()=>{clearTimeout(c.current),!d.current&&!p.current&&(u.current=window.setTimeout(()=>m(!1),a))},[a,m]),x=E.useCallback(()=>m(!1),[m]);return E.useEffect(()=>()=>{clearTimeout(c.current),clearTimeout(u.current)},[]),y.jsx(wpe,{scope:t,open:h,onOpenChange:m,onOpen:b,onClose:v,onDismiss:x,hasSelectionRef:d,isPointerDownOnContentRef:p,children:y.jsx(Dg,{...l,children:n})})};m8.displayName=l2;var b8="HoverCardTrigger",y8=E.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,i=c2(b8,n),o=Av(n);return y.jsx(xf,{asChild:!0,...o,children:y.jsx(Fe.a,{"data-state":i.open?"open":"closed",...r,ref:t,onPointerEnter:Re(e.onPointerEnter,v0(i.onOpen)),onPointerLeave:Re(e.onPointerLeave,v0(i.onClose)),onFocus:Re(e.onFocus,i.onOpen),onBlur:Re(e.onBlur,i.onClose),onTouchStart:Re(e.onTouchStart,s=>s.preventDefault())})})});y8.displayName=b8;var Spe="HoverCardPortal",[fIe,_pe]=g8(Spe,{forceMount:void 0}),y0="HoverCardContent",v8=E.forwardRef((e,t)=>{const n=_pe(y0,e.__scopeHoverCard),{forceMount:r=n.forceMount,...i}=e,o=c2(y0,e.__scopeHoverCard);return y.jsx(Jn,{present:r||o.open,children:y.jsx(Cpe,{"data-state":o.open?"open":"closed",...i,onPointerEnter:Re(e.onPointerEnter,v0(o.onOpen)),onPointerLeave:Re(e.onPointerLeave,v0(o.onClose)),ref:t})})});v8.displayName=y0;var Cpe=E.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,...a}=e,l=c2(y0,n),c=Av(n),u=E.useRef(null),d=rt(t,u),[p,h]=E.useState(!1);return E.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]),E.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]),E.useEffect(()=>{u.current&&Ppe(u.current).forEach(b=>b.setAttribute("tabindex","-1"))}),y.jsx(eu,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:s,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:Re(o,m=>{m.preventDefault()}),onDismiss:l.onDismiss,children:y.jsx(Ig,{...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)"}})})}),Epe="HoverCardArrow",Rpe=E.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,i=Av(n);return y.jsx(kg,{...i,...r,ref:t})});Rpe.displayName=Epe;function v0(e){return t=>t.pointerType==="touch"?void 0:e()}function Ppe(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 Tpe=m8,Ope=y8,x8=v8;const Dv=Tpe,Iv=Ope,Lg=E.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},i)=>y.jsx(x8,{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}));Lg.displayName=x8.displayName;function w8({card:e}){const{setCardInfo:t}=hr();return y.jsxs(Dv,{openDelay:0,children:[y.jsx(Iv,{children:y.jsx(E3,{className:"size-4 text-muted-foreground/40"})}),y.jsx(Lg,{align:"start",className:"w-[300px]",onMouseDown:n=>n.stopPropagation(),children:y.jsx(fs,{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 Mpe({card:e,renderFilterInfo:t}){var m,b,v,x,w,_,R,C,T,M,I,k,L,j,$,X;ve(H=>H.themeStyle);const{data:n,isLoading:r}=ol(e),i=(n==null?void 0:n.records)||[],o=ve(H=>H.isDashboardEditing),{getCurrency:s,getLocale:a}=z6(e),l=(b=(m=e.preferences)==null?void 0:m.formatNumber)==null?void 0:b.colorRanges,{metricKeys:c}=ur(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:xR(u,l)},className:"text-3xl font-semibold",children:la({number:u,decimalPlaces:((_=(w=e.preferences)==null?void 0:w.formatNumber)==null?void 0:_.decimalPlaces)||0,useSuffix:!!((C=(R=e.preferences)==null?void 0:R.formatNumber)!=null&&C.suffix),customSuffix:((M=(T=e.preferences)==null?void 0:T.formatNumber)==null?void 0:M.suffix)||"",locale:a()||"",currency:s()||""})}),h&&y.jsxs("div",{className:"flex items-end gap-1",children:[y.jsx(B6,{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 ${la({number:d,decimalPlaces:((k=(I=e.preferences)==null?void 0:I.formatNumber)==null?void 0:k.decimalPlaces)||0,useSuffix:!!((j=(L=e.preferences)==null?void 0:L.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(df,{className:"flex items-center gap-2 text-base font-medium text-muted-foreground",children:[e.title,(o||e.info)&&y.jsx(w8,{card:e})]}),t==null?void 0:t()]})]})})}var Ape="VisuallyHidden",u2=E.forwardRef((e,t)=>y.jsx(Fe.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}}));u2.displayName=Ape;var Dpe=u2,[kv,hIe]=or("Tooltip",[Ts]),Nv=Ts(),S8="TooltipProvider",Ipe=700,gC="tooltip.open",[kpe,d2]=kv(S8),_8=e=>{const{__scopeTooltip:t,delayDuration:n=Ipe,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,[s,a]=E.useState(!0),l=E.useRef(!1),c=E.useRef(0);return E.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),y.jsx(kpe,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:E.useCallback(()=>{window.clearTimeout(c.current),a(!1)},[]),onClose:E.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:E.useCallback(u=>{l.current=u},[]),disableHoverableContent:i,children:o})};_8.displayName=S8;var Lv="Tooltip",[Npe,Fv]=kv(Lv),C8=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i=!1,onOpenChange:o,disableHoverableContent:s,delayDuration:a}=e,l=d2(Lv,e.__scopeTooltip),c=Nv(t),[u,d]=E.useState(null),p=Qn(),h=E.useRef(0),m=s??l.disableHoverableContent,b=a??l.delayDuration,v=E.useRef(!1),[x=!1,w]=$r({prop:r,defaultProp:i,onChange:M=>{M?(l.onOpen(),document.dispatchEvent(new CustomEvent(gC))):l.onClose(),o==null||o(M)}}),_=E.useMemo(()=>x?v.current?"delayed-open":"instant-open":"closed",[x]),R=E.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,w(!0)},[w]),C=E.useCallback(()=>{window.clearTimeout(h.current),h.current=0,w(!1)},[w]),T=E.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,w(!0),h.current=0},b)},[b,w]);return E.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),y.jsx(Dg,{...c,children:y.jsx(Npe,{scope:t,contentId:p,open:x,stateAttribute:_,trigger:u,onTriggerChange:d,onTriggerEnter:E.useCallback(()=>{l.isOpenDelayed?T():R()},[l.isOpenDelayed,T,R]),onTriggerLeave:E.useCallback(()=>{m?C():(window.clearTimeout(h.current),h.current=0)},[C,m]),onOpen:R,onClose:C,disableHoverableContent:m,children:n})})};C8.displayName=Lv;var mC="TooltipTrigger",f2=E.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Fv(mC,n),o=d2(mC,n),s=Nv(n),a=E.useRef(null),l=rt(t,a,i.onTriggerChange),c=E.useRef(!1),u=E.useRef(!1),d=E.useCallback(()=>c.current=!1,[]);return E.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),y.jsx(xf,{asChild:!0,...s,children:y.jsx(Fe.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)})})});f2.displayName=mC;var Lpe="TooltipPortal",[pIe,Fpe]=kv(Lpe,{forceMount:void 0}),tf="TooltipContent",E8=E.forwardRef((e,t)=>{const n=Fpe(tf,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,s=Fv(tf,e.__scopeTooltip);return y.jsx(Jn,{present:r||s.open,children:s.disableHoverableContent?y.jsx(R8,{side:i,...o,ref:t}):y.jsx(jpe,{side:i,...o,ref:t})})}),jpe=E.forwardRef((e,t)=>{const n=Fv(tf,e.__scopeTooltip),r=d2(tf,e.__scopeTooltip),i=E.useRef(null),o=rt(t,i),[s,a]=E.useState(null),{trigger:l,onClose:c}=n,u=i.current,{onPointerInTransitChange:d}=r,p=E.useCallback(()=>{a(null),d(!1)},[d]),h=E.useCallback((m,b)=>{const v=m.currentTarget,x={x:m.clientX,y:m.clientY},w=Hpe(x,v.getBoundingClientRect()),_=Vpe(x,w),R=Wpe(b.getBoundingClientRect()),C=Gpe([..._,...R]);a(C),d(!0)},[d]);return E.useEffect(()=>()=>p(),[p]),E.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]),E.useEffect(()=>{if(s){const m=b=>{const v=b.target,x={x:b.clientX,y:b.clientY},w=(l==null?void 0:l.contains(v))||(u==null?void 0:u.contains(v)),_=!Upe(x,s);w?p():_&&(p(),c())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[l,u,s,c,p]),y.jsx(R8,{...e,ref:o})}),[$pe,zpe]=kv(Lv,{isInside:!1}),R8=E.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:s,...a}=e,l=Fv(tf,n),c=Nv(n),{onClose:u}=l;return E.useEffect(()=>(document.addEventListener(gC,u),()=>document.removeEventListener(gC,u)),[u]),E.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(eu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:y.jsxs(Ig,{"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(jE,{children:r}),y.jsx($pe,{scope:n,isInside:!0,children:y.jsx(Dpe,{id:l.contentId,role:"tooltip",children:i||r})})]})})});E8.displayName=tf;var P8="TooltipArrow",Bpe=E.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Nv(n);return zpe(P8,n).isInside?null:y.jsx(kg,{...i,...r,ref:t})});Bpe.displayName=P8;function Hpe(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 Vpe(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 Wpe(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 Upe(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 Gpe(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),qpe(t)}function qpe(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 Ype=_8,Kpe=C8,Xpe=f2,T8=E8;const Qpe=Ype,O8=Kpe,M8=Xpe,h2=E.forwardRef(({className:e,sideOffset:t=4,...n},r)=>y.jsx(T8,{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}));h2.displayName=T8.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:A8,setPrototypeOf:ZI,isFrozen:Jpe,getPrototypeOf:Zpe,getOwnPropertyDescriptor:ege}=Object;let{freeze:ii,seal:yo,create:D8}=Object,{apply:bC,construct:yC}=typeof Reflect<"u"&&Reflect;ii||(ii=function(t){return t});yo||(yo=function(t){return t});bC||(bC=function(t,n,r){return t.apply(n,r)});yC||(yC=function(t,n){return new t(...n)});const Db=qi(Array.prototype.forEach),ek=qi(Array.prototype.pop),th=qi(Array.prototype.push),yy=qi(String.prototype.toLowerCase),M1=qi(String.prototype.toString),tk=qi(String.prototype.match),nh=qi(String.prototype.replace),tge=qi(String.prototype.indexOf),nge=qi(String.prototype.trim),To=qi(Object.prototype.hasOwnProperty),Gr=qi(RegExp.prototype.test),rh=rge(TypeError);function qi(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 bC(e,t,r)}}function rge(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return yC(e,n)}}function Tt(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:yy;ZI&&ZI(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const o=n(i);o!==i&&(Jpe(t)||(t[r]=o),i=o)}e[i]=!0}return e}function ige(e){for(let t=0;t<e.length;t++)To(e,t)||(e[t]=null);return e}function Ul(e){const t=D8(null);for(const[n,r]of A8(e))To(e,n)&&(Array.isArray(r)?t[n]=ige(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=Ul(r):t[n]=r);return t}function ih(e,t){for(;e!==null;){const r=ege(e,t);if(r){if(r.get)return qi(r.get);if(typeof r.value=="function")return qi(r.value)}e=Zpe(e)}function n(){return null}return n}const nk=ii(["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=ii(["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"]),D1=ii(["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"]),oge=ii(["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"]),I1=ii(["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"]),sge=ii(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),rk=ii(["#text"]),ik=ii(["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"]),k1=ii(["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"]),ok=ii(["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"]),Ib=ii(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),age=yo(/\{\{[\w\W]*|[\w\W]*\}\}/gm),lge=yo(/<%[\w\W]*|[\w\W]*%>/gm),cge=yo(/\$\{[\w\W]*}/gm),uge=yo(/^data-[\-\w.\u00B7-\uFFFF]+$/),dge=yo(/^aria-[\-\w]+$/),I8=yo(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),fge=yo(/^(?:\w+script|data):/i),hge=yo(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),k8=yo(/^html$/i),pge=yo(/^[a-z][.\w]*(-[.\w]+)+$/i);var sk=Object.freeze({__proto__:null,ARIA_ATTR:dge,ATTR_WHITESPACE:hge,CUSTOM_ELEMENT:pge,DATA_ATTR:uge,DOCTYPE_NAME:k8,ERB_EXPR:lge,IS_ALLOWED_URI:I8,IS_SCRIPT_OR_DATA:fge,MUSTACHE_EXPR:age,TMPLIT_EXPR:cge});const oh={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},gge=function(){return typeof window>"u"?null:window},mge=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}},ak=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function N8(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:gge();const t=Le=>N8(Le);if(t.version="3.2.3",t.removed=[],!e||!e.document||e.document.nodeType!==oh.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=ih(m,"cloneNode"),v=ih(m,"remove"),x=ih(m,"nextSibling"),w=ih(m,"childNodes"),_=ih(m,"parentNode");if(typeof s=="function"){const Le=n.createElement("template");Le.content&&Le.content.ownerDocument&&(n=Le.content.ownerDocument)}let R,C="";const{implementation:T,createNodeIterator:M,createDocumentFragment:I,getElementsByTagName:k}=n,{importNode:L}=r;let j=ak();t.isSupported=typeof A8=="function"&&typeof _=="function"&&T&&T.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:$,ERB_EXPR:X,TMPLIT_EXPR:H,DATA_ATTR:F,ARIA_ATTR:G,IS_SCRIPT_OR_DATA:B,ATTR_WHITESPACE:W,CUSTOM_ELEMENT:K}=sk;let{IS_ALLOWED_URI:D}=sk,Y=null;const U=Tt({},[...nk,...A1,...D1,...I1,...rk]);let A=null;const te=Tt({},[...ik,...k1,...ok,...Ib]);let q=Object.seal(D8(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}})),se=null,J=null,ee=!0,ae=!0,ce=!1,ge=!0,oe=!1,pe=!0,de=!1,Ee=!1,De=!1,ze=!1,Oe=!1,Be=!1,vt=!0,Mt=!1;const xn="user-content-";let At=!0,pn=!1,en={},fe=null;const _e=Tt({},["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 He=null;const Ze=Tt({},["audio","video","img","source","image","track"]);let st=null;const kn=Tt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Bn="http://www.w3.org/1998/Math/MathML",Mn="http://www.w3.org/2000/svg",sn="http://www.w3.org/1999/xhtml";let Hn=sn,tn=!1,sr=null;const Zn=Tt({},[Bn,Mn,sn],M1);let Qi=Tt({},["mi","mo","mn","ms","mtext"]),Cr=Tt({},["annotation-xml"]);const Wo=Tt({},["title","style","font","a","script"]);let Er=null;const Br=["application/xhtml+xml","text/html"],_l="text/html";let je=null,xt=null;const Ht=n.createElement("form"),er=function(re){return re instanceof RegExp||re instanceof Function},tr=function(){let re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(xt&&xt===re)){if((!re||typeof re!="object")&&(re={}),re=Ul(re),Er=Br.indexOf(re.PARSER_MEDIA_TYPE)===-1?_l:re.PARSER_MEDIA_TYPE,je=Er==="application/xhtml+xml"?M1:yy,Y=To(re,"ALLOWED_TAGS")?Tt({},re.ALLOWED_TAGS,je):U,A=To(re,"ALLOWED_ATTR")?Tt({},re.ALLOWED_ATTR,je):te,sr=To(re,"ALLOWED_NAMESPACES")?Tt({},re.ALLOWED_NAMESPACES,M1):Zn,st=To(re,"ADD_URI_SAFE_ATTR")?Tt(Ul(kn),re.ADD_URI_SAFE_ATTR,je):kn,He=To(re,"ADD_DATA_URI_TAGS")?Tt(Ul(Ze),re.ADD_DATA_URI_TAGS,je):Ze,fe=To(re,"FORBID_CONTENTS")?Tt({},re.FORBID_CONTENTS,je):_e,se=To(re,"FORBID_TAGS")?Tt({},re.FORBID_TAGS,je):{},J=To(re,"FORBID_ATTR")?Tt({},re.FORBID_ATTR,je):{},en=To(re,"USE_PROFILES")?re.USE_PROFILES:!1,ee=re.ALLOW_ARIA_ATTR!==!1,ae=re.ALLOW_DATA_ATTR!==!1,ce=re.ALLOW_UNKNOWN_PROTOCOLS||!1,ge=re.ALLOW_SELF_CLOSE_IN_ATTR!==!1,oe=re.SAFE_FOR_TEMPLATES||!1,pe=re.SAFE_FOR_XML!==!1,de=re.WHOLE_DOCUMENT||!1,ze=re.RETURN_DOM||!1,Oe=re.RETURN_DOM_FRAGMENT||!1,Be=re.RETURN_TRUSTED_TYPE||!1,De=re.FORCE_BODY||!1,vt=re.SANITIZE_DOM!==!1,Mt=re.SANITIZE_NAMED_PROPS||!1,At=re.KEEP_CONTENT!==!1,pn=re.IN_PLACE||!1,D=re.ALLOWED_URI_REGEXP||I8,Hn=re.NAMESPACE||sn,Qi=re.MATHML_TEXT_INTEGRATION_POINTS||Qi,Cr=re.HTML_INTEGRATION_POINTS||Cr,q=re.CUSTOM_ELEMENT_HANDLING||{},re.CUSTOM_ELEMENT_HANDLING&&er(re.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(q.tagNameCheck=re.CUSTOM_ELEMENT_HANDLING.tagNameCheck),re.CUSTOM_ELEMENT_HANDLING&&er(re.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(q.attributeNameCheck=re.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),re.CUSTOM_ELEMENT_HANDLING&&typeof re.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(q.allowCustomizedBuiltInElements=re.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),oe&&(ae=!1),Oe&&(ze=!0),en&&(Y=Tt({},rk),A=[],en.html===!0&&(Tt(Y,nk),Tt(A,ik)),en.svg===!0&&(Tt(Y,A1),Tt(A,k1),Tt(A,Ib)),en.svgFilters===!0&&(Tt(Y,D1),Tt(A,k1),Tt(A,Ib)),en.mathMl===!0&&(Tt(Y,I1),Tt(A,ok),Tt(A,Ib))),re.ADD_TAGS&&(Y===U&&(Y=Ul(Y)),Tt(Y,re.ADD_TAGS,je)),re.ADD_ATTR&&(A===te&&(A=Ul(A)),Tt(A,re.ADD_ATTR,je)),re.ADD_URI_SAFE_ATTR&&Tt(st,re.ADD_URI_SAFE_ATTR,je),re.FORBID_CONTENTS&&(fe===_e&&(fe=Ul(fe)),Tt(fe,re.FORBID_CONTENTS,je)),At&&(Y["#text"]=!0),de&&Tt(Y,["html","head","body"]),Y.table&&(Tt(Y,["tbody"]),delete se.tbody),re.TRUSTED_TYPES_POLICY){if(typeof re.TRUSTED_TYPES_POLICY.createHTML!="function")throw rh('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof re.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw rh('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');R=re.TRUSTED_TYPES_POLICY,C=R.createHTML("")}else R===void 0&&(R=mge(h,i)),R!==null&&typeof C=="string"&&(C=R.createHTML(""));ii&&ii(re),xt=re}},Hr=Tt({},[...A1,...D1,...oge]),mr=Tt({},[...I1,...sge]),ar=function(re){let we=_(re);(!we||!we.tagName)&&(we={namespaceURI:Hn,tagName:"template"});const Ie=yy(re.tagName),Dt=yy(we.tagName);return sr[re.namespaceURI]?re.namespaceURI===Mn?we.namespaceURI===sn?Ie==="svg":we.namespaceURI===Bn?Ie==="svg"&&(Dt==="annotation-xml"||Qi[Dt]):!!Hr[Ie]:re.namespaceURI===Bn?we.namespaceURI===sn?Ie==="math":we.namespaceURI===Mn?Ie==="math"&&Cr[Dt]:!!mr[Ie]:re.namespaceURI===sn?we.namespaceURI===Mn&&!Cr[Dt]||we.namespaceURI===Bn&&!Qi[Dt]?!1:!mr[Ie]&&(Wo[Ie]||!Hr[Ie]):!!(Er==="application/xhtml+xml"&&sr[re.namespaceURI]):!1},wn=function(re){th(t.removed,{element:re});try{_(re).removeChild(re)}catch{v(re)}},ba=function(re,we){try{th(t.removed,{attribute:we.getAttributeNode(re),from:we})}catch{th(t.removed,{attribute:null,from:we})}if(we.removeAttribute(re),re==="is")if(ze||Oe)try{wn(we)}catch{}else try{we.setAttribute(re,"")}catch{}},iu=function(re){let we=null,Ie=null;if(De)re="<remove></remove>"+re;else{const Rt=tk(re,/^[\r\n\t ]+/);Ie=Rt&&Rt[0]}Er==="application/xhtml+xml"&&Hn===sn&&(re='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+re+"</body></html>");const Dt=R?R.createHTML(re):re;if(Hn===sn)try{we=new p().parseFromString(Dt,Er)}catch{}if(!we||!we.documentElement){we=T.createDocument(Hn,"template",null);try{we.documentElement.innerHTML=tn?C:Dt}catch{}}const gn=we.body||we.documentElement;return re&&Ie&&gn.insertBefore(n.createTextNode(Ie),gn.childNodes[0]||null),Hn===sn?k.call(we,de?"html":"body")[0]:de?we.documentElement:gn},ou=function(re){return M.call(re.ownerDocument||re,re,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},ne=function(re){return re instanceof d&&(typeof re.nodeName!="string"||typeof re.textContent!="string"||typeof re.removeChild!="function"||!(re.attributes instanceof u)||typeof re.removeAttribute!="function"||typeof re.setAttribute!="function"||typeof re.namespaceURI!="string"||typeof re.insertBefore!="function"||typeof re.hasChildNodes!="function")},Ce=function(re){return typeof a=="function"&&re instanceof a};function Ae(Le,re,we){Db(Le,Ie=>{Ie.call(t,re,we,xt)})}const We=function(re){let we=null;if(Ae(j.beforeSanitizeElements,re,null),ne(re))return wn(re),!0;const Ie=je(re.nodeName);if(Ae(j.uponSanitizeElement,re,{tagName:Ie,allowedTags:Y}),re.hasChildNodes()&&!Ce(re.firstElementChild)&&Gr(/<[/\w]/g,re.innerHTML)&&Gr(/<[/\w]/g,re.textContent)||re.nodeType===oh.progressingInstruction||pe&&re.nodeType===oh.comment&&Gr(/<[/\w]/g,re.data))return wn(re),!0;if(!Y[Ie]||se[Ie]){if(!se[Ie]&&$t(Ie)&&(q.tagNameCheck instanceof RegExp&&Gr(q.tagNameCheck,Ie)||q.tagNameCheck instanceof Function&&q.tagNameCheck(Ie)))return!1;if(At&&!fe[Ie]){const Dt=_(re)||re.parentNode,gn=w(re)||re.childNodes;if(gn&&Dt){const Rt=gn.length;for(let qn=Rt-1;qn>=0;--qn){const si=b(gn[qn],!0);si.__removalCount=(re.__removalCount||0)+1,Dt.insertBefore(si,x(re))}}}return wn(re),!0}return re instanceof l&&!ar(re)||(Ie==="noscript"||Ie==="noembed"||Ie==="noframes")&&Gr(/<\/no(script|embed|frames)/i,re.innerHTML)?(wn(re),!0):(oe&&re.nodeType===oh.text&&(we=re.textContent,Db([$,X,H],Dt=>{we=nh(we,Dt," ")}),re.textContent!==we&&(th(t.removed,{element:re.cloneNode()}),re.textContent=we)),Ae(j.afterSanitizeElements,re,null),!1)},kt=function(re,we,Ie){if(vt&&(we==="id"||we==="name")&&(Ie in n||Ie in Ht))return!1;if(!(ae&&!J[we]&&Gr(F,we))){if(!(ee&&Gr(G,we))){if(!A[we]||J[we]){if(!($t(re)&&(q.tagNameCheck instanceof RegExp&&Gr(q.tagNameCheck,re)||q.tagNameCheck instanceof Function&&q.tagNameCheck(re))&&(q.attributeNameCheck instanceof RegExp&&Gr(q.attributeNameCheck,we)||q.attributeNameCheck instanceof Function&&q.attributeNameCheck(we))||we==="is"&&q.allowCustomizedBuiltInElements&&(q.tagNameCheck instanceof RegExp&&Gr(q.tagNameCheck,Ie)||q.tagNameCheck instanceof Function&&q.tagNameCheck(Ie))))return!1}else if(!st[we]){if(!Gr(D,nh(Ie,W,""))){if(!((we==="src"||we==="xlink:href"||we==="href")&&re!=="script"&&tge(Ie,"data:")===0&&He[re])){if(!(ce&&!Gr(B,nh(Ie,W,"")))){if(Ie)return!1}}}}}}return!0},$t=function(re){return re!=="annotation-xml"&&tk(re,K)},wt=function(re){Ae(j.beforeSanitizeAttributes,re,null);const{attributes:we}=re;if(!we||ne(re))return;const Ie={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:A,forceKeepAttr:void 0};let Dt=we.length;for(;Dt--;){const gn=we[Dt],{name:Rt,namespaceURI:qn,value:si}=gn,Ms=je(Rt);let lr=Rt==="value"?si:nge(si);if(Ie.attrName=Ms,Ie.attrValue=lr,Ie.keepAttr=!0,Ie.forceKeepAttr=void 0,Ae(j.uponSanitizeAttribute,re,Ie),lr=Ie.attrValue,Mt&&(Ms==="id"||Ms==="name")&&(ba(Rt,re),lr=xn+lr),pe&&Gr(/((--!?|])>)|<\/(style|title)/i,lr)){ba(Rt,re);continue}if(Ie.forceKeepAttr||(ba(Rt,re),!Ie.keepAttr))continue;if(!ge&&Gr(/\/>/i,lr)){ba(Rt,re);continue}oe&&Db([$,X,H],Tf=>{lr=nh(lr,Tf," ")});const Pf=je(re.nodeName);if(kt(Pf,Ms,lr)){if(R&&typeof h=="object"&&typeof h.getAttributeType=="function"&&!qn)switch(h.getAttributeType(Pf,Ms)){case"TrustedHTML":{lr=R.createHTML(lr);break}case"TrustedScriptURL":{lr=R.createScriptURL(lr);break}}try{qn?re.setAttributeNS(qn,Rt,lr):re.setAttribute(Rt,lr),ne(re)?wn(re):ek(t.removed)}catch{}}}Ae(j.afterSanitizeAttributes,re,null)},gt=function Le(re){let we=null;const Ie=ou(re);for(Ae(j.beforeSanitizeShadowDOM,re,null);we=Ie.nextNode();)Ae(j.uponSanitizeShadowNode,we,null),We(we),wt(we),we.content instanceof o&&Le(we.content);Ae(j.afterSanitizeShadowDOM,re,null)};return t.sanitize=function(Le){let re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},we=null,Ie=null,Dt=null,gn=null;if(tn=!Le,tn&&(Le="<!-->"),typeof Le!="string"&&!Ce(Le))if(typeof Le.toString=="function"){if(Le=Le.toString(),typeof Le!="string")throw rh("dirty is not a string, aborting")}else throw rh("toString is not a function");if(!t.isSupported)return Le;if(Ee||tr(re),t.removed=[],typeof Le=="string"&&(pn=!1),pn){if(Le.nodeName){const si=je(Le.nodeName);if(!Y[si]||se[si])throw rh("root node is forbidden and cannot be sanitized in-place")}}else if(Le instanceof a)we=iu("<!---->"),Ie=we.ownerDocument.importNode(Le,!0),Ie.nodeType===oh.element&&Ie.nodeName==="BODY"||Ie.nodeName==="HTML"?we=Ie:we.appendChild(Ie);else{if(!ze&&!oe&&!de&&Le.indexOf("<")===-1)return R&&Be?R.createHTML(Le):Le;if(we=iu(Le),!we)return ze?null:Be?C:""}we&&De&&wn(we.firstChild);const Rt=ou(pn?Le:we);for(;Dt=Rt.nextNode();)We(Dt),wt(Dt),Dt.content instanceof o&>(Dt.content);if(pn)return Le;if(ze){if(Oe)for(gn=I.call(we.ownerDocument);we.firstChild;)gn.appendChild(we.firstChild);else gn=we;return(A.shadowroot||A.shadowrootmode)&&(gn=L.call(r,gn,!0)),gn}let qn=de?we.outerHTML:we.innerHTML;return de&&Y["!doctype"]&&we.ownerDocument&&we.ownerDocument.doctype&&we.ownerDocument.doctype.name&&Gr(k8,we.ownerDocument.doctype.name)&&(qn="<!DOCTYPE "+we.ownerDocument.doctype.name+`>
|
|
281
|
+
`+qn),oe&&Db([$,X,H],si=>{qn=nh(qn,si," ")}),R&&Be?R.createHTML(qn):qn},t.setConfig=function(){let Le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};tr(Le),Ee=!0},t.clearConfig=function(){xt=null,Ee=!1},t.isValidAttribute=function(Le,re,we){xt||tr({});const Ie=je(Le),Dt=je(re);return kt(Ie,Dt,we)},t.addHook=function(Le,re){typeof re=="function"&&th(j[Le],re)},t.removeHook=function(Le){return ek(j[Le])},t.removeHooks=function(Le){j[Le]=[]},t.removeAllHooks=function(){j=ak()},t}var lk=N8();function x0({card:e,isLoading:t,data:n}){var p,h;const r=n||[],{keys:i}=ur(r),o=ve(m=>m.selectedSheetId),s=ve(m=>m.isVisualEditing),a=(h=(p=e==null?void 0:e.preferences)==null?void 0:p.textVisualOptions)==null?void 0:h.isDynamicText,{setCardDescription:l}=hr(),{setCard:c}=gv();function u(){var x;if(t)return y.jsxs("div",{className:"space-y-2",children:[y.jsx(Yu,{className:"h-3 w-full animate-pulse bg-muted"}),y.jsx(Yu,{className:"h-3 w-3/4 animate-pulse bg-muted"}),y.jsx(Yu,{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=lk.sanitize(m),v=y.jsx("div",{dangerouslySetInnerHTML:{__html:b}});return y.jsx("div",{className:"text-sm text-foreground/80 hover:cursor-text",onMouseDown:w=>w.stopPropagation(),children:v})}function d(){return y.jsx("div",{onMouseDown:m=>m.stopPropagation(),children:y.jsx(fs,{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:lk.sanitize((e==null?void 0:e.description)||(s?"Edit Description":"")||"")}})})})}return y.jsxs(y.Fragment,{children:[!a&&d(),a===!0&&u()]})}const ck=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,uk=Cy,p2=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return uk(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=ck(u)||ck(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 uk(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},Mp=p2("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"}}),Si=E.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},o)=>{const s=r?ca:"button";return y.jsx(s,{className:be(Mp({variant:t,size:n,className:e})),ref:o,...i})});Si.displayName="Button";var bge="Separator",dk="horizontal",yge=["horizontal","vertical"],L8=E.forwardRef((e,t)=>{const{decorative:n,orientation:r=dk,...i}=e,o=vge(r)?r:dk,a=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return y.jsx(Fe.div,{"data-orientation":o,...a,...i,ref:t})});L8.displayName=bge;function vge(e){return yge.includes(e)}var F8=L8;const Fg=E.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},i)=>y.jsx(F8,{ref:i,decorative:n,orientation:t,className:be("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));Fg.displayName=F8.displayName;function xge(){var b,v;const e=ve(x=>x.themeStyle),t=ve(x=>x.filterValues),n=ve(x=>x.dashboard.filters),r=ve(x=>x.filteringCards),i=ve(x=>x.selectedSheetId),{removeFilterValue:o,removeFilteringCard:s,setFilterValues:a,setFilteringCards:l}=hr(),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(w=>w.id===x.filterId))||x.filterId.endsWith(i));if(!u||u.length===0)return null;const d=u.map(x=>{const w=n==null?void 0:n.find(_=>_.id===x.filterId);return{filterId:x.filterId,name:(w==null?void 0:w.title)||x.name,values:x.values}});function p(x){return x instanceof Date?x.toLocaleDateString():x}function h(x){const w=r==null?void 0:r.find(_=>x.filterId.startsWith(_.id));w&&s(w),o(x.filterId)}function m(x){var w,_;return y.jsxs("div",{className:"space-y-2",children:[y.jsxs("div",{style:{borderRadius:(_=(w=e==null?void 0:e.chart)==null?void 0:w.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(hf,{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(R=>{var C,T;return y.jsx("span",{style:{borderRadius:(T=(C=e==null?void 0:e.chart)==null?void 0:C.options)==null?void 0:T.borderRadius},className:"inline-block",children:p(R)},R.toString())})})]})}return y.jsxs(Dv,{openDelay:100,children:[y.jsx(Iv,{children:y.jsx(_3,{className:"z-100 size-3.5 text-muted-foreground/40"})}),y.jsxs(Lg,{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(bR,{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(Fg,{className:"my-2"})]},x.name))})]})]})}const wge=E.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})}));wge.displayName="Table";const g2=E.forwardRef(({className:e,...t},n)=>y.jsx("thead",{ref:n,className:be("[&_tr]:border-b",e),...t}));g2.displayName="TableHeader";const m2=E.forwardRef(({className:e,...t},n)=>y.jsx("tbody",{ref:n,className:be("[&_tr:last-child]:border-0",e),...t}));m2.displayName="TableBody";const Sge=E.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}));Sge.displayName="TableFooter";const Qh=E.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}));Qh.displayName="TableRow";const b2=E.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}));b2.displayName="TableHead";const y2=E.forwardRef(({className:e,...t},n)=>y.jsx("td",{ref:n,className:be("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));y2.displayName="TableCell";const _ge=E.forwardRef(({className:e,...t},n)=>y.jsx("caption",{ref:n,className:be("mt-4 text-sm text-muted-foreground",e),...t}));_ge.displayName="TableCaption";/**
|
|
282
|
+
* table-core
|
|
283
|
+
*
|
|
284
|
+
* Copyright (c) TanStack
|
|
285
|
+
*
|
|
286
|
+
* This source code is licensed under the MIT license found in the
|
|
287
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
288
|
+
*
|
|
289
|
+
* @license MIT
|
|
290
|
+
*/function Ka(e,t){return typeof e=="function"?e(t):e}function Yi(e,t){return n=>{t.setState(r=>({...r,[e]:Ka(n,r[e])}))}}function jv(e){return e instanceof Function}function Cge(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Ege(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 Ke(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`,`
|
|
291
|
+
font-size: .6rem;
|
|
292
|
+
font-weight: bold;
|
|
293
|
+
color: hsl(${Math.max(0,Math.min(120-120*p,120))}deg 100% 31%);`,n==null?void 0:n.key)}return i}}function Xe(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 Rge(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:Ke(()=>[e,n,t,o],(s,a,l,c)=>({table:s,column:a,row:l,cell:c,getValue:c.getValue,renderValue:c.renderValue}),Xe(e.options,"debugCells","cell.getContext"))};return e._features.forEach(s=>{s.createCell==null||s.createCell(o,n,t,e)},{}),o}function Pge(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:Ke(()=>[!0],()=>{var p;return[d,...(p=d.columns)==null?void 0:p.flatMap(h=>h.getFlatColumns())]},Xe(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:Ke(()=>[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]},Xe(e.options,"debugColumns","column.getLeafColumns"))};for(const p of e._features)p.createColumn==null||p.createColumn(d,e);return d}const Or="debugHeaders";function fk(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 Tge={createTable:e=>{e.getHeaderGroups=Ke(()=>[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 kb(t,[...a,...c,...l],e)},Xe(e.options,Or,"getHeaderGroups")),e.getCenterHeaderGroups=Ke(()=>[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))),kb(t,n,e,"center")),Xe(e.options,Or,"getCenterHeaderGroups")),e.getLeftHeaderGroups=Ke(()=>[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 kb(t,o,e,"left")},Xe(e.options,Or,"getLeftHeaderGroups")),e.getRightHeaderGroups=Ke(()=>[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 kb(t,o,e,"right")},Xe(e.options,Or,"getRightHeaderGroups")),e.getFooterGroups=Ke(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Xe(e.options,Or,"getFooterGroups")),e.getLeftFooterGroups=Ke(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Xe(e.options,Or,"getLeftFooterGroups")),e.getCenterFooterGroups=Ke(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Xe(e.options,Or,"getCenterFooterGroups")),e.getRightFooterGroups=Ke(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Xe(e.options,Or,"getRightFooterGroups")),e.getFlatHeaders=Ke(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),Xe(e.options,Or,"getFlatHeaders")),e.getLeftFlatHeaders=Ke(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),Xe(e.options,Or,"getLeftFlatHeaders")),e.getCenterFlatHeaders=Ke(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),Xe(e.options,Or,"getCenterFlatHeaders")),e.getRightFlatHeaders=Ke(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),Xe(e.options,Or,"getRightFlatHeaders")),e.getCenterLeafHeaders=Ke(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Xe(e.options,Or,"getCenterLeafHeaders")),e.getLeftLeafHeaders=Ke(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Xe(e.options,Or,"getLeftLeafHeaders")),e.getRightLeafHeaders=Ke(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Xe(e.options,Or,"getRightLeafHeaders")),e.getLeafHeaders=Ke(()=>[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()},Xe(e.options,Or,"getLeafHeaders"))}};function kb(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],w=v.column.depth===m.depth;let _,R=!1;if(w&&v.column.parent?_=v.column.parent:(_=v.column,R=!0),x&&(x==null?void 0:x.column)===_)x.subHeaders.push(v);else{const C=fk(n,_,{id:[r,h,_.id,v==null?void 0:v.id].filter(Boolean).join("_"),isPlaceholder:R,placeholderId:R?`${b.filter(T=>T.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)=>fk(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:R,rowSpan:C}=_;b+=R,x.push(C)})):b=1;const w=Math.min(...x);return v=v+w,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 Oge=(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:()=>Ege(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:Ke(()=>[e.getAllLeafColumns()],l=>l.map(c=>Rge(e,a,c,c.id)),Xe(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:Ke(()=>[a.getAllCells()],l=>l.reduce((c,u)=>(c[u.column.id]=u,c),{}),Xe(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},Mge={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()}}},j8=(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))};j8.autoRemove=e=>Lo(e);const $8=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};$8.autoRemove=e=>Lo(e);const z8=(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())};z8.autoRemove=e=>Lo(e);const B8=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};B8.autoRemove=e=>Lo(e)||!(e!=null&&e.length);const H8=(e,t,n)=>!n.some(r=>{var i;return!((i=e.getValue(t))!=null&&i.includes(r))});H8.autoRemove=e=>Lo(e)||!(e!=null&&e.length);const V8=(e,t,n)=>n.some(r=>{var i;return(i=e.getValue(t))==null?void 0:i.includes(r)});V8.autoRemove=e=>Lo(e)||!(e!=null&&e.length);const W8=(e,t,n)=>e.getValue(t)===n;W8.autoRemove=e=>Lo(e);const U8=(e,t,n)=>e.getValue(t)==n;U8.autoRemove=e=>Lo(e);const v2=(e,t,n)=>{let[r,i]=n;const o=e.getValue(t);return o>=r&&o<=i};v2.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]};v2.autoRemove=e=>Lo(e)||Lo(e[0])&&Lo(e[1]);const qs={includesString:j8,includesStringSensitive:$8,equalsString:z8,arrIncludes:B8,arrIncludesAll:H8,arrIncludesSome:V8,equals:W8,weakEquals:U8,inNumberRange:v2};function Lo(e){return e==null||e===""}const Age={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Yi("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"?qs.includesString:typeof r=="number"?qs.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?qs.equals:Array.isArray(r)?qs.arrIncludes:qs.weakEquals},e.getFilterFn=()=>{var n,r;return jv(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:qs[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=Ka(n,o?o.value:void 0);if(hk(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=Ka(t,i))==null?void 0:o.filter(s=>{const a=n.find(l=>l.id===s.id);if(a){const l=a.getFilterFn();if(hk(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 hk(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const Dge=(e,t,n)=>n.reduce((r,i)=>{const o=i.getValue(e);return r+(typeof o=="number"?o:0)},0),Ige=(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},kge=(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},Nge=(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]},Lge=(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},Fge=(e,t)=>{if(!t.length)return;const n=t.map(o=>o.getValue(e));if(!Cge(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},jge=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),$ge=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,zge=(e,t)=>t.length,N1={sum:Dge,min:Ige,max:kge,extent:Nge,mean:Lge,median:Fge,unique:jge,uniqueCount:$ge,count:zge},Bge={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:Yi("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 N1.sum;if(Object.prototype.toString.call(r)==="[object Date]")return N1.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return jv(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:N1[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 Hge(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 Vge={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Yi("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=Ke(n=>[Jh(t,n)],n=>n.findIndex(r=>r.id===e.id),Xe(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var r;return((r=Jh(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const i=Jh(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=Ke(()=>[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 Hge(o,n,r)},Xe(e.options,"debugTable","_getOrderColumnsFn"))}},L1=()=>({left:[],right:[]}),Wge={getInitialState:e=>({columnPinning:L1(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Yi("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=Ke(()=>[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))},Xe(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=Ke(()=>[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"})),Xe(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=Ke(()=>[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"})),Xe(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?L1():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:L1())},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=Ke(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(i=>i.id===r)).filter(Boolean),Xe(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=Ke(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(i=>i.id===r)).filter(Boolean),Xe(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=Ke(()=>[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))},Xe(e.options,"debugColumns","getCenterLeafColumns"))}},Nb={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},F1=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Uge={getDefaultColumnDef:()=>Nb,getInitialState:e=>({columnSizing:{},columnSizingInfo:F1(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Yi("columnSizing",e),onColumnSizingInfoChange:Yi("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:Nb.minSize,(r=o??e.columnDef.size)!=null?r:Nb.size),(i=e.columnDef.maxSize)!=null?i:Nb.maxSize)},e.getStart=Ke(n=>[n,Jh(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((i,o)=>i+o.getSize(),0),Xe(t.options,"debugColumns","getStart")),e.getAfter=Ke(n=>[n,Jh(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((i,o)=>i+o.getSize(),0),Xe(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(),j1(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=j1(o)?Math.round(o.touches[0].clientX):o.clientX,c={},u=(x,w)=>{typeof w=="number"&&(t.setColumnSizingInfo(_=>{var R,C;const T=t.options.columnResizeDirection==="rtl"?-1:1,M=(w-((R=_==null?void 0:_.startOffset)!=null?R:0))*T,I=Math.max(M/((C=_==null?void 0:_.startSize)!=null?C:0),-.999999);return _.columnSizingStart.forEach(k=>{let[L,j]=k;c[L]=Math.round(Math.max(j+j*I,0)*100)/100}),{..._,deltaOffset:M,deltaPercentage:I}}),(t.options.columnResizeMode==="onChange"||x==="end")&&t.setColumnSizing(_=>({..._,...c})))},d=x=>u("move",x),p=x=>{u("end",x),t.setColumnSizingInfo(w=>({...w,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 w;h==null||h.removeEventListener("touchmove",b.moveHandler),h==null||h.removeEventListener("touchend",b.upHandler),x.cancelable&&(x.preventDefault(),x.stopPropagation()),p((w=x.touches[0])==null?void 0:w.clientX)}},v=Gge()?{passive:!1}:!1;j1(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?F1():(n=e.initialState.columnSizingInfo)!=null?n:F1())},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 Lb=null;function Gge(){if(typeof Lb=="boolean")return Lb;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 Lb=e,Lb}function j1(e){return e.type==="touchstart"}const qge={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Yi("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=Ke(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),Xe(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=Ke(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,i)=>[...n,...r,...i],Xe(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(n,r)=>Ke(()=>[r(),r().filter(i=>i.getIsVisible()).map(i=>i.id).join("_")],i=>i.filter(o=>o.getIsVisible==null?void 0:o.getIsVisible()),Xe(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 Jh(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const Yge={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()}}},Kge={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Yi("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=()=>qs.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return jv(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:qs[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},Xge={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Yi("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()}}}},vC=0,xC=10,$1=()=>({pageIndex:vC,pageSize:xC}),Qge={getInitialState:e=>({...e,pagination:{...$1(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Yi("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=>Ka(r,o);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(i)},e.resetPagination=r=>{var i;e.setPagination(r?$1():(i=e.initialState.pagination)!=null?i:$1())},e.setPageIndex=r=>{e.setPagination(i=>{let o=Ka(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?vC:(i=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageIndex)!=null?i:vC)},e.resetPageSize=r=>{var i,o;e.setPageSize(r?xC:(i=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageSize)!=null?i:xC)},e.setPageSize=r=>{e.setPagination(i=>{const o=Math.max(1,Ka(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=Ka(r,(o=e.options.pageCount)!=null?o:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...i,pageCount:s}}),e.getPageOptions=Ke(()=>[e.getPageCount()],r=>{let i=[];return r&&r>0&&(i=[...new Array(r)].fill(null).map((o,s)=>s)),i},Xe(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}}},z1=()=>({top:[],bottom:[]}),Jge={getInitialState:e=>({rowPinning:z1(),...e}),getDefaultOptions:e=>({onRowPinningChange:Yi("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?z1():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:z1())},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=Ke(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),Xe(e.options,"debugRows","getTopRows")),e.getBottomRows=Ke(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),Xe(e.options,"debugRows","getBottomRows")),e.getCenterRows=Ke(()=>[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))},Xe(e.options,"debugRows","getCenterRows"))}},Zge={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Yi("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=>{wC(i,o.id,r,!0,e)}),i}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Ke(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?B1(e,n):{rows:[],flatRows:[],rowsById:{}},Xe(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=Ke(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?B1(e,n):{rows:[],flatRows:[],rowsById:{}},Xe(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=Ke(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?B1(e,n):{rows:[],flatRows:[],rowsById:{}},Xe(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 wC(a,e.id,n,(s=r==null?void 0:r.selectChildren)!=null?s:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return x2(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return SC(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return SC(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)}}}},wC=(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=>wC(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=x2(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 x2(e,t){var n;return(n=t[e.id])!=null?n:!1}function SC(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()&&(x2(s,t)?o=!0:i=!1),s.subRows&&s.subRows.length)){const a=SC(s,t);a==="all"?o=!0:(a==="some"&&(o=!0),i=!1)}}),i?"all":o?"some":!1}const _C=/([0-9]+)/gm,eme=(e,t,n)=>G8(hl(e.getValue(n)).toLowerCase(),hl(t.getValue(n)).toLowerCase()),tme=(e,t,n)=>G8(hl(e.getValue(n)),hl(t.getValue(n))),nme=(e,t,n)=>w2(hl(e.getValue(n)).toLowerCase(),hl(t.getValue(n)).toLowerCase()),rme=(e,t,n)=>w2(hl(e.getValue(n)),hl(t.getValue(n))),ime=(e,t,n)=>{const r=e.getValue(n),i=t.getValue(n);return r>i?1:r<i?-1:0},ome=(e,t,n)=>w2(e.getValue(n),t.getValue(n));function w2(e,t){return e===t?0:e>t?1:-1}function hl(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function G8(e,t){const n=e.split(_C).filter(Boolean),r=t.split(_C).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 sh={alphanumeric:eme,alphanumericCaseSensitive:tme,text:nme,textCaseSensitive:rme,datetime:ime,basic:ome},sme={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Yi("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 sh.datetime;if(typeof o=="string"&&(r=!0,o.split(_C).length>1))return sh.alphanumeric}return r?sh.text:sh.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 jv(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:sh[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())}},ame=[Tge,qge,Vge,Wge,Mge,Age,Yge,Kge,sme,Bge,Xge,Qge,Jge,Zge,Uge];function lme(e){var t,n;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const r=[...ame,...(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=Ka(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:Ke(()=>[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}},Xe(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>i.options.columns,getAllColumns:Ke(()=>[i._getColumnDefs()],p=>{const h=function(m,b,v){return v===void 0&&(v=0),m.map(x=>{const w=Pge(i,x,v,b),_=x;return w.columns=_.columns?h(_.columns,w,v+1):[],w})};return h(p)},Xe(e,"debugColumns","getAllColumns")),getAllFlatColumns:Ke(()=>[i.getAllColumns()],p=>p.flatMap(h=>h.getFlatColumns()),Xe(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:Ke(()=>[i.getAllFlatColumns()],p=>p.reduce((h,m)=>(h[m.id]=m,h),{}),Xe(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:Ke(()=>[i.getAllColumns(),i._getOrderColumnsFn()],(p,h)=>{let m=p.flatMap(b=>b.getLeafColumns());return h(m)},Xe(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 q8(){return e=>Ke(()=>[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=Oge(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},Xe(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function cme(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 Y8(e){return t=>Ke(()=>[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=cme({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},Xe(t.options,"debugTable","getPaginationRowModel"))}function K8(){return e=>Ke(()=>[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 w=0;if(v){const _=u.getValue(m.id),R=d.getValue(m.id),C=_===void 0,T=R===void 0;if(C||T){if(v==="first")return C?-1:1;if(v==="last")return C?1:-1;w=C&&T?0:C?v:-v}}if(w===0&&(w=b.sortingFn(u,d,m.id)),w!==0)return x&&(w*=-1),b.invertSorting&&(w*=-1),w}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}},Xe(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
|
|
294
|
+
* react-table
|
|
295
|
+
*
|
|
296
|
+
* Copyright (c) TanStack
|
|
297
|
+
*
|
|
298
|
+
* This source code is licensed under the MIT license found in the
|
|
299
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
300
|
+
*
|
|
301
|
+
* @license MIT
|
|
302
|
+
*/function CC(e,t){return e?ume(e)?E.createElement(e,t):e:null}function ume(e){return dme(e)||typeof e=="function"||fme(e)}function dme(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function fme(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function X8(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=E.useState(()=>({current:lme(t)})),[r,i]=E.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 EC(e,[t,n]){return Math.min(n,Math.max(t,e))}var H1=0;function $v(){E.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??pk()),document.body.insertAdjacentElement("beforeend",e[1]??pk()),H1++,()=>{H1===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),H1--}},[])}function pk(){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",W1="focusScope.autoFocusOnUnmount",gk={bubbles:!1,cancelable:!0},hme="FocusScope",jg=E.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[a,l]=E.useState(null),c=ir(i),u=ir(o),d=E.useRef(null),p=rt(t,b=>l(b)),h=E.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;E.useEffect(()=>{if(r){let b=function(_){if(h.paused||!a)return;const R=_.target;a.contains(R)?d.current=R:ka(d.current,{select:!0})},v=function(_){if(h.paused||!a)return;const R=_.relatedTarget;R!==null&&(a.contains(R)||ka(d.current,{select:!0}))},x=function(_){if(document.activeElement===document.body)for(const C of _)C.removedNodes.length>0&&ka(a)};document.addEventListener("focusin",b),document.addEventListener("focusout",v);const w=new MutationObserver(x);return a&&w.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",v),w.disconnect()}}},[r,a,h.paused]),E.useEffect(()=>{if(a){bk.add(h);const b=document.activeElement;if(!a.contains(b)){const x=new CustomEvent(V1,gk);a.addEventListener(V1,c),a.dispatchEvent(x),x.defaultPrevented||(pme(vme(Q8(a)),{select:!0}),document.activeElement===b&&ka(a))}return()=>{a.removeEventListener(V1,c),setTimeout(()=>{const x=new CustomEvent(W1,gk);a.addEventListener(W1,u),a.dispatchEvent(x),x.defaultPrevented||ka(b??document.body,{select:!0}),a.removeEventListener(W1,u),bk.remove(h)},0)}}},[a,c,u,h]);const m=E.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 w=b.currentTarget,[_,R]=gme(w);_&&R?!b.shiftKey&&x===R?(b.preventDefault(),n&&ka(_,{select:!0})):b.shiftKey&&x===_&&(b.preventDefault(),n&&ka(R,{select:!0})):x===w&&b.preventDefault()}},[n,r,h.paused]);return y.jsx(Fe.div,{tabIndex:-1,...s,ref:p,onKeyDown:m})});jg.displayName=hme;function pme(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ka(r,{select:t}),document.activeElement!==n)return}function gme(e){const t=Q8(e),n=mk(t,e),r=mk(t.reverse(),e);return[n,r]}function Q8(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 mk(e,t){for(const n of e)if(!mme(n,{upTo:t}))return n}function mme(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 bme(e){return e instanceof HTMLInputElement&&"select"in e}function ka(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&bme(e)&&t&&e.select()}}var bk=yme();function yme(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=yk(e,t),e.unshift(t)},remove(t){var n;e=yk(e,t),(n=e[0])==null||n.resume()}}}function yk(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function vme(e){return e.filter(t=>t.tagName!=="A")}function zv(e){const t=E.useRef({value:e,previous:e});return E.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var xme=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ru=new WeakMap,Fb=new WeakMap,jb={},U1=0,J8=function(e){return e&&(e.host||J8(e.parentNode))},wme=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=J8(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})},Sme=function(e,t,n,r){var i=wme(t,Array.isArray(e)?e:[e]);jb[n]||(jb[n]=new WeakMap);var o=jb[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=(Ru.get(p)||0)+1,v=(o.get(p)||0)+1;Ru.set(p,b),o.set(p,v),s.push(p),b===1&&m&&Fb.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(),U1++,function(){s.forEach(function(d){var p=Ru.get(d)-1,h=o.get(d)-1;Ru.set(d,p),o.set(d,h),p||(Fb.has(d)||d.removeAttribute(r),Fb.delete(d)),h||d.removeAttribute(n)}),U1--,U1||(Ru=new WeakMap,Ru=new WeakMap,Fb=new WeakMap,jb={})}},Bv=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=xme(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),Sme(r,i,n,"aria-hidden")):function(){return null}},ss=function(){return ss=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},ss.apply(this,arguments)};function Z8(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 _me(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 vy="right-scroll-bar-position",xy="width-before-scroll-bar",Cme="with-scroll-bars-hidden",Eme="--removed-body-scroll-bar-size";function G1(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Rme(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 Pme=typeof window<"u"?E.useLayoutEffect:E.useEffect,vk=new WeakMap;function Tme(e,t){var n=Rme(null,function(r){return e.forEach(function(i){return G1(i,r)})});return Pme(function(){var r=vk.get(n);if(r){var i=new Set(r),o=new Set(e),s=n.current;i.forEach(function(a){o.has(a)||G1(a,null)}),o.forEach(function(a){i.has(a)||G1(a,s)})}vk.set(n,e)},[e]),n}function Ome(e){return e}function Mme(e,t){t===void 0&&(t=Ome);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 Ame(e){e===void 0&&(e={});var t=Mme(null);return t.options=ss({async:!0,ssr:!1},e),t}var e7=function(e){var t=e.sideCar,n=Z8(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 E.createElement(r,ss({},n))};e7.isSideCarExport=!0;function Dme(e,t){return e.useMedium(t),e7}var t7=Ame(),q1=function(){},Hv=E.forwardRef(function(e,t){var n=E.useRef(null),r=E.useState({onScrollCapture:q1,onWheelCapture:q1,onTouchMoveCapture:q1}),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,w=e.gapMode,_=Z8(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=p,C=Tme([n,t]),T=ss(ss({},_),i);return E.createElement(E.Fragment,null,u&&E.createElement(R,{sideCar:t7,removeScrollBar:c,shards:d,noIsolation:h,inert:m,setCallbacks:o,allowPinchZoom:!!b,lockRef:n,gapMode:w}),s?E.cloneElement(E.Children.only(a),ss(ss({},T),{ref:C})):E.createElement(x,ss({},T,{className:l,ref:C}),a))});Hv.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Hv.classNames={fullWidth:xy,zeroRight:vy};var Ime=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function kme(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Ime();return t&&e.setAttribute("nonce",t),e}function Nme(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Lme(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Fme=function(){var e=0,t=null;return{add:function(n){e==0&&(t=kme())&&(Nme(t,n),Lme(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},jme=function(){var e=Fme();return function(t,n){E.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},n7=function(){var e=jme(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},$me={left:0,top:0,right:0,gap:0},Y1=function(e){return parseInt(e||"",10)||0},zme=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[Y1(n),Y1(r),Y1(i)]},Bme=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return $me;var t=zme(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])}},Hme=n7(),ed="data-scroll-locked",Vme=function(e,t,n,r){var i=e.left,o=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
303
|
+
.`.concat(Cme,` {
|
|
304
|
+
overflow: hidden `).concat(r,`;
|
|
305
|
+
padding-right: `).concat(a,"px ").concat(r,`;
|
|
306
|
+
}
|
|
307
|
+
body[`).concat(ed,`] {
|
|
308
|
+
overflow: hidden `).concat(r,`;
|
|
309
|
+
overscroll-behavior: contain;
|
|
310
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
311
|
+
padding-left: `.concat(i,`px;
|
|
312
|
+
padding-top: `).concat(o,`px;
|
|
313
|
+
padding-right: `).concat(s,`px;
|
|
314
|
+
margin-left:0;
|
|
315
|
+
margin-top:0;
|
|
316
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
|
317
|
+
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.`).concat(vy,` {
|
|
321
|
+
right: `).concat(a,"px ").concat(r,`;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.`).concat(xy,` {
|
|
325
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.`).concat(vy," .").concat(vy,` {
|
|
329
|
+
right: 0 `).concat(r,`;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.`).concat(xy," .").concat(xy,` {
|
|
333
|
+
margin-right: 0 `).concat(r,`;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
body[`).concat(ed,`] {
|
|
337
|
+
`).concat(Eme,": ").concat(a,`px;
|
|
338
|
+
}
|
|
339
|
+
`)},xk=function(){var e=parseInt(document.body.getAttribute(ed)||"0",10);return isFinite(e)?e:0},Wme=function(){E.useEffect(function(){return document.body.setAttribute(ed,(xk()+1).toString()),function(){var e=xk()-1;e<=0?document.body.removeAttribute(ed):document.body.setAttribute(ed,e.toString())}},[])},Ume=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;Wme();var o=E.useMemo(function(){return Bme(i)},[i]);return E.createElement(Hme,{styles:Vme(o,!t,i,n?"":"!important")})},RC=!1;if(typeof window<"u")try{var $b=Object.defineProperty({},"passive",{get:function(){return RC=!0,!0}});window.addEventListener("test",$b,$b),window.removeEventListener("test",$b,$b)}catch{RC=!1}var Pu=RC?{passive:!1}:!1,Gme=function(e){return e.tagName==="TEXTAREA"},r7=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Gme(e)&&n[t]==="visible")},qme=function(e){return r7(e,"overflowY")},Yme=function(e){return r7(e,"overflowX")},wk=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=i7(e,r);if(i){var o=o7(e,r),s=o[1],a=o[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Kme=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Xme=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},i7=function(e,t){return e==="v"?qme(t):Yme(t)},o7=function(e,t){return e==="v"?Kme(t):Xme(t)},Qme=function(e,t){return e==="h"&&t==="rtl"?-1:1},Jme=function(e,t,n,r,i){var o=Qme(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=o7(e,a),m=h[0],b=h[1],v=h[2],x=b-v-o*m;(m||x)&&i7(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},zb=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Sk=function(e){return[e.deltaX,e.deltaY]},_k=function(e){return e&&"current"in e?e.current:e},Zme=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ebe=function(e){return`
|
|
340
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
341
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
342
|
+
`)},tbe=0,Tu=[];function nbe(e){var t=E.useRef([]),n=E.useRef([0,0]),r=E.useRef(),i=E.useState(tbe++)[0],o=E.useState(n7)[0],s=E.useRef(e);E.useEffect(function(){s.current=e},[e]),E.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var b=_me([e.lockRef.current],(e.shards||[]).map(_k),!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=E.useCallback(function(b,v){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!s.current.allowPinchZoom;var x=zb(b),w=n.current,_="deltaX"in b?b.deltaX:w[0]-x[0],R="deltaY"in b?b.deltaY:w[1]-x[1],C,T=b.target,M=Math.abs(_)>Math.abs(R)?"h":"v";if("touches"in b&&M==="h"&&T.type==="range")return!1;var I=wk(M,T);if(!I)return!0;if(I?C=M:(C=M==="v"?"h":"v",I=wk(M,T)),!I)return!1;if(!r.current&&"changedTouches"in b&&(_||R)&&(r.current=C),!C)return!0;var k=r.current||C;return Jme(k,v,b,k==="h"?_:R)},[]),l=E.useCallback(function(b){var v=b;if(!(!Tu.length||Tu[Tu.length-1]!==o)){var x="deltaY"in v?Sk(v):zb(v),w=t.current.filter(function(C){return C.name===v.type&&(C.target===v.target||v.target===C.shadowParent)&&Zme(C.delta,x)})[0];if(w&&w.should){v.cancelable&&v.preventDefault();return}if(!w){var _=(s.current.shards||[]).map(_k).filter(Boolean).filter(function(C){return C.contains(v.target)}),R=_.length>0?a(v,_[0]):!s.current.noIsolation;R&&v.cancelable&&v.preventDefault()}}},[]),c=E.useCallback(function(b,v,x,w){var _={name:b,delta:v,target:x,should:w,shadowParent:rbe(x)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(R){return R!==_})},1)},[]),u=E.useCallback(function(b){n.current=zb(b),r.current=void 0},[]),d=E.useCallback(function(b){c(b.type,Sk(b),b.target,a(b,e.lockRef.current))},[]),p=E.useCallback(function(b){c(b.type,zb(b),b.target,a(b,e.lockRef.current))},[]);E.useEffect(function(){return Tu.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",l,Pu),document.addEventListener("touchmove",l,Pu),document.addEventListener("touchstart",u,Pu),function(){Tu=Tu.filter(function(b){return b!==o}),document.removeEventListener("wheel",l,Pu),document.removeEventListener("touchmove",l,Pu),document.removeEventListener("touchstart",u,Pu)}},[]);var h=e.removeScrollBar,m=e.inert;return E.createElement(E.Fragment,null,m?E.createElement(o,{styles:ebe(i)}):null,h?E.createElement(Ume,{gapMode:e.gapMode}):null)}function rbe(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const ibe=Dme(t7,nbe);var $g=E.forwardRef(function(e,t){return E.createElement(Hv,ss({},e,{ref:t,sideCar:ibe}))});$g.classNames=Hv.classNames;var obe=[" ","Enter","ArrowUp","ArrowDown"],sbe=[" ","Enter"],zg="Select",[Vv,Wv,abe]=Z0(zg),[wf,gIe]=or(zg,[abe,Ts]),Uv=Ts(),[lbe,yl]=wf(zg),[cbe,ube]=wf(zg),s7=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=Uv(t),[v,x]=E.useState(null),[w,_]=E.useState(null),[R,C]=E.useState(!1),T=Xc(c),[M=!1,I]=$r({prop:r,defaultProp:i,onChange:o}),[k,L]=$r({prop:s,defaultProp:a,onChange:l}),j=E.useRef(null),$=v?m||!!v.closest("form"):!0,[X,H]=E.useState(new Set),F=Array.from(X).map(G=>G.props.value).join(";");return y.jsx(Dg,{...b,children:y.jsxs(lbe,{required:h,scope:t,trigger:v,onTriggerChange:x,valueNode:w,onValueNodeChange:_,valueNodeHasChildren:R,onValueNodeHasChildrenChange:C,contentId:Qn(),value:k,onValueChange:L,open:M,onOpenChange:I,dir:T,triggerPointerDownPosRef:j,disabled:p,children:[y.jsx(Vv.Provider,{scope:t,children:y.jsx(cbe,{scope:e.__scopeSelect,onNativeOptionAdd:E.useCallback(G=>{H(B=>new Set(B).add(G))},[]),onNativeOptionRemove:E.useCallback(G=>{H(B=>{const W=new Set(B);return W.delete(G),W})},[]),children:n})}),$?y.jsxs(D7,{"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:d,value:k,onChange:G=>L(G.target.value),disabled:p,form:m,children:[k===void 0?y.jsx("option",{value:""}):null,Array.from(X)]},F):null]})})};s7.displayName=zg;var a7="SelectTrigger",l7=E.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=Uv(n),s=yl(a7,n),a=s.disabled||r,l=rt(t,s.onTriggerChange),c=Wv(n),u=E.useRef("touch"),[d,p,h]=I7(b=>{const v=c().filter(_=>!_.disabled),x=v.find(_=>_.value===s.value),w=k7(v,b,x);w!==void 0&&s.onValueChange(w.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(xf,{asChild:!0,...o,children:y.jsx(Fe.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":A7(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===" ")&&obe.includes(b.key)&&(m(),b.preventDefault())})})})});l7.displayName=a7;var c7="SelectValue",u7=E.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:s="",...a}=e,l=yl(c7,n),{onValueNodeHasChildrenChange:c}=l,u=o!==void 0,d=rt(t,l.onValueNodeChange);return Sr(()=>{c(u)},[c,u]),y.jsx(Fe.span,{...a,ref:d,style:{pointerEvents:"none"},children:A7(l.value)?y.jsx(y.Fragment,{children:s}):o})});u7.displayName=c7;var dbe="SelectIcon",d7=E.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return y.jsx(Fe.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});d7.displayName=dbe;var fbe="SelectPortal",f7=e=>y.jsx(Ng,{asChild:!0,...e});f7.displayName=fbe;var zc="SelectContent",h7=E.forwardRef((e,t)=>{const n=yl(zc,e.__scopeSelect),[r,i]=E.useState();if(Sr(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?Mc.createPortal(y.jsx(p7,{scope:e.__scopeSelect,children:y.jsx(Vv.Slot,{scope:e.__scopeSelect,children:y.jsx("div",{children:e.children})})}),o):null}return y.jsx(g7,{...e,ref:t})});h7.displayName=zc;var Oo=10,[p7,vl]=wf(zc),hbe="SelectContentImpl",g7=E.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,w=yl(zc,n),[_,R]=E.useState(null),[C,T]=E.useState(null),M=rt(t,J=>R(J)),[I,k]=E.useState(null),[L,j]=E.useState(null),$=Wv(n),[X,H]=E.useState(!1),F=E.useRef(!1);E.useEffect(()=>{if(_)return Bv(_)},[_]),$v();const G=E.useCallback(J=>{const[ee,...ae]=$().map(oe=>oe.ref.current),[ce]=ae.slice(-1),ge=document.activeElement;for(const oe of J)if(oe===ge||(oe==null||oe.scrollIntoView({block:"nearest"}),oe===ee&&C&&(C.scrollTop=0),oe===ce&&C&&(C.scrollTop=C.scrollHeight),oe==null||oe.focus(),document.activeElement!==ge))return},[$,C]),B=E.useCallback(()=>G([I,_]),[G,I,_]);E.useEffect(()=>{X&&B()},[X,B]);const{onOpenChange:W,triggerPointerDownPosRef:K}=w;E.useEffect(()=>{if(_){let J={x:0,y:0};const ee=ce=>{var ge,oe;J={x:Math.abs(Math.round(ce.pageX)-(((ge=K.current)==null?void 0:ge.x)??0)),y:Math.abs(Math.round(ce.pageY)-(((oe=K.current)==null?void 0:oe.y)??0))}},ae=ce=>{J.x<=10&&J.y<=10?ce.preventDefault():_.contains(ce.target)||W(!1),document.removeEventListener("pointermove",ee),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",ee),document.addEventListener("pointerup",ae,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ee),document.removeEventListener("pointerup",ae,{capture:!0})}}},[_,W,K]),E.useEffect(()=>{const J=()=>W(!1);return window.addEventListener("blur",J),window.addEventListener("resize",J),()=>{window.removeEventListener("blur",J),window.removeEventListener("resize",J)}},[W]);const[D,Y]=I7(J=>{const ee=$().filter(ge=>!ge.disabled),ae=ee.find(ge=>ge.ref.current===document.activeElement),ce=k7(ee,J,ae);ce&&setTimeout(()=>ce.ref.current.focus())}),U=E.useCallback((J,ee,ae)=>{const ce=!F.current&&!ae;(w.value!==void 0&&w.value===ee||ce)&&(k(J),ce&&(F.current=!0))},[w.value]),A=E.useCallback(()=>_==null?void 0:_.focus(),[_]),te=E.useCallback((J,ee,ae)=>{const ce=!F.current&&!ae;(w.value!==void 0&&w.value===ee||ce)&&j(J)},[w.value]),q=r==="popper"?PC:m7,se=q===PC?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:p,collisionPadding:h,sticky:m,hideWhenDetached:b,avoidCollisions:v}:{};return y.jsx(p7,{scope:n,content:_,viewport:C,onViewportChange:T,itemRefCallback:U,selectedItem:I,onItemLeave:A,itemTextRefCallback:te,focusSelectedItem:B,selectedItemText:L,position:r,isPositioned:X,searchRef:D,children:y.jsx($g,{as:ca,allowPinchZoom:!0,children:y.jsx(jg,{asChild:!0,trapped:w.open,onMountAutoFocus:J=>{J.preventDefault()},onUnmountAutoFocus:Re(i,J=>{var ee;(ee=w.trigger)==null||ee.focus({preventScroll:!0}),J.preventDefault()}),children:y.jsx(eu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:J=>J.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:y.jsx(q,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:J=>J.preventDefault(),...x,...se,onPlaced:()=>H(!0),ref:M,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:Re(x.onKeyDown,J=>{const ee=J.ctrlKey||J.altKey||J.metaKey;if(J.key==="Tab"&&J.preventDefault(),!ee&&J.key.length===1&&Y(J.key),["ArrowUp","ArrowDown","Home","End"].includes(J.key)){let ce=$().filter(ge=>!ge.disabled).map(ge=>ge.ref.current);if(["ArrowUp","End"].includes(J.key)&&(ce=ce.slice().reverse()),["ArrowUp","ArrowDown"].includes(J.key)){const ge=J.target,oe=ce.indexOf(ge);ce=ce.slice(oe+1)}setTimeout(()=>G(ce)),J.preventDefault()}})})})})})})});g7.displayName=hbe;var pbe="SelectItemAlignedPosition",m7=E.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=yl(zc,n),s=vl(zc,n),[a,l]=E.useState(null),[c,u]=E.useState(null),d=rt(t,M=>u(M)),p=Wv(n),h=E.useRef(!1),m=E.useRef(!0),{viewport:b,selectedItem:v,selectedItemText:x,focusSelectedItem:w}=s,_=E.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&c&&b&&v&&x){const M=o.trigger.getBoundingClientRect(),I=c.getBoundingClientRect(),k=o.valueNode.getBoundingClientRect(),L=x.getBoundingClientRect();if(o.dir!=="rtl"){const ge=L.left-I.left,oe=k.left-ge,pe=M.left-oe,de=M.width+pe,Ee=Math.max(de,I.width),De=window.innerWidth-Oo,ze=EC(oe,[Oo,Math.max(Oo,De-Ee)]);a.style.minWidth=de+"px",a.style.left=ze+"px"}else{const ge=I.right-L.right,oe=window.innerWidth-k.right-ge,pe=window.innerWidth-M.right-oe,de=M.width+pe,Ee=Math.max(de,I.width),De=window.innerWidth-Oo,ze=EC(oe,[Oo,Math.max(Oo,De-Ee)]);a.style.minWidth=de+"px",a.style.right=ze+"px"}const j=p(),$=window.innerHeight-Oo*2,X=b.scrollHeight,H=window.getComputedStyle(c),F=parseInt(H.borderTopWidth,10),G=parseInt(H.paddingTop,10),B=parseInt(H.borderBottomWidth,10),W=parseInt(H.paddingBottom,10),K=F+G+X+W+B,D=Math.min(v.offsetHeight*5,K),Y=window.getComputedStyle(b),U=parseInt(Y.paddingTop,10),A=parseInt(Y.paddingBottom,10),te=M.top+M.height/2-Oo,q=$-te,se=v.offsetHeight/2,J=v.offsetTop+se,ee=F+G+J,ae=K-ee;if(ee<=te){const ge=j.length>0&&v===j[j.length-1].ref.current;a.style.bottom="0px";const oe=c.clientHeight-b.offsetTop-b.offsetHeight,pe=Math.max(q,se+(ge?A:0)+oe+B),de=ee+pe;a.style.height=de+"px"}else{const ge=j.length>0&&v===j[0].ref.current;a.style.top="0px";const pe=Math.max(te,F+b.offsetTop+(ge?U:0)+se)+ae;a.style.height=pe+"px",b.scrollTop=ee-te+b.offsetTop}a.style.margin=`${Oo}px 0`,a.style.minHeight=D+"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]);Sr(()=>_(),[_]);const[R,C]=E.useState();Sr(()=>{c&&C(window.getComputedStyle(c).zIndex)},[c]);const T=E.useCallback(M=>{M&&m.current===!0&&(_(),w==null||w(),m.current=!1)},[_,w]);return y.jsx(mbe,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:T,children:y.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:R},children:y.jsx(Fe.div,{...i,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});m7.displayName=pbe;var gbe="SelectPopperPosition",PC=E.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Oo,...o}=e,s=Uv(n);return y.jsx(Ig,{...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)"}})});PC.displayName=gbe;var[mbe,S2]=wf(zc,{}),TC="SelectViewport",b7=E.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=vl(TC,n),s=S2(TC,n),a=rt(t,o.onViewportChange),l=E.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(Vv.Slot,{scope:n,children:y.jsx(Fe.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-Oo*2,b=parseFloat(d.style.minHeight),v=parseFloat(d.style.height),x=Math.max(b,v);if(x<m){const w=x+h,_=Math.min(m,w),R=w-_;d.style.height=_+"px",d.style.bottom==="0px"&&(u.scrollTop=R>0?R:0,d.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});b7.displayName=TC;var y7="SelectGroup",[bbe,ybe]=wf(y7),v7=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Qn();return y.jsx(bbe,{scope:n,id:i,children:y.jsx(Fe.div,{role:"group","aria-labelledby":i,...r,ref:t})})});v7.displayName=y7;var x7="SelectLabel",w7=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=ybe(x7,n);return y.jsx(Fe.div,{id:i.id,...r,ref:t})});w7.displayName=x7;var w0="SelectItem",[vbe,S7]=wf(w0),_7=E.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...s}=e,a=yl(w0,n),l=vl(w0,n),c=a.value===r,[u,d]=E.useState(o??""),[p,h]=E.useState(!1),m=rt(t,w=>{var _;return(_=l.itemRefCallback)==null?void 0:_.call(l,w,r,i)}),b=Qn(),v=E.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(vbe,{scope:n,value:r,disabled:i,textId:b,isSelected:c,onItemTextChange:E.useCallback(w=>{d(_=>_||((w==null?void 0:w.textContent)??"").trim())},[]),children:y.jsx(Vv.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:y.jsx(Fe.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,w=>{v.current=w.pointerType}),onPointerMove:Re(s.onPointerMove,w=>{var _;v.current=w.pointerType,i?(_=l.onItemLeave)==null||_.call(l):v.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Re(s.onPointerLeave,w=>{var _;w.currentTarget===document.activeElement&&((_=l.onItemLeave)==null||_.call(l))}),onKeyDown:Re(s.onKeyDown,w=>{var R;((R=l.searchRef)==null?void 0:R.current)!==""&&w.key===" "||(sbe.includes(w.key)&&x(),w.key===" "&&w.preventDefault())})})})})});_7.displayName=w0;var Ih="SelectItemText",C7=E.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,s=yl(Ih,n),a=vl(Ih,n),l=S7(Ih,n),c=ube(Ih,n),[u,d]=E.useState(null),p=rt(t,x=>d(x),l.onItemTextChange,x=>{var w;return(w=a.itemTextRefCallback)==null?void 0:w.call(a,x,l.value,l.disabled)}),h=u==null?void 0:u.textContent,m=E.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 Sr(()=>(b(m),()=>v(m)),[b,v,m]),y.jsxs(y.Fragment,{children:[y.jsx(Fe.span,{id:l.textId,...o,ref:p}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Mc.createPortal(o.children,s.valueNode):null]})});C7.displayName=Ih;var E7="SelectItemIndicator",R7=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return S7(E7,n).isSelected?y.jsx(Fe.span,{"aria-hidden":!0,...r,ref:t}):null});R7.displayName=E7;var OC="SelectScrollUpButton",P7=E.forwardRef((e,t)=>{const n=vl(OC,e.__scopeSelect),r=S2(OC,e.__scopeSelect),[i,o]=E.useState(!1),s=rt(t,r.onScrollButtonChange);return Sr(()=>{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(O7,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});P7.displayName=OC;var MC="SelectScrollDownButton",T7=E.forwardRef((e,t)=>{const n=vl(MC,e.__scopeSelect),r=S2(MC,e.__scopeSelect),[i,o]=E.useState(!1),s=rt(t,r.onScrollButtonChange);return Sr(()=>{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(O7,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});T7.displayName=MC;var O7=E.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=vl("SelectScrollButton",n),s=E.useRef(null),a=Wv(n),l=E.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return E.useEffect(()=>()=>l(),[l]),Sr(()=>{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(Fe.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()})})}),xbe="SelectSeparator",M7=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return y.jsx(Fe.div,{"aria-hidden":!0,...r,ref:t})});M7.displayName=xbe;var AC="SelectArrow",wbe=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Uv(n),o=yl(AC,n),s=vl(AC,n);return o.open&&s.position==="popper"?y.jsx(kg,{...i,...r,ref:t}):null});wbe.displayName=AC;function A7(e){return e===""||e===void 0}var D7=E.forwardRef((e,t)=>{const{value:n,...r}=e,i=E.useRef(null),o=rt(t,i),s=zv(n);return E.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(u2,{asChild:!0,children:y.jsx("select",{...r,ref:o,defaultValue:n})})});D7.displayName="BubbleSelect";function I7(e){const t=ir(e),n=E.useRef(""),r=E.useRef(0),i=E.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=E.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return E.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function k7(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=Sbe(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 Sbe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var _be=s7,N7=l7,Cbe=u7,Ebe=d7,Rbe=f7,L7=h7,Pbe=b7,Tbe=v7,F7=w7,j7=_7,Obe=C7,Mbe=R7,$7=P7,z7=T7,B7=M7;const Ys=_be,ku=Tbe,Ks=Cbe,Jo=E.forwardRef(({className:e,children:t,...n},r)=>y.jsxs(N7,{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(Ebe,{asChild:!0,children:y.jsx(mv,{className:"h-4 w-4 opacity-50"})})]}));Jo.displayName=N7.displayName;const H7=E.forwardRef(({className:e,...t},n)=>y.jsx($7,{ref:n,className:be("flex cursor-default items-center justify-center py-1",e),...t,children:y.jsx(w3,{className:"h-4 w-4"})}));H7.displayName=$7.displayName;const V7=E.forwardRef(({className:e,...t},n)=>y.jsx(z7,{ref:n,className:be("flex cursor-default items-center justify-center py-1",e),...t,children:y.jsx(mv,{className:"h-4 w-4"})}));V7.displayName=z7.displayName;const Zo=E.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>y.jsx(Rbe,{children:y.jsx(Kc,{children:y.jsxs(L7,{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(H7,{}),y.jsx(Pbe,{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(V7,{})]})})}));Zo.displayName=L7.displayName;const Yl=E.forwardRef(({className:e,...t},n)=>y.jsx(F7,{ref:n,className:be("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Yl.displayName=F7.displayName;const Un=E.forwardRef(({className:e,children:t,...n},r)=>y.jsxs(j7,{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(Mbe,{children:y.jsx(Rg,{className:"h-4 w-4"})})}),y.jsx(Obe,{children:t})]}));Un.displayName=j7.displayName;const Zh=E.forwardRef(({className:e,...t},n)=>y.jsx(B7,{ref:n,className:be("-mx-1 my-1 h-px bg-muted",e),...t}));Zh.displayName=B7.displayName;const Ec=E.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}));Ec.displayName="Input";var Abe="Label",W7=E.forwardRef((e,t)=>y.jsx(Fe.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())}}));W7.displayName=Abe;var U7=W7;const Dbe=p2("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),En=E.forwardRef(({className:e,...t},n)=>y.jsx(U7,{ref:n,className:be(Dbe(),e),...t}));En.displayName=U7.displayName;var _2="Popover",[G7,mIe]=or(_2,[Ts]),Bg=Ts(),[Ibe,xl]=G7(_2),q7=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!1}=e,a=Bg(t),l=E.useRef(null),[c,u]=E.useState(!1),[d=!1,p]=$r({prop:r,defaultProp:i,onChange:o});return y.jsx(Dg,{...a,children:y.jsx(Ibe,{scope:t,contentId:Qn(),triggerRef:l,open:d,onOpenChange:p,onOpenToggle:E.useCallback(()=>p(h=>!h),[p]),hasCustomAnchor:c,onCustomAnchorAdd:E.useCallback(()=>u(!0),[]),onCustomAnchorRemove:E.useCallback(()=>u(!1),[]),modal:s,children:n})})};q7.displayName=_2;var Y7="PopoverAnchor",kbe=E.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=xl(Y7,n),o=Bg(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:a}=i;return E.useEffect(()=>(s(),()=>a()),[s,a]),y.jsx(xf,{...o,...r,ref:t})});kbe.displayName=Y7;var K7="PopoverTrigger",X7=E.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=xl(K7,n),o=Bg(n),s=rt(t,i.triggerRef),a=y.jsx(Fe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":tj(i.open),...r,ref:s,onClick:Re(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?a:y.jsx(xf,{asChild:!0,...o,children:a})});X7.displayName=K7;var C2="PopoverPortal",[Nbe,Lbe]=G7(C2,{forceMount:void 0}),Q7=e=>{const{__scopePopover:t,forceMount:n,children:r,container:i}=e,o=xl(C2,t);return y.jsx(Nbe,{scope:t,forceMount:n,children:y.jsx(Jn,{present:n||o.open,children:y.jsx(Ng,{asChild:!0,container:i,children:r})})})};Q7.displayName=C2;var nf="PopoverContent",J7=E.forwardRef((e,t)=>{const n=Lbe(nf,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,o=xl(nf,e.__scopePopover);return y.jsx(Jn,{present:r||o.open,children:o.modal?y.jsx(Fbe,{...i,ref:t}):y.jsx(jbe,{...i,ref:t})})});J7.displayName=nf;var Fbe=E.forwardRef((e,t)=>{const n=xl(nf,e.__scopePopover),r=E.useRef(null),i=rt(t,r),o=E.useRef(!1);return E.useEffect(()=>{const s=r.current;if(s)return Bv(s)},[]),y.jsx($g,{as:ca,allowPinchZoom:!0,children:y.jsx(Z7,{...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})})})}),jbe=E.forwardRef((e,t)=>{const n=xl(nf,e.__scopePopover),r=E.useRef(!1),i=E.useRef(!1);return y.jsx(Z7,{...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()}})}),Z7=E.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=xl(nf,n),h=Bg(n);return $v(),y.jsx(jg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:y.jsx(eu,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>p.onOpenChange(!1),children:y.jsx(Ig,{"data-state":tj(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)"}})})})}),ej="PopoverClose",$be=E.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=xl(ej,n);return y.jsx(Fe.button,{type:"button",...r,ref:t,onClick:Re(e.onClick,()=>i.onOpenChange(!1))})});$be.displayName=ej;var zbe="PopoverArrow",Bbe=E.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Bg(n);return y.jsx(kg,{...i,...r,ref:t})});Bbe.displayName=zbe;function tj(e){return e?"open":"closed"}var Hbe=q7,Vbe=X7,Wbe=Q7,nj=J7;const Gv=Hbe,qv=Vbe,Hg=E.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},i)=>y.jsx(Wbe,{children:y.jsx(Kc,{children:y.jsx(nj,{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})})}));Hg.displayName=nj.displayName;function Ube(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 rj({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(En,{children:"Color Range"}),y.jsx(Si,{onClick:o,variant:"secondary",className:"h-5 p-1 text-muted-foreground",children:y.jsx(yR,{className:"size-3"})})]}),e.map((s,a)=>y.jsxs("div",{className:"flex items-center gap-2 px-2",children:[y.jsx(Ec,{onChange:l=>r(a,"start",l.target.value),value:s.start,className:be(`h-7 ${jh}`)}),y.jsx("span",{children:"-"}),y.jsx(Ec,{value:s.end,onChange:l=>r(a,"end",l.target.value),className:be(`h-7 ${jh}`)}),y.jsx(Ec,{onChange:l=>r(a,"color",l.target.value),value:s.color,className:be(`h-7 min-w-14 p-0 ${jh}`),type:"color",list:"presetColors"}),y.jsxs("datalist",{id:"presetColors",children:[y.jsx("option",{children:jt.green[600]}),y.jsx("option",{children:jt.red[500]}),y.jsx("option",{children:jt.yellow[400]}),y.jsx("option",{children:jt.orange[500]})]}),y.jsx(Si,{onClick:()=>i(a),variant:"secondary",className:"h-5 p-1 text-muted-foreground",children:y.jsx(hf,{className:"size-3"})})]},a))]})}var Gbe="Toggle",ij=E.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:i,...o}=e,[s=!1,a]=$r({prop:n,onChange:i,defaultProp:r});return y.jsx(Fe.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)})})});ij.displayName=Gbe;var oj=ij;const qbe=p2("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"}}),Yv=E.forwardRef(({className:e,variant:t,size:n,...r},i)=>y.jsx(oj,{ref:i,className:be(qbe({variant:t,size:n,className:e})),...r}));Yv.displayName=oj.displayName;function Ybe(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 Kbe(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 Xbe(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 Qbe(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 Jbe(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 Zbe(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 eye(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 tye(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 nye(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 rye({columnIndex:e,columnName:t}){const[n,r]=P.useState(!1),i=Jr(H=>{var F;return(F=H.card)==null?void 0:F.preferences}),[o,s]=P.useState(Ybe(i,e)),[a,l]=P.useState(tye(i,e)),[c,u]=P.useState(nye(i,e)),[d,p]=P.useState(Zbe(i,e)),[h,m]=P.useState(Kbe(i,e)),[b,v]=P.useState(Xbe(i,e)),[x,w]=P.useState(Qbe(i,e)),[_,R]=P.useState(Jbe(i,e).toString()),[C,T]=P.useState(eye(i,e));P.useState("");const M=Jr(H=>H.actions.setCardPreferences);function I(){return y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[y.jsx(En,{className:"col-span-3",htmlFor:"format",children:"Text Align"}),y.jsxs(Ys,{value:a||"left",onValueChange:H=>l(H),children:[y.jsx(Jo,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:y.jsx(Ks,{})}),y.jsxs(Zo,{children:[y.jsx(Un,{value:"left",children:"Left"}),y.jsx(Un,{value:"center",children:"Center"}),y.jsx(Un,{value:"right",children:"Right"})]})]})]}),y.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[y.jsx(En,{className:"col-span-3",htmlFor:"format",children:"Width (px)"}),y.jsx(Ec,{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:H=>{H.target.value===""?u(void 0):u(Number(H.target.value))}})]})]})}function k(){const H=[...new Set(qS.map(F=>F.currency))];return y.jsx(y.Fragment,{children:y.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[y.jsx(En,{className:"col-span-3",htmlFor:"format",children:"Locale"}),y.jsxs(Ys,{value:h,onValueChange:F=>m(F),children:[y.jsx(Jo,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:y.jsx(Ks,{})}),y.jsx(Zo,{children:y.jsxs(ku,{children:[y.jsx(Yl,{children:"Locale"}),qS.map(F=>y.jsx(Un,{value:F.locale,children:F.locale},F.locale))]})})]}),y.jsx(En,{className:"col-span-3",htmlFor:"format",children:"Currency"}),y.jsxs(Ys,{value:x||"none",onValueChange:F=>w(F==="none"?void 0:F),children:[y.jsx(Jo,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:y.jsx(Ks,{})}),y.jsx(Zo,{children:y.jsxs(ku,{children:[y.jsx(Yl,{children:"Currency"}),y.jsx(Un,{value:"none",children:"None"}),H.map(F=>y.jsx(Un,{value:F,children:F},F))]})})]}),y.jsx(En,{className:"col-span-3",htmlFor:"format",children:"Decimals"}),y.jsxs(Ys,{value:_,onValueChange:F=>R(F),children:[y.jsx(Jo,{className:"col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0",children:y.jsx(Ks,{})}),y.jsx(Zo,{children:["0","1","2","3","4"].map(F=>y.jsx(Un,{value:F,children:F},F))})]}),!x&&y.jsx(Yv,{onPressedChange:F=>T(F),variant:"outline",size:"sm",className:"col-span-3 h-8","aria-label":"Toggle italic",children:y.jsx(O3,{className:"size-3"})})]})})}function L(){return y.jsx(y.Fragment,{children:y.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[y.jsx(En,{className:"col-span-3",htmlFor:"format",children:"Locale"}),y.jsxs(Ys,{defaultValue:"en-US",value:h,onValueChange:H=>m(H),children:[y.jsx(Jo,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:y.jsx(Ks,{})}),y.jsx(Zo,{children:cJ.map(H=>y.jsxs(ku,{children:[y.jsx(Yl,{children:H.label}),H.locales.map(F=>y.jsx(Un,{value:F.code,children:F.name},F.code))]},H.label))})]}),y.jsx(En,{className:"col-span-3",htmlFor:"format",children:"Format"}),y.jsxs(Ys,{defaultValue:"short-date-time",value:b,onValueChange:H=>{console.log("format",H),v(H)},children:[y.jsx(Jo,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:y.jsx(Ks,{})}),y.jsx(Zo,{className:"",id:"type",children:y.jsxs(ku,{children:[y.jsx(Yl,{children:"Option"}),y.jsx(Un,{value:"full-date-time",children:"Full Date-Time"}),y.jsx(Un,{value:"short-date-time",children:"Short Date-Time"}),y.jsx(Un,{value:"hours-date-time",children:"24-Hour Date-Time"}),y.jsx(Un,{value:"short-date",children:"Short Date"}),y.jsx(Un,{value:"long-date",children:"Long Date"})]})})]})]})})}function j(){M({...i,columnSettings:[]})}function $(){var H;M({...i,columnSettings:[...((H=i==null?void 0:i.columnSettings)==null?void 0:H.filter(F=>F.columnIdx!==e))||[]]})}function X(){var H,F,G;if(o==="date"){const B=Ube(h,b),W={columnIdx:e,type:o,options:B};M({...i,columnSettings:[...((H=i==null?void 0:i.columnSettings)==null?void 0:H.filter(K=>K.columnIdx!==e))||[],W]})}else if(o==="number"){let B;x?B={locale:h,currency:x,options:{style:"currency",currency:x,minimumFractionDigits:Number(_)},colorRanges:d.length>0?d:void 0}:B={locale:h,currency:void 0,options:{style:C?"percent":"decimal",minimumFractionDigits:Number(_)},colorRanges:d.length>0?d:void 0};const W={columnIdx:e,type:o,textAlign:a,width:c,options:B};M({...i,columnSettings:[...((F=i==null?void 0:i.columnSettings)==null?void 0:F.filter(K=>K.columnIdx!==e))||[],W]})}else{const B={columnIdx:e,type:"none",textAlign:a,width:c,options:{}};M({...i,columnSettings:[...((G=i==null?void 0:i.columnSettings)==null?void 0:G.filter(W=>W.columnIdx!==e))||[],B]})}}return y.jsxs(Gv,{onOpenChange:H=>r(H),children:[y.jsx(qv,{asChild:!0,children:y.jsx(T3,{className:"size-3 cursor-pointer text-muted"})}),y.jsx(Hg,{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(En,{htmlFor:"scale",children:"Type"}),y.jsxs(Ys,{value:o||"none",onValueChange:H=>s(H),children:[y.jsx(Jo,{className:"col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0",children:y.jsx(Ks,{})}),y.jsx(Zo,{id:"type",children:y.jsxs(ku,{children:[y.jsx(Yl,{children:"Option"}),y.jsx(Un,{value:"number",children:"Number"}),y.jsx(Un,{value:"date",children:"Date"}),y.jsx(Un,{value:"none",children:"None"})]})})]})]}),I(),y.jsx(Zh,{}),o==="number"&&k(),o==="date"&&L(),o==="number"&&y.jsxs(y.Fragment,{children:[y.jsx(Zh,{}),y.jsx(rj,{colorRanges:d,setColorRanges:p})]}),y.jsx(Zh,{}),y.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[y.jsx(Si,{onClick:j,variant:"secondary",className:"col-span-1 col-start-1 h-8 w-full text-destructive",children:"Reset All"}),y.jsx(Si,{onClick:$,variant:"secondary",className:"col-span-1 col-start-2 h-8 w-full",children:"Reset"}),y.jsx(Si,{onClick:X,variant:"secondary",className:"col-span-1 col-start-3 h-8 w-full",children:"Apply"})]})]})]})})]})}function iye(e){const t=new Date(e);return!isNaN(t.getTime())}function sj({data:e,card:t}){var R,C,T,M;const[n,r]=P.useState([]),{keys:i}=ur(e),o=ve(I=>I.filteringCards),s=ve(I=>I.themeStyle),a=ve(I=>I.isVisualEditing),l=o==null?void 0:o.find(I=>I.id===t.id),c=(R=t==null?void 0:t.preferences)==null?void 0:R.onClickFilter,{addOrUpdateFilterValues:u,addFilteringCard:d,removeFilterValue:p,removeFilteringCard:h}=hr(),m=t==null?void 0:t.preferences;function b(I,k){if((k==null?void 0:k.type)==="date"&&iye(I)){const{locale:L,options:j}=k.options,$=new Date(I);return new Date($.getTime()).toLocaleDateString(L,j)}if((k==null?void 0:k.type)==="number"){const{locale:L,currency:j,options:$}=k.options;return j?new Intl.NumberFormat(L,{style:"currency",currency:j,...$}).format(I):new Intl.NumberFormat(L,$).format(I)}return I}const v=i.map((I,k)=>({accessorKey:I,header:({column:L})=>{var B;const j=L.getIsSorted(),$=k,X=(B=m==null?void 0:m.columnSettings)==null?void 0:B.find(W=>W.columnIdx===$),H=X==null?void 0:X.textAlign,F=X==null?void 0:X.width,G=F?{width:F}:{};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":H==="center","justify-end":H==="right","justify-start":H==="left"}),style:G,onClick:()=>L.toggleSorting(L.getIsSorted()==="asc"),children:[I,j==="asc"?y.jsx(b3,{className:"ml-2 h-5 w-5"}):j==="desc"?y.jsx(m3,{className:"ml-2 h-5 w-5"}):null]}),y.jsx("div",{className:"opacity-0 group-hover:opacity-100",children:a&&y.jsx(rye,{columnName:L.id,columnIndex:k})})]})},cell:({cell:L})=>{var G,B;const j=L.getValue(),$=(G=m==null?void 0:m.columnSettings)==null?void 0:G.find(W=>W.columnIdx===k),X=b(j,$),H=xR(j,(B=$==null?void 0:$.options)==null?void 0:B.colorRanges),F=$==null?void 0:$.textAlign;return $!=null&&$.width&&$.width,y.jsx("p",{title:X,className:be("overflow-auto px-2 py-1",{"text-center":F==="center","text-right":F==="right","text-left":F==="left"}),style:{backgroundColor:H},children:X})}})),x=X8({data:e,columns:v,getCoreRowModel:q8(),getPaginationRowModel:Y8(),onSortingChange:r,getSortedRowModel:K8(),manualPagination:!0,state:{sorting:n}}),w=x.getSelectedRowModel().rows;P.useEffect(()=>{if(w.length===0){if(l){const I=t.id;p(I),h(t)}return}if(c){const{dimensionKeys:I}=ur(e),k=c.map(L=>{const j=I==null?void 0:I[L.columnIndex],$=w.map(H=>H.getValue(j));return{filterId:t.id+"-"+j,connectionId:t==null?void 0:t.connectionId,tableName:t.lastSelectedTable,name:j,expression:L.expression,valueType:G0($[0]===void 0?"":$[0]),operation:"in",values:$}});u(k),d(t)}},[d,u,t,e,l,c,p,h,w]);function _(I){I.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:(T=s==null?void 0:s.chart)==null?void 0:T.options.borderRadius},children:y.jsxs("table",{className:"w-full",onMouseDown:I=>I.stopPropagation(),children:[y.jsx(g2,{className:"group",children:x.getHeaderGroups().map(I=>y.jsx(Qh,{children:I.headers.map((k,L)=>{var j,$,X,H,F,G,B;return y.jsx(b2,{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:Ld((G=(F=(H=s==null?void 0:s.chart)==null?void 0:H.dataset)==null?void 0:F.backgroundColor)==null?void 0:G[0])},className:be("sticky -top-[1px] h-9 bg-muted-foreground px-2 text-background",{"border-x":L>0&&L<I.headers.length-1,"border-l":L===1&&I.headers.length==2},(B=s==null?void 0:s.table)==null?void 0:B.tableHeaderColor),children:k.isPlaceholder?null:CC(k.column.columnDef.header,k.getContext())},k.id)})},I.id))}),y.jsx(m2,{children:(M=x.getRowModel().rows)!=null&&M.length?x.getRowModel().rows.map((I,k)=>y.jsx(Qh,{onClick:()=>_(I),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":I.getIsSelected()&&"selected",children:I.getVisibleCells().map((L,j)=>{var F,G;const $=(F=m==null?void 0:m.columnSettings)==null?void 0:F.find(B=>B.columnIdx===j),X=$==null?void 0:$.width,H=X?{width:X,maxWidth:X}:{};return y.jsx("td",{style:H,onClick:B=>{var K;const W=((K=window==null?void 0:window.getSelection())==null?void 0:K.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":k===((G=x.getRowModel().rows)==null?void 0:G.length)-1}),children:CC(L.column.columnDef.cell,L.getContext())},L.id)})},I.id)):y.jsx(Qh,{children:y.jsx(y2,{colSpan:v.length,className:"p-1 text-center",children:"No results."})})})]})})}async function oye(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 sye(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 aj(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 lj=e=>{const[t,n]=P.useState([]),[r,i]=P.useState(!1),[o,s]=P.useState(null);P.useEffect(()=>{window.React=P,window.ReactDOM=kr,i(!0)},[]),P.useEffect(()=>{e&&r&&aj(e).then(c=>{n(c.visuals),s(c)}).catch(()=>{sye(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(()=>oye(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 cj({onLoadingStatus:e,onDataChange:t,card:n}){const{isFetching:r,isLoading:i,data:o,queryKey:s}=ol(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 aye({card:e,frame:t}){var w,_,R,C,T,M,I,k;const[n,r]=P.useState([]),{authToken:i}=vo(),o=H5(i==null?void 0:i.accessToken),s=ve(L=>L.themeStyle),a={colors:((_=(w=s==null?void 0:s.chart)==null?void 0:w.dataset)==null?void 0:_.backgroundColor)||[]},[l,c]=P.useState(!1),{getCard:u}=lj(((R=e.customCardPreferences)==null?void 0:R.url)||""),d=((C=e.customCardPreferences)==null?void 0:C.visualType)||"single",p=(T=e.customCardPreferences)==null?void 0:T.componentName,{data:h}=ol(e),m=P.useCallback((L,j)=>{r($=>({...$,[L]:j}))},[]);if(!p)return null;const b=u(p),v=Object.keys(((M=e.customCardPreferences)==null?void 0:M.dataInputCardIds)||{}).map(L=>{var X,H,F;const j=(H=(X=e.customCardPreferences)==null?void 0:X.dataInputCardIds)==null?void 0:H[L].cardId,$=(F=t==null?void 0:t.cards)==null?void 0:F.find(G=>G.id===j);return $||null});function x(L){c(L)}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:(I=e.customCardPreferences)==null?void 0:I.settings,onDataChange:m,data:(h==null?void 0:h.records)||[]}),b&&d==="multiple"&&y.jsxs("div",{children:[Object.keys(((k=e.customCardPreferences)==null?void 0:k.dataInputCardIds)||{}).map(L=>{var X,H,F;const j=(H=(X=e.customCardPreferences)==null?void 0:X.dataInputCardIds)==null?void 0:H[L].cardId,$=(F=t==null?void 0:t.cards)==null?void 0:F.find(G=>G.id===j);if($)return y.jsx(cj,{onLoadingStatus:x,onDataChange:m,dataInputIndex:L,card:$},$.id+L)}),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(L=>{var j;return(j=L==null?void 0:L.customCardPreferences)==null?void 0:j.settings}),data:v.map(L=>L!=null&&L.id?n==null?void 0:n[L.id]:[])})})]})]},e.id)})}/*!
|
|
343
|
+
* chartjs-plugin-datalabels v2.2.0
|
|
344
|
+
* https://chartjs-plugin-datalabels.netlify.app
|
|
345
|
+
* (c) 2017-2022 chartjs-plugin-datalabels contributors
|
|
346
|
+
* Released under the MIT license
|
|
347
|
+
*/var Ck=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}(),ep={toTextLines:function(e){var t=[],n;for(e=[].concat(e);e.length;)n=e.pop(),typeof n=="string"?t.unshift.apply(t,n.split(`
|
|
348
|
+
`)):Array.isArray(n)?e.push.apply(e,n):Ct(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*Ck)/Ck}};function K1(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 lye(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 cye=0,uj=1,dj=2,fj=4,hj=8;function Bb(e,t,n){var r=cye;return e<n.left?r|=uj:e>n.right&&(r|=dj),t<n.top?r|=hj:t>n.bottom&&(r|=fj),r}function uye(e,t){for(var n=e.x0,r=e.y0,i=e.x1,o=e.y1,s=Bb(n,r,t),a=Bb(i,o,t),l,c,u;!(!(s|a)||s&a);)l=s||a,l&hj?(c=n+(i-n)*(t.top-r)/(o-r),u=t.top):l&fj?(c=n+(i-n)*(t.bottom-r)/(o-r),u=t.bottom):l&dj?(u=r+(o-r)*(t.right-n)/(i-n),c=t.right):l&uj&&(u=r+(o-r)*(t.left-n)/(i-n),c=t.left),l===s?(n=c,r=u,s=Bb(n,r,t)):(i=c,o=u,a=Bb(i,o,t));return{x0:n,x1:i,y0:r,y1:o}}function Hb(e,t){var n=t.anchor,r=e,i,o;return t.clamp&&(r=uye(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),lye(i,o,e.vx,e.vy,t.align)}var Vb={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 Hb({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=K1(e,t.origin),r=n.x*e.options.radius,i=n.y*e.options.radius;return Hb({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=K1(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)),Hb({x0:r,y0:i+s,x1:r+o,y1:i,vx:n.x,vy:n.y},t)},fallback:function(e,t){var n=K1(e,t.origin);return Hb({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)}},oa=ep.rasterize;function dye(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 fye(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 hye(e){return e instanceof $u?Vb.arc:e instanceof wc?Vb.point:e instanceof Sc?Vb.bar:Vb.fallback}function pye(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 gye(e,t,n){var r=n.backgroundColor,i=n.borderColor,o=n.borderWidth;!r&&(!i||!o)||(e.beginPath(),pye(e,oa(t.x)+o/2,oa(t.y)+o/2,oa(t.w)-o,oa(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 mye(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 bye(e,t,n){var r=e.shadowBlur,i=n.stroked,o=oa(n.x),s=oa(n.y),a=oa(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 yye(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=mye(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)bye(e,t[p],{stroked:d,filled:s,w:n.w,x:n.x,y:n.y+n.h*p})}var pj=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};gr(pj.prototype,{_modelize:function(e,t,n,r){var i=this,o=i._index,s=Xn(Cn([n.font,{}],r,o)),a=Cn([n.color,Tn.color],r,o);return{align:Cn([n.align,"center"],r,o),anchor:Cn([n.anchor,"center"],r,o),area:r.chart.chartArea,backgroundColor:Cn([n.backgroundColor,null],r,o),borderColor:Cn([n.borderColor,null],r,o),borderRadius:Cn([n.borderRadius,0],r,o),borderWidth:Cn([n.borderWidth,0],r,o),clamp:Cn([n.clamp,!1],r,o),clip:Cn([n.clip,!1],r,o),color:a,display:e,font:s,lines:t,offset:Cn([n.offset,4],r,o),opacity:Cn([n.opacity,1],r,o),origin:fye(i._el,r),padding:_r(Cn([n.padding,4],r,o)),positioner:hye(i._el),rotation:Cn([n.rotation,0],r,o)*(Math.PI/180),size:ep.textSize(i._ctx,t,s),textAlign:Cn([n.textAlign,"start"],r,o),textShadowBlur:Cn([n.textShadowBlur,0],r,o),textShadowColor:Cn([n.textShadowColor,a],r,o),textStrokeColor:Cn([n.textStrokeColor,a],r,o),textStrokeWidth:Cn([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=Cn([o.display,!0],e,i);c&&(s=e.dataset.data[i],a=nt(an(o.formatter,[s,e]),s),l=Ct(a)?[]:ep.toTextLines(a),l.length&&(n=t._modelize(c,l,o,e),r=dye(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=ep.bound(0,i.opacity,1),r.translate(oa(t.x),oa(t.y)),r.rotate(i.rotation),gye(r,o.frame,i),yye(r,i.lines,o.text,i),r.restore())}});var vye=Number.MIN_SAFE_INTEGER||-9007199254740991,xye=Number.MAX_SAFE_INTEGER||9007199254740991;function ah(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 Ek(e,t){var n=xye,r=vye,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 Wb(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 gj=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};gr(gj.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=ah(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=[Wb(t[0],t[1]),Wb(t[0],t[3])],i,o,s;for(this._rotation!==e._rotation&&r.push(Wb(n[0],n[1]),Wb(n[0],n[3])),i=0;i<r.length;++i)if(o=Ek(t,r[i]),s=Ek(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[ah({x:t.x,y:t.y},r,n),ah({x:t.x+t.w,y:t.y},r,n),ah({x:t.x+t.w,y:t.y+t.h},r,n),ah({x:t.x,y:t.y+t.h},r,n)]}});function mj(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 wye(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 Sye(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=mj(a,r.model(),o),i._box.update(s,o,r.rotation()));return wye(e,function(l,c){var u=l._hidable,d=c._hidable;u&&d||d?c._visible=!1:u&&(l._visible=!1)})}var tp={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 gj,_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&&Sye(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=mj(i._el,i.model(),s),o._box.update(a,s,i.rotation()),i.draw(e,a))}},_ye=function(e){if(Ct(e))return null;var t=e,n,r,i;if(Ot(e))if(!Ct(e.label))t=e.label;else if(!Ct(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},Cye={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:_ye,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},mi="$datalabels",bj="$default";function Eye(e,t){var n=e.datalabels,r={},i=[],o,s;return n===!1?null:(n===!0&&(n={}),t=gr({},[t,n]),o=t.labels||{},s=Object.keys(o),delete t.labels,s.length?s.forEach(function(a){o[a]&&i.push(gr({},[t,o[a],{_key:a}]))}):i.push(t),r=i.reduce(function(a,l){return Jt(l.listeners||{},function(c,u){a[u]=a[u]||{},a[u][l._key||bj]=c}),delete l.listeners,a},{}),{labels:i,listeners:r})}function DC(e,t,n,r){if(t){var i=n.$context,o=n.$groups,s;t[o._set]&&(s=t[o._set][o._key],s&&an(s,[i,r])===!0&&(e[mi]._dirty=!0,n.update(i)))}}function Rye(e,t,n,r,i){var o,s;!n&&!r||(n?r?n!==r&&(s=o=!0):s=!0:o=!0,s&&DC(e,t.leave,n,i),o&&DC(e,t.enter,r,i))}function Pye(e,t){var n=e[mi],r=n._listeners,i,o;if(!(!r.enter&&!r.leave)){if(t.type==="mousemove")o=tp.lookup(n._labels,t);else if(t.type!=="mouseout")return;i=n._hovered,n._hovered=o,Rye(e,r,i,o,t)}}function Tye(e,t){var n=e[mi],r=n._listeners.click,i=r&&tp.lookup(n._labels,t);i&&DC(e,r,i,t)}var Oye={id:"datalabels",defaults:Cye,beforeInit:function(e){e[mi]={_actives:[]}},beforeUpdate:function(e){var t=e[mi];t._listened=!1,t._listeners={},t._datasets=[],t._labels=[]},afterDatasetUpdate:function(e,t,n){var r=t.index,i=e[mi],o=i._datasets[r]=[],s=e.isDatasetVisible(r),a=e.data.datasets[r],l=Eye(a,n),c=t.meta.data||[],u=e.ctx,d,p,h,m,b,v,x,w;for(u.save(),d=0,h=c.length;d<h;++d)if(x=c[d],x[mi]=[],s&&x&&e.getDataVisibility(d)&&!x.skip)for(p=0,m=l.labels.length;p<m;++p)b=l.labels[p],v=b._key,w=new pj(b,u,x,d),w.$groups={_set:r,_key:v||bj},w.$context={active:!1,chart:e,dataIndex:d,dataset:a,datasetIndex:r},w.update(w.$context),x[mi].push(w),o.push(w);u.restore(),gr(i._listeners,l.listeners,{merger:function(_,R,C){R[_]=R[_]||{},R[_][t.index]=C[_],i._listened=!0}})},afterUpdate:function(e){e[mi]._labels=tp.prepare(e[mi]._datasets)},afterDatasetsDraw:function(e){tp.draw(e,e[mi]._labels)},beforeEvent:function(e,t){if(e[mi]._listened){var n=t.event;switch(n.type){case"mousemove":case"mouseout":Pye(e,n);break;case"click":Tye(e,n);break}}},afterEvent:function(e){var t=e[mi],n=t._actives,r=t._actives=e.getActiveElements(),i=ep.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[mi]||[],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)&&(tp.update(t._labels),e.render()),delete t._dirty}};In.register(...oue);In.register(Oye);In.register(wc);In.register(mf);In.register(bf);In.register(ua);In.register(Zc);In.register(cl);In.register(ul);In.register(Jy);In.register($F);function E2({cfg:e,onDatapointClick:t}){var u;const[n,r]=P.useState(""),i=ve(d=>d.selectedLensId),o=P.useRef(null),[s,a]=P.useState(),l=ve(d=>d.themeStyle);P.useEffect(()=>{if(o.current){const d=window.getComputedStyle(o.current);r(d.fontFamily)}},[]),P.useEffect(()=>{var m,b,v,x;if(!n)return;(b=(m=l==null?void 0:l.chart)==null?void 0:m.font)!=null&&b.family&&(In.defaults.font={...In.defaults.font,...(v=l==null?void 0:l.chart)==null?void 0:v.font,family:n});const d={...e,options:{...e.options,responsive:!0,maintainAspectRatio:!1}},p=(x=o==null?void 0:o.current)==null?void 0:x.getContext("2d");if(!p)return;let h;try{const w=dhe(d,p);h=new In(p,w),a(h)}catch(w){console.log("error creating chart",w)}return()=>{h&&h.destroy()}},[(u=l==null?void 0:l.chart)==null?void 0:u.font,i,n]);function c(d){var h,m;if(!s)return;const p=s==null?void 0:s.getElementsAtEventForMode(d,"nearest",{intersect:!0},!0);if(p&&p.length>0){const b=p[0].datasetIndex,v=p[0].index,x=(m=(h=p[0].element)==null?void 0:h.$context)==null?void 0:m.raw;t==null||t(s,b,v,x)}}return y.jsx("div",{onClick:c,className:"relative h-[99%]",children:y.jsx("canvas",{ref:o})})}function Mye(e,t){return E.useReducer((n,r)=>t[n][r]??n,e)}var R2="ScrollArea",[yj,bIe]=or(R2),[Aye,xo]=yj(R2),vj=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:o=600,...s}=e,[a,l]=E.useState(null),[c,u]=E.useState(null),[d,p]=E.useState(null),[h,m]=E.useState(null),[b,v]=E.useState(null),[x,w]=E.useState(0),[_,R]=E.useState(0),[C,T]=E.useState(!1),[M,I]=E.useState(!1),k=rt(t,j=>l(j)),L=Xc(i);return y.jsx(Aye,{scope:n,type:r,dir:L,scrollHideDelay:o,scrollArea:a,viewport:c,onViewportChange:u,content:d,onContentChange:p,scrollbarX:h,onScrollbarXChange:m,scrollbarXEnabled:C,onScrollbarXEnabledChange:T,scrollbarY:b,onScrollbarYChange:v,scrollbarYEnabled:M,onScrollbarYEnabledChange:I,onCornerWidthChange:w,onCornerHeightChange:R,children:y.jsx(Fe.div,{dir:L,...s,ref:k,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":_+"px",...e.style}})})});vj.displayName=R2;var xj="ScrollAreaViewport",wj=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...o}=e,s=xo(xj,n),a=E.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(Fe.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})})]})});wj.displayName=xj;var Os="ScrollAreaScrollbar",P2=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=xo(Os,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:s}=i,a=e.orientation==="horizontal";return E.useEffect(()=>(a?o(!0):s(!0),()=>{a?o(!1):s(!1)}),[a,o,s]),i.type==="hover"?y.jsx(Dye,{...r,ref:t,forceMount:n}):i.type==="scroll"?y.jsx(Iye,{...r,ref:t,forceMount:n}):i.type==="auto"?y.jsx(Sj,{...r,ref:t,forceMount:n}):i.type==="always"?y.jsx(T2,{...r,ref:t}):null});P2.displayName=Os;var Dye=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=xo(Os,e.__scopeScrollArea),[o,s]=E.useState(!1);return E.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(Jn,{present:n||o,children:y.jsx(Sj,{"data-state":o?"visible":"hidden",...r,ref:t})})}),Iye=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=xo(Os,e.__scopeScrollArea),o=e.orientation==="horizontal",s=Xv(()=>l("SCROLL_END"),100),[a,l]=Mye("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 E.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,i.scrollHideDelay,l]),E.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(Jn,{present:n||a!=="hidden",children:y.jsx(T2,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Re(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:Re(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),Sj=E.forwardRef((e,t)=>{const n=xo(Os,e.__scopeScrollArea),{forceMount:r,...i}=e,[o,s]=E.useState(!1),a=e.orientation==="horizontal",l=Xv(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?c:u)}},10);return rf(n.viewport,l),rf(n.content,l),y.jsx(Jn,{present:r||o,children:y.jsx(T2,{"data-state":o?"visible":"hidden",...i,ref:t})})}),T2=E.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,i=xo(Os,e.__scopeScrollArea),o=E.useRef(null),s=E.useRef(0),[a,l]=E.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=Pj(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 $ye(p,s.current,a,h)}return n==="horizontal"?y.jsx(kye,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const p=i.viewport.scrollLeft,h=Rk(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(Nye,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const p=i.viewport.scrollTop,h=Rk(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}),kye=E.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=xo(Os,e.__scopeScrollArea),[s,a]=E.useState(),l=E.useRef(null),c=rt(t,l,o.onScrollbarXChange);return E.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),y.jsx(Cj,{"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":Kv(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),Oj(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:_0(s.paddingLeft),paddingEnd:_0(s.paddingRight)}})}})}),Nye=E.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=xo(Os,e.__scopeScrollArea),[s,a]=E.useState(),l=E.useRef(null),c=rt(t,l,o.onScrollbarYChange);return E.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),y.jsx(Cj,{"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":Kv(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),Oj(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:_0(s.paddingTop),paddingEnd:_0(s.paddingBottom)}})}})}),[Lye,_j]=yj(Os),Cj=E.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=xo(Os,n),[m,b]=E.useState(null),v=rt(t,k=>b(k)),x=E.useRef(null),w=E.useRef(""),_=h.viewport,R=r.content-r.viewport,C=ir(u),T=ir(l),M=Xv(d,10);function I(k){if(x.current){const L=k.clientX-x.current.left,j=k.clientY-x.current.top;c({x:L,y:j})}}return E.useEffect(()=>{const k=L=>{const j=L.target;(m==null?void 0:m.contains(j))&&C(L,R)};return document.addEventListener("wheel",k,{passive:!1}),()=>document.removeEventListener("wheel",k,{passive:!1})},[_,m,R,C]),E.useEffect(T,[r,T]),rf(m,M),rf(h.content,M),y.jsx(Lye,{scope:n,scrollbar:m,hasThumb:i,onThumbChange:ir(o),onThumbPointerUp:ir(s),onThumbPositionChange:T,onThumbPointerDown:ir(a),children:y.jsx(Fe.div,{...p,ref:v,style:{position:"absolute",...p.style},onPointerDown:Re(e.onPointerDown,k=>{k.button===0&&(k.target.setPointerCapture(k.pointerId),x.current=m.getBoundingClientRect(),w.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),I(k))}),onPointerMove:Re(e.onPointerMove,I),onPointerUp:Re(e.onPointerUp,k=>{const L=k.target;L.hasPointerCapture(k.pointerId)&&L.releasePointerCapture(k.pointerId),document.body.style.webkitUserSelect=w.current,h.viewport&&(h.viewport.style.scrollBehavior=""),x.current=null})})})}),S0="ScrollAreaThumb",Ej=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=_j(S0,e.__scopeScrollArea);return y.jsx(Jn,{present:n||i.hasThumb,children:y.jsx(Fye,{ref:t,...r})})}),Fye=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,o=xo(S0,n),s=_j(S0,n),{onThumbPositionChange:a}=s,l=rt(t,d=>s.onThumbChange(d)),c=E.useRef(void 0),u=Xv(()=>{c.current&&(c.current(),c.current=void 0)},100);return E.useEffect(()=>{const d=o.viewport;if(d){const p=()=>{if(u(),!c.current){const h=zye(d,a);c.current=h,a()}};return a(),d.addEventListener("scroll",p),()=>d.removeEventListener("scroll",p)}},[o.viewport,u,a]),y.jsx(Fe.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)})});Ej.displayName=S0;var O2="ScrollAreaCorner",Rj=E.forwardRef((e,t)=>{const n=xo(O2,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?y.jsx(jye,{...e,ref:t}):null});Rj.displayName=O2;var jye=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=xo(O2,n),[o,s]=E.useState(0),[a,l]=E.useState(0),c=!!(o&&a);return rf(i.scrollbarX,()=>{var d;const u=((d=i.scrollbarX)==null?void 0:d.offsetHeight)||0;i.onCornerHeightChange(u),l(u)}),rf(i.scrollbarY,()=>{var d;const u=((d=i.scrollbarY)==null?void 0:d.offsetWidth)||0;i.onCornerWidthChange(u),s(u)}),c?y.jsx(Fe.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 _0(e){return e?parseInt(e,10):0}function Pj(e,t){const n=e/t;return isNaN(n)?0:n}function Kv(e){const t=Pj(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function $ye(e,t,n,r="ltr"){const i=Kv(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 Tj([l,c],d)(e)}function Rk(e,t,n="ltr"){const r=Kv(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=EC(e,l);return Tj([0,s],[0,a])(c)}function Tj(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 Oj(e,t){return e>0&&e<t}var zye=(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 Xv(e,t){const n=ir(e),r=E.useRef(0);return E.useEffect(()=>()=>window.clearTimeout(r.current),[]),E.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function rf(e,t){const n=ir(t);Sr(()=>{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 Mj=vj,Bye=wj,Hye=Rj;const Rc=E.forwardRef(({className:e,children:t,...n},r)=>y.jsxs(Mj,{ref:r,className:be("relative overflow-hidden",e),...n,children:[y.jsx(Bye,{className:"h-full w-full rounded-[inherit]",children:t}),y.jsx(Vg,{}),y.jsx(Hye,{})]}));Rc.displayName=Mj.displayName;const Vg=E.forwardRef(({className:e,orientation:t="vertical",...n},r)=>y.jsx(P2,{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(Ej,{className:"relative flex-1 rounded-full bg-border"})}));Vg.displayName=P2.displayName;function Bt(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 Ki(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function ei(e,t){const n=Bt(e);return isNaN(t)?Ki(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function zo(e,t){const n=Bt(e);if(isNaN(t))return Ki(e,NaN);if(!t)return n;const r=n.getDate(),i=Ki(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)}const M2=6048e5,Vye=864e5;let Wye={};function Wg(){return Wye}function xs(e,t){var a,l,c,u;const n=Wg(),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=Bt(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 Bc(e){return xs(e,{weekStartsOn:1})}function Aj(e){const t=Bt(e),n=t.getFullYear(),r=Ki(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const i=Bc(r),o=Ki(e,0);o.setFullYear(n,0,4),o.setHours(0,0,0,0);const s=Bc(o);return t.getTime()>=i.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function of(e){const t=Bt(e);return t.setHours(0,0,0,0),t}function C0(e){const t=Bt(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 cs(e,t){const n=of(e),r=of(t),i=+n-C0(n),o=+r-C0(r);return Math.round((i-o)/Vye)}function Uye(e){const t=Aj(e),n=Ki(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Bc(n)}function IC(e,t){const n=t*7;return ei(e,n)}function Gye(e,t){return zo(e,t*12)}function qye(e){let t;return e.forEach(function(n){const r=Bt(n);(t===void 0||t<r||isNaN(Number(r)))&&(t=r)}),t||new Date(NaN)}function Yye(e){let t;return e.forEach(n=>{const r=Bt(n);(!t||t>r||isNaN(+r))&&(t=r)}),t||new Date(NaN)}function wi(e,t){const n=of(e),r=of(t);return+n==+r}function A2(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Kye(e){if(!A2(e)&&typeof e!="number")return!1;const t=Bt(e);return!isNaN(Number(t))}function Ap(e,t){const n=Bt(e),r=Bt(t),i=n.getFullYear()-r.getFullYear(),o=n.getMonth()-r.getMonth();return i*12+o}function Xye(e,t,n){const r=xs(e,n),i=xs(t,n),o=+r-C0(r),s=+i-C0(i);return Math.round((o-s)/M2)}function D2(e){const t=Bt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function _i(e){const t=Bt(e);return t.setDate(1),t.setHours(0,0,0,0),t}function Dj(e){const t=Bt(e),n=Ki(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function I2(e,t){var a,l,c,u;const n=Wg(),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=Bt(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 Ij(e){return I2(e,{weekStartsOn:1})}const Qye={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"}},Jye=(e,t,n)=>{let r;const i=Qye[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 X1(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Zye={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},e0e={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},t0e={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},n0e={date:X1({formats:Zye,defaultWidth:"full"}),time:X1({formats:e0e,defaultWidth:"full"}),dateTime:X1({formats:t0e,defaultWidth:"full"})},r0e={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},i0e=(e,t,n,r)=>r0e[e];function lh(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 o0e={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},s0e={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},a0e={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"]},l0e={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"]},c0e={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"}},u0e={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"}},d0e=(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"},f0e={ordinalNumber:d0e,era:lh({values:o0e,defaultWidth:"wide"}),quarter:lh({values:s0e,defaultWidth:"wide",argumentCallback:e=>e-1}),month:lh({values:a0e,defaultWidth:"wide"}),day:lh({values:l0e,defaultWidth:"wide"}),dayPeriod:lh({values:c0e,defaultWidth:"wide",formattingValues:u0e,defaultFormattingWidth:"wide"})};function ch(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)?p0e(a,d=>d.test(s)):h0e(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 h0e(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function p0e(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function g0e(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 m0e=/^(\d+)(th|st|nd|rd)?/i,b0e=/\d+/i,y0e={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},v0e={any:[/^b/i,/^(a|c)/i]},x0e={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},w0e={any:[/1/i,/2/i,/3/i,/4/i]},S0e={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},_0e={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]},C0e={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},E0e={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]},R0e={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},P0e={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}},T0e={ordinalNumber:g0e({matchPattern:m0e,parsePattern:b0e,valueCallback:e=>parseInt(e,10)}),era:ch({matchPatterns:y0e,defaultMatchWidth:"wide",parsePatterns:v0e,defaultParseWidth:"any"}),quarter:ch({matchPatterns:x0e,defaultMatchWidth:"wide",parsePatterns:w0e,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ch({matchPatterns:S0e,defaultMatchWidth:"wide",parsePatterns:_0e,defaultParseWidth:"any"}),day:ch({matchPatterns:C0e,defaultMatchWidth:"wide",parsePatterns:E0e,defaultParseWidth:"any"}),dayPeriod:ch({matchPatterns:R0e,defaultMatchWidth:"any",parsePatterns:P0e,defaultParseWidth:"any"})},kj={code:"en-US",formatDistance:Jye,formatLong:n0e,formatRelative:i0e,localize:f0e,match:T0e,options:{weekStartsOn:0,firstWeekContainsDate:1}};function O0e(e){const t=Bt(e);return cs(t,Dj(t))+1}function Nj(e){const t=Bt(e),n=+Bc(t)-+Uye(t);return Math.round(n/M2)+1}function Lj(e,t){var u,d,p,h;const n=Bt(e),r=n.getFullYear(),i=Wg(),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=Ki(e,0);s.setFullYear(r+1,0,o),s.setHours(0,0,0,0);const a=xs(s,t),l=Ki(e,0);l.setFullYear(r,0,o),l.setHours(0,0,0,0);const c=xs(l,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function M0e(e,t){var a,l,c,u;const n=Wg(),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=Lj(e,t),o=Ki(e,0);return o.setFullYear(i,0,r),o.setHours(0,0,0,0),xs(o,t)}function Fj(e,t){const n=Bt(e),r=+xs(n,t)-+M0e(n,t);return Math.round(r/M2)+1}function rn(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Aa={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return rn(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):rn(n+1,2)},d(e,t){return rn(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 rn(e.getHours()%12||12,t.length)},H(e,t){return rn(e.getHours(),t.length)},m(e,t){return rn(e.getMinutes(),t.length)},s(e,t){return rn(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return rn(i,t.length)}},Ou={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Pk={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 Aa.y(e,t)},Y:function(e,t,n,r){const i=Lj(e,r),o=i>0?i:1-i;if(t==="YY"){const s=o%100;return rn(s,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):rn(o,t.length)},R:function(e,t){const n=Aj(e);return rn(n,t.length)},u:function(e,t){const n=e.getFullYear();return rn(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 rn(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 rn(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 Aa.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 rn(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=Fj(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):rn(i,t.length)},I:function(e,t,n){const r=Nj(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):rn(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Aa.d(e,t)},D:function(e,t,n){const r=O0e(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):rn(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 rn(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 rn(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 rn(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=Ou.noon:r===0?i=Ou.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=Ou.evening:r>=12?i=Ou.afternoon:r>=4?i=Ou.morning:i=Ou.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 Aa.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Aa.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):rn(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):rn(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Aa.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Aa.s(e,t)},S:function(e,t){return Aa.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Ok(r);case"XXXX":case"XX":return Gl(r);case"XXXXX":case"XXX":default:return Gl(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Ok(r);case"xxxx":case"xx":return Gl(r);case"xxxxx":case"xxx":default:return Gl(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Tk(r,":");case"OOOO":default:return"GMT"+Gl(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Tk(r,":");case"zzzz":default:return"GMT"+Gl(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return rn(r,t.length)},T:function(e,t,n){const r=e.getTime();return rn(r,t.length)}};function Tk(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+rn(o,2)}function Ok(e,t){return e%60===0?(e>0?"-":"+")+rn(Math.abs(e)/60,2):Gl(e,t)}function Gl(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=rn(Math.trunc(r/60),2),o=rn(r%60,2);return n+i+t+o}const Mk=(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"})}},jj=(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"})}},A0e=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Mk(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}}",Mk(r,t)).replace("{{time}}",jj(i,t))},D0e={p:jj,P:A0e},I0e=/^D+$/,k0e=/^Y+$/,N0e=["D","DD","YY","YYYY"];function L0e(e){return I0e.test(e)}function F0e(e){return k0e.test(e)}function j0e(e,t,n){const r=$0e(e,t,n);if(console.warn(r),N0e.includes(e))throw new RangeError(r)}function $0e(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 z0e=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,B0e=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,H0e=/^'([^]*?)'?$/,V0e=/''/g,W0e=/[a-zA-Z]/;function ps(e,t,n){var u,d,p,h,m,b,v,x;const r=Wg(),i=(n==null?void 0:n.locale)??r.locale??kj,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=Bt(e);if(!Kye(a))throw new RangeError("Invalid time value");let l=t.match(B0e).map(w=>{const _=w[0];if(_==="p"||_==="P"){const R=D0e[_];return R(w,i.formatLong)}return w}).join("").match(z0e).map(w=>{if(w==="''")return{isToken:!1,value:"'"};const _=w[0];if(_==="'")return{isToken:!1,value:U0e(w)};if(Pk[_])return{isToken:!0,value:w};if(_.match(W0e))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");return{isToken:!1,value:w}});i.localize.preprocessor&&(l=i.localize.preprocessor(a,l));const c={firstWeekContainsDate:o,weekStartsOn:s,locale:i};return l.map(w=>{if(!w.isToken)return w.value;const _=w.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&F0e(_)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&L0e(_))&&j0e(_,t,String(e));const R=Pk[_[0]];return R(a,_,i.localize,c)}).join("")}function U0e(e){const t=e.match(H0e);return t?t[1].replace(V0e,"'"):e}function G0e(e){const t=Bt(e),n=t.getFullYear(),r=t.getMonth(),i=Ki(e,0);return i.setFullYear(n,r+1,0),i.setHours(0,0,0,0),i.getDate()}function q0e(e){return Math.trunc(+Bt(e)/1e3)}function Y0e(e){const t=Bt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function K0e(e,t){return Xye(Y0e(e),_i(e),t)+1}function kC(e,t){const n=Bt(e),r=Bt(t);return n.getTime()>r.getTime()}function $j(e,t){const n=Bt(e),r=Bt(t);return+n<+r}function k2(e,t){const n=Bt(e),r=Bt(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function X0e(e,t){const n=Bt(e),r=Bt(t);return n.getFullYear()===r.getFullYear()}function Q1(e,t){return ei(e,-t)}function J1(e,t){const n=Bt(e),r=n.getFullYear(),i=n.getDate(),o=Ki(e,0);o.setFullYear(r,t,15),o.setHours(0,0,0,0);const s=G0e(o);return n.setMonth(t,Math.min(i,s)),n}function Ak(e,t){const n=Bt(e);return isNaN(+n)?Ki(e,NaN):(n.setFullYear(t),n)}var Je=function(){return Je=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},Je.apply(this,arguments)};function Q0e(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 zj(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 Ug(e){return e.mode==="multiple"}function Gg(e){return e.mode==="range"}function Qv(e){return e.mode==="single"}var J0e={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 Z0e(e,t){return ps(e,"LLLL y",t)}function eve(e,t){return ps(e,"d",t)}function tve(e,t){return ps(e,"LLLL",t)}function nve(e){return"".concat(e)}function rve(e,t){return ps(e,"cccccc",t)}function ive(e,t){return ps(e,"yyyy",t)}var ove=Object.freeze({__proto__:null,formatCaption:Z0e,formatDay:eve,formatMonthCaption:tve,formatWeekNumber:nve,formatWeekdayName:rve,formatYearCaption:ive}),sve=function(e,t,n){return ps(e,"do MMMM (EEEE)",n)},ave=function(){return"Month: "},lve=function(){return"Go to next month"},cve=function(){return"Go to previous month"},uve=function(e,t){return ps(e,"cccc",t)},dve=function(e){return"Week n. ".concat(e)},fve=function(){return"Year: "},hve=Object.freeze({__proto__:null,labelDay:sve,labelMonthDropdown:ave,labelNext:lve,labelPrevious:cve,labelWeekNumber:dve,labelWeekday:uve,labelYearDropdown:fve});function pve(){var e="buttons",t=J0e,n=kj,r={},i={},o=1,s={},a=new Date;return{captionLayout:e,classNames:t,formatters:ove,labels:hve,locale:n,modifiersClassNames:r,modifiers:i,numberOfMonths:o,styles:s,today:a,mode:"default"}}function gve(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,i=e.toMonth,o=e.fromDate,s=e.toDate;return r?o=_i(r):t&&(o=new Date(t,0,1)),i?s=D2(i):n&&(s=new Date(n,11,31)),{fromDate:o?of(o):void 0,toDate:s?of(s):void 0}}var Bj=P.createContext(void 0);function mve(e){var t,n=e.initialProps,r=pve(),i=gve(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;(Qv(n)||Ug(n)||Gg(n))&&(l=n.onSelect);var c=Je(Je(Je({},r),n),{captionLayout:a,classNames:Je(Je({},r.classNames),n.classNames),components:Je({},n.components),formatters:Je(Je({},r.formatters),n.formatters),fromDate:o,labels:Je(Je({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:Je(Je({},r.modifiers),n.modifiers),modifiersClassNames:Je(Je({},r.modifiersClassNames),n.modifiersClassNames),onSelect:l,styles:Je(Je({},r.styles),n.styles),toDate:s});return y.jsx(Bj.Provider,{value:c,children:e.children})}function vn(){var e=P.useContext(Bj);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function Hj(e){var t=vn(),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 bve(e){return y.jsx("svg",Je({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 Vj(e){var t,n,r=e.onChange,i=e.value,o=e.children,s=e.caption,a=e.className,l=e.style,c=vn(),u=(n=(t=c.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:bve;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 yve(e){var t,n=vn(),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(X0e(r,i))for(var p=_i(r),h=r.getMonth();h<=i.getMonth();h++)d.push(J1(p,h));else for(var p=_i(new Date),h=0;h<=11;h++)d.push(J1(p,h));var m=function(v){var x=Number(v.target.value),w=J1(_i(e.displayMonth),x);e.onChange(w)},b=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:Vj;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 vve(e){var t,n=e.displayMonth,r=vn(),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(Ak(Dj(new Date),b));var v=function(w){var _=Ak(_i(n),Number(w.target.value));e.onChange(_)},x=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:Vj;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(w){return y.jsx("option",{value:w.getFullYear(),children:u(w,{locale:s})},w.getFullYear())})})}function xve(e,t){var n=P.useState(e),r=n[0],i=n[1],o=t===void 0?r:t;return[o,i]}function wve(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&&Ap(o,i)<0){var c=-1*(l-1);i=zo(o,c)}return s&&Ap(i,s)<0&&(i=s),_i(i)}function Sve(){var e=vn(),t=wve(e),n=xve(t,e.month),r=n[0],i=n[1],o=function(s){var a;if(!e.disableNavigation){var l=_i(s);i(l),(a=e.onMonthChange)===null||a===void 0||a.call(e,l)}};return[r,o]}function _ve(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,i=_i(e),o=_i(zo(i,r)),s=Ap(o,i),a=[],l=0;l<s;l++){var c=zo(i,l);a.push(c)}return n&&(a=a.reverse()),a}function Cve(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=_i(e);if(!n)return zo(a,s);var l=Ap(n,e);if(!(l<o))return zo(a,s)}}function Eve(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=_i(e);if(!n)return zo(a,-s);var l=Ap(a,n);if(!(l<=0))return zo(a,-s)}}var Wj=P.createContext(void 0);function Rve(e){var t=vn(),n=Sve(),r=n[0],i=n[1],o=_ve(r,t),s=Cve(r,t),a=Eve(r,t),l=function(d){return o.some(function(p){return k2(d,p)})},c=function(d,p){l(d)||(p&&$j(d,p)?i(zo(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(Wj.Provider,{value:u,children:e.children})}function qg(){var e=P.useContext(Wj);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function Dk(e){var t,n=vn(),r=n.classNames,i=n.styles,o=n.components,s=qg().goToMonth,a=function(u){s(zo(u,e.displayIndex?-e.displayIndex:0))},l=(t=o==null?void 0:o.CaptionLabel)!==null&&t!==void 0?t:Hj,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(yve,{onChange:a,displayMonth:e.displayMonth}),y.jsx(vve,{onChange:a,displayMonth:e.displayMonth})]})}function Pve(e){return y.jsx("svg",Je({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 Tve(e){return y.jsx("svg",Je({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 E0=P.forwardRef(function(e,t){var n=vn(),r=n.classNames,i=n.styles,o=[r.button_reset,r.button];e.className&&o.push(e.className);var s=o.join(" "),a=Je(Je({},i.button_reset),i.button);return e.style&&Object.assign(a,e.style),y.jsx("button",Je({},e,{ref:t,type:"button",className:s,style:a}))});function Ove(e){var t,n,r=vn(),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:Tve,x=(n=d==null?void 0:d.IconLeft)!==null&&n!==void 0?n:Pve;return y.jsxs("div",{className:s.nav,style:a.nav,children:[!e.hidePrevious&&y.jsx(E0,{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(E0,{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 Ik(e){var t=vn().numberOfMonths,n=qg(),r=n.previousMonth,i=n.nextMonth,o=n.goToMonth,s=n.displayMonths,a=s.findIndex(function(m){return k2(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(Ove,{displayMonth:e.displayMonth,hideNext:u,hidePrevious:d,nextMonth:i,previousMonth:r,onPreviousClick:p,onNextClick:h})}function Mve(e){var t,n=vn(),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:Hj,c;return i?c=y.jsx(l,{id:e.id,displayMonth:e.displayMonth}):s==="dropdown"?c=y.jsx(Dk,{displayMonth:e.displayMonth,id:e.id}):s==="dropdown-buttons"?c=y.jsxs(y.Fragment,{children:[y.jsx(Dk,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),y.jsx(Ik,{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(Ik,{displayMonth:e.displayMonth,id:e.id})]}),y.jsx("div",{className:r.caption,style:o.caption,children:c})}function Ave(e){var t=vn(),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 Dve(e,t,n){for(var r=n?Bc(new Date):xs(new Date,{locale:e,weekStartsOn:t}),i=[],o=0;o<7;o++){var s=ei(r,o);i.push(s)}return i}function Ive(){var e=vn(),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=Dve(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 kve(){var e,t=vn(),n=t.classNames,r=t.styles,i=t.components,o=(e=i==null?void 0:i.HeadRow)!==null&&e!==void 0?e:Ive;return y.jsx("thead",{style:r.head,className:n.head,children:y.jsx(o,{})})}function Nve(e){var t=vn(),n=t.locale,r=t.formatters.formatDay;return y.jsx(y.Fragment,{children:r(e.date,{locale:n})})}var N2=P.createContext(void 0);function Lve(e){if(!Ug(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return y.jsx(N2.Provider,{value:t,children:e.children})}return y.jsx(Fve,{initialProps:e.initialProps,children:e.children})}function Fve(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?zj([],r):[];if(u.selected){var x=v.findIndex(function(w){return wi(c,w)});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 wi(p,c)});return!!(u&&!d)});var l={selected:r,onDayClick:s,modifiers:a};return y.jsx(N2.Provider,{value:l,children:n})}function L2(){var e=P.useContext(N2);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function jve(e,t){var n=t||{},r=n.from,i=n.to;return r&&i?wi(i,e)&&wi(r,e)?void 0:wi(i,e)?{from:i,to:void 0}:wi(r,e)?void 0:kC(r,e)?{from:e,to:i}:{from:r,to:e}:i?kC(e,i)?{from:i,to:e}:{from:e,to:i}:r?$j(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var F2=P.createContext(void 0);function $ve(e){if(!Gg(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return y.jsx(F2.Provider,{value:t,children:e.children})}return y.jsx(zve,{initialProps:e.initialProps,children:e.children})}function zve(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 w=jve(h,r);(x=t.onSelect)===null||x===void 0||x.call(t,w,h,m,b)},u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(o?(u.range_start=[o],s?(u.range_end=[s],wi(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:Q1(o,a-1),before:ei(o,a-1)}),o&&s&&u.disabled.push({after:o,before:ei(o,a-1)}),!o&&s&&u.disabled.push({after:Q1(s,a-1),before:ei(s,a-1)})),l){if(o&&!s&&(u.disabled.push({before:ei(o,-l+1)}),u.disabled.push({after:ei(o,l-1)})),o&&s){var d=cs(s,o)+1,p=l-d;u.disabled.push({before:Q1(o,p)}),u.disabled.push({after:ei(s,p)})}!o&&s&&(u.disabled.push({before:ei(s,-l+1)}),u.disabled.push({after:ei(s,l-1)}))}return y.jsx(F2.Provider,{value:{selected:r,onDayClick:c,modifiers:u},children:n})}function j2(){var e=P.useContext(F2);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function wy(e){return Array.isArray(e)?zj([],e):e!==void 0?[e]:[]}function Bve(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],i=n[1];t[r]=wy(i)}),t}var Bo;(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"})(Bo||(Bo={}));var Hve=Bo.Selected,Hs=Bo.Disabled,Vve=Bo.Hidden,Wve=Bo.Today,Z1=Bo.RangeEnd,eS=Bo.RangeMiddle,tS=Bo.RangeStart,Uve=Bo.Outside;function Gve(e,t,n){var r,i=(r={},r[Hve]=wy(e.selected),r[Hs]=wy(e.disabled),r[Vve]=wy(e.hidden),r[Wve]=[e.today],r[Z1]=[],r[eS]=[],r[tS]=[],r[Uve]=[],r);return e.fromDate&&i[Hs].push({before:e.fromDate}),e.toDate&&i[Hs].push({after:e.toDate}),Ug(e)?i[Hs]=i[Hs].concat(t.modifiers[Hs]):Gg(e)&&(i[Hs]=i[Hs].concat(n.modifiers[Hs]),i[tS]=n.modifiers[tS],i[eS]=n.modifiers[eS],i[Z1]=n.modifiers[Z1]),i}var Uj=P.createContext(void 0);function qve(e){var t=vn(),n=L2(),r=j2(),i=Gve(t,n,r),o=Bve(t.modifiers),s=Je(Je({},i),o);return y.jsx(Uj.Provider,{value:s,children:e.children})}function Gj(){var e=P.useContext(Uj);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function Yve(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Kve(e){return!!(e&&typeof e=="object"&&"from"in e)}function Xve(e){return!!(e&&typeof e=="object"&&"after"in e)}function Qve(e){return!!(e&&typeof e=="object"&&"before"in e)}function Jve(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function Zve(e,t){var n,r=t.from,i=t.to;if(r&&i){var o=cs(i,r)<0;o&&(n=[i,r],r=n[0],i=n[1]);var s=cs(e,r)>=0&&cs(i,e)>=0;return s}return i?wi(i,e):r?wi(r,e):!1}function exe(e){return A2(e)}function txe(e){return Array.isArray(e)&&e.every(A2)}function nxe(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(exe(n))return wi(e,n);if(txe(n))return n.includes(e);if(Kve(n))return Zve(e,n);if(Jve(n))return n.dayOfWeek.includes(e.getDay());if(Yve(n)){var r=cs(n.before,e),i=cs(n.after,e),o=r>0,s=i<0,a=kC(n.before,n.after);return a?s&&o:o||s}return Xve(n)?cs(e,n.after)>0:Qve(n)?cs(n.before,e)>0:typeof n=="function"?n(e):!1})}function $2(e,t,n){var r=Object.keys(t).reduce(function(o,s){var a=t[s];return nxe(e,a)&&o.push(s),o},[]),i={};return r.forEach(function(o){return i[o]=!0}),n&&!k2(e,n)&&(i.outside=!0),i}function rxe(e,t){for(var n=_i(e[0]),r=D2(e[e.length-1]),i,o,s=n;s<=r;){var a=$2(s,t),l=!a.disabled&&!a.hidden;if(!l){s=ei(s,1);continue}if(a.selected)return s;a.today&&!o&&(o=s),i||(i=s),s=ei(s,1)}return o||i}var ixe=365;function qj(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:ei,week:IC,month:zo,year:Gye,startOfWeek:function(v){return i.ISOWeek?Bc(v):xs(v,{locale:d,weekStartsOn:l})},endOfWeek:function(v){return i.ISOWeek?Ij(v):I2(v,{locale:d,weekStartsOn:l})}},h=p[n](e,r==="after"?1:-1);r==="before"&&c?h=qye([c,h]):r==="after"&&u&&(h=Yye([u,h]));var m=!0;if(o){var b=$2(h,o);m=!b.disabled&&!b.hidden}return m?h:a.count>ixe?a.lastFocused:qj(h,{moveBy:n,direction:r,context:i,modifiers:o,retry:Je(Je({},a),{count:a.count+1})})}var Yj=P.createContext(void 0);function oxe(e){var t=qg(),n=Gj(),r=P.useState(),i=r[0],o=r[1],s=P.useState(),a=s[0],l=s[1],c=rxe(t.displayMonths,n),u=i??(a&&t.isDateDisplayed(a))?a:c,d=function(){l(i),o(void 0)},p=function(v){o(v)},h=vn(),m=function(v,x){if(i){var w=qj(i,{moveBy:v,direction:x,context:h,modifiers:n});wi(i,w)||(t.goToDate(w,i),p(w))}},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(Yj.Provider,{value:b,children:e.children})}function z2(){var e=P.useContext(Yj);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function sxe(e,t){var n=Gj(),r=$2(e,n,t);return r}var B2=P.createContext(void 0);function axe(e){if(!Qv(e.initialProps)){var t={selected:void 0};return y.jsx(B2.Provider,{value:t,children:e.children})}return y.jsx(lxe,{initialProps:e.initialProps,children:e.children})}function lxe(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(B2.Provider,{value:i,children:n})}function Kj(){var e=P.useContext(B2);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function cxe(e,t){var n=vn(),r=Kj(),i=L2(),o=j2(),s=z2(),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,w=s.focusEndOfWeek,_=function(B){var W,K,D,Y;Qv(n)?(W=r.onDayClick)===null||W===void 0||W.call(r,e,t,B):Ug(n)?(K=i.onDayClick)===null||K===void 0||K.call(i,e,t,B):Gg(n)?(D=o.onDayClick)===null||D===void 0||D.call(o,e,t,B):(Y=n.onDayClick)===null||Y===void 0||Y.call(n,e,t,B)},R=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)},T=function(B){var W;(W=n.onDayMouseEnter)===null||W===void 0||W.call(n,e,t,B)},M=function(B){var W;(W=n.onDayMouseLeave)===null||W===void 0||W.call(n,e,t,B)},I=function(B){var W;(W=n.onDayPointerEnter)===null||W===void 0||W.call(n,e,t,B)},k=function(B){var W;(W=n.onDayPointerLeave)===null||W===void 0||W.call(n,e,t,B)},L=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)},H=function(B){var W;(W=n.onDayKeyUp)===null||W===void 0||W.call(n,e,t,B)},F=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(),w();break}(W=n.onDayKeyDown)===null||W===void 0||W.call(n,e,t,B)},G={onClick:_,onFocus:R,onBlur:C,onKeyDown:F,onKeyUp:H,onMouseEnter:T,onMouseLeave:M,onPointerEnter:I,onPointerLeave:k,onTouchCancel:L,onTouchEnd:j,onTouchMove:$,onTouchStart:X};return G}function uxe(){var e=vn(),t=Kj(),n=L2(),r=j2(),i=Qv(e)?t.selected:Ug(e)?n.selected:Gg(e)?r.selected:void 0;return i}function dxe(e){return Object.values(Bo).includes(e)}function fxe(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(dxe(r)){var o=e.classNames["day_".concat(r)];o&&n.push(o)}}),n}function hxe(e,t){var n=Je({},e.styles.day);return Object.keys(t).forEach(function(r){var i;n=Je(Je({},n),(i=e.modifiersStyles)===null||i===void 0?void 0:i[r])}),n}function pxe(e,t,n){var r,i,o,s=vn(),a=z2(),l=sxe(e,t),c=cxe(e,l),u=uxe(),d=!!(s.onDayClick||s.mode!=="default");P.useEffect(function(){var T;l.outside||a.focusedDay&&d&&wi(a.focusedDay,e)&&((T=n.current)===null||T===void 0||T.focus())},[a.focusedDay,e,n,d,l.outside]);var p=fxe(s,l).join(" "),h=hxe(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:Nve,v=y.jsx(b,{date:e,displayMonth:t,activeModifiers:l}),x={style:h,className:p,children:v,role:"gridcell"},w=a.focusTarget&&wi(a.focusTarget,e)&&!l.outside,_=a.focusedDay&&wi(a.focusedDay,e),R=Je(Je(Je({},x),(r={disabled:l.disabled,role:"gridcell"},r["aria-selected"]=l.selected,r.tabIndex=_||w?0:-1,r)),c),C={isButton:d,isHidden:m,activeModifiers:l,selectedDays:u,buttonProps:R,divProps:x};return C}function gxe(e){var t=P.useRef(null),n=pxe(e.date,e.displayMonth,t);return n.isHidden?y.jsx("div",{role:"gridcell"}):n.isButton?y.jsx(E0,Je({name:"day",ref:t},n.buttonProps)):y.jsx("div",Je({},n.divProps))}function mxe(e){var t=e.number,n=e.dates,r=vn(),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(E0,{name:"week-number","aria-label":d,className:s.weeknumber,style:o.weeknumber,onClick:p,children:u})}function bxe(e){var t,n,r=vn(),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:gxe,c=(n=a==null?void 0:a.WeekNumber)!==null&&n!==void 0?n:mxe,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})},q0e(d))})]})}function kk(e,t,n){for(var r=n!=null&&n.ISOWeek?Ij(t):I2(t,n),i=n!=null&&n.ISOWeek?Bc(e):xs(e,n),o=cs(r,i),s=[],a=0;a<=o;a++)s.push(ei(i,a));var l=s.reduce(function(c,u){var d=n!=null&&n.ISOWeek?Nj(u):Fj(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 yxe(e,t){var n=kk(_i(e),D2(e),t);if(t!=null&&t.useFixedWeeks){var r=K0e(e,t);if(r<6){var i=n[n.length-1],o=i.dates[i.dates.length-1],s=IC(o,6-r),a=kk(IC(o,1),s,t);n.push.apply(n,a)}}return n}function vxe(e){var t,n,r,i=vn(),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=yxe(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:kve,v=(n=u==null?void 0:u.Row)!==null&&n!==void 0?n:bxe,x=(r=u==null?void 0:u.Footer)!==null&&r!==void 0?r:Ave;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(w){return y.jsx(v,{displayMonth:e.displayMonth,dates:w.dates,weekNumber:w.weekNumber},w.weekNumber)})}),y.jsx(x,{displayMonth:e.displayMonth})]})}function xxe(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var wxe=xxe()?P.useLayoutEffect:P.useEffect,nS=!1,Sxe=0;function Nk(){return"react-day-picker-".concat(++Sxe)}function _xe(e){var t,n=e??(nS?Nk():null),r=P.useState(n),i=r[0],o=r[1];return wxe(function(){i===null&&o(Nk())},[]),P.useEffect(function(){nS===!1&&(nS=!0)},[]),(t=e??i)!==null&&t!==void 0?t:void 0}function Cxe(e){var t,n,r=vn(),i=r.dir,o=r.classNames,s=r.styles,a=r.components,l=qg().displayMonths,c=_xe(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=Je(Je({},p),s.caption_start)),m&&(d.push(o.caption_end),p=Je(Je({},p),s.caption_end)),b&&(d.push(o.caption_between),p=Je(Je({},p),s.caption_between));var v=(n=a==null?void 0:a.Caption)!==null&&n!==void 0?n:Mve;return y.jsxs("div",{className:d.join(" "),style:p,children:[y.jsx(v,{id:c,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),y.jsx(vxe,{id:u,"aria-labelledby":c,displayMonth:e.displayMonth})]},e.displayIndex)}function Exe(e){var t=vn(),n=t.classNames,r=t.styles;return y.jsx("div",{className:n.months,style:r.months,children:e.children})}function Rxe(e){var t,n,r=e.initialProps,i=vn(),o=z2(),s=qg(),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=Je(Je({},i.styles.root),i.style),p=Object.keys(r).filter(function(m){return m.startsWith("data-")}).reduce(function(m,b){var v;return Je(Je({},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:Exe;return y.jsx("div",Je({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(Cxe,{displayIndex:b,displayMonth:m},b)})})}))}function Pxe(e){var t=e.children,n=Q0e(e,["children"]);return y.jsx(mve,{initialProps:n,children:y.jsx(Rve,{children:y.jsx(axe,{initialProps:n,children:y.jsx(Lve,{initialProps:n,children:y.jsx($ve,{initialProps:n,children:y.jsx(qve,{children:y.jsx(oxe,{children:t})})})})})})})}function Txe(e){return y.jsx(Pxe,Je({},e,{children:y.jsx(Rxe,{initialProps:e})}))}function Xj({className:e,classNames:t,showOutsideDays:n=!0,...r}){return y.jsx(Txe,{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(Mp({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(Mp({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(gR,{...i,className:"h-4 w-4"}),IconRight:({...i})=>y.jsx(bv,{...i,className:"h-4 w-4"})},...r})}Xj.displayName="Calendar";function Qj(e){const{authToken:t}=vo(),n=ve(w=>w.dashboard.filters),r=ve(w=>w.selectedSheetId),i=ve(w=>w.filterValues),[o,s]=P.useState(!0),a=n==null?void 0:n.filter(w=>w.sheetId===r||!w.sheetId),l=i==null?void 0:i.filter(w=>(a==null?void 0:a.some(_=>_.id===w.filterId))||w.filterId.endsWith(r));function c(w){return o?{allowQuery:!0,filterValues:w.filter(C=>C.filterId!==e.id)}:(w==null?void 0:w.find(R=>R.filterId===e.id))?{allowQuery:!1,filterValues:w}:{allowQuery:!0,filterValues:w}}const{allowQuery:u,filterValues:d}=c(l||[]),{data:p,isLoading:h,isFetching:m,isError:b,refetch:v,isSuccess:x}=Sg({queryKey:["filter",e.id,e.sql,JSON.stringify(d)],queryFn:()=>z0("https://semaphor.cloud/api/v1/query",(t==null?void 0:t.accessToken)||"",{connection_id:e.connectionId,sql:e.sql,active_filters:d,cache_config:PE()}),enabled:!!e.sql&&!!e.connectionId&&u,placeholderData:w=>w});return P.useEffect(()=>{x&&o&&s(!1)},[x,o]),{data:p,isLoading:h,isFetching:m,isError:b,refetch:v}}function Oxe({filter:e,className:t}){var w,_,R,C,T,M,I,k;const n=ve(L=>L.themeStyle),[r,i]=P.useState(!1),[o,s]=P.useState(),[a,l]=P.useState(),c=ve(L=>L.filterValues),u=ve(L=>L.actions.addOrUpdateFilterValue),d=ve(L=>L.actions.removeFilterValue),{data:p,isLoading:h,isFetching:m,isError:b}=Qj(e);P.useEffect(()=>{var L;if(((L=p==null?void 0:p.records)==null?void 0:L.length)>0){const j=p.records[0];if(!j.min||!j.max)return;s({from:new Date(j.min),to:new Date(j.max)}),l({from:new Date(j.min),to:new Date(j.max)})}},[p]),P.useEffect(()=>{if(c&&!c.find(j=>j.filterId===e.id)){s(a);return}},[c,e.id,a]);function v(){d(e.id),s(a),i(!1)}function x(){if(!o)return;console.log(o);const L=[o==null?void 0:o.from,o==null?void 0:o.to];console.log(L);const j={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:Gu(e),name:e.column,operation:"between",values:L};u(j),i(!1)}return h||m?y.jsx("div",{children:y.jsx(Yu,{className:"h-8 w-full bg-foreground/10"})}):b?y.jsx("div",{className:"h-8 w-full bg-muted px-2",children:"Error"}):p?y.jsx("div",{className:be("grid gap-2",t),children:y.jsxs(Gv,{open:r,onOpenChange:i,children:[y.jsx(qv,{style:{borderRadius:(_=(w=n==null?void 0:n.chart)==null?void 0:w.options)==null?void 0:_.borderRadius},asChild:!0,children:y.jsxs(Si,{size:"sm",id:"date",variant:"outline",className:be("h-[34px] w-full justify-start rounded-sm text-left font-normal",!o&&"text-muted-foreground"),children:[y.jsx(x3,{className:"mr-2 h-4 w-4"}),o!=null&&o.from?o.to?y.jsxs(y.Fragment,{children:[ps(o.from,"LLL dd, y")," -"," ",ps(o.to,"LLL dd, y")]}):ps(o.from,"LLL dd, y"):y.jsx("span",{children:"Pick a date"})]})}),y.jsxs(Hg,{style:{borderRadius:(C=(R=n==null?void 0:n.chart)==null?void 0:R.options)==null?void 0:C.borderRadius},className:"w-auto p-0",align:"start",children:[y.jsx("div",{className:"px-4 pt-3",children:y.jsx(En,{children:e.title})}),y.jsx(Xj,{initialFocus:!0,mode:"range",defaultMonth:o==null?void 0:o.from,selected:o,onSelect:s,numberOfMonths:2}),y.jsxs("div",{className:"flex justify-end gap-2 px-4 py-3",children:[y.jsx(Si,{style:{borderRadius:(M=(T=n==null?void 0:n.chart)==null?void 0:T.options)==null?void 0:M.borderRadius},size:"sm",variant:"outline",onClick:x,children:"Apply"}),y.jsx(Si,{style:{borderRadius:(k=(I=n==null?void 0:n.chart)==null?void 0:I.options)==null?void 0:k.borderRadius},size:"sm",variant:"outline",onClick:v,children:"Clear"})]})]})]})}):y.jsxs(En,{className:"w-fulll flex h-8 items-center bg-muted px-2",children:[" ","No Data"]})}const Jj=typeof document<"u"?P.useLayoutEffect:()=>{};function Mxe(e){const t=P.useRef(null);return Jj(()=>{t.current=e},[e]),P.useCallback((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const Yg=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},nc=e=>e&&"window"in e&&e.window===e?e:Yg(e).defaultView||window;function Axe(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 Dxe(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 Zj(e){let t=null;return()=>(t==null&&(t=e()),t)}const Ixe=Zj(function(){return Dxe(/^Mac/i)}),kxe=Zj(function(){return Axe(/Android/i)});function Nxe(e){return e.mozInputSource===0&&e.isTrusted?!0:kxe()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}class Lxe{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 e9(e){let t=P.useRef({isFocused:!1,observer:null});Jj(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=Mxe(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 Lxe("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 Fxe(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=e9(o),a=P.useCallback(l=>{const c=Yg(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 Kg=null,NC=new Set,np=new Map,Hc=!1,LC=!1;const jxe={Tab:!0,Escape:!0};function H2(e,t){for(let n of NC)n(e,t)}function $xe(e){return!(e.metaKey||!Ixe()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function R0(e){Hc=!0,$xe(e)&&(Kg="keyboard",H2("keyboard",e))}function uo(e){Kg="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(Hc=!0,H2("pointer",e))}function t9(e){Nxe(e)&&(Hc=!0,Kg="virtual")}function n9(e){e.target===window||e.target===document||(!Hc&&!LC&&(Kg="virtual",H2("virtual",e)),Hc=!1,LC=!1)}function r9(){Hc=!1,LC=!0}function FC(e){if(typeof window>"u"||np.get(nc(e)))return;const t=nc(e),n=Yg(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){Hc=!0,r.apply(this,arguments)},n.addEventListener("keydown",R0,!0),n.addEventListener("keyup",R0,!0),n.addEventListener("click",t9,!0),t.addEventListener("focus",n9,!0),t.addEventListener("blur",r9,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",uo,!0),n.addEventListener("pointermove",uo,!0),n.addEventListener("pointerup",uo,!0)):(n.addEventListener("mousedown",uo,!0),n.addEventListener("mousemove",uo,!0),n.addEventListener("mouseup",uo,!0)),t.addEventListener("beforeunload",()=>{i9(e)},{once:!0}),np.set(t,{focus:r})}const i9=(e,t)=>{const n=nc(e),r=Yg(e);t&&r.removeEventListener("DOMContentLoaded",t),np.has(n)&&(n.HTMLElement.prototype.focus=np.get(n).focus,r.removeEventListener("keydown",R0,!0),r.removeEventListener("keyup",R0,!0),r.removeEventListener("click",t9,!0),n.removeEventListener("focus",n9,!0),n.removeEventListener("blur",r9,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",uo,!0),r.removeEventListener("pointermove",uo,!0),r.removeEventListener("pointerup",uo,!0)):(r.removeEventListener("mousedown",uo,!0),r.removeEventListener("mousemove",uo,!0),r.removeEventListener("mouseup",uo,!0)),np.delete(n))};function zxe(e){const t=Yg(e);let n;return t.readyState!=="loading"?FC(e):(n=()=>{FC(e)},t.addEventListener("DOMContentLoaded",n)),()=>i9(e,n)}typeof document<"u"&&zxe();function o9(){return Kg!=="pointer"}const Bxe=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Hxe(e,t,n){var r;const i=typeof window<"u"?nc(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,o=typeof window<"u"?nc(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,s=typeof window<"u"?nc(n==null?void 0:n.target).HTMLElement:HTMLElement,a=typeof window<"u"?nc(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||(n==null?void 0:n.target)instanceof i&&!Bxe.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&&!jxe[n.key])}function Vxe(e,t,n){FC(),P.useEffect(()=>{let r=(i,o)=>{Hxe(!!(n!=null&&n.isTextInput),i,o)&&e(o9())};return NC.add(r),()=>{NC.delete(r)}},t)}function Wxe(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=e9(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 P0=!1,rS=0;function jC(){P0=!0,setTimeout(()=>{P0=!1},50)}function Lk(e){e.pointerType==="touch"&&jC()}function Uxe(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",Lk):document.addEventListener("touchend",jC),rS++,()=>{rS--,!(rS>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",Lk):document.removeEventListener("touchend",jC))}}function s9(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(Uxe,[]);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=>{P0&&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&&!P0&&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 a9(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,i=P.useRef({isFocused:!1,isFocusVisible:t||o9()}),[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]);Vxe(h=>{i.current.isFocusVisible=h,c()},[],{isTextInput:n});let{focusProps:d}=Fxe({isDisabled:r,onFocusChange:u}),{focusWithinProps:p}=Wxe({isDisabled:!r,onFocusWithinChange:u});return{isFocused:o,isFocusVisible:a,focusProps:r?p:d}}var Gxe=Object.defineProperty,qxe=(e,t,n)=>t in e?Gxe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,iS=(e,t,n)=>(qxe(e,typeof t!="symbol"?t+"":t,n),n);let Yxe=class{constructor(){iS(this,"current",this.detect()),iS(this,"handoffState","pending"),iS(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"}},Pc=new Yxe;function Xg(e){return Pc.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}function l9(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function ws(){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 l9(()=>{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=ws();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 Sf(){let[e]=P.useState(ws);return P.useEffect(()=>()=>e.dispose(),[e]),e}let on=(e,t)=>{Pc.isServer?P.useEffect(e,t):P.useLayoutEffect(e,t)};function wl(e){let t=P.useRef(e);return on(()=>{t.current=e},[e]),t}let Ye=function(e){let t=wl(e);return P.useCallback((...n)=>t.current(...n),[t])};function Kxe(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 Xxe(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function Qxe({disabled:e=!1}={}){let t=P.useRef(null),[n,r]=P.useState(!1),i=Sf(),o=Ye(()=>{t.current=null,r(!1),i.dispose()}),s=Ye(a=>{if(i.dispose(),t.current===null){t.current=a.currentTarget,r(!0);{let l=Xg(a.currentTarget);i.addEventListener(l,"pointerup",o,!1),i.addEventListener(l,"pointermove",c=>{if(t.current){let u=Kxe(c);r(Xxe(u,t.current.getBoundingClientRect()))}},!1),i.addEventListener(l,"pointercancel",o,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:s,onPointerUp:o,onClick:o}}}let Jxe=P.createContext(void 0);function V2(){return P.useContext(Jxe)}function $C(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function Fo(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,Fo),r}var T0=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(T0||{}),Xa=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Xa||{});function Xi(){let e=ewe();return P.useCallback(t=>Zxe({mergeRefs:e,...t}),[e])}function Zxe({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:i,visible:o=!0,name:s,mergeRefs:a}){a=a??twe;let l=c9(t,e);if(o)return Ub(l,n,r,s,a);let c=i??0;if(c&2){let{static:u=!1,...d}=l;if(u)return Ub(d,n,r,s,a)}if(c&1){let{unmount:u=!0,...d}=l;return Fo(u?0:1,{0(){return null},1(){return Ub({...d,hidden:!0,style:{display:"none"}},n,r,s,a)}})}return Ub(l,n,r,s,a)}function Ub(e,t={},n,r,i){let{as:o=n,children:s,refName:a="ref",...l}=oS(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(Na(l)).length>0||Object.keys(Na(d)).length>0))if(!P.isValidElement(u)||Array.isArray(u)&&u.length>1){if(Object.keys(Na(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(Na(l)).concat(Object.keys(Na(d))).map(p=>` - ${p}`).join(`
|
|
349
|
+
`),"","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(`
|
|
350
|
+
`)].join(`
|
|
351
|
+
`))}else{let p=u.props,h=p==null?void 0:p.className,m=typeof h=="function"?(...x)=>$C(h(...x),l.className):$C(h,l.className),b=m?{className:m}:{},v=c9(u.props,Na(oS(l,["ref"])));for(let x in d)x in v&&delete d[x];return P.cloneElement(u,Object.assign({},v,d,c,{ref:i(nwe(u),c.ref)},b))}return P.createElement(o,Object.assign({},oS(l,["ref"]),o!==P.Fragment&&c,o!==P.Fragment&&d),u)}function ewe(){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 twe(...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 c9(...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 W2(...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 Ri(e){var t;return Object.assign(P.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Na(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function oS(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function nwe(e){return P.version.split(".")[0]>="19"?e.props.ref:e.ref}function rwe(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,Ye(c=>(o||i(c),t==null?void 0:t(c)))]}function iwe(e){let[t]=P.useState(e);return t}function u9(e={},t=null,n=[]){for(let[r,i]of Object.entries(e))f9(n,d9(t,r),i);return n}function d9(e,t){return e?e+"["+t+"]":t}function f9(e,t,n){if(Array.isArray(n))for(let[r,i]of n.entries())f9(e,d9(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,""]):u9(n,t,e)}let owe="span";var U2=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(U2||{});function swe(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 Xi()({ourProps:o,theirProps:i,slot:{},defaultTag:owe,name:"Hidden"})}let h9=Ri(swe),awe=P.createContext(null);function lwe({children:e}){let t=P.useContext(awe);if(!t)return P.createElement(P.Fragment,null,e);let{target:n}=t;return n?kr.createPortal(P.createElement(P.Fragment,null,e),n):null}function cwe({data:e,form:t,disabled:n,onReset:r,overrides:i}){let[o,s]=P.useState(null),a=Sf();return P.useEffect(()=>{if(r&&o)return a.addEventListener(o,"reset",r)},[o,t,r]),P.createElement(lwe,null,P.createElement(uwe,{setForm:s,formId:t}),u9(e).map(([l,c])=>P.createElement(h9,{features:U2.Hidden,...Na({key:l,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:l,value:c,...i})})))}function uwe({setForm:e,formId:t}){return P.useEffect(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:P.createElement(h9,{features:U2.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let dwe=P.createContext(void 0);function p9(){return P.useContext(dwe)}function fwe(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&&hwe(n)?!1:r}function hwe(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}let g9=Symbol();function pwe(e,t=!0){return Object.assign(e,{[g9]:t})}function Ho(...e){let t=P.useRef(e);P.useEffect(()=>{t.current=e},[e]);let n=Ye(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[g9]))?void 0:n}let G2=P.createContext(null);G2.displayName="DescriptionContext";function m9(){let e=P.useContext(G2);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,m9),t}return e}function gwe(){var e,t;return(t=(e=P.useContext(G2))==null?void 0:e.value)!=null?t:void 0}let mwe="p";function bwe(e,t){let n=P.useId(),r=V2(),{id:i=`headlessui-description-${n}`,...o}=e,s=m9(),a=Ho(t);on(()=>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 Xi()({ourProps:u,theirProps:o,slot:c,defaultTag:mwe,name:s.name||"Description"})}let ywe=Ri(bwe);Object.assign(ywe,{});var Qr=(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))(Qr||{});let Jv=P.createContext(null);Jv.displayName="LabelContext";function b9(){let e=P.useContext(Jv);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,b9),t}return e}function Zv(e){var t,n,r;let i=(n=(t=P.useContext(Jv))==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 vwe({inherit:e=!1}={}){let t=Zv(),[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=Ye(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(Jv.Provider,{value:a},o.children)},[r])]}let xwe="label";function wwe(e,t){var n;let r=P.useId(),i=b9(),o=p9(),s=V2(),{id:a=`headlessui-label-${r}`,htmlFor:l=o??((n=i.props)==null?void 0:n.htmlFor),passive:c=!1,...u}=e,d=Ho(t);on(()=>i.register(a),[a,i.register]);let p=Ye(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 w=document.getElementById(x.htmlFor);if(w){let _=w.getAttribute("disabled");if(_==="true"||_==="")return;let R=w.getAttribute("aria-disabled");if(R==="true"||R==="")return;(w instanceof HTMLInputElement&&(w.type==="radio"||w.type==="checkbox")||w.role==="radio"||w.role==="checkbox"||w.role==="switch")&&w.click(),w.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),Xi()({ourProps:b,theirProps:u,slot:m,defaultTag:l?xwe:"div",name:i.name||"Label"})}let Swe=Ri(wwe),_we=Object.assign(Swe,{});function Mu(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,w)=>{for(x=String(x);x.length<w;)x=" "+x;return x};console.info(`%c⏱ ${v(m,5)} /${v(h,5)} ms`,`
|
|
352
|
+
font-size: .6rem;
|
|
353
|
+
font-weight: bold;
|
|
354
|
+
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 sS(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const Cwe=(e,t)=>Math.abs(e-t)<1,Ewe=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},Rwe=e=>e,Pwe=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},Twe=(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)}},Fk={passive:!0},Owe=typeof window>"u"?!0:"onscrollend"in window,Mwe=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let i=0;const o=e.options.useScrollendEvent&&Owe?()=>{}:Ewe(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,Fk),n.addEventListener("scrollend",l,Fk),()=>{n.removeEventListener("scroll",a),n.removeEventListener("scrollend",l)}},Awe=(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"])},Dwe=(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 Iwe{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:Rwe,rangeExtractor:Pwe,onChange:()=>{},measureElement:Awe,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=Mu(()=>(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=Mu(()=>[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=Mu(()=>[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=Mu(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()],(n,r,i)=>this.range=n.length>0&&r>0?kwe({measurements:n,outerSize:r,scrollOffset:i}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getIndexes=Mu(()=>[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=Mu(()=>[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 sS(r[y9(0,r.length-1,i=>sS(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]=sS(this.getOffsetForIndex(n,a));Cwe(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 y9=(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 kwe({measurements:e,outerSize:t,scrollOffset:n}){const r=e.length-1,o=y9(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 jk=typeof document<"u"?E.useLayoutEffect:E.useEffect;function Nwe(e){const t=E.useReducer(()=>({}),{})[1],n={...e,onChange:(i,o)=>{var s;o?kr.flushSync(t):t(),(s=e.onChange)==null||s.call(e,i,o)}},[r]=E.useState(()=>new Iwe(n));return r.setOptions(n),jk(()=>r._didMount(),[]),jk(()=>r._willUpdate()),r}function Lwe(e){return Nwe({observeElementRect:Twe,observeElementOffset:Mwe,scrollToFn:Dwe,...e})}function Fwe(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 jwe(e=Fwe){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 $we(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function $k(e,t=!1){let[n,r]=P.useReducer(()=>({}),{}),i=P.useMemo(()=>$we(e),[e,n]);return on(()=>{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 zwe=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 v9(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 x9(e){return P.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}let Bwe=new zwe(()=>v9(()=>[],{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 q2(e,t){let n=Bwe.get(t),r=P.useId(),i=x9(n);if(on(()=>{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 zC=new Map,rp=new Map;function zk(e){var t;let n=(t=rp.get(e))!=null?t:0;return rp.set(e,n+1),n!==0?()=>Bk(e):(zC.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>Bk(e))}function Bk(e){var t;let n=(t=rp.get(e))!=null?t:1;if(n===1?rp.delete(e):rp.set(e,n-1),n!==1)return;let r=zC.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,zC.delete(e))}function Hwe(e,{allowed:t,disallowed:n}={}){let r=q2(e,"inert-others");on(()=>{var i,o;if(!r)return;let s=ws();for(let l of(i=n==null?void 0:n())!=null?i:[])l&&s.add(zk(l));let a=(o=t==null?void 0:t())!=null?o:[];for(let l of a){if(!l)continue;let c=Xg(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(zk(d));u=u.parentElement}}return s.dispose},[r,t,n])}function Vwe(e,t,n){let r=wl(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=ws();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 BC=["[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 Wwe=(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))(Wwe||{}),Uwe=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Uwe||{}),Gwe=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Gwe||{}),w9=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(w9||{});function qwe(e,t=0){var n;return e===((n=Xg(e))==null?void 0:n.body)?!1:Fo(t,{0(){return e.matches(BC)},1(){let r=e;for(;r!==null;){if(r.matches(BC))return!0;r=r.parentElement}return!1}})}var Ywe=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Ywe||{});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 Kwe(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 S9(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Xwe(){return/Android/gi.test(window.navigator.userAgent)}function _9(){return S9()||Xwe()}function uh(e,t,n,r){let i=wl(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 Qwe(e,t,n,r){let i=wl(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 Hk=30;function Jwe(e,t,n){let r=q2(e,"outside-click"),i=wl(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!qwe(u,w9.Loose)&&u.tabIndex!==-1&&l.preventDefault(),i.current(l,u)},[i,t]),s=P.useRef(null);uh(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),uh(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),uh(r,"click",l=>{_9()||s.current&&(o(l,()=>s.current),s.current=null)},!0);let a=P.useRef({x:0,y:0});uh(r,"touchstart",l=>{a.current.x=l.touches[0].clientX,a.current.y=l.touches[0].clientY},!0),uh(r,"touchend",l=>{let c={x:l.changedTouches[0].clientX,y:l.changedTouches[0].clientY};if(!(Math.abs(c.x-a.current.x)>=Hk||Math.abs(c.y-a.current.y)>=Hk))return o(l,()=>l.target instanceof HTMLElement?l.target:null)},!0),Qwe(r,"blur",l=>o(l,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function ex(...e){return P.useMemo(()=>Xg(...e),[...e])}function Zwe(e,t,n,r){let i=wl(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 C9(e){let t=P.useRef({value:"",selectionStart:null,selectionEnd:null});return Zwe(e,"blur",n=>{let r=n.target;r instanceof HTMLInputElement&&(t.current={value:r.value,selectionStart:r.selectionStart,selectionEnd:r.selectionEnd})}),Ye(()=>{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 e1e(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 t1e(){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 n1e(){return S9()?{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=ws();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 r1e(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function i1e(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let rc=v9(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:ws(),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:i1e(n)},i=[n1e(),t1e(),r1e()];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)}});rc.subscribe(()=>{let e=rc.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)&&rc.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&rc.dispatch("TEARDOWN",n)}});function o1e(e,t,n=()=>({containers:[]})){let r=x9(rc),i=t?r.get(t):void 0,o=i?i.count>0:!1;return on(()=>{if(!(!t||!e))return rc.dispatch("PUSH",t,n),()=>rc.dispatch("POP",t,n)},[e,t]),o}function s1e(e,t,n=()=>[document.body]){let r=q2(e,"scroll-lock");o1e(r,t,i=>{var o;return{containers:[...(o=i.containers)!=null?o:[],n]}})}function Vk(e){return[e.screenX,e.screenY]}function a1e(){let e=P.useRef([-1,-1]);return{wasMoved(t){let n=Vk(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=Vk(t)}}}function l1e(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 Wk,Uk;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((Wk=process==null?void 0:process.env)==null?void 0:Wk.NODE_ENV)==="test"&&typeof((Uk=Element==null?void 0:Element.prototype)==null?void 0:Uk.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(`
|
|
355
|
+
`)),[]});var c1e=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(c1e||{});function E9(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function R9(e,t,n,r){let[i,o]=P.useState(n),{hasFlag:s,addFlag:a,removeFlag:l}=l1e(e&&i?3:0),c=P.useRef(!1),u=P.useRef(!1),d=Sf();return on(()=>{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),u1e(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 u1e(e,{prepare:t,run:n,done:r,inFlight:i}){let o=ws();return f1e(e,{prepare:t,inFlight:i}),o.nextFrame(()=>{n(),o.requestAnimationFrame(()=>{o.add(d1e(e,r))})}),o.dispose}function d1e(e,t){var n,r;let i=ws();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 f1e(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 h1e(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]),on(()=>{if(!t||!e)return;let s=Xg(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 Gk(e,t){let n=P.useRef([]),r=Ye(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 p1e(){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 P9={...E},g1e=P9.useInsertionEffect,m1e=g1e||(e=>e());function T9(e){const t=E.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return m1e(()=>{t.current=e}),E.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 HC=typeof document<"u"?P.useLayoutEffect:P.useEffect;let qk=!1,b1e=0;const Yk=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+b1e++;function y1e(){const[e,t]=E.useState(()=>qk?Yk():void 0);return HC(()=>{e==null&&t(Yk())},[]),E.useEffect(()=>{qk=!0},[]),e}const v1e=P9.useId,x1e=v1e||y1e;let Dp;process.env.NODE_ENV!=="production"&&(Dp=new Set);function w1e(){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=Dp)!=null&&e.has(i))){var o;(o=Dp)==null||o.add(i),console.warn(i)}}function S1e(){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=Dp)!=null&&e.has(i))){var o;(o=Dp)==null||o.add(i),console.error(i)}}function _1e(){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 C1e=E.createContext(null),E1e=E.createContext(null),R1e=()=>{var e;return((e=E.useContext(C1e))==null?void 0:e.id)||null},P1e=()=>E.useContext(E1e),T1e="data-floating-ui-focusable";function O1e(e){const{open:t=!1,onOpenChange:n,elements:r}=e,i=x1e(),o=E.useRef({}),[s]=E.useState(()=>_1e()),a=R1e()!=null;if(process.env.NODE_ENV!=="production"){const h=r.reference;h&&!Fr(h)&&S1e("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]=E.useState(r.reference),u=T9((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=E.useMemo(()=>({setPositionReference:c}),[]),p=E.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return E.useMemo(()=>({dataRef:o,open:t,onOpenChange:u,elements:p,events:s,floatingId:i,refs:d}),[t,u,p,s,i,d])}function M1e(e){e===void 0&&(e={});const{nodeId:t}=e,n=O1e({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[o,s]=E.useState(null),[a,l]=E.useState(null),u=(i==null?void 0:i.domReference)||o,d=E.useRef(null),p=P1e();HC(()=>{u&&(d.current=u)},[u]);const h=Z6({...e,elements:{...i,...a&&{reference:a}}}),m=E.useCallback(_=>{const R=Fr(_)?{getBoundingClientRect:()=>_.getBoundingClientRect(),contextElement:_}:_;l(R),h.refs.setReference(R)},[h.refs]),b=E.useCallback(_=>{(Fr(_)||_===null)&&(d.current=_,s(_)),(Fr(h.refs.reference.current)||h.refs.reference.current===null||_!==null&&!Fr(_))&&h.refs.setReference(_)},[h.refs]),v=E.useMemo(()=>({...h.refs,setReference:b,setPositionReference:m,domReference:d}),[h.refs,b,m]),x=E.useMemo(()=>({...h.elements,domReference:u}),[h.elements,u]),w=E.useMemo(()=>({...h,...r,refs:v,elements:x,nodeId:t}),[h,v,x,t,r]);return HC(()=>{r.dataRef.current.floatingContext=w;const _=p==null?void 0:p.nodesRef.current.find(R=>R.id===t);_&&(_.context=w)}),E.useMemo(()=>({...h,context:w,refs:v,elements:x}),[h,v,x,w])}const Kk="active",Xk="selected";function aS(e,t,n){const r=new Map,i=n==="item";let o=e;if(i&&e){const{[Kk]:s,[Xk]:a,...l}=e;o=l}return{...n==="floating"&&{tabIndex:-1,[T1e]:""},...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&&[Kk,Xk].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 A1e(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=E.useCallback(a=>aS(a,e,"reference"),t),o=E.useCallback(a=>aS(a,e,"floating"),n),s=E.useCallback(a=>aS(a,e,"item"),r);return E.useMemo(()=>({getReferenceProps:i,getFloatingProps:o,getItemProps:s}),[i,o,s])}function Qk(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const D1e=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}=ys(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,w=p===m;if(process.env.NODE_ENV!=="production"&&(t.placement.startsWith("bottom")||w1e('`placement` side must be "bottom" when using the `inner`',"middleware.")),!h)return{};const _={...t,...await o2(-h.offsetTop-p.clientTop-d.reference.height/2-h.offsetHeight/2-o).fn(t)},R=await P1(Qk(_,m.scrollHeight+b+p.clientTop),u),C=await P1(_,{...u,elementContext:"reference"}),T=Ir(0,R.top),M=_.y+T,L=(m.scrollHeight>m.clientHeight?j=>j:Tp)(Ir(0,m.scrollHeight+(v&&w||x?b*2:0)-T-Ir(0,R.bottom)));if(m.style.maxHeight=L+"px",m.scrollTop=T,i){const j=m.offsetHeight<h.offsetHeight*da(a,n.current.length)-1||C.top>=-l||C.bottom>=-l;Mc.flushSync(()=>i(j))}return r&&(r.current=await P1(Qk({..._,y:M},m.offsetHeight+b+p.clientTop),u)),{y:M}}});function I1e(e,t){const{open:n,elements:r}=e,{enabled:i=!0,overflowRef:o,scrollRef:s,onChange:a}=t,l=T9(a),c=E.useRef(!1),u=E.useRef(null),d=E.useRef(null);E.useEffect(()=>{if(!i)return;function h(b){if(b.ctrlKey||!m||o.current==null)return;const v=b.deltaY,x=o.current.top>=-.5,w=o.current.bottom>=-.5,_=m.scrollHeight-m.clientHeight,R=v<0?-1:1,C=v<0?"max":"min";m.scrollHeight<=m.clientHeight||(!x&&v>0||!w&&v<0?(b.preventDefault(),Mc.flushSync(()=>{l(T=>T+Math[C](v,_*R))})):/firefox/i.test(p1e())&&(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=E.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)&&Mc.flushSync(()=>l(b=>b+m))}requestAnimationFrame(()=>{u.current=h.scrollTop})}}}),[r.floating,l,o,s]);return E.useMemo(()=>i?{floating:p}:{},[i,p])}let Qg=P.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});Qg.displayName="FloatingContext";let Y2=P.createContext(null);Y2.displayName="PlacementContext";function k1e(e){return P.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function N1e(){return P.useContext(Qg).setReference}function L1e(){let{getFloatingProps:e,slot:t}=P.useContext(Qg);return P.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function F1e(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=P.useContext(Y2),n=P.useMemo(()=>e,[JSON.stringify(e,(i,o)=>{var s;return(s=o==null?void 0:o.outerHTML)!=null?s:o})]);on(()=>{t==null||t(n??null)},[t,n]);let r=P.useContext(Qg);return P.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let Jk=4;function j1e({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);$1e(a);let c=t&&n!==null&&a!==null,{to:u="bottom",gap:d=0,offset:p=0,padding:h=0,inner:m}=z1e(n,a),[b,v="center"]=u.split(" ");on(()=>{c&&o(0)},[c]);let{refs:x,floatingStyles:w,context:_}=M1e({open:c,placement:b==="selection"?v==="center"?"bottom":`bottom-${v}`:v==="center"?`${b}`:`${b}-${v}`,strategy:"absolute",transform:!1,middleware:[o2({mainAxis:b==="selection"?0:d,crossAxis:p}),e8({padding:h}),b!=="selection"&&t8({padding:h}),b==="selection"&&m?D1e({...m,padding:h,overflowRef:s,offset:i,minItemsVisible:Jk,referenceOverflowThreshold:h,onFallbackChange(j){var $,X;if(!j)return;let H=_.elements.floating;if(!H)return;let F=parseFloat(getComputedStyle(H).scrollPaddingBottom)||0,G=Math.min(Jk,H.childElementCount),B=0,W=0;for(let K of(X=($=_.elements.floating)==null?void 0:$.childNodes)!=null?X:[])if(K instanceof HTMLElement){let D=K.offsetTop,Y=D+K.clientHeight+F,U=H.scrollTop,A=U+H.clientHeight;if(D>=U&&Y<=A)G--;else{W=Math.max(0,Math.min(Y,A)-Math.max(D,U)),B=K.clientHeight;break}}G>=1&&o(K=>{let D=B*G-W+F;return K>=D?K:D})}}):null,n8({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:Q6}),[R=b,C=v]=_.placement.split("-");b==="selection"&&(R="selection");let T=P.useMemo(()=>({anchor:[R,C].filter(Boolean).join(" ")}),[R,C]),M=I1e(_,{overflowRef:s,onChange:o}),{getReferenceProps:I,getFloatingProps:k}=A1e([M]),L=Ye(j=>{l(j),x.setFloating(j)});return E.createElement(Y2.Provider,{value:r},E.createElement(Qg.Provider,{value:{setFloating:L,setReference:x.setReference,styles:w,getReferenceProps:I,getFloatingProps:k,slot:T}},e))}function $1e(e){on(()=>{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 z1e(e,t){var n,r,i;let o=lS((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),s=lS((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),a=lS((i=e==null?void 0:e.padding)!=null?i:"var(--anchor-padding, 0)",t);return{...e,gap:o,offset:s,padding:a}}function lS(e,t,n=void 0){let r=Sf(),i=Ye((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=Zk(l,c);return[u,d=>{let p=O9(l);{let h=p.map(m=>window.getComputedStyle(c).getPropertyValue(m));r.requestAnimationFrame(function m(){r.nextFrame(m);let b=!1;for(let[x,w]of p.entries()){let _=window.getComputedStyle(c).getPropertyValue(w);if(h[x]!==_){h[x]=_,b=!0;break}}if(!b)return;let v=Zk(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 on(()=>{let[l,c]=i(e,t);if(a(l),!!c)return c(a)},[e,t]),s}function O9(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,...O9(i)]:[r]}return[]}function Zk(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 B1e({children:e,freeze:t}){let n=VC(t,e);return P.createElement(P.Fragment,null,n)}function VC(e,t){let[n,r]=P.useState(t);return!e&&n!==t&&r(t),e?n:t}let K2=P.createContext(null);K2.displayName="OpenClosedContext";var No=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(No||{});function X2(){return P.useContext(K2)}function M9({value:e,children:t}){return P.createElement(K2.Provider,{value:e},t)}function H1e(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let Kl=[];H1e(()=>{function e(t){if(!(t.target instanceof HTMLElement)||t.target===document.body||Kl[0]===t.target)return;let n=t.target;n=n.closest(BC),Kl.unshift(n??t.target),Kl=Kl.filter(r=>r!=null&&r.isConnected),Kl.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 V1e(e){throw new Error("Unexpected object: "+e)}var Kn=(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))(Kn||{});function eN(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:V1e(e)}}var Q2=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(Q2||{});function W1e(e){let t=Ye(e),n=P.useRef(!1);P.useEffect(()=>(n.current=!1,()=>{n.current=!0,l9(()=>{n.current&&t()})}),[t])}function U1e(){let e=typeof document>"u";return"useSyncExternalStore"in E?(t=>t.useSyncExternalStore)(E)(()=>()=>{},()=>!1,()=>!e):!1}function J2(){let e=U1e(),[t,n]=E.useState(Pc.isHandoffComplete);return t&&Pc.isHandoffComplete===!1&&n(!1),E.useEffect(()=>{t!==!0&&n(!0)},[t]),E.useEffect(()=>Pc.handoff(),[]),e?!1:t}let G1e=P.createContext(!1);function q1e(){return P.useContext(G1e)}function Y1e(e){let t=q1e(),n=P.useContext(D9),r=ex(e),[i,o]=P.useState(()=>{var s;if(!t&&n!==null)return(s=n.current)!=null?s:null;if(Pc.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 A9=P.Fragment,K1e=Ri(function(e,t){let n=e,r=P.useRef(null),i=Ho(pwe(d=>{r.current=d}),t),o=ex(r),s=Y1e(r),[a]=P.useState(()=>{var d;return Pc.isServer?null:(d=o==null?void 0:o.createElement("div"))!=null?d:null}),l=P.useContext(Z1e),c=J2();on(()=>{!s||!a||s.contains(a)||(a.setAttribute("data-headlessui-portal",""),s.appendChild(a))},[s,a]),on(()=>{if(a&&l)return l.register(a)},[l,a]),W1e(()=>{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=Xi();return c?!s||!a?null:kr.createPortal(u({ourProps:{ref:i},theirProps:n,slot:{},defaultTag:A9,name:"Portal"}),a):null});function X1e(e,t){let n=Ho(t),{enabled:r=!0,...i}=e,o=Xi();return r?P.createElement(K1e,{...i,ref:n}):o({ourProps:{ref:n},theirProps:i,slot:{},defaultTag:A9,name:"Portal"})}let Q1e=P.Fragment,D9=P.createContext(null);function J1e(e,t){let{target:n,...r}=e,i={ref:Ho(t)},o=Xi();return P.createElement(D9.Provider,{value:n},o({ourProps:i,theirProps:r,defaultTag:Q1e,name:"Popover.Group"}))}let Z1e=P.createContext(null),eSe=Ri(X1e),tSe=Ri(J1e),nSe=Object.assign(eSe,{Group:tSe});var rSe=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(rSe||{}),iSe=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(iSe||{}),oSe=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(oSe||{}),sSe=(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))(sSe||{});function cS(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):Kwe(r,s=>s.dataRef.current.domRef.current),o=n?i.indexOf(n):null;return o===-1&&(o=null),{options:i,activeOptionIndex:o}}let aSe={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===Kn.Specific?t.idx:eN(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=cS(e);if(s.activeOptionIndex===null){let c=s.options.findIndex(u=>!u.dataRef.current.disabled);c!==-1&&(s.activeOptionIndex=c)}let a=t.focus===Kn.Specific?t.idx:eN(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=cS(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=cS(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}},Z2=P.createContext(null);Z2.displayName="ComboboxActionsContext";function Jg(e){let t=P.useContext(Z2);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Jg),n}return t}let I9=P.createContext(null);function lSe(e){let t=_f("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=Lwe({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);on(()=>{a(c=>c+1)},[n]);let l=o.getVirtualItems();return l.length===0?null:P.createElement(I9.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 Ip=P.createContext(null);Ip.displayName="ComboboxDataContext";function _f(e){let t=P.useContext(Ip);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,_f),n}return t}function cSe(e,t){return Fo(t.type,aSe,e,t)}let uSe=P.Fragment;function dSe(e,t){var n,r;let i=V2(),{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,...w}=e,_=iwe(s),[R=m?[]:void 0,C]=rwe(o,a,_),[T,M]=P.useReducer(cSe,{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}),I=P.useRef(!1),k=P.useRef({static:!1,hold:!1}),L=jwe(u),j=Ye(de=>v?u===null?v.options.indexOf(de):v.options.findIndex(Ee=>L(Ee,de)):T.options.findIndex(Ee=>L(Ee.dataRef.current.value,de))),$=P.useCallback(de=>Fo(H.mode,{1:()=>R.some(Ee=>L(Ee,de)),0:()=>L(R,de)}),[R]),X=Ye(de=>T.activeOptionIndex===j(de)),H=P.useMemo(()=>({...T,immediate:b,optionsPropsRef:k,value:R,defaultValue:_,disabled:d,mode:m?1:0,virtual:v?T.virtual:null,get activeOptionIndex(){if(I.current&&T.activeOptionIndex===null&&(v?v.options.length>0:T.options.length>0)){if(v){let Ee=v.options.findIndex(De=>{var ze,Oe;return!((Oe=(ze=v.disabled)==null?void 0:ze.call(v,De))!=null&&Oe)});if(Ee!==-1)return Ee}let de=T.options.findIndex(Ee=>!Ee.dataRef.current.disabled);if(de!==-1)return de}return T.activeOptionIndex},calculateIndex:j,compare:L,isSelected:$,isActive:X}),[R,_,d,m,h,T,v]);on(()=>{var de;v&&M({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]),on(()=>{T.dataRef.current=H},[H]);let F=H.comboboxState===0;Jwe(F,[H.buttonElement,H.inputElement,H.optionsElement],()=>ee.closeCombobox());let G=P.useMemo(()=>{var de,Ee,De;return{open:H.comboboxState===0,disabled:d,activeIndex:H.activeOptionIndex,activeOption:H.activeOptionIndex===null?null:H.virtual?H.virtual.options[(de=H.activeOptionIndex)!=null?de:0]:(De=(Ee=H.options[H.activeOptionIndex])==null?void 0:Ee.dataRef.current.value)!=null?De:null,value:R}},[H,d,R]),B=Ye(()=>{if(H.activeOptionIndex!==null){if(ee.setIsTyping(!1),H.virtual)A(H.virtual.options[H.activeOptionIndex]);else{let{dataRef:de}=H.options[H.activeOptionIndex];A(de.current.value)}ee.goToOption(Kn.Specific,H.activeOptionIndex)}}),W=Ye(()=>{M({type:0}),I.current=!0}),K=Ye(()=>{M({type:1}),I.current=!1,p==null||p()}),D=Ye(de=>{M({type:3,isTyping:de})}),Y=Ye((de,Ee,De)=>(I.current=!1,de===Kn.Specific?M({type:2,focus:Kn.Specific,idx:Ee,trigger:De}):M({type:2,focus:de,trigger:De}))),U=Ye((de,Ee)=>(M({type:4,payload:{id:de,dataRef:Ee}}),()=>{H.isActive(Ee.current.value)&&(I.current=!0),M({type:5,id:de})})),A=Ye(de=>Fo(H.mode,{0(){return C==null?void 0:C(de)},1(){let Ee=H.value.slice(),De=Ee.findIndex(ze=>L(ze,de));return De===-1?Ee.push(de):Ee.splice(De,1),C==null?void 0:C(Ee)}})),te=Ye(de=>{M({type:6,trigger:de})}),q=Ye(de=>{M({type:8,element:de})}),se=Ye(de=>{M({type:9,element:de})}),J=Ye(de=>{M({type:10,element:de})}),ee=P.useMemo(()=>({onChange:A,registerOption:U,goToOption:Y,setIsTyping:D,closeCombobox:K,openCombobox:W,setActivationTrigger:te,selectActiveOption:B,setInputElement:q,setButtonElement:se,setOptionsElement:J}),[]),[ae,ce]=vwe(),ge=t===null?{}:{ref:t},oe=P.useCallback(()=>{if(_!==void 0)return C==null?void 0:C(_)},[C,_]),pe=Xi();return P.createElement(ce,{value:ae,props:{htmlFor:(r=H.inputElement)==null?void 0:r.id},slot:{open:H.comboboxState===0,disabled:d}},P.createElement(j1e,null,P.createElement(Z2.Provider,{value:ee},P.createElement(Ip.Provider,{value:H},P.createElement(M9,{value:Fo(H.comboboxState,{0:No.Open,1:No.Closed})},c!=null&&P.createElement(cwe,{disabled:d,data:R!=null?{[c]:R}:{},form:l,onReset:oe}),pe({ourProps:ge,theirProps:w,slot:G,defaultTag:uSe,name:"Combobox"}))))))}let fSe="input";function hSe(e,t){var n,r,i,o,s;let a=_f("Combobox.Input"),l=Jg("Combobox.Input"),c=P.useId(),u=p9(),{id:d=u||`headlessui-combobox-input-${c}`,onChange:p,displayValue:h,disabled:m=a.disabled||!1,autoFocus:b=!1,type:v="text",...x}=e,w=P.useRef(null),_=Ho(w,t,N1e(),l.setInputElement),R=ex(a.inputElement),C=Sf(),T=Ye(()=>{l.onChange(null),a.optionsElement&&(a.optionsElement.scrollTop=0),l.goToOption(Kn.Nothing)}),M=P.useMemo(()=>{var A;return typeof h=="function"&&a.value!==void 0?(A=h(a.value))!=null?A:"":typeof a.value=="string"?a.value:""},[a.value,h]);Gk(([A,te],[q,se])=>{if(a.isTyping)return;let J=w.current;J&&((se===0&&te===1||A!==q)&&(J.value=A),requestAnimationFrame(()=>{if(a.isTyping||!J||(R==null?void 0:R.activeElement)!==J)return;let{selectionStart:ee,selectionEnd:ae}=J;Math.abs((ae??0)-(ee??0))===0&&ee===0&&J.setSelectionRange(J.value.length,J.value.length)}))},[M,a.comboboxState,R,a.isTyping]),Gk(([A],[te])=>{if(A===0&&te===1){if(a.isTyping)return;let q=w.current;if(!q)return;let se=q.value,{selectionStart:J,selectionEnd:ee,selectionDirection:ae}=q;q.value="",q.value=se,ae!==null?q.setSelectionRange(J,ee,ae):q.setSelectionRange(J,ee)}},[a.comboboxState]);let I=P.useRef(!1),k=Ye(()=>{I.current=!0}),L=Ye(()=>{C.nextFrame(()=>{I.current=!1})}),j=Ye(A=>{switch(l.setIsTyping(!0),A.key){case Qr.Enter:if(a.comboboxState!==0||I.current)return;if(A.preventDefault(),A.stopPropagation(),a.activeOptionIndex===null){l.closeCombobox();return}l.selectActiveOption(),a.mode===0&&l.closeCombobox();break;case Qr.ArrowDown:return A.preventDefault(),A.stopPropagation(),Fo(a.comboboxState,{0:()=>l.goToOption(Kn.Next),1:()=>l.openCombobox()});case Qr.ArrowUp:return A.preventDefault(),A.stopPropagation(),Fo(a.comboboxState,{0:()=>l.goToOption(Kn.Previous),1:()=>{kr.flushSync(()=>l.openCombobox()),a.value||l.goToOption(Kn.Last)}});case Qr.Home:if(A.shiftKey)break;return A.preventDefault(),A.stopPropagation(),l.goToOption(Kn.First);case Qr.PageUp:return A.preventDefault(),A.stopPropagation(),l.goToOption(Kn.First);case Qr.End:if(A.shiftKey)break;return A.preventDefault(),A.stopPropagation(),l.goToOption(Kn.Last);case Qr.PageDown:return A.preventDefault(),A.stopPropagation(),l.goToOption(Kn.Last);case Qr.Escape:return a.comboboxState!==0?void 0:(A.preventDefault(),a.optionsElement&&!a.optionsPropsRef.current.static&&A.stopPropagation(),a.mode===0&&a.value===null&&T(),l.closeCombobox());case Qr.Tab:if(a.comboboxState!==0)return;a.mode===0&&a.activationTrigger!==1&&l.selectActiveOption(),l.closeCombobox();break}}),$=Ye(A=>{p==null||p(A),a.mode===0&&A.target.value===""&&T(),l.openCombobox()}),X=Ye(A=>{var te,q,se;let J=(te=A.relatedTarget)!=null?te:Kl.find(ee=>ee!==A.currentTarget);if(!((q=a.optionsElement)!=null&&q.contains(J))&&!((se=a.buttonElement)!=null&&se.contains(J))&&a.comboboxState===0)return A.preventDefault(),a.mode===0&&a.value===null&&T(),l.closeCombobox()}),H=Ye(A=>{var te,q,se;let J=(te=A.relatedTarget)!=null?te:Kl.find(ee=>ee!==A.currentTarget);(q=a.buttonElement)!=null&&q.contains(J)||(se=a.optionsElement)!=null&&se.contains(J)||a.disabled||a.immediate&&a.comboboxState!==0&&C.microTask(()=>{kr.flushSync(()=>l.openCombobox()),l.setActivationTrigger(1)})}),F=Zv(),G=gwe(),{isFocused:B,focusProps:W}=a9({autoFocus:b}),{isHovered:K,hoverProps:D}=s9({isDisabled:m}),Y=P.useMemo(()=>({open:a.comboboxState===0,disabled:m,hover:K,focus:B,autofocus:b}),[a,K,B,b,m]),U=W2({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(A=>!A.dataRef.current.disabled&&a.compare(A.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":F,"aria-describedby":G,"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:k,onCompositionEnd:L,onKeyDown:j,onChange:$,onFocus:H,onBlur:X},W,D);return Xi()({ourProps:U,theirProps:x,slot:Y,defaultTag:fSe,name:"Combobox.Input"})}let pSe="button";function gSe(e,t){var n;let r=_f("Combobox.Button"),i=Jg("Combobox.Button"),o=Ho(t,i.setButtonElement),s=P.useId(),{id:a=`headlessui-combobox-button-${s}`,disabled:l=r.disabled||!1,autoFocus:c=!1,...u}=e,d=C9(r.inputElement),p=Ye(M=>{switch(M.key){case Qr.Space:case Qr.Enter:M.preventDefault(),M.stopPropagation(),r.comboboxState===1&&kr.flushSync(()=>i.openCombobox()),d();return;case Qr.ArrowDown:M.preventDefault(),M.stopPropagation(),r.comboboxState===1&&(kr.flushSync(()=>i.openCombobox()),r.value||i.goToOption(Kn.First)),d();return;case Qr.ArrowUp:M.preventDefault(),M.stopPropagation(),r.comboboxState===1&&(kr.flushSync(()=>i.openCombobox()),r.value||i.goToOption(Kn.Last)),d();return;case Qr.Escape:if(r.comboboxState!==0)return;M.preventDefault(),r.optionsElement&&!r.optionsPropsRef.current.static&&M.stopPropagation(),kr.flushSync(()=>i.closeCombobox()),d();return;default:return}}),h=Ye(M=>{M.preventDefault(),!fwe(M.currentTarget)&&(M.button===Q2.Left&&(r.comboboxState===0?i.closeCombobox():i.openCombobox()),d())}),m=Zv([a]),{isFocusVisible:b,focusProps:v}=a9({autoFocus:c}),{isHovered:x,hoverProps:w}=s9({isDisabled:l}),{pressed:_,pressProps:R}=Qxe({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]),T=W2({ref:o,id:a,type:e1e(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,w,R);return Xi()({ourProps:T,theirProps:u,slot:C,defaultTag:pSe,name:"Combobox.Button"})}let mSe="div",bSe=T0.RenderStrategy|T0.Static;function ySe(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=_f("Combobox.Options"),m=Jg("Combobox.Options"),b=k1e(l);b&&(c=!0);let[v,x]=F1e(b),[w,_]=P.useState(null),R=L1e(),C=Ho(t,b?v:null,m.setOptionsElement,_),T=ex(h.optionsElement),M=X2(),[I,k]=R9(d,w,M!==null?(M&No.Open)===No.Open:h.comboboxState===0);Vwe(I,h.inputElement,m.closeCombobox);let L=h.__demoMode?!1:u&&h.comboboxState===0;s1e(L,T);let j=h.__demoMode?!1:u&&h.comboboxState===0;Hwe(j,{allowed:P.useCallback(()=>[h.inputElement,h.buttonElement,h.optionsElement],[h.inputElement,h.buttonElement,h.optionsElement])}),on(()=>{var U;h.optionsPropsRef.current.static=(U=e.static)!=null?U:!1},[h.optionsPropsRef,e.static]),on(()=>{h.optionsPropsRef.current.hold=a},[h.optionsPropsRef,a]),h1e(h.comboboxState===0,{container:h.optionsElement,accept(U){return U.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:U.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(U){U.setAttribute("role","none")}});let $=Zv([(n=h.buttonElement)==null?void 0:n.id]),X=P.useMemo(()=>({open:h.comboboxState===0,option:void 0}),[h.comboboxState]),H=Ye(()=>{m.setActivationTrigger(0)}),F=Ye(U=>{U.preventDefault(),m.setActivationTrigger(0)}),G=W2(b?R():{},{"aria-labelledby":$,role:"listbox","aria-multiselectable":h.mode===1?!0:void 0,id:s,ref:C,style:{...p.style,...x,"--input-width":$k(h.inputElement,!0).width,"--button-width":$k(h.buttonElement,!0).width},onWheel:h.activationTrigger===0?void 0:H,onMouseDown:F,...E9(k)}),B=I&&h.comboboxState===1,W=VC(B,(r=h.virtual)==null?void 0:r.options),K=VC(B,h.value),D=Ye(U=>h.compare(K,U));if(h.virtual){if(W===void 0)throw new Error("Missing `options` in virtual mode");Object.assign(p,{children:P.createElement(Ip.Provider,{value:W!==h.virtual.options?{...h,virtual:{...h.virtual,options:W}}:h},P.createElement(lSe,{slot:X},p.children))})}let Y=Xi();return P.createElement(nSe,{enabled:c?e.static||I:!1},P.createElement(Ip.Provider,{value:h.mode===1?h:{...h,isSelected:D}},Y({ourProps:G,theirProps:{...p,children:P.createElement(B1e,{freeze:B},typeof p.children=="function"?(i=p.children)==null?void 0:i.call(p,X):p.children)},slot:X,defaultTag:mSe,features:bSe,visible:I,name:"Combobox.Options"})))}let vSe="div";function xSe(e,t){var n,r,i,o;let s=_f("Combobox.Option"),a=Jg("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=C9(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),w=wl({disabled:d,value:u,domRef:x,order:p}),_=P.useContext(I9),R=Ho(t,x,_?_.measureElement:null),C=Ye(()=>{a.setIsTyping(!1),a.onChange(u)});on(()=>a.registerOption(c,w),[w,c]);let T=P.useRef(!(s.virtual||s.__demoMode));on(()=>{if(!s.virtual&&!s.__demoMode)return ws().requestAnimationFrame(()=>{T.current=!0})},[s.virtual,s.__demoMode]),on(()=>{if(T.current&&s.comboboxState===0&&b&&s.activationTrigger!==0)return ws().requestAnimationFrame(()=>{var F,G;(G=(F=x.current)==null?void 0:F.scrollIntoView)==null||G.call(F,{block:"nearest"})})},[x,b,s.comboboxState,s.activationTrigger,s.activeOptionIndex]);let M=Ye(F=>{F.preventDefault(),F.button===Q2.Left&&(d||(C(),_9()||requestAnimationFrame(()=>m()),s.mode===0&&a.closeCombobox()))}),I=Ye(()=>{if(d)return a.goToOption(Kn.Nothing);let F=s.calculateIndex(u);a.goToOption(Kn.Specific,F)}),k=a1e(),L=Ye(F=>k.update(F)),j=Ye(F=>{if(!k.wasMoved(F)||d||b)return;let G=s.calculateIndex(u);a.goToOption(Kn.Specific,G,0)}),$=Ye(F=>{k.wasMoved(F)&&(d||b&&(s.optionsPropsRef.current.hold||a.goToOption(Kn.Nothing)))}),X=P.useMemo(()=>({active:b,focus:b,selected:v,disabled:d}),[b,v,d]),H={id:c,ref:R,role:"option",tabIndex:d===!0?void 0:-1,"aria-disabled":d===!0?!0:void 0,"aria-selected":v,disabled:void 0,onMouseDown:M,onFocus:I,onPointerEnter:L,onMouseEnter:L,onPointerMove:j,onMouseMove:j,onPointerLeave:$,onMouseLeave:$};return Xi()({ourProps:H,theirProps:h,slot:X,defaultTag:vSe,name:"Combobox.Option"})}let wSe=Ri(dSe),k9=Ri(gSe),N9=Ri(hSe),SSe=_we,L9=Ri(ySe),F9=Ri(xSe),_Se=Object.assign(wSe,{Input:N9,Button:k9,Label:SSe,Options:L9,Option:F9});function CSe(){let e=P.useRef(!1);return on(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function j9(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||((t=e.as)!=null?t:z9)!==P.Fragment||P.Children.count(e.children)===1}let tx=P.createContext(null);tx.displayName="TransitionContext";var ESe=(e=>(e.Visible="visible",e.Hidden="hidden",e))(ESe||{});function RSe(){let e=P.useContext(tx);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function PSe(){let e=P.useContext(nx);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let nx=P.createContext(null);nx.displayName="NestingContext";function rx(e){return"children"in e?rx(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function $9(e,t){let n=wl(e),r=P.useRef([]),i=CSe(),o=Sf(),s=Ye((h,m=Xa.Hidden)=>{let b=r.current.findIndex(({el:v})=>v===h);b!==-1&&(Fo(m,{[Xa.Unmount](){r.current.splice(b,1)},[Xa.Hidden](){r.current[b].state="hidden"}}),o.microTask(()=>{var v;!rx(r)&&i.current&&((v=n.current)==null||v.call(n))}))}),a=Ye(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,Xa.Unmount)}),l=P.useRef([]),c=P.useRef(Promise.resolve()),u=P.useRef({enter:[],leave:[]}),d=Ye((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,w])=>w)).then(()=>v())})]),m==="enter"?c.current=c.current.then(()=>t==null?void 0:t.wait.current).then(()=>b(m)):b(m)}),p=Ye((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 z9=P.Fragment,B9=T0.RenderStrategy;function TSe(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,w]=P.useState(null),_=P.useRef(null),R=j9(e),C=Ho(...R?[_,t,w]:t===null?[]:[t]),T=(n=v.unmount)==null||n?Xa.Unmount:Xa.Hidden,{show:M,appear:I,initial:k}=RSe(),[L,j]=P.useState(M?"visible":"hidden"),$=PSe(),{register:X,unregister:H}=$;on(()=>X(_),[X,_]),on(()=>{if(T===Xa.Hidden&&_.current){if(M&&L!=="visible"){j("visible");return}return Fo(L,{hidden:()=>H(_),visible:()=>X(_)})}},[L,_,X,H,M,T]);let F=J2();on(()=>{if(R&&F&&L==="visible"&&_.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[_,L,F,R]);let G=k&&!I,B=I&&M&&k,W=P.useRef(!1),K=$9(()=>{W.current||(j("hidden"),H(_))},$),D=Ye(J=>{W.current=!0;let ee=J?"enter":"leave";K.onStart(_,ee,ae=>{ae==="enter"?o==null||o():ae==="leave"&&(a==null||a())})}),Y=Ye(J=>{let ee=J?"enter":"leave";W.current=!1,K.onStop(_,ee,ae=>{ae==="enter"?s==null||s():ae==="leave"&&(l==null||l())}),ee==="leave"&&!rx(K)&&(j("hidden"),H(_))});P.useEffect(()=>{R&&i||(D(M),Y(M))},[M,R,i]);let U=!(!i||!R||!F||G),[,A]=R9(U,x,M,{start:D,end:Y}),te=Na({ref:C,className:((r=$C(v.className,B&&c,B&&u,A.enter&&c,A.enter&&A.closed&&u,A.enter&&!A.closed&&d,A.leave&&h,A.leave&&!A.closed&&m,A.leave&&A.closed&&b,!A.transition&&M&&p))==null?void 0:r.trim())||void 0,...E9(A)}),q=0;L==="visible"&&(q|=No.Open),L==="hidden"&&(q|=No.Closed),A.enter&&(q|=No.Opening),A.leave&&(q|=No.Closing);let se=Xi();return P.createElement(nx.Provider,{value:K},P.createElement(M9,{value:q},se({ourProps:te,theirProps:v,defaultTag:z9,features:B9,visible:L==="visible",name:"Transition.Child"})))}function OSe(e,t){let{show:n,appear:r=!1,unmount:i=!0,...o}=e,s=P.useRef(null),a=j9(e),l=Ho(...a?[s,t]:t===null?[]:[t]);J2();let c=X2();if(n===void 0&&c!==null&&(n=(c&No.Open)===No.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=$9(()=>{n||d("hidden")}),[h,m]=P.useState(!0),b=P.useRef([n]);on(()=>{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]);on(()=>{n?d("visible"):!rx(p)&&s.current!==null&&d("hidden")},[n,p]);let x={unmount:i},w=Ye(()=>{var C;h&&m(!1),(C=e.beforeEnter)==null||C.call(e)}),_=Ye(()=>{var C;h&&m(!1),(C=e.beforeLeave)==null||C.call(e)}),R=Xi();return P.createElement(nx.Provider,{value:p},P.createElement(tx.Provider,{value:v},R({ourProps:{...x,as:P.Fragment,children:P.createElement(H9,{ref:l,...x,...o,beforeEnter:w,beforeLeave:_})},theirProps:{},defaultTag:P.Fragment,features:B9,visible:u==="visible",name:"Transition"})))}function MSe(e,t){let n=P.useContext(tx)!==null,r=X2()!==null;return P.createElement(P.Fragment,null,!n&&r?P.createElement(WC,{ref:t,...e}):P.createElement(H9,{ref:t,...e}))}let WC=Ri(OSe),H9=Ri(TSe),ASe=Ri(MSe),DSe=Object.assign(WC,{Child:ASe,Root:WC});var eP="Checkbox",[ISe,xIe]=or(eP),[kSe,NSe]=ISe(eP),V9=E.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]=E.useState(null),m=rt(t,R=>h(R)),b=E.useRef(!1),v=p?u||!!p.closest("form"):!0,[x=!1,w]=$r({prop:i,defaultProp:o,onChange:c}),_=E.useRef(x);return E.useEffect(()=>{const R=p==null?void 0:p.form;if(R){const C=()=>w(_.current);return R.addEventListener("reset",C),()=>R.removeEventListener("reset",C)}},[p,w]),y.jsxs(kSe,{scope:n,state:x,disabled:a,children:[y.jsx(Fe.button,{type:"button",role:"checkbox","aria-checked":tl(x)?"mixed":x,"aria-required":s,"data-state":G9(x),"data-disabled":a?"":void 0,disabled:a,value:l,...d,ref:m,onKeyDown:Re(e.onKeyDown,R=>{R.key==="Enter"&&R.preventDefault()}),onClick:Re(e.onClick,R=>{w(C=>tl(C)?!0:!C),v&&(b.current=R.isPropagationStopped(),b.current||R.stopPropagation())})}),v&&y.jsx(LSe,{control:p,bubbles:!b.current,name:r,value:l,checked:x,required:s,disabled:a,form:u,style:{transform:"translateX(-100%)"},defaultChecked:tl(o)?!1:o})]})});V9.displayName=eP;var W9="CheckboxIndicator",U9=E.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,o=NSe(W9,n);return y.jsx(Jn,{present:r||tl(o.state)||o.state===!0,children:y.jsx(Fe.span,{"data-state":G9(o.state),"data-disabled":o.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});U9.displayName=W9;var LSe=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:i,...o}=e,s=E.useRef(null),a=zv(n),l=Mv(t);E.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=tl(n),h.call(u,tl(n)?!1:n),u.dispatchEvent(m)}},[a,n,r]);const c=E.useRef(tl(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 tl(e){return e==="indeterminate"}function G9(e){return tl(e)?"indeterminate":e?"checked":"unchecked"}var q9=V9,FSe=U9;const ix=E.forwardRef(({className:e,...t},n)=>y.jsx(q9,{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(FSe,{className:be("flex items-center justify-center text-current"),children:y.jsx(Rg,{className:"h-4 w-4"})})}));ix.displayName=q9.displayName;function jSe(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 $Se(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 cf.includes(e)?i:r}function Y9(e){const[t,n]=P.useState([]),[r,i]=P.useState(""),o=ve(C=>C.filterValues),s=ve(C=>C.selectedSheetId),{addOrUpdateFilterValue:a,removeFilterValue:l}=hr(),{data:c,isLoading:u,isFetching:d,isError:p}=Qj(e),h=P.useMemo(()=>{var C;return(C=c==null?void 0:c.records)==null?void 0:C.map(T=>{let M=e.column.split(".").slice(-1)[0].replace(/"/g,"");return T[M]===void 0&&(M=M.toLowerCase()),{id:T[M],value:T[M]}})},[c,e.column]);P.useEffect(()=>{if(o){const C=o.find(T=>T.filterId===e.id);if(!C){n([]);return}if(C.operation==="in"){const T=h==null?void 0:h.filter(M=>C.values.includes(M.value));T&&n(T)}}},[c,s,o,e.id,h]),P.useEffect(()=>{if(o&&!o.find(T=>T.filterId===e.id)){n([]);return}},[o,e.id]);function m(C){const T=jSe(C[0].toString());if(!(T!=null&&T.value)||!(T!=null&&T.operation))return;const M={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:Gu(e),name:e.column,operation:T.operation,values:[Number(T.value)]};a(M)}function b(C){if(Array.isArray(C)||(C=[C]),C.length===1&&h.find(M=>M.value===C[0].value)===void 0){m(C);return}if(n(C),C.length===0){l(e.id);return}const T={filterId:e.id,connectionType:e.database==="NA"?"api":"database",name:e.column,valueType:Gu(e),operation:e.operation,values:C.map(M=>M.value)};a(T)}function v(C){if(C){n(h);const T={filterId:e.id,connectionType:e.database==="NA"?"api":"database",name:e.column,valueType:Gu(e),operation:e.operation,values:h.map(M=>M.value)};a(T)}else n([]),l(e.id)}function x(){if(vg.includes(e.dataType))return h;const C=r.toLowerCase().replace(/\s+/g,"");return r===""?h:h.filter(T=>T.value.toLowerCase().replace(/\s+/g,"").includes(C))}const w=x(),_=e.type==="single",R=t.length===(h==null?void 0:h.length);return{isLoading:u,isFetching:d,isError:p,selected:t,handleValueChange:b,handleSelectAll:v,query:r,setQuery:i,filteredRecords:w,isSingleSelect:_,allSelected:R}}function zSe({filter:e}){var h,m,b,v,x,w;const t=ve(_=>_.themeStyle),{filteredRecords:n,isSingleSelect:r,allSelected:i,handleValueChange:o,handleSelectAll:s,query:a,setQuery:l,isLoading:c,isFetching:u,isError:d,selected:p}=Y9(e);return c||u?y.jsx(Yu,{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(_Se,{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(N9,{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(k9,{className:"absolute inset-y-0 right-0 flex items-center bg-background pl-1 pr-2",children:y.jsx(oie,{className:"h-5 w-5 text-gray-400","aria-hidden":"true"})})]}),y.jsx(DSe,{as:P.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",afterLeave:()=>l(""),children:y.jsxs(L9,{style:{borderRadius:(w=(x=t==null?void 0:t.chart)==null?void 0:x.options)==null?void 0:w.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(ix,{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(_=>y.jsx(F9,{className:({active:R})=>`relative cursor-default select-none border-b border-muted py-2 pl-10 pr-4 ${R?"bg-muted":"text-foreground-900"}`,value:_,children:({selected:R,active:C})=>y.jsxs("div",{className:"",children:[y.jsx("span",{className:`block ${R?"font-medium":"font-normal"}`,children:typeof _.value=="boolean"?_.value?"True":"False":_.value}),R?y.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 text-foreground",children:y.jsx(h3,{className:"h-5 w-5","aria-hidden":"true"})}):null]})},_.value))]})})]})})})}var tP="Radio",[BSe,K9]=or(tP),[HSe,VSe]=BSe(tP),X9=E.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]=E.useState(null),h=rt(t,v=>p(v)),m=E.useRef(!1),b=d?c||!!d.closest("form"):!0;return y.jsxs(HSe,{scope:n,checked:i,disabled:s,children:[y.jsx(Fe.button,{type:"button",role:"radio","aria-checked":i,"data-state":Z9(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(WSe,{control:d,bubbles:!m.current,name:r,value:a,checked:i,required:o,disabled:s,form:c,style:{transform:"translateX(-100%)"}})]})});X9.displayName=tP;var Q9="RadioIndicator",J9=E.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...i}=e,o=VSe(Q9,n);return y.jsx(Jn,{present:r||o.checked,children:y.jsx(Fe.span,{"data-state":Z9(o.checked),"data-disabled":o.disabled?"":void 0,...i,ref:t})})});J9.displayName=Q9;var WSe=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,o=E.useRef(null),s=zv(n),a=Mv(t);return E.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 Z9(e){return e?"checked":"unchecked"}var USe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],nP="RadioGroup",[GSe,wIe]=or(nP,[ff,K9]),e$=ff(),t$=K9(),[qSe,YSe]=GSe(nP),n$=E.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=e$(n),m=Xc(c),[b,v]=$r({prop:o,defaultProp:i,onChange:d});return y.jsx(qSe,{scope:n,name:r,required:s,disabled:a,value:b,onValueChange:v,children:y.jsx($E,{asChild:!0,...h,orientation:l,dir:m,loop:u,children:y.jsx(Fe.div,{role:"radiogroup","aria-required":s,"aria-orientation":l,"data-disabled":a?"":void 0,dir:m,...p,ref:t})})})});n$.displayName=nP;var r$="RadioGroupItem",i$=E.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...i}=e,o=YSe(r$,n),s=o.disabled||r,a=e$(n),l=t$(n),c=E.useRef(null),u=rt(t,c),d=o.value===i.value,p=E.useRef(!1);return E.useEffect(()=>{const h=b=>{USe.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(zE,{asChild:!0,...a,focusable:!s,active:d,children:y.jsx(X9,{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())})})})});i$.displayName=r$;var KSe="RadioGroupIndicator",o$=E.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,i=t$(n);return y.jsx(J9,{...i,...r,ref:t})});o$.displayName=KSe;var s$=n$,a$=i$,XSe=o$;const kp=E.forwardRef(({className:e,...t},n)=>y.jsx(s$,{className:be("grid gap-2",e),...t,ref:n}));kp.displayName=s$.displayName;const ic=E.forwardRef(({className:e,...t},n)=>y.jsx(a$,{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(XSe,{className:"flex items-center justify-center",children:y.jsx(mR,{className:"h-2.5 w-2.5 fill-current text-current"})})}));ic.displayName=a$.displayName;function QSe({filter:e}){var o;const{filteredRecords:t,handleValueChange:n,selected:r}=Y9(e);function i(s){n([{value:s,id:s}])}return y.jsx(kp,{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(ic,{value:s.value,id:"r1"}),y.jsx(En,{className:"text-muted-foreground",htmlFor:"r1",children:s.value})]},s.value))})}function rP({filter:e}){return cf.includes(e.dataType)?y.jsx(Oxe,{filter:e}):e.uiType==="radio"&&e.type==="single"?y.jsx(QSe,{filter:e}):y.jsx(zSe,{filter:e})}function JSe({frame:e}){const[t,n]=P.useState(!1),r=e==null?void 0:e.cards[0],{data:i}=ol(r),o=e==null?void 0:e.cards[1],{data:s,isLoading:a,isFetching:l}=ol(o);return(o==null?void 0:o.type)!=="text"?y.jsx(p0,{card:r,data:(i==null?void 0:i.records)||[]}):y.jsxs(Rc,{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(x0,{card:o,data:(s==null?void 0:s.records)||[],isLoading:!1})}):y.jsx(p0,{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(Yv,{disabled:a||l,className:be("h-7 p-1"),pressed:t,onPressedChange:n,"aria-label":"Toggle bold",children:t?y.jsx(R3,{className:"size-4 text-muted-foreground/70"}):y.jsx(P3,{className:"size-4 text-muted-foreground/70"})})})]})}function ZSe({card:e,frame:t}){var H,F,G;const{customCards:n,placeholders:r}=vo(),i=ve(B=>B.themeStyle),o=ve(B=>B.selectedSheetId),s=ve(B=>B.isDashboardEditing),a=ve(B=>B.selectedLensId),l=ve(B=>B.dashboard.filters),c=l==null?void 0:l.find(B=>B.id===t.filterId),{setCardTitle:u,setCardDescription:d,setSelectedFrameId:p,updateFilter:h}=hr(),{updateFrame:m}=hr(),b=((H=e.customCardPreferences)==null?void 0:H.showCardHeader)??!0,{isError:v,isLoading:x,isFetching:w,cfg:_,visualKey:R,data:C,handleDatapointClick:T}=$6(e);function M(){var B,W,K;if(n&&n.length>0){const D=n.find(Y=>Y.cardId===e.id);if(D&&D.replaceDefault){const Y=D.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(p0,{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(JSe,{frame:t})}return e.type==="text"&&((K=t==null?void 0:t.cards)==null?void 0:K.length)===1?y.jsx(Rc,{className:"mx-3 my-6 overflow-y-auto break-words px-3",children:y.jsx(x0,{isLoading:x||w,card:e,data:(C==null?void 0:C.records)||[]})}):X}function I(){return["{{ filters | where }}","{{ filters | and }}"].some(W=>{var K;return(K=e.sql)==null?void 0:K.includes(W)})?y.jsx(xge,{}):null}function k(){if(v)return y.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:[y.jsx(A3,{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(N3,{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(Rc,{className:"relative flex h-full min-h-0 w-full flex-1 grow basis-0",children:[y.jsx(sj,{card:e,data:(C==null?void 0:C.records)||[]}),y.jsx(Vg,{orientation:"horizontal"})]});if(e.type==="text")return y.jsx(Rc,{className:"overflow-y-auto break-words pr-2",children:y.jsx(x0,{isLoading:x||w,card:e,data:(C==null?void 0:C.records)||[]})});if(e.type==="custom")return y.jsx(aye,{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(E2,{cfg:_,onDatapointClick:T},`${R}-${a}`)}function L(){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,K;return y.jsx(VE,{value:t.activeCardId,className:"flex items-center justify-end gap-3",onValueChange:D=>{const Y={...t,activeCardId:D};m(o,Y)},children:y.jsx(tv,{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:(K=t.cards.filter(D=>{var Y;return!((Y=D.tabTitle)!=null&&Y.endsWith("__Header"))&&(D.displayTab===!0||D.displayTab===void 0)}))==null?void 0:K.map(D=>{var Y,U;return y.jsx(nv,{style:{borderRadius:(U=(Y=i==null?void 0:i.chart)==null?void 0:Y.options)==null?void 0:U.borderRadius},value:D.id,children:D.tabTitle||D.title},D.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(Mpe,{renderFilterInfo:I,card:B})}):y.jsxs(y.Fragment,{children:[y.jsxs("div",{role:"card-title-container",className:"flex items-center gap-2",children:[y.jsx(fs,{text:e.title,onSave:W=>u(o,e.id,W),children:y.jsx(df,{className:be("text-base",{}),children:e.title})}),(s||e.info)&&y.jsx(w8,{card:e}),e.refreshInterval&&y.jsxs(O8,{children:[y.jsx(M8,{className:"pr-1",children:y.jsx("div",{className:be("h-2 w-2 rounded-full bg-green-500 transition-opacity",{"opacity-10":x||w})})}),y.jsx(h2,{side:"right",align:"center",children:y.jsx("p",{className:"text-xs",children:`Realtime (${e==null?void 0:e.refreshInterval})`})})]}),I()]}),y.jsx("div",{role:"card-description-container",children:y.jsx(fs,{text:(e==null?void 0:e.description)||"",onSave:W=>d(o,e.id,W),children:y.jsxs(FE,{className:be("",{}),children:[" ",e.description]})})})]})}if(!e.id)return null;const X=y.jsxs(y.Fragment,{children:[b?y.jsx(X0,{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:(G=(F=i==null?void 0:i.chart)==null?void 0:F.options)==null?void 0:G.borderRadius},role:"frame-filter-container",className:"flex h-10 shrink-0 items-center bg-muted p-1",children:[!cf.includes(c.dataType)&&y.jsx(fs,{className:"my-1",containerClassName:"shrink-0",text:c.title||c.column,onSave:B=>h({...c,title:B}),children:y.jsx(En,{className:"px-3",children:c.title})}),y.jsx(rP,{filter:c})]})})]})]})}):y.jsx("div",{className:"h-8"}),y.jsx(Q0,{className:"relative flex min-h-0 grow flex-col",children:k()}),y.jsx(o4,{children:L()})]});return y.jsx("div",{className:be("flex h-full flex-col",{"animate-pulse":x||w}),children:M()})}function e_e({frame:e,footer:t,className:n,...r}){var b,v;const i=P.useRef(null),o=ve(x=>x.themeStyle),s=ve(x=>x.selectedFrameId),a=ve(x=>x.isDashboardEditing),{setSelectedFrameId:l}=hr(),{setSelectedConnectionId:c,setSelectedDatabaseName:u,setSelectedSchemaName:d,setSelectedTableName:p}=gv(),h=e.cards.find(x=>x.id===e.activeCardId);Kie(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(yv,{FallbackComponent:vR,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(F3,{frame:e}),y.jsx(ZSe,{card:h,frame:e},h.id)]})})}const iP=E.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}));iP.displayName="Textarea";function t_e({label:e,onCheckedChange:t,checked:n}){return y.jsxs("div",{className:"flex items-center space-x-2",children:[y.jsx(ix,{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 n_e({filter:e}){const[t,n]=P.useState(e.sql),[r,i]=P.useState(!1),o=ve(p=>p.selectedSheetId),{updateFilter:s}=hr();function a(){const p={...e,sql:t};s(p),i(!1)}function l(p){console.log("operation",p);const h={...e,operation:p};s(h)}function c(p){const h={...e,type:p};s(h)}function u(p){const h={...e,uiType:p};s(h)}function d(p){if(!o)return;const h={...e,sheetId:p?o:void 0};s(h)}return y.jsxs(Gv,{open:r,onOpenChange:i,children:[y.jsx(qv,{children:y.jsx(I3,{className:"invisible h-3 w-3 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"})}),y.jsxs(Hg,{onMouseDown:p=>p.stopPropagation(),onDoubleClick:p=>p.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-3",children:[y.jsx("h4",{className:"font-medium leading-none",children:"Customize Filter"}),y.jsx("p",{className:"rounded-md bg-muted px-2 py-1 text-xs text-muted-foreground",children:e.column})]}),y.jsx("p",{className:"text-sm text-muted-foreground",children:"Customize the filter operation and SQL"})]}),y.jsx(Fg,{}),y.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[y.jsxs("div",{className:"space-y-2",children:[y.jsx(En,{children:"Type"}),y.jsxs(kp,{onValueChange:c,value:e.type||"multiple",className:"flex gap-3",defaultValue:"x",children:[y.jsxs("div",{className:"flex items-center space-x-2",children:[y.jsx(ic,{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(ic,{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(En,{children:"Filter Element"}),y.jsxs(kp,{onValueChange:u,value:e.uiType||"dropdown",className:"flex gap-3",defaultValue:"x",children:[y.jsxs("div",{className:"flex items-center space-x-2",children:[y.jsx(ic,{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(ic,{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(En,{children:"Table Column"}),y.jsx(En,{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(En,{children:"Data Type"}),y.jsx(En,{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(En,{className:"text-sm",children:"Filter Operation"}),y.jsx(r_e,{updateFilterOperation:l,value:e.operation})]})]}),y.jsxs("div",{className:"flex grow flex-col space-y-1",role:"container",children:[y.jsx(En,{className:"text-sm",children:"Values SQL"}),y.jsx(iP,{onKeyDown:p=>{p.stopPropagation()},value:t,onChange:p=>n(p.target.value),className:`min-w-full grow resize font-mono text-xs ${jh}`})]}),y.jsx("div",{children:y.jsx(t_e,{label:"Local to sheet",onCheckedChange:d,checked:!!e.sheetId})}),y.jsx("div",{className:"flex justify-end gap-2",children:y.jsxs(Si,{onClick:a,size:"sm",variant:"outline",children:[y.jsx(Rg,{className:"mr-2 size-4"}),"Accept"]})})]})]})}function r_e({value:e,updateFilterOperation:t}){return y.jsxs(Ys,{defaultValue:"in",value:e,onValueChange:n=>t(n),children:[y.jsx(Jo,{className:"h-8 w-[180px] focus:ring-0 focus:ring-offset-0",children:y.jsx(Ks,{placeholder:"Operation"})}),y.jsxs(Zo,{children:[y.jsx(Un,{value:"=",children:"Equals"}),y.jsx(Un,{value:"in",children:"Contains"}),y.jsx(Un,{value:"like",children:"Like"})]})]})}function l$({filter:e}){const t=ve(a=>a.isDashboardEditing),n=ve(a=>a.filterValues),r=n==null?void 0:n.some(a=>a.filterId===e.id),{removeFilterValue:i,removeFilter:o,updateFilter:s}=hr();return y.jsx(fs,{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(En,{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(bR,{className:"size-3.5"})}),t&&y.jsx(n_e,{filter:e})]}),y.jsx("div",{className:"flex items-center gap-2",children:t&&y.jsx(hf,{onClick:()=>{i(e.id),o(e.id)},className:"size-3.5 cursor-pointer text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})})]})})}var i_e=e=>{switch(e){case"success":return a_e;case"info":return c_e;case"warning":return l_e;case"error":return u_e;default:return null}},o_e=Array(12).fill(0),s_e=({visible:e,className:t})=>P.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},P.createElement("div",{className:"sonner-spinner"},o_e.map((n,r)=>P.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),a_e=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"})),l_e=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"})),c_e=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"})),u_e=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"})),d_e=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"})),f_e=()=>{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},UC=1,h_e=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:UC++,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(g_e(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)||UC++;return this.create({jsx:e(n),id:n,...t}),n},this.subscribers=[],this.toasts=[]}},Fi=new h_e,p_e=(e,t)=>{let n=(t==null?void 0:t.id)||UC++;return Fi.addToast({title:e,...t,id:n}),n},g_e=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",m_e=p_e,b_e=()=>Fi.toasts,c$=Object.assign(m_e,{success:Fi.success,info:Fi.info,warning:Fi.warning,error:Fi.error,custom:Fi.custom,message:Fi.message,promise:Fi.promise,dismiss:Fi.dismiss,loading:Fi.loading},{getHistory:b_e});function y_e(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))}y_e(`: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%)}
|
|
356
|
+
`);function Gb(e){return e.label!==void 0}var v_e=3,x_e="32px",w_e="16px",tN=4e3,S_e=356,__e=14,C_e=20,E_e=200;function Ro(...e){return e.filter(Boolean).join(" ")}function R_e(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var P_e=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:w,index:_,toasts:R,expanded:C,removeToast:T,defaultRichColors:M,closeButton:I,style:k,cancelButtonStyle:L,actionButtonStyle:j,className:$="",descriptionClassName:X="",duration:H,position:F,gap:G,loadingIcon:B,expandByDefault:W,classNames:K,icons:D,closeButtonAriaLabel:Y="Close toast",pauseWhenPageIsHidden:U}=e,[A,te]=P.useState(null),[q,se]=P.useState(null),[J,ee]=P.useState(!1),[ae,ce]=P.useState(!1),[ge,oe]=P.useState(!1),[pe,de]=P.useState(!1),[Ee,De]=P.useState(!1),[ze,Oe]=P.useState(0),[Be,vt]=P.useState(0),Mt=P.useRef(h.duration||H||tN),xn=P.useRef(null),At=P.useRef(null),pn=_===0,en=_+1<=x,fe=h.type,_e=h.dismissible!==!1,He=h.className||"",Ze=h.descriptionClassName||"",st=P.useMemo(()=>w.findIndex(je=>je.toastId===h.id)||0,[w,h.id]),kn=P.useMemo(()=>{var je;return(je=h.closeButton)!=null?je:I},[h.closeButton,I]),Bn=P.useMemo(()=>h.duration||H||tN,[h.duration,H]),Mn=P.useRef(0),sn=P.useRef(0),Hn=P.useRef(0),tn=P.useRef(null),[sr,Zn]=F.split("-"),Qi=P.useMemo(()=>w.reduce((je,xt,Ht)=>Ht>=st?je:je+xt.height,0),[w,st]),Cr=f_e(),Wo=h.invert||p,Er=fe==="loading";sn.current=P.useMemo(()=>st*G+Qi,[st,Qi]),P.useEffect(()=>{Mt.current=Bn},[Bn]),P.useEffect(()=>{ee(!0)},[]),P.useEffect(()=>{let je=At.current;if(je){let xt=je.getBoundingClientRect().height;return vt(xt),v(Ht=>[{toastId:h.id,height:xt,position:h.position},...Ht]),()=>v(Ht=>Ht.filter(er=>er.toastId!==h.id))}},[v,h.id]),P.useLayoutEffect(()=>{if(!J)return;let je=At.current,xt=je.style.height;je.style.height="auto";let Ht=je.getBoundingClientRect().height;je.style.height=xt,vt(Ht),v(er=>er.find(tr=>tr.toastId===h.id)?er.map(tr=>tr.toastId===h.id?{...tr,height:Ht}:tr):[{toastId:h.id,height:Ht,position:h.position},...er])},[J,h.title,h.description,v,h.id]);let Br=P.useCallback(()=>{ce(!0),Oe(sn.current),v(je=>je.filter(xt=>xt.toastId!==h.id)),setTimeout(()=>{T(h)},E_e)},[h,T,v,sn]);P.useEffect(()=>{if(h.promise&&fe==="loading"||h.duration===1/0||h.type==="loading")return;let je;return C||b||U&&Cr?(()=>{if(Hn.current<Mn.current){let xt=new Date().getTime()-Mn.current;Mt.current=Mt.current-xt}Hn.current=new Date().getTime()})():Mt.current!==1/0&&(Mn.current=new Date().getTime(),je=setTimeout(()=>{var xt;(xt=h.onAutoClose)==null||xt.call(h,h),Br()},Mt.current)),()=>clearTimeout(je)},[C,b,h,fe,U,Cr,Br]),P.useEffect(()=>{h.delete&&Br()},[Br,h.delete]);function _l(){var je,xt,Ht;return D!=null&&D.loading?P.createElement("div",{className:Ro(K==null?void 0:K.loader,(je=h==null?void 0:h.classNames)==null?void 0:je.loader,"sonner-loader"),"data-visible":fe==="loading"},D.loading):B?P.createElement("div",{className:Ro(K==null?void 0:K.loader,(xt=h==null?void 0:h.classNames)==null?void 0:xt.loader,"sonner-loader"),"data-visible":fe==="loading"},B):P.createElement(s_e,{className:Ro(K==null?void 0:K.loader,(Ht=h==null?void 0:h.classNames)==null?void 0:Ht.loader),visible:fe==="loading"})}return P.createElement("li",{tabIndex:0,ref:At,className:Ro($,He,K==null?void 0:K.toast,(t=h==null?void 0:h.classNames)==null?void 0:t.toast,K==null?void 0:K.default,K==null?void 0:K[fe],(n=h==null?void 0:h.classNames)==null?void 0:n[fe]),"data-sonner-toast":"","data-rich-colors":(r=h.richColors)!=null?r:M,"data-styled":!(h.jsx||h.unstyled||m),"data-mounted":J,"data-promise":!!h.promise,"data-swiped":Ee,"data-removed":ae,"data-visible":en,"data-y-position":sr,"data-x-position":Zn,"data-index":_,"data-front":pn,"data-swiping":ge,"data-dismissible":_e,"data-type":fe,"data-invert":Wo,"data-swipe-out":pe,"data-swipe-direction":q,"data-expanded":!!(C||W&&J),style:{"--index":_,"--toasts-before":_,"--z-index":R.length-_,"--offset":`${ae?ze:sn.current}px`,"--initial-height":W?"auto":`${Be}px`,...k,...h.style},onPointerDown:je=>{Er||!_e||(xn.current=new Date,Oe(sn.current),je.target.setPointerCapture(je.pointerId),je.target.tagName!=="BUTTON"&&(oe(!0),tn.current={x:je.clientX,y:je.clientY}))},onPointerUp:()=>{var je,xt,Ht,er;if(pe||!_e)return;tn.current=null;let tr=Number(((je=At.current)==null?void 0:je.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Hr=Number(((xt=At.current)==null?void 0:xt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),mr=new Date().getTime()-((Ht=xn.current)==null?void 0:Ht.getTime()),ar=A==="x"?tr:Hr,wn=Math.abs(ar)/mr;if(Math.abs(ar)>=C_e||wn>.11){Oe(sn.current),(er=h.onDismiss)==null||er.call(h,h),se(A==="x"?tr>0?"right":"left":Hr>0?"down":"up"),Br(),de(!0),De(!1);return}oe(!1),te(null)},onPointerMove:je=>{var xt,Ht,er,tr;if(!tn.current||!_e||((xt=window.getSelection())==null?void 0:xt.toString().length)>0)return;let Hr=je.clientY-tn.current.y,mr=je.clientX-tn.current.x,ar=(Ht=e.swipeDirections)!=null?Ht:R_e(F);!A&&(Math.abs(mr)>1||Math.abs(Hr)>1)&&te(Math.abs(mr)>Math.abs(Hr)?"x":"y");let wn={x:0,y:0};A==="y"?(ar.includes("top")||ar.includes("bottom"))&&(ar.includes("top")&&Hr<0||ar.includes("bottom")&&Hr>0)&&(wn.y=Hr):A==="x"&&(ar.includes("left")||ar.includes("right"))&&(ar.includes("left")&&mr<0||ar.includes("right")&&mr>0)&&(wn.x=mr),(Math.abs(wn.x)>0||Math.abs(wn.y)>0)&&De(!0),(er=At.current)==null||er.style.setProperty("--swipe-amount-x",`${wn.x}px`),(tr=At.current)==null||tr.style.setProperty("--swipe-amount-y",`${wn.y}px`)}},kn&&!h.jsx?P.createElement("button",{"aria-label":Y,"data-disabled":Er,"data-close-button":!0,onClick:Er||!_e?()=>{}:()=>{var je;Br(),(je=h.onDismiss)==null||je.call(h,h)},className:Ro(K==null?void 0:K.closeButton,(i=h==null?void 0:h.classNames)==null?void 0:i.closeButton)},(o=D==null?void 0:D.close)!=null?o:d_e):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:Ro(K==null?void 0:K.icon,(s=h==null?void 0:h.classNames)==null?void 0:s.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||_l():null,h.type!=="loading"?h.icon||(D==null?void 0:D[fe])||i_e(fe):null):null,P.createElement("div",{"data-content":"",className:Ro(K==null?void 0:K.content,(a=h==null?void 0:h.classNames)==null?void 0:a.content)},P.createElement("div",{"data-title":"",className:Ro(K==null?void 0:K.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:Ro(X,Ze,K==null?void 0:K.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&&Gb(h.cancel)?P.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||L,onClick:je=>{var xt,Ht;Gb(h.cancel)&&_e&&((Ht=(xt=h.cancel).onClick)==null||Ht.call(xt,je),Br())},className:Ro(K==null?void 0:K.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&&Gb(h.action)?P.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||j,onClick:je=>{var xt,Ht;Gb(h.action)&&((Ht=(xt=h.action).onClick)==null||Ht.call(xt,je),!je.defaultPrevented&&Br())},className:Ro(K==null?void 0:K.actionButton,(d=h==null?void 0:h.classNames)==null?void 0:d.actionButton)},h.action.label):null))};function nN(){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 T_e(e,t){let n={};return[e,t].forEach((r,i)=>{let o=i===1,s=o?"--mobile-offset":"--offset",a=o?w_e:x_e;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 O_e=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=v_e,toastOptions:b,dir:v=nN(),gap:x=__e,loadingIcon:w,icons:_,containerAriaLabel:R="Notifications",pauseWhenPageIsHidden:C}=e,[T,M]=P.useState([]),I=P.useMemo(()=>Array.from(new Set([r].concat(T.filter(U=>U.position).map(U=>U.position)))),[T,r]),[k,L]=P.useState([]),[j,$]=P.useState(!1),[X,H]=P.useState(!1),[F,G]=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,""),K=P.useRef(null),D=P.useRef(!1),Y=P.useCallback(U=>{M(A=>{var te;return(te=A.find(q=>q.id===U.id))!=null&&te.delete||Fi.dismiss(U.id),A.filter(({id:q})=>q!==U.id)})},[]);return P.useEffect(()=>Fi.subscribe(U=>{if(U.dismiss){M(A=>A.map(te=>te.id===U.id?{...te,delete:!0}:te));return}setTimeout(()=>{kr.flushSync(()=>{M(A=>{let te=A.findIndex(q=>q.id===U.id);return te!==-1?[...A.slice(0,te),{...A[te],...U},...A.slice(te+1)]:[U,...A]})})})}),[]),P.useEffect(()=>{if(u!=="system"){G(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?G("dark"):G("light")),typeof window>"u")return;let U=window.matchMedia("(prefers-color-scheme: dark)");try{U.addEventListener("change",({matches:A})=>{G(A?"dark":"light")})}catch{U.addListener(({matches:te})=>{try{G(te?"dark":"light")}catch(q){console.error(q)}})}},[u]),P.useEffect(()=>{T.length<=1&&$(!1)},[T]),P.useEffect(()=>{let U=A=>{var te,q;i.every(se=>A[se]||A.code===se)&&($(!0),(te=B.current)==null||te.focus()),A.code==="Escape"&&(document.activeElement===B.current||(q=B.current)!=null&&q.contains(document.activeElement))&&$(!1)};return document.addEventListener("keydown",U),()=>document.removeEventListener("keydown",U)},[i]),P.useEffect(()=>{if(B.current)return()=>{K.current&&(K.current.focus({preventScroll:!0}),K.current=null,D.current=!1)}},[B.current]),P.createElement("section",{ref:t,"aria-label":`${R} ${W}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},I.map((U,A)=>{var te;let[q,se]=U.split("-");return T.length?P.createElement("ol",{key:U,dir:v==="auto"?nN():v,tabIndex:-1,ref:B,className:a,"data-sonner-toaster":!0,"data-theme":F,"data-y-position":q,"data-lifted":j&&T.length>1&&!o,"data-x-position":se,style:{"--front-toast-height":`${((te=k[0])==null?void 0:te.height)||0}px`,"--width":`${S_e}px`,"--gap":`${x}px`,...h,...T_e(l,c)},onBlur:J=>{D.current&&!J.currentTarget.contains(J.relatedTarget)&&(D.current=!1,K.current&&(K.current.focus({preventScroll:!0}),K.current=null))},onFocus:J=>{J.target instanceof HTMLElement&&J.target.dataset.dismissible==="false"||D.current||(D.current=!0,K.current=J.relatedTarget)},onMouseEnter:()=>$(!0),onMouseMove:()=>$(!0),onMouseLeave:()=>{X||$(!1)},onPointerDown:J=>{J.target instanceof HTMLElement&&J.target.dataset.dismissible==="false"||H(!0)},onPointerUp:()=>H(!1)},T.filter(J=>!J.position&&A===0||J.position===U).map((J,ee)=>{var ae,ce;return P.createElement(P_e,{key:J.id,icons:_,index:ee,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:U,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:T.filter(ge=>ge.position==J.position),heights:k.filter(ge=>ge.position==J.position),setHeights:L,expandByDefault:o,gap:x,loadingIcon:w,expanded:j,pauseWhenPageIsHidden:C,swipeDirections:e.swipeDirections})})):null}))});function M_e(){const{getSelectedFrame:e,addFrame:t,setSelectedFrameId:n}=hr(),r=ve(l=>l.dashboard.sheets),o=ve(l=>l.selectedSheetId)??(r==null?void 0:r[0].id),s=ve(l=>l.isDashboardEditing),a=ve(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(),c$.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=il();const h=p.activeCardId;p.cards.forEach(m=>{const b=m.id;m.id=il(),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 A_e=DA.WidthProvider(DA.Responsive);function D_e({sheet:e}){var v,x,w;const t=ve(_=>_.isDashboardEditing),n=ve(_=>_.currentBreakpoint),r=ve(_=>_.themeStyle);P.useState([]);const i=ve(_=>_.selectedSheetId);ve(_=>_.selectedLensId);const o=e.layouts,s=ve(_=>_.dashboard.filters),a=e.frames,{setSheetLayouts:l,setCurrentBreakpoint:c}=ve(_=>_.actions);P.useEffect(()=>{var _,R;document.documentElement.style.setProperty("--placeholder-border-radius",`${(R=(_=r==null?void 0:r.chart)==null?void 0:_.options)==null?void 0:R.borderRadius}px`)},[(x=(v=r==null?void 0:r.chart)==null?void 0:v.options)==null?void 0:x.borderRadius]),M_e();function u(_){c(_)}function d(_,R){i===e.id&&l(i,R)}if(!i)return null;const p=(_,R)=>y.jsx(u$,{className:"after:content-none",ref:R,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(R=>R.sheetId===i||!R.sheetId);return _==null?void 0:_.map(R=>{var M,I,k;const C=(M=o==null?void 0:o[n])==null?void 0:M.find(L=>L.i===R.id);if(R.location==="frame")return null;const T=h(C);return y.jsxs("div",{style:{borderRadius:(k=(I=r==null?void 0:r.chart)==null?void 0:I.options)==null?void 0:k.borderRadius},className:be("z-50 flex flex-col rounded-md border bg-background px-3 py-2"),...T?{"data-grid":T}:{},children:[y.jsx(l$,{filter:R}),y.jsx(rP,{filter:R})]},R.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(yv,{FallbackComponent:({error:R,resetErrorBoundary:C})=>y.jsx(Jie,{error:R,resetErrorBoundary:C,frame:_}),children:y.jsx(e_e,{frame:_})})},_.id))}return y.jsx(y.Fragment,{children:y.jsxs(A_e,{margin:[10,10],isDraggable:t,resizeHandles:t?["sw","nw","ne","se","e","w"]:[],className:be((w=r==null?void 0:r.gridLayout)==null?void 0:w.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 u$=P.forwardRef(({className:e,handleAxis:t,...n},r)=>{var s,a;const i=ve(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})});u$.displayName="ResizeHandle";var d$="vercel.ai.error",I_e=Symbol.for(d$),f$,k_e=class h$ extends Error{constructor({name:t,message:n,cause:r}){super(n),this[f$]=!0,this.name=t,this.cause=r}static isInstance(t){return h$.hasMarker(t,d$)}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}};f$=I_e;var sf=k_e;function p$(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var g$="AI_InvalidArgumentError",m$=`vercel.ai.error.${g$}`,N_e=Symbol.for(m$),b$,L_e=class extends sf{constructor({message:e,cause:t,argument:n}){super({name:g$,message:e,cause:t}),this[b$]=!0,this.argument=n}static isInstance(e){return sf.hasMarker(e,m$)}};b$=N_e;var y$="AI_JSONParseError",v$=`vercel.ai.error.${y$}`,F_e=Symbol.for(v$),x$,rN=class extends sf{constructor({text:e,cause:t}){super({name:y$,message:`JSON parsing failed: Text: ${e}.
|
|
357
|
+
Error message: ${p$(t)}`,cause:t}),this[x$]=!0,this.text=e}static isInstance(e){return sf.hasMarker(e,v$)}};x$=F_e;var w$="AI_TypeValidationError",S$=`vercel.ai.error.${w$}`,j_e=Symbol.for(S$),_$,$_e=class GC extends sf{constructor({value:t,cause:n}){super({name:w$,message:`Type validation failed: Value: ${JSON.stringify(t)}.
|
|
358
|
+
Error message: ${p$(n)}`,cause:n}),this[_$]=!0,this.value=t}static isInstance(t){return sf.hasMarker(t,S$)}static wrap({value:t,cause:n}){return GC.isInstance(n)&&n.value===t?n:new GC({value:t,cause:n})}};_$=j_e;var iN=$_e;let z_e=(e,t=21)=>(n=t)=>{let r="",i=n|0;for(;i--;)r+=e[Math.random()*e.length|0];return r};var Cf={exports:{}};const B_e=typeof Buffer<"u",oN=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,sN=/"(?: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 C$(e,t,n){n==null&&t!==null&&typeof t=="object"&&(n=t,t=void 0),B_e&&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(oN.test(e)===!1&&sN.test(e)===!1)return r}else if(i!=="ignore"&&o==="ignore"){if(oN.test(e)===!1)return r}else if(sN.test(e)===!1)return r;return E$(r,{protoAction:i,constructorAction:o,safe:n&&n.safe})}function E$(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 oP(e,t,n){const r=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return C$(e,t,n)}finally{Error.stackTraceLimit=r}}function H_e(e,t){const n=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return C$(e,t,{safe:!0})}catch{return null}finally{Error.stackTraceLimit=n}}Cf.exports=oP;Cf.exports.default=oP;Cf.exports.parse=oP;Cf.exports.safeParse=H_e;Cf.exports.scan=E$;var V_e=Cf.exports;const W_e=qc(V_e);var U_e=({prefix:e,size:t=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const i=z_e(n,t);if(e==null)return i;if(n.includes(r))throw new L_e({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return o=>`${e}${r}${i(o)}`},R$=U_e(),qC=Symbol.for("vercel.ai.validator");function G_e(e){return{[qC]:!0,validate:e}}function q_e(e){return typeof e=="object"&&e!==null&&qC in e&&e[qC]===!0&&"validate"in e}function Y_e(e){return q_e(e)?e:K_e(e)}function K_e(e){return G_e(t=>{const n=e.safeParse(t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}})}function X_e({value:e,schema:t}){const n=Y_e(t);try{if(n.validate==null)return{success:!0,value:e};const r=n.validate(e);return r.success?r:{success:!1,error:iN.wrap({value:e,cause:r.error})}}catch(r){return{success:!1,error:iN.wrap({value:e,cause:r})}}}function aN({text:e,schema:t}){try{const n=W_e.parse(e);return t==null?{success:!0,value:n}:X_e({value:n,schema:t})}catch(n){return{success:!1,error:rN.isInstance(n)?n:new rN({text:e,cause:n})}}}new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");var Np={code:"0",name:"text",parse:e=>{if(typeof e!="string")throw new Error('"text" parts expect a string value.');return{type:"text",value:e}}},Lp={code:"3",name:"error",parse:e=>{if(typeof e!="string")throw new Error('"error" parts expect a string value.');return{type:"error",value:e}}},Fp={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}}},jp={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}}}},$p={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}}},Q_e=[Np,Lp,Fp,jp,$p];Np.code+"",Lp.code+"",Fp.code+"",jp.code+"",$p.code+"";Np.name+"",Np.code,Lp.name+"",Lp.code,Fp.name+"",Fp.code,jp.name+"",jp.code,$p.name+"",$p.code;Q_e.map(e=>e.code);function J_e(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 Z_e(e){if(e===void 0)return{value:void 0,state:"undefined-input"};let t=aN({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=aN({text:J_e(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var zp={code:"0",name:"text",parse:e=>{if(typeof e!="string")throw new Error('"text" parts expect a string value.');return{type:"text",value:e}}},Bp={code:"2",name:"data",parse:e=>{if(!Array.isArray(e))throw new Error('"data" parts expect an array value.');return{type:"data",value:e}}},Hp={code:"3",name:"error",parse:e=>{if(typeof e!="string")throw new Error('"error" parts expect a string value.');return{type:"error",value:e}}},Vp={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}}},Wp={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}}},Up={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}}},Gp={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}}},qp={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}}},Yp={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}}},Kp={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}}},Xp={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}}}},eCe=[zp,Bp,Hp,Vp,Wp,Up,Gp,qp,Yp,Kp,Xp],tCe={[zp.code]:zp,[Bp.code]:Bp,[Hp.code]:Hp,[Vp.code]:Vp,[Wp.code]:Wp,[Up.code]:Up,[Gp.code]:Gp,[qp.code]:qp,[Yp.code]:Yp,[Kp.code]:Kp,[Xp.code]:Xp};zp.name+"",zp.code,Bp.name+"",Bp.code,Hp.name+"",Hp.code,Vp.name+"",Vp.code,Wp.name+"",Wp.code,Up.name+"",Up.code,Gp.name+"",Gp.code,qp.name+"",qp.code,Yp.name+"",Yp.code,Kp.name+"",Kp.code,Xp.name+"",Xp.code;var nCe=eCe.map(e=>e.code),rCe=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(!nCe.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 tCe[r].parse(o)},iCe=10;function oCe(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 sCe({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]!==iCe))continue;if(m.length===0)break;const x=oCe(m,b);b=0;const w=h.decode(x,{stream:!0}).split(`
|
|
359
|
+
`).filter(_=>_!=="").map(rCe);for(const{type:_,value:R}of w)switch(_){case"text":await(t==null?void 0:t(R));break;case"data":await(n==null?void 0:n(R));break;case"error":await(r==null?void 0:r(R));break;case"message_annotations":await(l==null?void 0:l(R));break;case"tool_call_streaming_start":await(i==null?void 0:i(R));break;case"tool_call_delta":await(o==null?void 0:o(R));break;case"tool_call":await(s==null?void 0:s(R));break;case"tool_result":await(a==null?void 0:a(R));break;case"finish_message":await(c==null?void 0:c(R));break;case"finish_step":await(u==null?void 0:u(R));break;case"start_step":await(d==null?void 0:d(R));break;default:{const C=_;throw new Error(`Unknown stream part type: ${C}`)}}}}function aCe({promptTokens:e,completionTokens:t}){return{promptTokens:e,completionTokens:t,totalTokens:e+t}}async function lCe({stream:e,update:t,onToolCall:n,onFinish:r,generateId:i=R$,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 w=[...d];if(a==null){t(u,w);return}p!=null&&p.length&&(a.annotations=p);const _={...JSON.parse(JSON.stringify(a)),revisionId:i(),createdAt:a.createdAt};t([...u,_],w)}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 sCe({stream:e,onTextPart(w){const _=x();a={..._,content:_.content+w},v()},onToolCallStreamingStartPart(w){const _=x();_.toolInvocations==null&&(_.toolInvocations=[]),h[w.toolCallId]={text:"",toolName:w.toolName,index:_.toolInvocations.length},_.toolInvocations.push({state:"partial-call",toolCallId:w.toolCallId,toolName:w.toolName,args:void 0}),v()},onToolCallDeltaPart(w){const _=x(),R=h[w.toolCallId];R.text+=w.argsTextDelta;const{value:C}=Z_e(R.text);_.toolInvocations[R.index]={state:"partial-call",toolCallId:w.toolCallId,toolName:R.toolName,args:C},v()},async onToolCallPart(w){const _=x();if(h[w.toolCallId]!=null?_.toolInvocations[h[w.toolCallId].index]={state:"call",...w}:(_.toolInvocations==null&&(_.toolInvocations=[]),_.toolInvocations.push({state:"call",...w})),n){const R=await n({toolCall:w});R!=null&&(_.toolInvocations[_.toolInvocations.length-1]={state:"result",...w,result:R})}v()},onToolResultPart(w){const R=x().toolInvocations;if(R==null)throw new Error("tool_result must be preceded by a tool_call");const C=R.findIndex(T=>T.toolCallId===w.toolCallId);if(C===-1)throw new Error("tool_result must be preceded by a tool_call with the same toolCallId");R[C]={...R[C],state:"result",...w},v()},onDataPart(w){d.push(...w),v()},onMessageAnnotationsPart(w){p==null?p=[...w]:p.push(...w),v()},onFinishStepPart(w){l=!w.isContinued},onStartStepPart(w){c=w.messageId},onFinishMessagePart(w){b=w.finishReason,w.usage!=null&&(m=aCe(w.usage))},onErrorPart(w){throw new Error(w)}}),r==null||r({message:a,finishReason:b,usage:m})}async function cCe({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 uCe=()=>fetch;async function dCe({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=uCe()}){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 cCe({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 lCe({stream:b.body,update:l,onToolCall:u,onFinish({message:v,finishReason:x,usage:w}){c&&v!=null&&c(v,{usage:w,finishReason:x})},generateId:d});return}default:{const v=n;throw new Error(`Unknown stream protocol: ${v}`)}}}async function lN(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 P$=xE(),cN=Object.prototype.hasOwnProperty;function YC(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--&&YC(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(cN.call(e,n)&&++r&&!cN.call(t,n)||!(n in t)||!YC(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const ea=new WeakMap,Qa=()=>{},ti=Qa(),KC=Object,Vt=e=>e===ti,as=e=>typeof e=="function",pl=(e,t)=>({...e,...t}),T$=e=>as(e.then),uS={},qb={},sP="undefined",ox=typeof window!=sP,XC=typeof document!=sP,fCe=()=>ox&&typeof window.requestAnimationFrame!=sP,O$=(e,t)=>{const n=ea.get(e);return[()=>!Vt(t)&&e.get(t)||uS,r=>{if(!Vt(t)){const i=e.get(t);t in qb||(qb[t]=i),n[5](t,pl(i,r),i||uS)}},n[6],()=>!Vt(t)&&t in qb?qb[t]:!Vt(t)&&e.get(t)||uS]};let QC=!0;const hCe=()=>QC,[JC,ZC]=ox&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Qa,Qa],pCe=()=>{const e=XC&&document.visibilityState;return Vt(e)||e!=="hidden"},gCe=e=>(XC&&document.addEventListener("visibilitychange",e),JC("focus",e),()=>{XC&&document.removeEventListener("visibilitychange",e),ZC("focus",e)}),mCe=e=>{const t=()=>{QC=!0,e()},n=()=>{QC=!1};return JC("online",t),JC("offline",n),()=>{ZC("online",t),ZC("offline",n)}},bCe={isOnline:hCe,isVisible:pCe},yCe={initFocus:gCe,initReconnect:mCe},uN=!P.useId,Qp=!ox||"Deno"in globalThis,vCe=e=>fCe()?window.requestAnimationFrame(e):setTimeout(e,1),dS=Qp?P.useEffect:P.useLayoutEffect,fS=typeof navigator<"u"&&navigator.connection,dN=!Qp&&fS&&(["slow-2g","2g"].includes(fS.effectiveType)||fS.saveData),Yb=new WeakMap,hS=(e,t)=>KC.prototype.toString.call(e)===`[object ${t}]`;let xCe=0;const eE=e=>{const t=typeof e,n=hS(e,"Date"),r=hS(e,"RegExp"),i=hS(e,"Object");let o,s;if(KC(e)===e&&!n&&!r){if(o=Yb.get(e),o)return o;if(o=++xCe+"~",Yb.set(e,o),Array.isArray(e)){for(o="@",s=0;s<e.length;s++)o+=eE(e[s])+",";Yb.set(e,o)}if(i){o="#";const a=KC.keys(e).sort();for(;!Vt(s=a.pop());)Vt(e[s])||(o+=s+":"+eE(e[s])+",");Yb.set(e,o)}}else o=n?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return o},aP=e=>{if(as(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?eE(e):"",[e,t]};let wCe=0;const tE=()=>++wCe,M$=0,A$=1,D$=2,SCe=3;var dh={__proto__:null,ERROR_REVALIDATE_EVENT:SCe,FOCUS_EVENT:M$,MUTATE_EVENT:D$,RECONNECT_EVENT:A$};async function I$(...e){const[t,n,r,i]=e,o=pl({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(as(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]=aP(p);if(!h)return;const[m,b]=O$(t,h),[v,x,w,_]=ea.get(t),R=()=>{const X=v[h];return(as(o.revalidate)?o.revalidate(m().data,p):o.revalidate!==!1)&&(delete w[h],delete _[h],X&&X[0])?X[0](D$).then(()=>m().data):m().data};if(e.length<3)return R();let C=r,T;const M=tE();x[h]=[M,0];const I=!Vt(l),k=m(),L=k.data,j=k._c,$=Vt(j)?L:j;if(I&&(l=as(l)?l($,L):l,b({data:l,_c:$})),as(C))try{C=C($)}catch(X){T=X}if(C&&T$(C))if(C=await C.catch(X=>{T=X}),M!==x[h][0]){if(T)throw T;return C}else T&&I&&c(T)&&(s=!0,b({data:$,_c:ti}));if(s&&!T)if(as(s)){const X=s(C,$);b({data:X,error:ti,_c:ti})}else b({data:C,error:ti,_c:ti});if(x[h][1]=tE(),Promise.resolve(R()).then(()=>{b({_c:ti})}),T){if(u)throw T;return}return C}}const fN=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},_Ce=(e,t)=>{if(!ea.has(e)){const n=pl(yCe,t),r={},i=I$.bind(ti,e);let o=Qa;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(!ea.has(e)&&(ea.set(e,[r,{},{},{},i,l,a]),!Qp)){const u=n.initFocus(setTimeout.bind(ti,fN.bind(ti,r,M$))),d=n.initReconnect(setTimeout.bind(ti,fN.bind(ti,r,A$)));o=()=>{u&&u(),d&&d(),ea.delete(e)}}};return c(),[e,i,c,o]}return[e,ea.get(e)[4]]},CCe=(e,t,n,r,i)=>{const o=n.errorRetryCount,s=i.retryCount,a=~~((Math.random()+.5)*(1<<(s<8?s:8)))*n.errorRetryInterval;!Vt(o)&&s>o||setTimeout(r,a,i)},ECe=YC,[k$,RCe]=_Ce(new Map),PCe=pl({onLoadingSlow:Qa,onSuccess:Qa,onError:Qa,onErrorRetry:CCe,onDiscarded:Qa,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:dN?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:dN?5e3:3e3,compare:ECe,isPaused:()=>!1,cache:k$,mutate:RCe,fallback:{}},bCe),TCe=(e,t)=>{const n=pl(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=pl(i,s))}return n},OCe=P.createContext({}),MCe="$inf$",N$=ox&&window.__SWR_DEVTOOLS_USE__,ACe=N$?window.__SWR_DEVTOOLS_USE__:[],DCe=()=>{N$&&(window.__SWR_DEVTOOLS_REACT__=P)},ICe=e=>as(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],kCe=()=>pl(PCe,P.useContext(OCe)),NCe=e=>(t,n,r)=>e(t,n&&((...o)=>{const[s]=aP(t),[,,,a]=ea.get(k$);if(s.startsWith(MCe))return n(...o);const l=a[s];return Vt(l)?n(...o):(delete a[s],l)}),r),LCe=ACe.concat(NCe),FCe=e=>function(...n){const r=kCe(),[i,o,s]=ICe(n),a=TCe(r,s);let l=e;const{use:c}=a,u=(c||[]).concat(LCe);for(let d=u.length;d--;)l=u[d](l);return l(i,o||a.fetcher||null,a)},jCe=(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())}};DCe();const pS=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}}),gS={dedupe:!0},$Ce=(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]=ea.get(r),[x,w]=aP(e),_=P.useRef(!1),R=P.useRef(!1),C=P.useRef(x),T=P.useRef(t),M=P.useRef(n),I=()=>M.current,k=()=>I().isVisible()&&I().isOnline(),[L,j,$,X]=O$(r,x),H=P.useRef({}).current,F=Vt(s)?Vt(n.fallback)?ti:n.fallback[x]:s,G=(oe,pe)=>{for(const de in H){const Ee=de;if(Ee==="data"){if(!i(oe[Ee],pe[Ee])&&(!Vt(oe[Ee])||!i(q,pe[Ee])))return!1}else if(pe[Ee]!==oe[Ee])return!1}return!0},B=P.useMemo(()=>{const oe=!x||!t?!1:Vt(a)?I().isPaused()||o?!1:l!==!1:a,pe=Be=>{const vt=pl(Be);return delete vt._k,oe?{isValidating:!0,isLoading:!0,...vt}:vt},de=L(),Ee=X(),De=pe(de),ze=de===Ee?De:pe(Ee);let Oe=De;return[()=>{const Be=pe(L());return G(Be,Oe)?(Oe.data=Be.data,Oe.isLoading=Be.isLoading,Oe.isValidating=Be.isValidating,Oe.error=Be.error,Oe):(Oe=Be,Be)},()=>ze]},[r,x]),W=P$.useSyncExternalStore(P.useCallback(oe=>$(x,(pe,de)=>{G(de,pe)||oe()}),[r,x]),B[0],B[1]),K=!_.current,D=h[x]&&h[x].length>0,Y=W.data,U=Vt(Y)?F&&T$(F)?pS(F):F:Y,A=W.error,te=P.useRef(U),q=p?Vt(Y)?te.current:Y:U,se=D&&!Vt(A)?!1:K&&!Vt(a)?a:I().isPaused()?!1:o?Vt(U)?!1:l:Vt(U)||l,J=!!(x&&t&&K&&se),ee=Vt(W.isValidating)?J:W.isValidating,ae=Vt(W.isLoading)?J:W.isLoading,ce=P.useCallback(async oe=>{const pe=T.current;if(!x||!pe||R.current||I().isPaused())return!1;let de,Ee,De=!0;const ze=oe||{},Oe=!b[x]||!ze.dedupe,Be=()=>uN?!R.current&&x===C.current&&_.current:x===C.current,vt={isValidating:!1,isLoading:!1},Mt=()=>{j(vt)},xn=()=>{const pn=b[x];pn&&pn[1]===Ee&&delete b[x]},At={isValidating:!0};Vt(L().data)&&(At.isLoading=!0);try{if(Oe&&(j(At),n.loadingTimeout&&Vt(L().data)&&setTimeout(()=>{De&&Be()&&I().onLoadingSlow(x,n)},n.loadingTimeout),b[x]=[pe(w),tE()]),[de,Ee]=b[x],de=await de,Oe&&setTimeout(xn,n.dedupingInterval),!b[x]||b[x][1]!==Ee)return Oe&&Be()&&I().onDiscarded(x),!1;vt.error=ti;const pn=m[x];if(!Vt(pn)&&(Ee<=pn[0]||Ee<=pn[1]||pn[1]===0))return Mt(),Oe&&Be()&&I().onDiscarded(x),!1;const en=L().data;vt.data=i(en,de)?en:de,Oe&&Be()&&I().onSuccess(de,x,n)}catch(pn){xn();const en=I(),{shouldRetryOnError:fe}=en;en.isPaused()||(vt.error=pn,Oe&&Be()&&(en.onError(pn,x,en),(fe===!0||as(fe)&&fe(pn))&&(!I().revalidateOnFocus||!I().revalidateOnReconnect||k())&&en.onErrorRetry(pn,x,en,_e=>{const He=h[x];He&&He[0]&&He[0](dh.ERROR_REVALIDATE_EVENT,_e)},{retryCount:(ze.retryCount||0)+1,dedupe:!0})))}return De=!1,Mt(),!0},[x,r]),ge=P.useCallback((...oe)=>I$(r,C.current,...oe),[]);if(dS(()=>{T.current=t,M.current=n,Vt(Y)||(te.current=Y)}),dS(()=>{if(!x)return;const oe=ce.bind(ti,gS);let pe=0;const Ee=jCe(x,h,(De,ze={})=>{if(De==dh.FOCUS_EVENT){const Oe=Date.now();I().revalidateOnFocus&&Oe>pe&&k()&&(pe=Oe+I().focusThrottleInterval,oe())}else if(De==dh.RECONNECT_EVENT)I().revalidateOnReconnect&&k()&&oe();else{if(De==dh.MUTATE_EVENT)return ce();if(De==dh.ERROR_REVALIDATE_EVENT)return ce(ze)}});return R.current=!1,C.current=x,_.current=!0,j({_k:w}),se&&(Vt(U)||Qp?oe():vCe(oe)),()=>{R.current=!0,Ee()}},[x]),dS(()=>{let oe;function pe(){const Ee=as(c)?c(L().data):c;Ee&&oe!==-1&&(oe=setTimeout(de,Ee))}function de(){!L().error&&(u||I().isVisible())&&(d||I().isOnline())?ce(gS).then(pe):pe()}return pe(),()=>{oe&&(clearTimeout(oe),oe=-1)}},[c,u,d,x]),P.useDebugValue(q),o&&Vt(U)&&x){if(!uN&&Qp)throw new Error("Fallback data is required when using Suspense in SSR.");T.current=t,M.current=n,R.current=!1;const oe=v[x];if(!Vt(oe)){const pe=ge(oe);pS(pe)}if(Vt(A)){const pe=ce(gS);Vt(q)||(pe.status="fulfilled",pe.value=!0),pS(pe)}else throw A}return{mutate:ge,get data(){return H.data=!0,q},get error(){return H.error=!0,A},get isValidating(){return H.isValidating=!0,ee},get isLoading(){return H.isLoading=!0,ae}}},Kb=FCe($Ce);function zCe(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 BCe=zCe;const HCe=qc(BCe);function hN(e,t){return t!=null?HCe(e,t):e}var VCe=async(e,t,n,r,i,o,s,a,l,c,u,d,p,h,m,b,v,x)=>{var w;const _=s.current;n(t.messages,!1);const R=h?t.messages:t.messages.map(({role:T,content:M,experimental_attachments:I,data:k,annotations:L,toolInvocations:j})=>({role:T,content:M,...I!==void 0&&{experimental_attachments:I},...k!==void 0&&{data:k},...L!==void 0&&{annotations:L},...j!==void 0&&{toolInvocations:j}})),C=i.current;return await dCe({api:e,body:(w=m==null?void 0:m({id:x,messages:t.messages,requestData:t.data,requestBody:t.body}))!=null?w:{id:x,messages:R,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(T,M){n([...t.messages,...T],!1),M!=null&&M.length&&r([...C??[],...M],!1)},onToolCall:p,onFinish:u,generateId:l,fetch:b})};function WCe({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=R$,fetch:v,keepLastMessageOnError:x=!0,experimental_throttle:w}={}){const[_]=P.useState(b),R=t??_,C=typeof e=="string"?[e,R]:R,[T]=P.useState([]),{data:M,mutate:I}=Kb([C,"messages"],null,{fallbackData:n??T}),k=P.useRef(M||[]);P.useEffect(()=>{k.current=M||[]},[M]);const{data:L,mutate:j}=Kb([C,"streamData"],null),$=P.useRef(L);P.useEffect(()=>{$.current=L},[L]);const{data:X=!1,mutate:H}=Kb([C,"loading"],null),{data:F=void 0,mutate:G}=Kb([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 K=P.useCallback(async ce=>{const ge=k.current.length;try{H(!0),G(void 0);const de=new AbortController;B.current=de,await VCe(e,ce,hN(I,w),hN(j,w),$,W,k,B,b,l,u,c,o,i,s,v,x,R),B.current=null}catch(de){if(de.name==="AbortError")return B.current=null,null;d&&de instanceof Error&&d(de),G(de)}finally{H(!1)}const oe=k.current,pe=oe[oe.length-1];oe.length>ge&&pe!=null&&a>1&&pN(pe)&&UCe(oe)<a&&await K({messages:oe})},[I,H,e,W,c,u,d,G,j,$,l,i,s,o,a,k,B,b,v,x,w,R]),D=P.useCallback(async(ce,{data:ge,headers:oe,body:pe,experimental_attachments:de}={})=>{var Ee,De;const ze=await lN(de),Oe=k.current.concat({...ce,id:(Ee=ce.id)!=null?Ee:b(),createdAt:(De=ce.createdAt)!=null?De:new Date,experimental_attachments:ze.length>0?ze:void 0});return K({messages:Oe,headers:oe,body:pe,data:ge})},[K,b]),Y=P.useCallback(async({data:ce,headers:ge,body:oe}={})=>{const pe=k.current;if(pe.length===0)return null;const de=pe[pe.length-1];return K({messages:de.role==="assistant"?pe.slice(0,-1):pe,headers:ge,body:oe,data:ce})},[K]),U=P.useCallback(()=>{B.current&&(B.current.abort(),B.current=null)},[]),A=P.useCallback(ce=>{typeof ce=="function"&&(ce=ce(k.current)),I(ce,!1),k.current=ce},[I]),te=P.useCallback(ce=>{typeof ce=="function"&&(ce=ce($.current)),j(ce,!1),$.current=ce},[j]),[q,se]=P.useState(r),J=P.useCallback(async(ce,ge={},oe)=>{var pe;if((pe=ce==null?void 0:ce.preventDefault)==null||pe.call(ce),!q&&!ge.allowEmptySubmit)return;oe&&(W.current={...W.current,...oe});const de=await lN(ge.experimental_attachments),De={messages:!q&&!de.length&&ge.allowEmptySubmit?k.current:k.current.concat({id:b(),createdAt:new Date,role:"user",content:q,experimental_attachments:de.length>0?de:void 0}),headers:ge.headers,body:ge.body,data:ge.data};K(De),se("")},[q,b,K]);return{messages:M||[],id:R,setMessages:A,data:L,setData:te,error:F,append:D,reload:Y,stop:U,input:q,setInput:se,handleInputChange:ce=>{se(ce.target.value)},handleSubmit:J,isLoading:X,addToolResult:({toolCallId:ce,result:ge})=>{const oe=k.current.map((de,Ee,De)=>Ee===De.length-1&&de.role==="assistant"&&de.toolInvocations?{...de,toolInvocations:de.toolInvocations.map(ze=>ze.toolCallId===ce?{...ze,result:ge,state:"result"}:ze)}:de);I(oe,!1);const pe=oe[oe.length-1];pN(pe)&&K({messages:oe})}}}function pN(e){return e.role==="assistant"&&e.toolInvocations&&e.toolInvocations.length>0&&e.toolInvocations.every(t=>"result"in t)}function UCe(e){let t=0;for(let n=e.length-1;n>=0&&e[n].role==="assistant";n--)t++;return t}var lP="Switch",[GCe,SIe]=or(lP),[qCe,YCe]=GCe(lP),L$=E.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]=E.useState(null),m=rt(t,_=>h(_)),b=E.useRef(!1),v=p?u||!!p.closest("form"):!0,[x=!1,w]=$r({prop:i,defaultProp:o,onChange:c});return y.jsxs(qCe,{scope:n,checked:x,disabled:a,children:[y.jsx(Fe.button,{type:"button",role:"switch","aria-checked":x,"aria-required":s,"data-state":$$(x),"data-disabled":a?"":void 0,disabled:a,value:l,...d,ref:m,onClick:Re(e.onClick,_=>{w(R=>!R),v&&(b.current=_.isPropagationStopped(),b.current||_.stopPropagation())})}),v&&y.jsx(KCe,{control:p,bubbles:!b.current,name:r,value:l,checked:x,required:s,disabled:a,form:u,style:{transform:"translateX(-100%)"}})]})});L$.displayName=lP;var F$="SwitchThumb",j$=E.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,i=YCe(F$,n);return y.jsx(Fe.span,{"data-state":$$(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:t})});j$.displayName=F$;var KCe=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,o=E.useRef(null),s=zv(n),a=Mv(t);return E.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 $$(e){return e?"checked":"unchecked"}var sx=L$,z$=j$;const B$=E.forwardRef(({className:e,...t},n)=>y.jsx(sx,{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(z$,{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")})}));B$.displayName=sx.displayName;const XCe=E.forwardRef(({className:e,...t},n)=>y.jsx(sx,{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(z$,{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")})}));XCe.displayName=sx.displayName;function QCe(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const JCe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ZCe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,eEe={};function gN(e,t){return(eEe.jsx?ZCe:JCe).test(e)}const tEe=/[ \t\n\f\r]/g;function nEe(e){return typeof e=="object"?e.type==="text"?mN(e.value):!1:mN(e)}function mN(e){return e.replace(tEe,"")===""}class Zg{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}Zg.prototype.property={};Zg.prototype.normal={};Zg.prototype.space=null;function H$(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 Zg(n,r,t)}function nE(e){return e.toLowerCase()}class wo{constructor(t,n){this.property=t,this.attribute=n}}wo.prototype.space=null;wo.prototype.boolean=!1;wo.prototype.booleanish=!1;wo.prototype.overloadedBoolean=!1;wo.prototype.number=!1;wo.prototype.commaSeparated=!1;wo.prototype.spaceSeparated=!1;wo.prototype.commaOrSpaceSeparated=!1;wo.prototype.mustUseProperty=!1;wo.prototype.defined=!1;let rEe=0;const ct=tu(),Yn=tu(),V$=tu(),Te=tu(),bn=tu(),td=tu(),Ni=tu();function tu(){return 2**++rEe}const rE=Object.freeze(Object.defineProperty({__proto__:null,boolean:ct,booleanish:Yn,commaOrSpaceSeparated:Ni,commaSeparated:td,number:Te,overloadedBoolean:V$,spaceSeparated:bn},Symbol.toStringTag,{value:"Module"})),mS=Object.keys(rE);class cP extends wo{constructor(t,n,r,i){let o=-1;if(super(t,n),bN(this,"space",i),typeof r=="number")for(;++o<mS.length;){const s=mS[o];bN(this,mS[o],(r&rE[s])===rE[s])}}}cP.prototype.defined=!0;function bN(e,t,n){n&&(e[t]=n)}const iEe={}.hasOwnProperty;function Ef(e){const t={},n={};let r;for(r in e.properties)if(iEe.call(e.properties,r)){const i=e.properties[r],o=new cP(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[nE(r)]=r,n[nE(o.attribute)]=r}return new Zg(t,n,e.space)}const W$=Ef({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}}),U$=Ef({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function G$(e,t){return t in e?e[t]:t}function q$(e,t){return G$(e,t.toLowerCase())}const Y$=Ef({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:q$,properties:{xmlns:null,xmlnsXLink:null}}),K$=Ef({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:Yn,ariaAutoComplete:null,ariaBusy:Yn,ariaChecked:Yn,ariaColCount:Te,ariaColIndex:Te,ariaColSpan:Te,ariaControls:bn,ariaCurrent:null,ariaDescribedBy:bn,ariaDetails:null,ariaDisabled:Yn,ariaDropEffect:bn,ariaErrorMessage:null,ariaExpanded:Yn,ariaFlowTo:bn,ariaGrabbed:Yn,ariaHasPopup:null,ariaHidden:Yn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:bn,ariaLevel:Te,ariaLive:null,ariaModal:Yn,ariaMultiLine:Yn,ariaMultiSelectable:Yn,ariaOrientation:null,ariaOwns:bn,ariaPlaceholder:null,ariaPosInSet:Te,ariaPressed:Yn,ariaReadOnly:Yn,ariaRelevant:null,ariaRequired:Yn,ariaRoleDescription:bn,ariaRowCount:Te,ariaRowIndex:Te,ariaRowSpan:Te,ariaSelected:Yn,ariaSetSize:Te,ariaSort:null,ariaValueMax:Te,ariaValueMin:Te,ariaValueNow:Te,ariaValueText:null,role:null}}),oEe=Ef({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:q$,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:td,acceptCharset:bn,accessKey:bn,action:null,allow:null,allowFullScreen:ct,allowPaymentRequest:ct,allowUserMedia:ct,alt:null,as:null,async:ct,autoCapitalize:null,autoComplete:bn,autoFocus:ct,autoPlay:ct,blocking:bn,capture:null,charSet:null,checked:ct,cite:null,className:bn,cols:Te,colSpan:null,content:null,contentEditable:Yn,controls:ct,controlsList:bn,coords:Te|td,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ct,defer:ct,dir:null,dirName:null,disabled:ct,download:V$,draggable:Yn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ct,formTarget:null,headers:bn,height:Te,hidden:ct,high:Te,href:null,hrefLang:null,htmlFor:bn,httpEquiv:bn,id:null,imageSizes:null,imageSrcSet:null,inert:ct,inputMode:null,integrity:null,is:null,isMap:ct,itemId:null,itemProp:bn,itemRef:bn,itemScope:ct,itemType:bn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ct,low:Te,manifest:null,max:null,maxLength:Te,media:null,method:null,min:null,minLength:Te,multiple:ct,muted:ct,name:null,nonce:null,noModule:ct,noValidate:ct,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:ct,optimum:Te,pattern:null,ping:bn,placeholder:null,playsInline:ct,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ct,referrerPolicy:null,rel:bn,required:ct,reversed:ct,rows:Te,rowSpan:Te,sandbox:bn,scope:null,scoped:ct,seamless:ct,selected:ct,shadowRootClonable:ct,shadowRootDelegatesFocus:ct,shadowRootMode:null,shape:null,size:Te,sizes:null,slot:null,span:Te,spellCheck:Yn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Te,step:null,style:null,tabIndex:Te,target:null,title:null,translate:null,type:null,typeMustMatch:ct,useMap:null,value:Yn,width:Te,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:bn,axis:null,background:null,bgColor:null,border:Te,borderColor:null,bottomMargin:Te,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ct,declare:ct,event:null,face:null,frame:null,frameBorder:null,hSpace:Te,leftMargin:Te,link:null,longDesc:null,lowSrc:null,marginHeight:Te,marginWidth:Te,noResize:ct,noHref:ct,noShade:ct,noWrap:ct,object:null,profile:null,prompt:null,rev:null,rightMargin:Te,rules:null,scheme:null,scrolling:Yn,standby:null,summary:null,text:null,topMargin:Te,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Te,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ct,disableRemotePlayback:ct,prefix:null,property:null,results:Te,security:null,unselectable:null}}),sEe=Ef({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:G$,properties:{about:Ni,accentHeight:Te,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Te,amplitude:Te,arabicForm:null,ascent:Te,attributeName:null,attributeType:null,azimuth:Te,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Te,by:null,calcMode:null,capHeight:Te,className:bn,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:Te,diffuseConstant:Te,direction:null,display:null,dur:null,divisor:Te,dominantBaseline:null,download:ct,dx:null,dy:null,edgeMode:null,editable:null,elevation:Te,enableBackground:null,end:null,event:null,exponent:Te,externalResourcesRequired:null,fill:null,fillOpacity:Te,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:td,g2:td,glyphName:td,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Te,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Te,horizOriginX:Te,horizOriginY:Te,id:null,ideographic:Te,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Te,k:Te,k1:Te,k2:Te,k3:Te,k4:Te,kernelMatrix:Ni,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Te,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:Te,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:Te,overlineThickness:Te,paintOrder:null,panose1:null,path:null,pathLength:Te,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:bn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Te,pointsAtY:Te,pointsAtZ:Te,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ni,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ni,rev:Ni,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ni,requiredFeatures:Ni,requiredFonts:Ni,requiredFormats:Ni,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:Te,specularExponent:Te,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Te,strikethroughThickness:Te,string:null,stroke:null,strokeDashArray:Ni,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Te,strokeOpacity:Te,strokeWidth:null,style:null,surfaceScale:Te,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ni,tabIndex:Te,tableValues:null,target:null,targetX:Te,targetY:Te,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ni,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Te,underlineThickness:Te,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Te,values:null,vAlphabetic:Te,vMathematical:Te,vectorEffect:null,vHanging:Te,vIdeographic:Te,version:null,vertAdvY:Te,vertOriginX:Te,vertOriginY:Te,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Te,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),aEe=/^data[-\w.:]+$/i,yN=/-[a-z]/g,lEe=/[A-Z]/g;function cEe(e,t){const n=nE(t);let r=t,i=wo;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&aEe.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(yN,dEe);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!yN.test(o)){let s=o.replace(lEe,uEe);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=cP}return new i(r,t)}function uEe(e){return"-"+e.toLowerCase()}function dEe(e){return e.charAt(1).toUpperCase()}const fEe={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"},hEe=H$([U$,W$,Y$,K$,oEe],"html"),uP=H$([U$,W$,Y$,K$,sEe],"svg");function pEe(e){return e.join(" ").trim()}var X$={},vN=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,gEe=/\n/g,mEe=/^\s*/,bEe=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,yEe=/^:\s*/,vEe=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,xEe=/^[;\s]*/,wEe=/^\s+|\s+$/g,SEe=`
|
|
360
|
+
`,xN="/",wN="*",Xl="",_Ee="comment",CEe="declaration",EEe=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(gEe);b&&(n+=b.length);var v=m.lastIndexOf(SEe);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(mEe)}function u(m){var b;for(m=m||[];b=d();)b!==!1&&m.push(b);return m}function d(){var m=o();if(!(xN!=e.charAt(0)||wN!=e.charAt(1))){for(var b=2;Xl!=e.charAt(b)&&(wN!=e.charAt(b)||xN!=e.charAt(b+1));)++b;if(b+=2,Xl===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:_Ee,comment:v})}}function p(){var m=o(),b=l(bEe);if(b){if(d(),!l(yEe))return a("property missing ':'");var v=l(vEe),x=m({type:CEe,property:SN(b[0].replace(vN,Xl)),value:v?SN(v[0].replace(vN,Xl)):Xl});return l(xEe),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 SN(e){return e?e.replace(wEe,Xl):Xl}var REe=La&&La.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(X$,"__esModule",{value:!0});var _N=X$.default=TEe,PEe=REe(EEe);function TEe(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,PEe.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 OEe=_N.default||_N,Q$=J$("end"),dP=J$("start");function J$(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 MEe(e){const t=dP(e),n=Q$(e);if(t&&n)return{start:t,end:n}}function ip(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?CN(e.position):"start"in e||"end"in e?CN(e):"line"in e||"column"in e?iE(e):""}function iE(e){return EN(e&&e.line)+":"+EN(e&&e.column)}function CN(e){return iE(e&&e.start)+"-"+iE(e&&e.end)}function EN(e){return e&&typeof e=="number"?e:1}class zr 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=ip(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}}zr.prototype.file="";zr.prototype.name="";zr.prototype.reason="";zr.prototype.message="";zr.prototype.stack="";zr.prototype.column=void 0;zr.prototype.line=void 0;zr.prototype.ancestors=void 0;zr.prototype.cause=void 0;zr.prototype.fatal=void 0;zr.prototype.place=void 0;zr.prototype.ruleId=void 0;zr.prototype.source=void 0;const fP={}.hasOwnProperty,AEe=new Map,DEe=/[A-Z]/g,IEe=/-([a-z])/g,kEe=new Set(["table","tbody","thead","tfoot","tr"]),NEe=new Set(["td","th"]),Z$="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function LEe(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=WEe(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=VEe(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"?uP:hEe,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=ez(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function ez(e,t,n){if(t.type==="element")return FEe(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return jEe(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return zEe(e,t,n);if(t.type==="mdxjsEsm")return $Ee(e,t);if(t.type==="root")return BEe(e,t,n);if(t.type==="text")return HEe(e,t)}function FEe(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=uP,e.schema=i),e.ancestors.push(t);const o=nz(e,t.tagName,!1),s=UEe(e,t);let a=pP(e,t);return kEe.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!nEe(l):!0})),tz(e,s,o,t),hP(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function jEe(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)}Jp(e,t.position)}function $Ee(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Jp(e,t.position)}function zEe(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=uP,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:nz(e,t.name,!0),s=GEe(e,t),a=pP(e,t);return tz(e,s,o,t),hP(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function BEe(e,t,n){const r={};return hP(r,pP(e,t)),e.create(t,e.Fragment,r,n)}function HEe(e,t){return t.value}function tz(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function hP(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function VEe(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 WEe(e,t){return n;function n(r,i,o,s){const a=Array.isArray(o.children),l=dP(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 UEe(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&fP.call(t.properties,i)){const o=qEe(e,i,t.properties[i]);if(o){const[s,a]=o;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&NEe.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 GEe(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 Jp(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 Jp(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function pP(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:AEe;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=ez(e,o,s);a!==void 0&&n.push(a)}return n}function qEe(e,t,n){const r=cEe(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?QCe(n):pEe(n)),r.property==="style"){let i=typeof n=="object"?n:YEe(e,String(n));return e.stylePropertyNameCase==="css"&&(i=KEe(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?fEe[r.property]||r.property:r.attribute,n]}}function YEe(e,t){const n={};try{OEe(t,r)}catch(i){if(!e.ignoreInvalidStyle){const o=i,s=new zr("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=Z$+"#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(IEe,QEe)),n[s]=o}}function nz(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=gN(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=gN(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return fP.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Jp(e)}function Jp(e,t){const n=new zr("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=Z$+"#cannot-handle-mdx-estrees-without-createevaluater",n}function KEe(e){const t={};let n;for(n in e)fP.call(e,n)&&(t[XEe(n)]=e[n]);return t}function XEe(e){let t=e.replace(DEe,JEe);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function QEe(e,t){return t.toUpperCase()}function JEe(e){return"-"+e.toLowerCase()}const bS={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"]},ZEe={};function eRe(e,t){const n=ZEe,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return rz(e,r,i)}function rz(e,t,n){if(tRe(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 RN(e.children,t,n)}return Array.isArray(e)?RN(e,t,n):""}function RN(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=rz(e[i],t,n);return r.join("")}function tRe(e){return!!(e&&typeof e=="object")}const PN=document.createElement("i");function gP(e){const t="&"+e+";";PN.innerHTML=t;const n=PN.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Ss(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 fo(e,t){return e.length>0?(Ss(e,e.length,0,t),e):t}const TN={}.hasOwnProperty;function nRe(e){const t={};let n=-1;for(;++n<e.length;)rRe(t,e[n]);return t}function rRe(e,t){let n;for(n in t){const i=(TN.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){TN.call(i,s)||(i[s]=[]);const a=o[s];iRe(i[s],Array.isArray(a)?a:a?[a]:[])}}}function iRe(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Ss(e,0,0,r)}function iz(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 nd(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ls=Sl(/[A-Za-z]/),Bi=Sl(/[\dA-Za-z]/),oRe=Sl(/[#-'*+\--9=?A-Z^-~]/);function oE(e){return e!==null&&(e<32||e===127)}const sE=Sl(/\d/),sRe=Sl(/[\dA-Fa-f]/),aRe=Sl(/[!-/:-@[-`{-~]/);function et(e){return e!==null&&e<-2}function Ci(e){return e!==null&&(e<0||e===32)}function qt(e){return e===-2||e===-1||e===32}const lRe=Sl(new RegExp("\\p{P}|\\p{S}","u")),cRe=Sl(/\s/);function Sl(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Rf(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&Bi(e.charCodeAt(n+1))&&Bi(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 yn(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(l){return qt(l)?(e.enter(n),a(l)):t(l)}function a(l){return qt(l)&&o++<i?(e.consume(l),a):(e.exit(n),t(l))}}const uRe={tokenize:dRe};function dRe(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"),yn(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 fRe={tokenize:hRe},ON={tokenize:pRe};function hRe(e){const t=this,n=[];let r=0,i,o,s;return a;function a(_){if(r<n.length){const R=n[r];return t.containerState=R[1],e.attempt(R[0].continuation,l,c)(_)}return c(_)}function l(_){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&w();const R=t.events.length;let C=R,T;for(;C--;)if(t.events[C][0]==="exit"&&t.events[C][1].type==="chunkFlow"){T=t.events[C][1].end;break}x(r);let M=R;for(;M<t.events.length;)t.events[M][1].end={...T},M++;return Ss(t.events,C+1,0,t.events.slice(R)),t.events.length=M,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(ON,u,d)(_)}function u(_){return i&&w(),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(ON,h,m)(_)}function h(_){return r++,n.push([t.currentConstruct,t.containerState]),p(_)}function m(_){if(_===null){i&&w(),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(_,R){const C=t.sliceStream(_);if(R&&C.push(null),_.previous=o,o&&(o.next=_),o=_,i.defineSkip(_.start),i.write(C),t.parser.lazy[_.start.line]){let T=i.events.length;for(;T--;)if(i.events[T][1].start.offset<s&&(!i.events[T][1].end||i.events[T][1].end.offset>s))return;const M=t.events.length;let I=M,k,L;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){if(k){L=t.events[I][1].end;break}k=!0}for(x(r),T=M;T<t.events.length;)t.events[T][1].end={...L},T++;Ss(t.events,I+1,0,t.events.slice(M)),t.events.length=T}}function x(_){let R=n.length;for(;R-- >_;){const C=n[R];t.containerState=C[1],C[0].exit.call(t,e)}n.length=_}function w(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function pRe(e,t,n){return yn(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function MN(e){if(e===null||Ci(e)||cRe(e))return 1;if(lRe(e))return 2}function mP(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 aE={name:"attention",resolveAll:gRe,tokenize:mRe};function gRe(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};AN(d,-l),AN(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=fo(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=fo(c,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),c=fo(c,mP(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=fo(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=fo(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,Ss(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 mRe(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=MN(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=MN(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 AN(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const bRe={name:"autolink",tokenize:yRe};function yRe(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 ls(h)?(e.consume(h),s):h===64?n(h):c(h)}function s(h){return h===43||h===45||h===46||Bi(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||Bi(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||oE(h)?n(h):(e.consume(h),l)}function c(h){return h===64?(e.consume(h),u):oRe(h)?(e.consume(h),c):n(h)}function u(h){return Bi(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||Bi(h))&&r++<63){const m=h===45?p:d;return e.consume(h),m}return n(h)}}const ax={partial:!0,tokenize:vRe};function vRe(e,t,n){return r;function r(o){return qt(o)?yn(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||et(o)?t(o):n(o)}}const oz={continuation:{tokenize:wRe},exit:SRe,name:"blockQuote",tokenize:xRe};function xRe(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 qt(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function wRe(e,t,n){const r=this;return i;function i(s){return qt(s)?yn(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(oz,t,n)(s)}}function SRe(e){e.exit("blockQuote")}const sz={name:"characterEscape",tokenize:_Re};function _Re(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 aRe(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const az={name:"characterReference",tokenize:CRe};function CRe(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=Bi,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=sRe,u):(e.enter("characterReferenceValue"),o=7,s=sE,u(d))}function u(d){if(d===59&&i){const p=e.exit("characterReferenceValue");return s===Bi&&!gP(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 DN={partial:!0,tokenize:RRe},IN={concrete:!0,name:"codeFenced",tokenize:ERe};function ERe(e,t,n){const r=this,i={partial:!0,tokenize:C};let o=0,s=0,a;return l;function l(T){return c(T)}function c(T){const M=r.events[r.events.length-1];return o=M&&M[1].type==="linePrefix"?M[2].sliceSerialize(M[1],!0).length:0,a=T,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(T)}function u(T){return T===a?(s++,e.consume(T),u):s<3?n(T):(e.exit("codeFencedFenceSequence"),qt(T)?yn(e,d,"whitespace")(T):d(T))}function d(T){return T===null||et(T)?(e.exit("codeFencedFence"),r.interrupt?t(T):e.check(DN,b,R)(T)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(T))}function p(T){return T===null||et(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(T)):qt(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),yn(e,h,"whitespace")(T)):T===96&&T===a?n(T):(e.consume(T),p)}function h(T){return T===null||et(T)?d(T):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(T))}function m(T){return T===null||et(T)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(T)):T===96&&T===a?n(T):(e.consume(T),m)}function b(T){return e.attempt(i,R,v)(T)}function v(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),x}function x(T){return o>0&&qt(T)?yn(e,w,"linePrefix",o+1)(T):w(T)}function w(T){return T===null||et(T)?e.check(DN,b,R)(T):(e.enter("codeFlowValue"),_(T))}function _(T){return T===null||et(T)?(e.exit("codeFlowValue"),w(T)):(e.consume(T),_)}function R(T){return e.exit("codeFenced"),t(T)}function C(T,M,I){let k=0;return L;function L(F){return T.enter("lineEnding"),T.consume(F),T.exit("lineEnding"),j}function j(F){return T.enter("codeFencedFence"),qt(F)?yn(T,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):$(F)}function $(F){return F===a?(T.enter("codeFencedFenceSequence"),X(F)):I(F)}function X(F){return F===a?(k++,T.consume(F),X):k>=s?(T.exit("codeFencedFenceSequence"),qt(F)?yn(T,H,"whitespace")(F):H(F)):I(F)}function H(F){return F===null||et(F)?(T.exit("codeFencedFence"),M(F)):I(F)}}}function RRe(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 yS={name:"codeIndented",tokenize:TRe},PRe={partial:!0,tokenize:ORe};function TRe(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),yn(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(PRe,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 ORe(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):yn(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 MRe={name:"codeText",previous:DRe,resolve:ARe,tokenize:IRe};function ARe(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 DRe(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function IRe(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 kRe{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&&fh(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),fh(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),fh(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);fh(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);fh(this.left,n.reverse())}}}function fh(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 lz(e){const t={};let n=-1,r,i,o,s,a,l,c;const u=new kRe(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,NRe(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 Ss(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function NRe(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]),w=o.pop();l.push([w,w+x.length-1]),e.splice(w,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 LRe={resolve:jRe,tokenize:$Re},FRe={partial:!0,tokenize:zRe};function jRe(e){return lz(e),e}function $Re(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(FRe,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 zRe(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),yn(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 cz(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||oE(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||Ci(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||oE(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 uz(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=!qt(h)),h===92?p:d)}function p(h){return h===91||h===92||h===93?(e.consume(h),a++,d):d(h)}}function dz(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"),yn(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 op(e,t){let n;return r;function r(i){return et(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):qt(i)?yn(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const BRe={name:"definition",tokenize:VRe},HRe={partial:!0,tokenize:WRe};function VRe(e,t,n){const r=this;let i;return o;function o(h){return e.enter("definition"),s(h)}function s(h){return uz.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return i=nd(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 Ci(h)?op(e,c)(h):c(h)}function c(h){return cz(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function u(h){return e.attempt(HRe,d,d)(h)}function d(h){return qt(h)?yn(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 WRe(e,t,n){return r;function r(a){return Ci(a)?op(e,i)(a):n(a)}function i(a){return dz(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return qt(a)?yn(e,s,"whitespace")(a):s(a)}function s(a){return a===null||et(a)?t(a):n(a)}}const URe={name:"hardBreakEscape",tokenize:GRe};function GRe(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 qRe={name:"headingAtx",resolve:YRe,tokenize:KRe};function YRe(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"},Ss(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function KRe(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||Ci(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)):qt(u)?yn(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||Ci(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const XRe=["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"],kN=["pre","script","style","textarea"],QRe={concrete:!0,name:"htmlFlow",resolveTo:e2e,tokenize:t2e},JRe={partial:!0,tokenize:r2e},ZRe={partial:!0,tokenize:n2e};function e2e(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 t2e(e,t,n){const r=this;let i,o,s,a,l;return c;function c(A){return u(A)}function u(A){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(A),d}function d(A){return A===33?(e.consume(A),p):A===47?(e.consume(A),o=!0,b):A===63?(e.consume(A),i=3,r.interrupt?t:D):ls(A)?(e.consume(A),s=String.fromCharCode(A),v):n(A)}function p(A){return A===45?(e.consume(A),i=2,h):A===91?(e.consume(A),i=5,a=0,m):ls(A)?(e.consume(A),i=4,r.interrupt?t:D):n(A)}function h(A){return A===45?(e.consume(A),r.interrupt?t:D):n(A)}function m(A){const te="CDATA[";return A===te.charCodeAt(a++)?(e.consume(A),a===te.length?r.interrupt?t:$:m):n(A)}function b(A){return ls(A)?(e.consume(A),s=String.fromCharCode(A),v):n(A)}function v(A){if(A===null||A===47||A===62||Ci(A)){const te=A===47,q=s.toLowerCase();return!te&&!o&&kN.includes(q)?(i=1,r.interrupt?t(A):$(A)):XRe.includes(s.toLowerCase())?(i=6,te?(e.consume(A),x):r.interrupt?t(A):$(A)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(A):o?w(A):_(A))}return A===45||Bi(A)?(e.consume(A),s+=String.fromCharCode(A),v):n(A)}function x(A){return A===62?(e.consume(A),r.interrupt?t:$):n(A)}function w(A){return qt(A)?(e.consume(A),w):L(A)}function _(A){return A===47?(e.consume(A),L):A===58||A===95||ls(A)?(e.consume(A),R):qt(A)?(e.consume(A),_):L(A)}function R(A){return A===45||A===46||A===58||A===95||Bi(A)?(e.consume(A),R):C(A)}function C(A){return A===61?(e.consume(A),T):qt(A)?(e.consume(A),C):_(A)}function T(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),l=A,M):qt(A)?(e.consume(A),T):I(A)}function M(A){return A===l?(e.consume(A),l=null,k):A===null||et(A)?n(A):(e.consume(A),M)}function I(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||Ci(A)?C(A):(e.consume(A),I)}function k(A){return A===47||A===62||qt(A)?_(A):n(A)}function L(A){return A===62?(e.consume(A),j):n(A)}function j(A){return A===null||et(A)?$(A):qt(A)?(e.consume(A),j):n(A)}function $(A){return A===45&&i===2?(e.consume(A),G):A===60&&i===1?(e.consume(A),B):A===62&&i===4?(e.consume(A),Y):A===63&&i===3?(e.consume(A),D):A===93&&i===5?(e.consume(A),K):et(A)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(JRe,U,X)(A)):A===null||et(A)?(e.exit("htmlFlowData"),X(A)):(e.consume(A),$)}function X(A){return e.check(ZRe,H,U)(A)}function H(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),F}function F(A){return A===null||et(A)?X(A):(e.enter("htmlFlowData"),$(A))}function G(A){return A===45?(e.consume(A),D):$(A)}function B(A){return A===47?(e.consume(A),s="",W):$(A)}function W(A){if(A===62){const te=s.toLowerCase();return kN.includes(te)?(e.consume(A),Y):$(A)}return ls(A)&&s.length<8?(e.consume(A),s+=String.fromCharCode(A),W):$(A)}function K(A){return A===93?(e.consume(A),D):$(A)}function D(A){return A===62?(e.consume(A),Y):A===45&&i===2?(e.consume(A),D):$(A)}function Y(A){return A===null||et(A)?(e.exit("htmlFlowData"),U(A)):(e.consume(A),Y)}function U(A){return e.exit("htmlFlow"),t(A)}}function n2e(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 r2e(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(ax,t,n)}}const i2e={name:"htmlText",tokenize:o2e};function o2e(e,t,n){const r=this;let i,o,s;return a;function a(D){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(D),l}function l(D){return D===33?(e.consume(D),c):D===47?(e.consume(D),C):D===63?(e.consume(D),_):ls(D)?(e.consume(D),I):n(D)}function c(D){return D===45?(e.consume(D),u):D===91?(e.consume(D),o=0,m):ls(D)?(e.consume(D),w):n(D)}function u(D){return D===45?(e.consume(D),h):n(D)}function d(D){return D===null?n(D):D===45?(e.consume(D),p):et(D)?(s=d,B(D)):(e.consume(D),d)}function p(D){return D===45?(e.consume(D),h):d(D)}function h(D){return D===62?G(D):D===45?p(D):d(D)}function m(D){const Y="CDATA[";return D===Y.charCodeAt(o++)?(e.consume(D),o===Y.length?b:m):n(D)}function b(D){return D===null?n(D):D===93?(e.consume(D),v):et(D)?(s=b,B(D)):(e.consume(D),b)}function v(D){return D===93?(e.consume(D),x):b(D)}function x(D){return D===62?G(D):D===93?(e.consume(D),x):b(D)}function w(D){return D===null||D===62?G(D):et(D)?(s=w,B(D)):(e.consume(D),w)}function _(D){return D===null?n(D):D===63?(e.consume(D),R):et(D)?(s=_,B(D)):(e.consume(D),_)}function R(D){return D===62?G(D):_(D)}function C(D){return ls(D)?(e.consume(D),T):n(D)}function T(D){return D===45||Bi(D)?(e.consume(D),T):M(D)}function M(D){return et(D)?(s=M,B(D)):qt(D)?(e.consume(D),M):G(D)}function I(D){return D===45||Bi(D)?(e.consume(D),I):D===47||D===62||Ci(D)?k(D):n(D)}function k(D){return D===47?(e.consume(D),G):D===58||D===95||ls(D)?(e.consume(D),L):et(D)?(s=k,B(D)):qt(D)?(e.consume(D),k):G(D)}function L(D){return D===45||D===46||D===58||D===95||Bi(D)?(e.consume(D),L):j(D)}function j(D){return D===61?(e.consume(D),$):et(D)?(s=j,B(D)):qt(D)?(e.consume(D),j):k(D)}function $(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),i=D,X):et(D)?(s=$,B(D)):qt(D)?(e.consume(D),$):(e.consume(D),H)}function X(D){return D===i?(e.consume(D),i=void 0,F):D===null?n(D):et(D)?(s=X,B(D)):(e.consume(D),X)}function H(D){return D===null||D===34||D===39||D===60||D===61||D===96?n(D):D===47||D===62||Ci(D)?k(D):(e.consume(D),H)}function F(D){return D===47||D===62||Ci(D)?k(D):n(D)}function G(D){return D===62?(e.consume(D),e.exit("htmlTextData"),e.exit("htmlText"),t):n(D)}function B(D){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),W}function W(D){return qt(D)?yn(e,K,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):K(D)}function K(D){return e.enter("htmlTextData"),s(D)}}const bP={name:"labelEnd",resolveAll:c2e,resolveTo:u2e,tokenize:d2e},s2e={tokenize:f2e},a2e={tokenize:h2e},l2e={tokenize:p2e};function c2e(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&&Ss(e,0,e.length,n),e}function u2e(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=fo(a,e.slice(o+1,o+r+3)),a=fo(a,[["enter",u,t]]),a=fo(a,mP(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),a=fo(a,[["exit",u,t],e[s-2],e[s-1],["exit",c,t]]),a=fo(a,e.slice(s+1)),a=fo(a,[["exit",l,t]]),Ss(e,o,e.length,a),e}function d2e(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(nd(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(s2e,u,s?u:d)(p):p===91?e.attempt(a2e,u,s?c:d)(p):s?u(p):d(p)}function c(p){return e.attempt(l2e,u,d)(p)}function u(p){return t(p)}function d(p){return o._balanced=!0,n(p)}}function f2e(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 Ci(d)?op(e,o)(d):o(d)}function o(d){return d===41?u(d):cz(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function s(d){return Ci(d)?op(e,l)(d):u(d)}function a(d){return n(d)}function l(d){return d===34||d===39||d===40?dz(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return Ci(d)?op(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 h2e(e,t,n){const r=this;return i;function i(a){return uz.call(r,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(nd(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function p2e(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 g2e={name:"labelStartImage",resolveAll:bP.resolveAll,tokenize:m2e};function m2e(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 b2e={name:"labelStartLink",resolveAll:bP.resolveAll,tokenize:y2e};function y2e(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 vS={name:"lineEnding",tokenize:v2e};function v2e(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),yn(e,t,"linePrefix")}}const Sy={name:"thematicBreak",tokenize:x2e};function x2e(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"),qt(c)?yn(e,a,"whitespace")(c):a(c))}}const pi={continuation:{tokenize:C2e},exit:R2e,name:"list",tokenize:_2e},w2e={partial:!0,tokenize:P2e},S2e={partial:!0,tokenize:E2e};function _2e(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:sE(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(Sy,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 sE(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(ax,r.interrupt?n:u,e.attempt(w2e,p,d))}function u(h){return r.containerState.initialBlankLine=!0,o++,p(h)}function d(h){return qt(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 C2e(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(ax,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,yn(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!qt(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(S2e,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,yn(e,e.attempt(pi,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function E2e(e,t,n){const r=this;return yn(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 R2e(e){e.exit(this.containerState.type)}function P2e(e,t,n){const r=this;return yn(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!qt(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const NN={name:"setextUnderline",resolveTo:T2e,tokenize:O2e};function T2e(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 O2e(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"),qt(c)?yn(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||et(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const M2e={tokenize:A2e};function A2e(e){const t=this,n=e.attempt(ax,r,e.attempt(this.parser.constructs.flowInitial,i,yn(e,e.attempt(this.parser.constructs.flow,i,e.attempt(LRe,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 D2e={resolveAll:hz()},I2e=fz("string"),k2e=fz("text");function fz(e){return{resolveAll:hz(e==="text"?N2e: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 hz(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 N2e(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 L2e={42:pi,43:pi,45:pi,48:pi,49:pi,50:pi,51:pi,52:pi,53:pi,54:pi,55:pi,56:pi,57:pi,62:oz},F2e={91:BRe},j2e={[-2]:yS,[-1]:yS,32:yS},$2e={35:qRe,42:Sy,45:[NN,Sy],60:QRe,61:NN,95:Sy,96:IN,126:IN},z2e={38:az,92:sz},B2e={[-5]:vS,[-4]:vS,[-3]:vS,33:g2e,38:az,42:aE,60:[bRe,i2e],91:b2e,92:[URe,sz],93:bP,95:aE,96:MRe},H2e={null:[aE,D2e]},V2e={null:[42,95]},W2e={null:[]},U2e=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:V2e,contentInitial:F2e,disable:W2e,document:L2e,flow:$2e,flowInitial:j2e,insideSpan:H2e,string:z2e,text:B2e},Symbol.toStringTag,{value:"Module"}));function G2e(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:M(C),check:M(T),consume:w,enter:_,exit:R,interrupt:M(T,{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=fo(s,j),v(),s[s.length-1]!==null?[]:(I(t,0),c.events=mP(o,c.events,c),c.events)}function p(j,$){return Y2e(h(j),$)}function h(j){return q2e(s,j)}function m(){const{_bufferIndex:j,_index:$,line:X,column:H,offset:F}=r;return{_bufferIndex:j,_index:$,line:X,column:H,offset:F}}function b(j){i[j.line]=j.column,L()}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 w(j){et(j)?(r.line++,r.column=1,r.offset+=j===-3?2:1,L()):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 R(j){const $=a.pop();return $.end=m(),c.events.push(["exit",$,c]),$}function C(j,$){I(j,$.from)}function T(j,$){$.restore()}function M(j,$){return X;function X(H,F,G){let B,W,K,D;return Array.isArray(H)?U(H):"tokenize"in H?U([H]):Y(H);function Y(se){return J;function J(ee){const ae=ee!==null&&se[ee],ce=ee!==null&&se.null,ge=[...Array.isArray(ae)?ae:ae?[ae]:[],...Array.isArray(ce)?ce:ce?[ce]:[]];return U(ge)(ee)}}function U(se){return B=se,W=0,se.length===0?G:A(se[W])}function A(se){return J;function J(ee){return D=k(),K=se,se.partial||(c.currentConstruct=se),se.name&&c.parser.constructs.disable.null.includes(se.name)?q():se.tokenize.call($?Object.assign(Object.create(c),$):c,l,te,q)(ee)}}function te(se){return j(K,D),F}function q(se){return D.restore(),++W<B.length?A(B[W]):G}}}function I(j,$){j.resolveAll&&!o.includes(j)&&o.push(j),j.resolve&&Ss(c.events,$,c.events.length-$,j.resolve(c.events.slice($),c)),j.resolveTo&&(c.events=j.resolveTo(c.events,c))}function k(){const j=m(),$=c.previous,X=c.currentConstruct,H=c.events.length,F=Array.from(a);return{from:H,restore:G};function G(){r=j,c.previous=$,c.currentConstruct=X,c.events.length=H,a=F,L()}}function L(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function q2e(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 Y2e(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=`
|
|
361
|
+
`;break}case-3:{s=`\r
|
|
362
|
+
`;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 K2e(e){const r={constructs:nRe([U2e,...(e||{}).extensions||[]]),content:i(uRe),defined:[],document:i(fRe),flow:i(M2e),lazy:{},string:i(I2e),text:i(k2e)};return r;function i(o){return s;function s(a){return G2e(r,o,a)}}}function X2e(e){for(;!lz(e););return e}const LN=/[\0\t\n\r]/g;function Q2e(){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(LN.lastIndex=d,c=LN.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 J2e=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Z2e(e){return e.replace(J2e,ePe)}function ePe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return iz(n.slice(o?2:1),o?16:10)}return gP(n)||e}const pz={}.hasOwnProperty;function tPe(e,t,n){return typeof t!="string"&&(n=t,t=void 0),nPe(n)(X2e(K2e(n).document().write(Q2e()(e,t,!0))))}function nPe(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Be),autolinkProtocol:k,autolinkEmail:k,atxHeading:o(Ee),blockQuote:o(ce),characterEscape:k,characterReference:k,codeFenced:o(ge),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(ge,s),codeText:o(oe,s),codeTextData:k,data:k,codeFlowValue:k,definition:o(pe),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(de),hardBreakEscape:o(De),hardBreakTrailing:o(De),htmlFlow:o(ze,s),htmlFlowData:k,htmlText:o(ze,s),htmlTextData:k,image:o(Oe),label:s,link:o(Be),listItem:o(Mt),listItemValue:p,listOrdered:o(vt,d),listUnordered:o(vt),paragraph:o(xn),reference:A,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(Ee),strong:o(At),thematicBreak:o(en)},exit:{atxHeading:l(),atxHeadingSequence:C,autolink:l(),autolinkEmail:ae,autolinkProtocol:ee,blockQuote:l(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:q,characterReferenceMarkerNumeric:q,characterReferenceValue:se,characterReference:J,codeFenced:l(v),codeFencedFence:b,codeFencedFenceInfo:h,codeFencedFenceMeta:m,codeFlowValue:L,codeIndented:l(x),codeText:l(F),codeTextData:L,data:L,definition:l(),definitionDestinationString:R,definitionLabelString:w,definitionTitleString:_,emphasis:l(),hardBreakEscape:l($),hardBreakTrailing:l($),htmlFlow:l(X),htmlFlowData:L,htmlText:l(H),htmlTextData:L,image:l(B),label:K,labelText:W,lineEnding:j,link:l(G),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:te,resourceDestinationString:D,resourceTitleString:Y,resource:U,setextHeading:l(I),setextHeadingLineSequence:M,setextHeadingText:T,strong:l(),thematicBreak:l()}};gz(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(fe){let _e={type:"root",children:[]};const He={stack:[_e],tokenStack:[],config:t,enter:a,exit:c,buffer:s,resume:u,data:n},Ze=[];let st=-1;for(;++st<fe.length;)if(fe[st][1].type==="listOrdered"||fe[st][1].type==="listUnordered")if(fe[st][0]==="enter")Ze.push(st);else{const kn=Ze.pop();st=i(fe,kn,st)}for(st=-1;++st<fe.length;){const kn=t[fe[st][0]];pz.call(kn,fe[st][1].type)&&kn[fe[st][1].type].call(Object.assign({sliceSerialize:fe[st][2].sliceSerialize},He),fe[st][1])}if(He.tokenStack.length>0){const kn=He.tokenStack[He.tokenStack.length-1];(kn[1]||FN).call(He,void 0,kn[0])}for(_e.position={start:Da(fe.length>0?fe[0][1].start:{line:1,column:1,offset:0}),end:Da(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,He){let Ze=_e-1,st=-1,kn=!1,Bn,Mn,sn,Hn;for(;++Ze<=He;){const tn=fe[Ze];switch(tn[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{tn[0]==="enter"?st++:st--,Hn=void 0;break}case"lineEndingBlank":{tn[0]==="enter"&&(Bn&&!Hn&&!st&&!sn&&(sn=Ze),Hn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Hn=void 0}if(!st&&tn[0]==="enter"&&tn[1].type==="listItemPrefix"||st===-1&&tn[0]==="exit"&&(tn[1].type==="listUnordered"||tn[1].type==="listOrdered")){if(Bn){let sr=Ze;for(Mn=void 0;sr--;){const Zn=fe[sr];if(Zn[1].type==="lineEnding"||Zn[1].type==="lineEndingBlank"){if(Zn[0]==="exit")continue;Mn&&(fe[Mn][1].type="lineEndingBlank",kn=!0),Zn[1].type="lineEnding",Mn=sr}else if(!(Zn[1].type==="linePrefix"||Zn[1].type==="blockQuotePrefix"||Zn[1].type==="blockQuotePrefixWhitespace"||Zn[1].type==="blockQuoteMarker"||Zn[1].type==="listItemIndent"))break}sn&&(!Mn||sn<Mn)&&(Bn._spread=!0),Bn.end=Object.assign({},Mn?fe[Mn][1].start:tn[1].end),fe.splice(Mn||Ze,0,["exit",Bn,tn[2]]),Ze++,He++}if(tn[1].type==="listItemPrefix"){const sr={type:"listItem",_spread:!1,start:Object.assign({},tn[1].start),end:void 0};Bn=sr,fe.splice(Ze,0,["enter",sr,tn[2]]),Ze++,He++,sn=void 0,Hn=!0}}}return fe[_e][1]._spread=kn,He}function o(fe,_e){return He;function He(Ze){a.call(this,fe(Ze),Ze),_e&&_e.call(this,Ze)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(fe,_e,He){this.stack[this.stack.length-1].children.push(fe),this.stack.push(fe),this.tokenStack.push([_e,He||void 0]),fe.position={start:Da(_e.start),end:void 0}}function l(fe){return _e;function _e(He){fe&&fe.call(this,He),c.call(this,He)}}function c(fe,_e){const He=this.stack.pop(),Ze=this.tokenStack.pop();if(Ze)Ze[0].type!==fe.type&&(_e?_e.call(this,fe,Ze[0]):(Ze[1]||FN).call(this,fe,Ze[0]));else throw new Error("Cannot close `"+fe.type+"` ("+ip({start:fe.start,end:fe.end})+"): it’s not open");He.position.end=Da(fe.end)}function u(){return eRe(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 w(fe){const _e=this.resume(),He=this.stack[this.stack.length-1];He.label=_e,He.identifier=nd(this.sliceSerialize(fe)).toLowerCase()}function _(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.title=fe}function R(){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 He=this.sliceSerialize(fe).length;_e.depth=He}}function T(){this.data.setextHeadingSlurpLineEnding=!0}function M(fe){const _e=this.stack[this.stack.length-1];_e.depth=this.sliceSerialize(fe).codePointAt(0)===61?1:2}function I(){this.data.setextHeadingSlurpLineEnding=void 0}function k(fe){const He=this.stack[this.stack.length-1].children;let Ze=He[He.length-1];(!Ze||Ze.type!=="text")&&(Ze=pn(),Ze.position={start:Da(fe.start),end:void 0},He.push(Ze)),this.stack.push(Ze)}function L(fe){const _e=this.stack.pop();_e.value+=this.sliceSerialize(fe),_e.position.end=Da(fe.end)}function j(fe){const _e=this.stack[this.stack.length-1];if(this.data.atHardBreak){const He=_e.children[_e.children.length-1];He.position.end=Da(fe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(_e.type)&&(k.call(this,fe),L.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 H(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.value=fe}function F(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.value=fe}function G(){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),He=this.stack[this.stack.length-2];He.label=Z2e(_e),He.identifier=nd(_e).toLowerCase()}function K(){const fe=this.stack[this.stack.length-1],_e=this.resume(),He=this.stack[this.stack.length-1];if(this.data.inReference=!0,He.type==="link"){const Ze=fe.children;He.children=Ze}else He.alt=_e}function D(){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 U(){this.data.inReference=void 0}function A(){this.data.referenceType="collapsed"}function te(fe){const _e=this.resume(),He=this.stack[this.stack.length-1];He.label=_e,He.identifier=nd(this.sliceSerialize(fe)).toLowerCase(),this.data.referenceType="full"}function q(fe){this.data.characterReferenceType=fe.type}function se(fe){const _e=this.sliceSerialize(fe),He=this.data.characterReferenceType;let Ze;He?(Ze=iz(_e,He==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ze=gP(_e);const st=this.stack[this.stack.length-1];st.value+=Ze}function J(fe){const _e=this.stack.pop();_e.position.end=Da(fe.end)}function ee(fe){L.call(this,fe);const _e=this.stack[this.stack.length-1];_e.url=this.sliceSerialize(fe)}function ae(fe){L.call(this,fe);const _e=this.stack[this.stack.length-1];_e.url="mailto:"+this.sliceSerialize(fe)}function ce(){return{type:"blockquote",children:[]}}function ge(){return{type:"code",lang:null,meta:null,value:""}}function oe(){return{type:"inlineCode",value:""}}function pe(){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 ze(){return{type:"html",value:""}}function Oe(){return{type:"image",title:null,url:"",alt:null}}function Be(){return{type:"link",title:null,url:"",children:[]}}function vt(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 xn(){return{type:"paragraph",children:[]}}function At(){return{type:"strong",children:[]}}function pn(){return{type:"text",value:""}}function en(){return{type:"thematicBreak"}}}function Da(e){return{line:e.line,column:e.column,offset:e.offset}}function gz(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?gz(e,r):rPe(e,r)}}function rPe(e,t){let n;for(n in t)if(pz.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 FN(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ip({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ip({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ip({start:t.start,end:t.end})+") is still open")}function iPe(e){const t=this;t.parser=n;function n(r){return tPe(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function oPe(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 sPe(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
363
|
+
`}]}function aPe(e,t){const n=t.value?t.value+`
|
|
364
|
+
`:"",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 lPe(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function cPe(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function uPe(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Rf(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 dPe(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 fPe(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function mz(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 hPe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return mz(e,t);const i={src:Rf(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 pPe(e,t){const n={src:Rf(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 gPe(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 mPe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return mz(e,t);const i={href:Rf(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 bPe(e,t){const n={href:Rf(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 yPe(e,t,n){const r=e.all(t),i=n?vPe(n):bz(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:`
|
|
365
|
+
`}),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:`
|
|
366
|
+
`});const c={type:"element",tagName:"li",properties:o,children:s};return e.patch(t,c),e.applyData(t,c)}function vPe(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=bz(n[r])}return t}function bz(e){const t=e.spread;return t??e.children.length>1}function xPe(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 wPe(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function SPe(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function _Pe(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function CPe(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=dP(t.children[1]),l=Q$(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 EPe(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 RPe(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const jN=9,$N=32;function PPe(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(zN(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(zN(t.slice(i),i>0,!1)),o.join("")}function zN(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===jN||o===$N;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===jN||o===$N;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function TPe(e,t){const n={type:"text",value:PPe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function OPe(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const MPe={blockquote:oPe,break:sPe,code:aPe,delete:lPe,emphasis:cPe,footnoteReference:uPe,heading:dPe,html:fPe,imageReference:hPe,image:pPe,inlineCode:gPe,linkReference:mPe,link:bPe,listItem:yPe,list:xPe,paragraph:wPe,root:SPe,strong:_Pe,table:CPe,tableCell:RPe,tableRow:EPe,text:TPe,thematicBreak:OPe,toml:Xb,yaml:Xb,definition:Xb,footnoteDefinition:Xb};function Xb(){}const yz=-1,lx=0,O0=1,M0=2,yP=3,vP=4,xP=5,wP=6,vz=7,xz=8,BN=typeof self=="object"?self:globalThis,APe=(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 lx:case yz:return n(s,i);case O0:{const a=n([],i);for(const l of s)a.push(r(l));return a}case M0:{const a=n({},i);for(const[l,c]of s)a[r(l)]=r(c);return a}case yP:return n(new Date(s),i);case vP:{const{source:a,flags:l}=s;return n(new RegExp(a,l),i)}case xP:{const a=n(new Map,i);for(const[l,c]of s)a.set(r(l),r(c));return a}case wP:{const a=n(new Set,i);for(const l of s)a.add(r(l));return a}case vz:{const{name:a,message:l}=s;return n(new BN[a](l),i)}case xz:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i)}return n(new BN[o](s),i)};return r},HN=e=>APe(new Map,e)(0),Au="",{toString:DPe}={},{keys:IPe}=Object,hh=e=>{const t=typeof e;if(t!=="object"||!e)return[lx,t];const n=DPe.call(e).slice(8,-1);switch(n){case"Array":return[O0,Au];case"Object":return[M0,Au];case"Date":return[yP,Au];case"RegExp":return[vP,Au];case"Map":return[xP,Au];case"Set":return[wP,Au]}return n.includes("Array")?[O0,n]:n.includes("Error")?[vz,n]:[M0,n]},Qb=([e,t])=>e===lx&&(t==="function"||t==="symbol"),kPe=(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]=hh(s);switch(a){case lx:{let u=s;switch(l){case"bigint":a=xz,u=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return i([yz],s)}return i([a,u],s)}case O0:{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 M0:{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 IPe(s))(e||!Qb(hh(s[p])))&&u.push([o(p),o(s[p])]);return d}case yP:return i([a,s.toISOString()],s);case vP:{const{source:u,flags:d}=s;return i([a,{source:u,flags:d}],s)}case xP:{const u=[],d=i([a,u],s);for(const[p,h]of s)(e||!(Qb(hh(p))||Qb(hh(h))))&&u.push([o(p),o(h)]);return d}case wP:{const u=[],d=i([a,u],s);for(const p of s)(e||!Qb(hh(p)))&&u.push(o(p));return d}}const{message:c}=s;return i([a,{name:l,message:c}],s)};return o},VN=(e,{json:t,lossy:n}={})=>{const r=[];return kPe(!(t||n),!!t,new Map,r)(e),r},A0=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?HN(VN(e,t)):structuredClone(e):(e,t)=>HN(VN(e,t));function NPe(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 LPe(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function FPe(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||NPe,r=e.options.footnoteBackLabel||LPe,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=Rf(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 w=typeof n=="string"?n:n(l,h);typeof w=="string"&&(w={type:"text",value:w}),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(w)?w:[w]})}const v=u[u.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const w=v.children[v.children.length-1];w&&w.type==="text"?w.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:{...A0(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
367
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
|
368
|
+
`}]}}const wz=function(e){if(e==null)return BPe;if(typeof e=="function")return cx(e);if(typeof e=="object")return Array.isArray(e)?jPe(e):$Pe(e);if(typeof e=="string")return zPe(e);throw new Error("Expected function, string, or object as test")};function jPe(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=wz(e[n]);return cx(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function $Pe(e){const t=e;return cx(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function zPe(e){return cx(t);function t(n){return n&&n.type===e}}function cx(e){return t;function t(n,r,i){return!!(HPe(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function BPe(){return!0}function HPe(e){return e!==null&&typeof e=="object"&&"type"in e}const Sz=[],VPe=!0,WN=!1,WPe="skip";function UPe(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=wz(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=Sz,m,b,v;if((!t||o(l,c,u[u.length-1]||void 0))&&(h=GPe(n(l,u)),h[0]===WN))return h;if("children"in l&&l.children){const x=l;if(x.children&&h[0]!==WPe)for(b=(r?x.children.length:-1)+s,v=u.concat(x);b>-1&&b<x.children.length;){const w=x.children[b];if(m=a(w,b,v)(),m[0]===WN)return m;b=typeof m[1]=="number"?m[1]:b+s}}return h}}}function GPe(e){return Array.isArray(e)?e:typeof e=="number"?[VPe,e]:e==null?Sz:[e]}function _z(e,t,n,r){let i,o,s;typeof t=="function"?(o=void 0,s=t,i=n):(o=t,s=n,i=r),UPe(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 lE={}.hasOwnProperty,qPe={};function YPe(e,t){const n=t||qPe,r=new Map,i=new Map,o=new Map,s={...MPe,...n.handlers},a={all:c,applyData:XPe,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:s,one:l,options:n,patch:KPe,wrap:JPe};return _z(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(lE.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=A0(v);return x.children=a.all(u),x}return A0(u)}return(a.options.unknownHandler||QPe)(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=UN(m.value)),!Array.isArray(m)&&m.type==="element")){const b=m.children[0];b&&b.type==="text"&&(b.value=UN(b.value))}Array.isArray(m)?d.push(...m):d.push(m)}}}return d}}function KPe(e,t){e.position&&(t.position=MEe(e))}function XPe(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,A0(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function QPe(e,t){const n=t.data||{},r="value"in t&&!(lE.call(n,"hProperties")||lE.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 JPe(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
369
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
370
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
371
|
+
`}),n}function UN(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function GN(e,t){const n=YPe(e,t),r=n.one(e,void 0),i=FPe(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
|
|
372
|
+
`},i),o}function ZPe(e,t){return e&&"run"in e?async function(n,r){const i=GN(n,{file:r,...t});await e.run(i,r)}:function(n,r){return GN(n,{file:r,...e||t})}}function qN(e){if(e)throw e}var _y=Object.prototype.hasOwnProperty,Cz=Object.prototype.toString,YN=Object.defineProperty,KN=Object.getOwnPropertyDescriptor,XN=function(t){return typeof Array.isArray=="function"?Array.isArray(t):Cz.call(t)==="[object Array]"},QN=function(t){if(!t||Cz.call(t)!=="[object Object]")return!1;var n=_y.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&_y.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||_y.call(t,i)},JN=function(t,n){YN&&n.name==="__proto__"?YN(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},ZN=function(t,n){if(n==="__proto__")if(_y.call(t,n)){if(KN)return KN(t,n).value}else return;return t[n]},eTe=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=ZN(a,n),i=ZN(t,n),a!==i&&(u&&i&&(QN(i)||(o=XN(i)))?(o?(o=!1,s=r&&XN(r)?r:[]):s=r&&QN(r)?r:{},JN(a,{name:n,newValue:e(u,s,i)})):typeof i<"u"&&JN(a,{name:n,newValue:i}));return a};const xS=qc(eTe);function cE(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 tTe(){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?nTe(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 nTe(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 Qo={basename:rTe,dirname:iTe,extname:oTe,join:sTe,sep:"/"};function rTe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');em(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 iTe(e){if(em(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 oTe(e){em(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 sTe(...e){let t=-1,n;for(;++t<e.length;)em(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":aTe(n)}function aTe(e){em(e);const t=e.codePointAt(0)===47;let n=lTe(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function lTe(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 em(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const cTe={cwd:uTe};function uTe(){return"/"}function uE(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function dTe(e){if(typeof e=="string")e=new URL(e);else if(!uE(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 fTe(e)}function fTe(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 wS=["history","path","basename","stem","extname","dirname"];class Ez{constructor(t){let n;t?uE(t)?n={path:t}:typeof t=="string"||hTe(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":cTe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<wS.length;){const o=wS[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)wS.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Qo.basename(this.path):void 0}set basename(t){_S(t,"basename"),SS(t,"basename"),this.path=Qo.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Qo.dirname(this.path):void 0}set dirname(t){e5(this.basename,"dirname"),this.path=Qo.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Qo.extname(this.path):void 0}set extname(t){if(SS(t,"extname"),e5(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=Qo.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){uE(t)&&(t=dTe(t)),_S(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Qo.basename(this.path,this.extname):void 0}set stem(t){_S(t,"stem"),SS(t,"stem"),this.path=Qo.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 zr(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 SS(e,t){if(e&&e.includes(Qo.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Qo.sep+"`")}function _S(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function e5(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function hTe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const pTe=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},gTe={}.hasOwnProperty;class SP extends pTe{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=tTe()}copy(){const t=new SP;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(xS(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(RS("data",this.frozen),this.namespace[t]=n,this):gTe.call(this.namespace,t)&&this.namespace[t]||void 0:t?(RS("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=Jb(t),r=this.parser||this.Parser;return CS("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),CS("process",this.parser||this.Parser),ES("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,s){const a=Jb(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);yTe(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(),CS("processSync",this.parser||this.Parser),ES("processSync",this.compiler||this.Compiler),this.process(t,i),n5("processSync","process",n),r;function i(o,s){n=!0,qN(o),r=s}}run(t,n,r){t5(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=Jb(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),n5("runSync","run",r),i;function o(s,a){qN(s),i=a,r=!0}}stringify(t,n){this.freeze();const r=Jb(n),i=this.compiler||this.Compiler;return ES("stringify",i),t5(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(RS("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=xS(!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];cE(b)&&cE(h)&&(h=xS(!0,b,h)),r[p]=[c,h,...m]}}}}const mTe=new SP().freeze();function CS(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function ES(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function RS(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 t5(e){if(!cE(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function n5(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Jb(e){return bTe(e)?e:new Ez(e)}function bTe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function yTe(e){return typeof e=="string"||vTe(e)}function vTe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const xTe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",r5=[],i5={allowDangerousHtml:!0},wTe=/^(https?|ircs?|mailto|xmpp)$/i,STe=[{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 Rz(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,o=e.components,s=e.disallowedElements,a=e.rehypePlugins||r5,l=e.remarkPlugins||r5,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...i5}:i5,u=e.skipHtml,d=e.unwrapDisallowed,p=e.urlTransform||_Te,h=mTe().use(iPe).use(l).use(ZPe,c).use(a),m=new Ez;typeof r=="string"&&(m.value=r);for(const w of STe)Object.hasOwn(e,w.from)&&(""+w.from+(w.to?"use `"+w.to+"` instead":"remove it")+xTe+w.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]}),_z(v,x),LEe(v,{Fragment:y.Fragment,components:o,ignoreInvalidStyle:!0,jsx:y.jsx,jsxs:y.jsxs,passKeys:!0,passNode:!0});function x(w,_,R){if(w.type==="raw"&&R&&typeof _=="number")return u?R.children.splice(_,1):R.children[_]={type:"text",value:w.value},_;if(w.type==="element"){let C;for(C in bS)if(Object.hasOwn(bS,C)&&Object.hasOwn(w.properties,C)){const T=w.properties[C],M=bS[C];(M===null||M.includes(w.tagName))&&(w.properties[C]=p(String(T||""),C,w))}}if(w.type==="element"){let C=t?!t.includes(w.tagName):s?s.includes(w.tagName):!1;if(!C&&n&&typeof _=="number"&&(C=!n(w,_,R)),C&&R&&typeof _=="number")return d&&w.children?R.children.splice(_,1,...w.children):R.children.splice(_,1),_}}}function _Te(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||wTe.test(e.slice(0,t))?e:""}function CTe(){const e=P.useRef(null),[t,n]=P.useState(""),[r,i]=P.useState(!1),o=ve(k=>k.dashboard.aiScopeTables);gv();const s=ve(k=>k.selectedSheetId),{addFrame:a,setSelectedFrameId:l,setIsDashboardEditing:c}=hr(),{authToken:u}=vo(),d=wg(),{messages:p,input:h,handleInputChange:m,handleSubmit:b,addToolResult:v,stop:x,isLoading:w}=WCe({api:"https://semaphor.cloud/api/v1/chat",headers:{Authorization:`Bearer ${u==null?void 0:u.accessToken}`},maxSteps:10,async onToolCall({toolCall:k}){if(R(k.toolName),k.toolName==="getLocation"){const L=["New York","Los Angeles","Chicago","San Francisco"];return L[Math.floor(Math.random()*L.length)]}if(k.toolName==="getTables")return JSON.stringify(o||[]);if(k.toolName==="getData"){console.log(k.args);const L=k.args;if(!(L!=null&&L.sql)||!(L!=null&&L.connectionId))return"Please provide sql, connectionId and table";const j=await d.fetchQuery({queryKey:["chat",L.connectionId,L.sql],queryFn:()=>z0("https://semaphor.cloud/api/v1/query",(u==null?void 0:u.accessToken)||(u==null?void 0:u.accessToken)||"",{connection_id:L.connectionId,sql:L.sql,cache_config:PE()})});return n("Summarizing"),JSON.stringify(j)}},onFinish(k,L){console.log("onFinish",k,L),k.content&&n("")}}),_=()=>{var k;(k=e.current)==null||k.scrollIntoView({behavior:"smooth"})};P.useEffect(()=>{_()},[p]);function R(k){k==="getTables"&&n("Initializing"),k==="getSchemas"&&n("Analyzing"),k==="getData"&&n("Fetching")}function C(k){const L=k.toolInvocations||[];return L.length===0||L.find($=>$.toolName==="getData"&&"result"in $)?!0:r}function T(k){return k==null?void 0:k.map(L=>{var $;const j=L.role==="user";return C(L)?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(L3,{className:"size-5 shrink-0"}):y.jsx(I_,{className:"size-5 shrink-0"})}),y.jsx("div",{children:y.jsx(Rz,{components:ETe,children:L.content})})]})}),($=L.toolInvocations)==null?void 0:$.map(X=>{const H=X.toolCallId;return"result"in X?y.jsx("div",{children:M(X)},H):y.jsxs("div",{children:["Calling ",X.toolName,"..."]},H)})]},L.id):null})}function M(k){if("result"in k){let L;try{const j=JSON.parse(k.result);if(L=y.jsx("pre",{className:"whitespace-normal text-xs",children:JSON.stringify(j,null,2)}),k.toolName==="getData"){const $=QR({cardType:k.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"})," ",`${k.toolName}: `,L]}),y.jsxs("div",{className:"flex h-[350px] w-[99%] grow flex-col py-2",children:[y.jsx(Si,{onClick:()=>{const X=k.args.chartTitle,H=k.args.connectionId;I({sql:k.args.sql,data:j.records,cardType:k.args.chartType,cardCfg:$,cardTitle:X,connectionId:H})},variant:"secondary",size:"sm",className:"absolute right-3 top-3",children:"Add"}),$&&y.jsx(E2,{cfg:$})]})]})}}catch{L=y.jsx("span",{children:k.result})}return y.jsxs("div",{children:[y.jsx("span",{className:"font-semibold text-blue-700",children:"Tool call"})," ",`${k.toolName}: `,L]})}return`Calling ${k.toolName}...`}function I({sql:k,data:L,cardCfg:j,cardTitle:$,connectionId:X,cardType:H}){if(!s)return;const F={id:il(),title:$||"Title",description:"Description",preferences:{onClickFilter:[{columnIndex:0,expression:""}],chartOptions:{indexAxis:H==="horizontalBar"?"y":"x"}},type:j.type,cfg:j,sql:k,data:L,connectionId:X},G={id:il(),cards:[F],activeCardId:F.id};c(!0),a(s,G,"start"),l(G.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(En,{className:"flex items-center gap-2 text-xl",children:"Assistant"}),y.jsxs(Dv,{openDelay:700,children:[y.jsx(Iv,{children:y.jsx(M3,{className:"size-4 text-muted-foreground"})}),y.jsx(Lg,{className:"w-70",children:y.jsxs("div",{className:"flex justify-between space-x-2 text-muted-foreground",children:[y.jsx(I_,{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((k,L)=>y.jsxs("div",{className:"flex gap-2 text-xs",children:[y.jsx(k3,{className:"size-4 opacity-70"}),y.jsx("span",{children:k.tableName})]},L))})]})]})})]}),!1]}),y.jsx(Fg,{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(Ec,{className:"w-full border-none focus-visible:ring-0 focus-visible:ring-offset-0",value:h,disabled:w,placeholder:"What can I help you with?",onChange:m}),y.jsx("button",{className:"mr-3",children:y.jsx(g3,{className:"size-4 text-muted-foreground/70 hover:text-muted-foreground"})})]}),w&&y.jsx(Si,{size:"sm",className:"rounded-full",onClick:()=>x(),children:y.jsx(wie,{className:"size-2.5 bg-background"})})]})}),y.jsxs(Rc,{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:[w&&t!==""&&y.jsx(uie,{className:"size-10 animate-pulse"}),t]}),y.jsx("div",{className:"flex flex-col-reverse gap-2 py-2",children:T(p)}),y.jsx(Vg,{orientation:"vertical"})]})]})}const ETe={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:af,createContext:RTe,createRef:_Ie,forwardRef:Pz,useCallback:gi,useContext:Tz,useEffect:Tc,useImperativeHandle:Oz,useLayoutEffect:PTe,useMemo:TTe,useRef:yi,useState:rd}=E,o5=E[`useId${Math.random()}`.slice(0,5)],OTe=PTe,ux=RTe(null);ux.displayName="PanelGroupContext";const Oc=OTe,MTe=typeof o5=="function"?o5:()=>null;let ATe=0;function _P(e=null){const t=MTe(),n=yi(e||t||null);return n.current===null&&(n.current=""+ATe++),e??n.current}function Mz({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=Tz(ux);if(v===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:x,expandPanel:w,getPanelSize:_,getPanelStyle:R,groupId:C,isPanelCollapsed:T,reevaluatePanelConstraints:M,registerPanel:I,resizePanel:k,unregisterPanel:L}=v,j=_P(s),$=yi({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});yi({didLogMissingDefaultSizeWarning:!1}),Oc(()=>{const{callbacks:H,constraints:F}=$.current,G={...F};$.current.id=j,$.current.idIsFromProps=s!==void 0,$.current.order=p,H.onCollapse=c,H.onExpand=u,H.onResize=d,F.collapsedSize=n,F.collapsible=r,F.defaultSize=i,F.maxSize=a,F.minSize=l,(G.collapsedSize!==F.collapsedSize||G.collapsible!==F.collapsible||G.maxSize!==F.maxSize||G.minSize!==F.minSize)&&M($.current,G)}),Oc(()=>{const H=$.current;return I(H),()=>{L(H)}},[p,j,I,L]),Oz(o,()=>({collapse:()=>{x($.current)},expand:H=>{w($.current,H)},getId(){return j},getSize(){return _($.current)},isCollapsed(){return T($.current)},isExpanded(){return!T($.current)},resize:H=>{k($.current,H)}}),[x,w,_,T,j,k]);const X=R($.current,i);return af(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 Az=Pz((e,t)=>af(Mz,{...e,forwardedRef:t}));Mz.displayName="Panel";Az.displayName="forwardRef(Panel)";let dE=null,oc=null;function DTe(e,t){if(t){const n=(t&Lz)!==0,r=(t&Fz)!==0,i=(t&jz)!==0,o=(t&$z)!==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 ITe(){oc!==null&&(document.head.removeChild(oc),dE=null,oc=null)}function PS(e,t){const n=DTe(e,t);dE!==n&&(dE=n,oc===null&&(oc=document.createElement("style"),document.head.appendChild(oc)),oc.innerHTML=`*{cursor: ${n}!important;}`)}function Dz(e){return e.type==="keydown"}function Iz(e){return e.type.startsWith("pointer")}function kz(e){return e.type.startsWith("mouse")}function dx(e){if(Iz(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(kz(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function kTe(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function NTe(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 LTe(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:l5(e),b:l5(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;yt(r,"Stacking order can only be calculated for elements with a common ancestor");const i={a:a5(s5(n.a)),b:a5(s5(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 FTe=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function jTe(e){var t;const n=getComputedStyle((t=Nz(e))!==null&&t!==void 0?t:e).display;return n==="flex"||n==="inline-flex"}function $Te(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||jTe(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"||FTe.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function s5(e){let t=e.length;for(;t--;){const n=e[t];if(yt(n,"Missing node"),$Te(n))return n}return null}function a5(e){return e&&Number(getComputedStyle(e).zIndex)||0}function l5(e){const t=[];for(;e;)t.push(e),e=Nz(e);return t}function Nz(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const Lz=1,Fz=2,jz=4,$z=8,zTe=kTe()==="coarse";let jo=[],id=!1,Fa=new Map,fx=new Map;const Zp=new Set;function BTe(e,t,n,r,i){var o;const{ownerDocument:s}=t,a={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:i},l=(o=Fa.get(s))!==null&&o!==void 0?o:0;return Fa.set(s,l+1),Zp.add(a),D0(),function(){var u;fx.delete(e),Zp.delete(a);const d=(u=Fa.get(s))!==null&&u!==void 0?u:1;if(Fa.set(s,d-1),D0(),d===1&&Fa.delete(s),jo.includes(a)){const p=jo.indexOf(a);p>=0&&jo.splice(p,1),EP(),i("up",!0,null)}}}function c5(e){const{target:t}=e,{x:n,y:r}=dx(e);id=!0,CP({target:t,x:n,y:r}),D0(),jo.length>0&&(I0("down",e),e.preventDefault(),e.stopPropagation())}function ph(e){const{x:t,y:n}=dx(e);if(id&&e.buttons===0&&(id=!1,I0("up",e)),!id){const{target:r}=e;CP({target:r,x:t,y:n})}I0("move",e),EP(),jo.length>0&&e.preventDefault()}function Du(e){const{target:t}=e,{x:n,y:r}=dx(e);fx.clear(),id=!1,jo.length>0&&e.preventDefault(),I0("up",e),CP({target:t,x:n,y:r}),EP(),D0()}function CP({target:e,x:t,y:n}){jo.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),Zp.forEach(i=>{const{element:o,hitAreaMargins:s}=i,a=o.getBoundingClientRect(),{bottom:l,left:c,right:u,top:d}=a,p=zTe?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)&<e(r,o)>0){let m=r,b=!1;for(;m&&!m.contains(o);){if(NTe(m.getBoundingClientRect(),a)){b=!0;break}m=m.parentElement}if(b)return}jo.push(i)}})}function TS(e,t){fx.set(e,t)}function EP(){let e=!1,t=!1;jo.forEach(r=>{const{direction:i}=r;i==="horizontal"?e=!0:t=!0});let n=0;fx.forEach(r=>{n|=r}),e&&t?PS("intersection",n):e?PS("horizontal",n):t?PS("vertical",n):ITe()}function D0(){Fa.forEach((e,t)=>{const{body:n}=t;n.removeEventListener("contextmenu",Du),n.removeEventListener("pointerdown",c5),n.removeEventListener("pointerleave",ph),n.removeEventListener("pointermove",ph)}),window.removeEventListener("pointerup",Du),window.removeEventListener("pointercancel",Du),Zp.size>0&&(id?(jo.length>0&&Fa.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("contextmenu",Du),n.addEventListener("pointerleave",ph),n.addEventListener("pointermove",ph))}),window.addEventListener("pointerup",Du),window.addEventListener("pointercancel",Du)):Fa.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("pointerdown",c5,{capture:!0}),n.addEventListener("pointermove",ph))}))}function I0(e,t){Zp.forEach(n=>{const{setResizeHandlerState:r}=n,i=jo.includes(n);r(e,i,t)})}function HTe(){const[e,t]=rd(0);return gi(()=>t(n=>n+1),[])}function yt(e,t){if(!e)throw console.error(t),Error(t)}const RP=10;function Vc(e,t,n=RP){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function ta(e,t,n=RP){return Vc(e,t,n)===0}function ji(e,t,n){return Vc(e,t,n)===0}function VTe(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(!ji(i,o,n))return!1}return!0}function Vu({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];yt(r!=null,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:o,maxSize:s=100,minSize:a=0}=r;if(Vc(n,a)<0)if(o){const l=(i+a)/2;Vc(n,l)<0?n=i:n=a}else n=a;return n=Math.min(s,n),n=parseFloat(n.toFixed(RP)),n}function kh({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:o}){if(ji(e,0))return t;const s=[...t],[a,l]=r;yt(a!=null,"Invalid first pivot index"),yt(l!=null,"Invalid second pivot index");let c=0;if(o==="keyboard"){{const d=e<0?l:a,p=n[d];yt(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(yt(v!=null,`Previous layout not found for panel index ${d}`),ji(v,h)){const x=b-v;Vc(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}{const d=e<0?a:l,p=n[d];yt(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(yt(v!=null,`Previous layout not found for panel index ${d}`),ji(v,b)){const x=v-h;Vc(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];yt(b!=null,`Previous layout not found for panel index ${p}`);const x=Vu({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];yt(m!=null,`Previous layout not found for panel index ${p}`);const b=m-h,v=Vu({panelConstraints:n,panelIndex:p,size:b});if(!ji(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(VTe(i,s))return i;{const d=e<0?l:a,p=t[d];yt(p!=null,`Previous layout not found for panel index ${d}`);const h=p+c,m=Vu({panelConstraints:n,panelIndex:d,size:h});if(s[d]=m,!ji(m,h)){let b=h-m,x=e<0?l:a;for(;x>=0&&x<n.length;){const w=s[x];yt(w!=null,`Previous layout not found for panel index ${x}`);const _=w+b,R=Vu({panelConstraints:n,panelIndex:x,size:_});if(ji(w,R)||(b-=R-w,s[x]=R),ji(b,0))break;e>0?x--:x++}}}const u=s.reduce((d,p)=>p+d,0);return ji(u,100)?s:i}function WTe({layout:e,panelsArray:t,pivotIndices:n}){let r=0,i=100,o=0,s=0;const a=n[0];yt(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 eg(e,t=document){return Array.from(t.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function zz(e,t,n=document){const i=eg(e,n).findIndex(o=>o.getAttribute("data-panel-resize-handle-id")===t);return i??null}function Bz(e,t,n){const r=zz(e,t,n);return r!=null?[r,r+1]:[-1,-1]}function Hz(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 hx(e,t=document){const n=t.querySelector(`[data-panel-resize-handle-id="${e}"]`);return n||null}function UTe(e,t,n,r=document){var i,o,s,a;const l=hx(t,r),c=eg(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 GTe({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:i,panelGroupElement:o,setLayout:s}){yi({didWarnAboutMissingResizeHandle:!1}),Oc(()=>{if(!o)return;const a=eg(n,o);for(let l=0;l<i.length-1;l++){const{valueMax:c,valueMin:u,valueNow:d}=WTe({layout:r,panelsArray:i,pivotIndices:[l,l+1]}),p=a[l];if(p!=null){const h=i[l];yt(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]),Tc(()=>{if(!o)return;const a=t.current;yt(a,"Eager values not found");const{panelDataArray:l}=a,c=Hz(n,o);yt(c!=null,`No group found for id "${n}"`);const u=eg(n,o);yt(u,`No resize handles found for group id "${n}"`);const d=u.map(p=>{const h=p.getAttribute("data-panel-resize-handle-id");yt(h,"Resize handle element has no handle id attribute");const[m,b]=UTe(n,h,l,o);if(m==null||b==null)return()=>{};const v=x=>{if(!x.defaultPrevented)switch(x.key){case"Enter":{x.preventDefault();const w=l.findIndex(_=>_.id===m);if(w>=0){const _=l[w];yt(_,`No panel data found for index ${w}`);const R=r[w],{collapsedSize:C=0,collapsible:T,minSize:M=0}=_.constraints;if(R!=null&&T){const I=kh({delta:ji(R,C)?M-C:C-R,initialLayout:r,panelConstraints:l.map(k=>k.constraints),pivotIndices:Bz(n,h,o),prevLayout:r,trigger:"keyboard"});r!==I&&s(I)}}break}}};return p.addEventListener("keydown",v),()=>{p.removeEventListener("keydown",v)}});return()=>{d.forEach(p=>p())}},[o,e,t,n,r,i,s])}function u5(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 Vz(e,t){const n=e==="horizontal",{x:r,y:i}=dx(t);return n?r:i}function qTe(e,t,n,r,i){const o=n==="horizontal",s=hx(t,i);yt(s,`No resize handle element found for id "${t}"`);const a=s.getAttribute("data-panel-group-id");yt(a,"Resize handle element has no group id attribute");let{initialCursorPosition:l}=r;const c=Vz(n,e),u=Hz(a,i);yt(u,`No group element found for id "${a}"`);const d=u.getBoundingClientRect(),p=o?d.width:d.height;return(c-l)/p*100}function YTe(e,t,n,r,i,o){if(Dz(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:qTe(e,t,n,r,o)}function KTe({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];yt(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];yt(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 Iu(e,t,n){t.forEach((r,i)=>{const o=e[i];yt(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||ta(d,c))&&!ta(r,c)&&h(),p&&(d==null||!ta(d,c))&&ta(r,c)&&p())}})}function Zb(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 XTe({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 QTe(e,t=10){let n=null;return(...i)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...i)},t)}}function d5(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 Wz(e){return`react-resizable-panels:${e}`}function Uz(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 Gz(e,t){try{const n=Wz(e),r=t.getItem(n);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function JTe(e,t,n){var r,i;const o=(r=Gz(e,n))!==null&&r!==void 0?r:{},s=Uz(t);return(i=o[s])!==null&&i!==void 0?i:null}function ZTe(e,t,n,r,i){var o;const s=Wz(e),a=Uz(t),l=(o=Gz(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 f5({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(!ji(r,100)&&n.length>0)for(let o=0;o<t.length;o++){const s=n[o];yt(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];yt(s!=null,`No layout data found for index ${o}`);const a=Vu({panelConstraints:t,panelIndex:o,size:s});s!=a&&(i+=s-a,n[o]=a)}if(!ji(i,0))for(let o=0;o<t.length;o++){const s=n[o];yt(s!=null,`No layout data found for index ${o}`);const a=s+i,l=Vu({panelConstraints:t,panelIndex:o,size:a});if(s!==l&&(i-=l-s,n[o]=l,ji(i,0)))break}return n}const eOe=100,Nh={getItem:e=>(d5(Nh),Nh.getItem(e)),setItem:(e,t)=>{d5(Nh),Nh.setItem(e,t)}},h5={};function qz({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:i,id:o=null,onLayout:s=null,keyboardResizeBy:a=null,storage:l=Nh,style:c,tagName:u="div",...d}){const p=_P(o),h=yi(null),[m,b]=rd(null),[v,x]=rd([]),w=HTe(),_=yi({}),R=yi(new Map),C=yi(0),T=yi({autoSaveId:e,direction:r,dragState:m,id:p,keyboardResizeBy:a,onLayout:s,storage:l}),M=yi({layout:v,panelDataArray:[],panelDataArrayChanged:!1});yi({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),Oz(i,()=>({getId:()=>T.current.id,getLayout:()=>{const{layout:A}=M.current;return A},setLayout:A=>{const{onLayout:te}=T.current,{layout:q,panelDataArray:se}=M.current,J=f5({layout:A,panelConstraints:se.map(ee=>ee.constraints)});u5(q,J)||(x(J),M.current.layout=J,te&&te(J),Iu(se,J,_.current))}}),[]),Oc(()=>{T.current.autoSaveId=e,T.current.direction=r,T.current.dragState=m,T.current.id=p,T.current.onLayout=s,T.current.storage=l}),GTe({committedValuesRef:T,eagerValuesRef:M,groupId:p,layout:v,panelDataArray:M.current.panelDataArray,setLayout:x,panelGroupElement:h.current}),Tc(()=>{const{panelDataArray:A}=M.current;if(e){if(v.length===0||v.length!==A.length)return;let te=h5[e];te==null&&(te=QTe(ZTe,eOe),h5[e]=te);const q=[...A],se=new Map(R.current);te(e,q,se,v,l)}},[e,v,l]),Tc(()=>{});const I=gi(A=>{const{onLayout:te}=T.current,{layout:q,panelDataArray:se}=M.current;if(A.constraints.collapsible){const J=se.map(ge=>ge.constraints),{collapsedSize:ee=0,panelSize:ae,pivotIndices:ce}=zl(se,A,q);if(yt(ae!=null,`Panel size not found for panel "${A.id}"`),!ta(ae,ee)){R.current.set(A.id,ae);const oe=Nu(se,A)===se.length-1?ae-ee:ee-ae,pe=kh({delta:oe,initialLayout:q,panelConstraints:J,pivotIndices:ce,prevLayout:q,trigger:"imperative-api"});Zb(q,pe)||(x(pe),M.current.layout=pe,te&&te(pe),Iu(se,pe,_.current))}}},[]),k=gi((A,te)=>{const{onLayout:q}=T.current,{layout:se,panelDataArray:J}=M.current;if(A.constraints.collapsible){const ee=J.map(de=>de.constraints),{collapsedSize:ae=0,panelSize:ce=0,minSize:ge=0,pivotIndices:oe}=zl(J,A,se),pe=te??ge;if(ta(ce,ae)){const de=R.current.get(A.id),Ee=de!=null&&de>=pe?de:pe,ze=Nu(J,A)===J.length-1?ce-Ee:Ee-ce,Oe=kh({delta:ze,initialLayout:se,panelConstraints:ee,pivotIndices:oe,prevLayout:se,trigger:"imperative-api"});Zb(se,Oe)||(x(Oe),M.current.layout=Oe,q&&q(Oe),Iu(J,Oe,_.current))}}},[]),L=gi(A=>{const{layout:te,panelDataArray:q}=M.current,{panelSize:se}=zl(q,A,te);return yt(se!=null,`Panel size not found for panel "${A.id}"`),se},[]),j=gi((A,te)=>{const{panelDataArray:q}=M.current,se=Nu(q,A);return XTe({defaultSize:te,dragState:m,layout:v,panelData:q,panelIndex:se})},[m,v]),$=gi(A=>{const{layout:te,panelDataArray:q}=M.current,{collapsedSize:se=0,collapsible:J,panelSize:ee}=zl(q,A,te);return yt(ee!=null,`Panel size not found for panel "${A.id}"`),J===!0&&ta(ee,se)},[]),X=gi(A=>{const{layout:te,panelDataArray:q}=M.current,{collapsedSize:se=0,collapsible:J,panelSize:ee}=zl(q,A,te);return yt(ee!=null,`Panel size not found for panel "${A.id}"`),!J||Vc(ee,se)>0},[]),H=gi(A=>{const{panelDataArray:te}=M.current;te.push(A),te.sort((q,se)=>{const J=q.order,ee=se.order;return J==null&&ee==null?0:J==null?-1:ee==null?1:J-ee}),M.current.panelDataArrayChanged=!0,w()},[w]);Oc(()=>{if(M.current.panelDataArrayChanged){M.current.panelDataArrayChanged=!1;const{autoSaveId:A,onLayout:te,storage:q}=T.current,{layout:se,panelDataArray:J}=M.current;let ee=null;if(A){const ce=JTe(A,J,q);ce&&(R.current=new Map(Object.entries(ce.expandToSizes)),ee=ce.layout)}ee==null&&(ee=KTe({panelDataArray:J}));const ae=f5({layout:ee,panelConstraints:J.map(ce=>ce.constraints)});u5(se,ae)||(x(ae),M.current.layout=ae,te&&te(ae),Iu(J,ae,_.current))}}),Oc(()=>{const A=M.current;return()=>{A.layout=[]}},[]);const F=gi(A=>{let te=!1;const q=h.current;return q&&window.getComputedStyle(q,null).getPropertyValue("direction")==="rtl"&&(te=!0),function(J){J.preventDefault();const ee=h.current;if(!ee)return()=>null;const{direction:ae,dragState:ce,id:ge,keyboardResizeBy:oe,onLayout:pe}=T.current,{layout:de,panelDataArray:Ee}=M.current,{initialLayout:De}=ce??{},ze=Bz(ge,A,ee);let Oe=YTe(J,A,ae,ce,oe,ee);const Be=ae==="horizontal";Be&&te&&(Oe=-Oe);const vt=Ee.map(At=>At.constraints),Mt=kh({delta:Oe,initialLayout:De??de,panelConstraints:vt,pivotIndices:ze,prevLayout:de,trigger:Dz(J)?"keyboard":"mouse-or-touch"}),xn=!Zb(de,Mt);(Iz(J)||kz(J))&&C.current!=Oe&&(C.current=Oe,!xn&&Oe!==0?Be?TS(A,Oe<0?Lz:Fz):TS(A,Oe<0?jz:$z):TS(A,0)),xn&&(x(Mt),M.current.layout=Mt,pe&&pe(Mt),Iu(Ee,Mt,_.current))}},[]),G=gi((A,te)=>{const{onLayout:q}=T.current,{layout:se,panelDataArray:J}=M.current,ee=J.map(de=>de.constraints),{panelSize:ae,pivotIndices:ce}=zl(J,A,se);yt(ae!=null,`Panel size not found for panel "${A.id}"`);const oe=Nu(J,A)===J.length-1?ae-te:te-ae,pe=kh({delta:oe,initialLayout:se,panelConstraints:ee,pivotIndices:ce,prevLayout:se,trigger:"imperative-api"});Zb(se,pe)||(x(pe),M.current.layout=pe,q&&q(pe),Iu(J,pe,_.current))},[]),B=gi((A,te)=>{const{layout:q,panelDataArray:se}=M.current,{collapsedSize:J=0,collapsible:ee}=te,{collapsedSize:ae=0,collapsible:ce,maxSize:ge=100,minSize:oe=0}=A.constraints,{panelSize:pe}=zl(se,A,q);pe!=null&&(ee&&ce&&ta(pe,J)?ta(J,ae)||G(A,ae):pe<oe?G(A,oe):pe>ge&&G(A,ge))},[G]),W=gi((A,te)=>{const{direction:q}=T.current,{layout:se}=M.current;if(!h.current)return;const J=hx(A,h.current);yt(J,`Drag handle element not found for id "${A}"`);const ee=Vz(q,te);b({dragHandleId:A,dragHandleRect:J.getBoundingClientRect(),initialCursorPosition:ee,initialLayout:se})},[]),K=gi(()=>{b(null)},[]),D=gi(A=>{const{panelDataArray:te}=M.current,q=Nu(te,A);q>=0&&(te.splice(q,1),delete _.current[A.id],M.current.panelDataArrayChanged=!0,w())},[w]),Y=TTe(()=>({collapsePanel:I,direction:r,dragState:m,expandPanel:k,getPanelSize:L,getPanelStyle:j,groupId:p,isPanelCollapsed:$,isPanelExpanded:X,reevaluatePanelConstraints:B,registerPanel:H,registerResizeHandle:F,resizePanel:G,startDragging:W,stopDragging:K,unregisterPanel:D,panelGroupElement:h.current}),[I,m,r,k,L,j,p,$,X,B,H,F,G,W,K,D]),U={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return af(ux.Provider,{value:Y},af(u,{...d,children:t,className:n,id:o,ref:h,style:{...U,...c},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":p}))}const Yz=Pz((e,t)=>af(qz,{...e,forwardedRef:t}));qz.displayName="PanelGroup";Yz.displayName="forwardRef(PanelGroup)";function Nu(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function zl(e,t,n){const r=Nu(e,t),o=r===e.length-1?[r-1,r]:[r,r+1],s=n[r];return{...t.constraints,panelSize:s,pivotIndices:o}}function tOe({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){Tc(()=>{if(e||n==null||r==null)return;const i=hx(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");yt(a,`No group element found for id "${a}"`);const l=eg(a,r),c=zz(a,t,r);yt(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 PP({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=yi(null),b=yi({onDragging:s});Tc(()=>{b.current.onDragging=s});const v=Tz(ux);if(v===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:x,groupId:w,registerResizeHandle:_,startDragging:R,stopDragging:C,panelGroupElement:T}=v,M=_P(i),[I,k]=rd("inactive"),[L,j]=rd(!1),[$,X]=rd(null),H=yi({state:I});Oc(()=>{H.current.state=I}),Tc(()=>{if(n)X(null);else{const W=_(M);X(()=>W)}},[n,M,_]);const F=(p=r==null?void 0:r.coarse)!==null&&p!==void 0?p:15,G=(h=r==null?void 0:r.fine)!==null&&h!==void 0?h:5;return Tc(()=>{if(n||$==null)return;const W=m.current;return yt(W,"Element ref not attached"),BTe(M,W,x,{coarse:F,fine:G},(D,Y,U)=>{if(Y)switch(D){case"down":{k("drag"),yt(U,'Expected event to be defined for "down" action'),R(M,U);const{onDragging:A}=b.current;A&&A(!0);break}case"move":{const{state:A}=H.current;A!=="drag"&&k("hover"),yt(U,'Expected event to be defined for "move" action'),$(U);break}case"up":{k("hover"),C();const{onDragging:A}=b.current;A&&A(!1);break}}else k("inactive")})},[F,x,n,G,_,M,$,R,C]),tOe({disabled:n,handleId:M,resizeHandler:$,panelGroupElement:T}),af(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":w,"data-resize-handle":"","data-resize-handle-active":I==="drag"?"pointer":L?"keyboard":void 0,"data-resize-handle-state":I,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":M})}PP.displayName="PanelResizeHandle";const Kz=({className:e,...t})=>y.jsx(Yz,{className:be("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}),fE=Az,nOe=({withHandle:e,className:t,...n})=>y.jsx(PP,{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(C3,{className:"h-2.5 w-2.5"})})}),rOe=({withHandle:e,className:t,onTabClick:n,open:r,...i})=>y.jsx(PP,{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(Si,{variant:"secondary",className:be("h-7 p-0.5",{"rounded-bl-none rounded-br-md rounded-tl-none rounded-tr-md":r,"mt-12 rounded-bl-md rounded-br-none rounded-tl-md rounded-tr-none":!r}),onClick:()=>n(!r),children:r?y.jsx(bv,{className:"size-4"}):y.jsx(gR,{className:"size-4"})})})});var TP="Dialog",[Xz,Qz]=or(TP),[iOe,Vo]=Xz(TP),Jz=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!0}=e,a=E.useRef(null),l=E.useRef(null),[c=!1,u]=$r({prop:r,defaultProp:i,onChange:o});return y.jsx(iOe,{scope:t,triggerRef:a,contentRef:l,contentId:Qn(),titleId:Qn(),descriptionId:Qn(),open:c,onOpenChange:u,onOpenToggle:E.useCallback(()=>u(d=>!d),[u]),modal:s,children:n})};Jz.displayName=TP;var Zz="DialogTrigger",eB=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Vo(Zz,n),o=rt(t,i.triggerRef);return y.jsx(Fe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":AP(i.open),...r,ref:o,onClick:Re(e.onClick,i.onOpenToggle)})});eB.displayName=Zz;var OP="DialogPortal",[oOe,tB]=Xz(OP,{forceMount:void 0}),nB=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=Vo(OP,t);return y.jsx(oOe,{scope:t,forceMount:n,children:E.Children.map(r,s=>y.jsx(Jn,{present:n||o.open,children:y.jsx(Ng,{asChild:!0,container:i,children:s})}))})};nB.displayName=OP;var k0="DialogOverlay",rB=E.forwardRef((e,t)=>{const n=tB(k0,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Vo(k0,e.__scopeDialog);return o.modal?y.jsx(Jn,{present:r||o.open,children:y.jsx(sOe,{...i,ref:t})}):null});rB.displayName=k0;var sOe=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Vo(k0,n);return y.jsx($g,{as:ca,allowPinchZoom:!0,shards:[i.contentRef],children:y.jsx(Fe.div,{"data-state":AP(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Wc="DialogContent",iB=E.forwardRef((e,t)=>{const n=tB(Wc,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Vo(Wc,e.__scopeDialog);return y.jsx(Jn,{present:r||o.open,children:o.modal?y.jsx(aOe,{...i,ref:t}):y.jsx(lOe,{...i,ref:t})})});iB.displayName=Wc;var aOe=E.forwardRef((e,t)=>{const n=Vo(Wc,e.__scopeDialog),r=E.useRef(null),i=rt(t,n.contentRef,r);return E.useEffect(()=>{const o=r.current;if(o)return Bv(o)},[]),y.jsx(oB,{...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())})}),lOe=E.forwardRef((e,t)=>{const n=Vo(Wc,e.__scopeDialog),r=E.useRef(!1),i=E.useRef(!1);return y.jsx(oB,{...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()}})}),oB=E.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...s}=e,a=Vo(Wc,n),l=E.useRef(null),c=rt(t,l);return $v(),y.jsxs(y.Fragment,{children:[y.jsx(jg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:y.jsx(eu,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":AP(a.open),...s,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),y.jsxs(y.Fragment,{children:[y.jsx(uOe,{titleId:a.titleId}),y.jsx(fOe,{contentRef:l,descriptionId:a.descriptionId})]})]})}),MP="DialogTitle",sB=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Vo(MP,n);return y.jsx(Fe.h2,{id:i.titleId,...r,ref:t})});sB.displayName=MP;var aB="DialogDescription",lB=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Vo(aB,n);return y.jsx(Fe.p,{id:i.descriptionId,...r,ref:t})});lB.displayName=aB;var cB="DialogClose",uB=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Vo(cB,n);return y.jsx(Fe.button,{type:"button",...r,ref:t,onClick:Re(e.onClick,()=>i.onOpenChange(!1))})});uB.displayName=cB;function AP(e){return e?"open":"closed"}var dB="DialogTitleWarning",[cOe,fB]=Uee(dB,{contentName:Wc,titleName:MP,docsSlug:"dialog"}),uOe=({titleId:e})=>{const t=fB(dB),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
373
|
+
|
|
374
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
375
|
+
|
|
376
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return E.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},dOe="DialogDescriptionWarning",fOe=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${fB(dOe).contentName}}.`;return E.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},DP=Jz,hB=eB,IP=nB,px=rB,gx=iB,kP=sB,NP=lB,LP=uB,pB="AlertDialog",[hOe,CIe]=or(pB,[Qz]),ga=Qz(),gB=e=>{const{__scopeAlertDialog:t,...n}=e,r=ga(t);return y.jsx(DP,{...r,...n,modal:!0})};gB.displayName=pB;var pOe="AlertDialogTrigger",gOe=E.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=ga(n);return y.jsx(hB,{...i,...r,ref:t})});gOe.displayName=pOe;var mOe="AlertDialogPortal",mB=e=>{const{__scopeAlertDialog:t,...n}=e,r=ga(t);return y.jsx(IP,{...r,...n})};mB.displayName=mOe;var bOe="AlertDialogOverlay",bB=E.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=ga(n);return y.jsx(px,{...i,...r,ref:t})});bB.displayName=bOe;var od="AlertDialogContent",[yOe,vOe]=hOe(od),yB=E.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,o=ga(n),s=E.useRef(null),a=rt(t,s),l=E.useRef(null);return y.jsx(cOe,{contentName:od,titleName:vB,docsSlug:"alert-dialog",children:y.jsx(yOe,{scope:n,cancelRef:l,children:y.jsxs(gx,{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(jE,{children:r}),y.jsx(wOe,{contentRef:s})]})})})});yB.displayName=od;var vB="AlertDialogTitle",xB=E.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=ga(n);return y.jsx(kP,{...i,...r,ref:t})});xB.displayName=vB;var wB="AlertDialogDescription",SB=E.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=ga(n);return y.jsx(NP,{...i,...r,ref:t})});SB.displayName=wB;var xOe="AlertDialogAction",_B=E.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=ga(n);return y.jsx(LP,{...i,...r,ref:t})});_B.displayName=xOe;var CB="AlertDialogCancel",EB=E.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=vOe(CB,n),o=ga(n),s=rt(t,i);return y.jsx(LP,{...o,...r,ref:s})});EB.displayName=CB;var wOe=({contentRef:e})=>{const t=`\`${od}\` requires a description for the component to be accessible for screen reader users.
|
|
377
|
+
|
|
378
|
+
You can add a description to the \`${od}\` by passing a \`${wB}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
379
|
+
|
|
380
|
+
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 \`${od}\`. 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.
|
|
381
|
+
|
|
382
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return E.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},SOe=gB,_Oe=mB,RB=bB,PB=yB,TB=_B,OB=EB,MB=xB,AB=SB;const COe=SOe,EOe=_Oe,DB=E.forwardRef(({className:e,...t},n)=>y.jsx(RB,{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}));DB.displayName=RB.displayName;const IB=E.forwardRef(({className:e,...t},n)=>y.jsx(EOe,{children:y.jsxs(Kc,{children:[y.jsx(DB,{}),y.jsx(PB,{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})]})}));IB.displayName=PB.displayName;const kB=({className:e,...t})=>y.jsx("div",{className:be("flex flex-col space-y-2 text-center sm:text-left",e),...t});kB.displayName="AlertDialogHeader";const NB=({className:e,...t})=>y.jsx("div",{className:be("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});NB.displayName="AlertDialogFooter";const LB=E.forwardRef(({className:e,...t},n)=>y.jsx(MB,{ref:n,className:be("text-lg font-semibold",e),...t}));LB.displayName=MB.displayName;const FB=E.forwardRef(({className:e,...t},n)=>y.jsx(AB,{ref:n,className:be("text-sm text-muted-foreground",e),...t}));FB.displayName=AB.displayName;const jB=E.forwardRef(({className:e,...t},n)=>y.jsx(TB,{ref:n,className:be(Mp(),e),...t}));jB.displayName=TB.displayName;const $B=E.forwardRef(({className:e,...t},n)=>y.jsx(OB,{ref:n,className:be(Mp({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));$B.displayName=OB.displayName;function ROe({open:e,setOpen:t}){const n=ve(o=>o.selectedSheetId),{deleteSheet:r}=hr();function i(){n&&(r(n),t(!1))}return y.jsx(COe,{open:e,onOpenChange:t,children:y.jsxs(IB,{children:[y.jsxs(kB,{children:[y.jsx(LB,{children:"Delete Sheet"}),y.jsx(FB,{children:"Are you sure you want to delete this sheet along with all its cards? This action cannot be undone."})]}),y.jsxs(NB,{children:[y.jsx($B,{children:"Cancel"}),y.jsx(jB,{onClick:i,children:"Delete"})]})]})})}function zB(){var v,x;const[e,t]=P.useState(!1),n=ve(w=>{var _;return(_=w.dashboard)==null?void 0:_.sheets}),{showAssistant:r}=vo(),i=P.useRef(null),[o,s]=P.useState(!1),a=ve(w=>w.isDashboardEditing),l=ve(w=>w.themeStyle),c=ve(w=>w.selectedSheetId),{setSelectedSheetId:u,setSheetTitle:d,addSheet:p}=hr();if(!n)return null;function h(w){var _,R;w?((_=i.current)==null||_.resize(35),s(!0)):(s(!1),(R=i.current)==null||R.resize(0))}function m(){const w={id:il(),title:"New Sheet"};p(w)}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(VE,{role:"dashboard-tabs-container",className:be("relative flex grow flex-col",l==null?void 0:l.dashboardTabsContainer),onValueChange:w=>{u(w)},value:c||n[0].id,children:[y.jsx("div",{children:(n.length>1||a)&&y.jsxs(tv,{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(w=>{var _,R;return y.jsx(fs,{text:w.title,onSave:C=>d(w.id,C),children:y.jsxs(nv,{style:{borderRadius:(R=(_=l==null?void 0:l.chart)==null?void 0:_.options)==null?void 0:R.borderRadius},onClick:()=>u(w.id),className:"flex items-center gap-1 rounded-none border px-2 py-1",value:w.id,children:[w.title,a&&c===w.id&&n.length>1&&y.jsx(hf,{className:"ml-1 size-3",onClick:()=>t(!0)})]})},w.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(yR,{className:"size-3"})})]})}),y.jsxs(Kz,{className:"grow",direction:"horizontal",children:[y.jsx(fE,{children:y.jsx("div",{style:{},children:n==null?void 0:n.map(w=>y.jsx(WE,{style:{backgroundColor:b()},className:be("mt-0",{}),value:w.id,children:y.jsx(D_e,{sheet:w})},w.id))})}),r===!0&&y.jsxs(y.Fragment,{children:[y.jsx(rOe,{open:o,onTabClick:h,withHandle:!0}),y.jsx(fE,{onResize:w=>{w<1?s(!1):o||s(!0)},defaultSize:0,ref:i,children:y.jsx(CTe,{})})]})]}),y.jsx(ROe,{open:e,setOpen:t})]})}function BB({children:e}){return y.jsx(yJ,{defaultTheme:"system",storageKey:"vite-ui-theme",children:y.jsx(Qpe,{delayDuration:0,children:e})})}function HB(e){return y.jsx(yv,{FallbackComponent:vR,children:y.jsx(n4,{dashboardProps:e,children:y.jsx(BB,{children:y.jsx(s4,{...e,children:y.jsx(zB,{})})})})})}var hE=["Enter"," "],POe=["ArrowDown","PageUp","Home"],VB=["ArrowUp","PageDown","End"],TOe=[...POe,...VB],OOe={ltr:[...hE,"ArrowRight"],rtl:[...hE,"ArrowLeft"]},MOe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},tm="Menu",[tg,AOe,DOe]=Z0(tm),[nu,WB]=or(tm,[DOe,Ts,ff]),mx=Ts(),UB=ff(),[IOe,ru]=nu(tm),[kOe,nm]=nu(tm),GB=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:s=!0}=e,a=mx(t),[l,c]=E.useState(null),u=E.useRef(!1),d=ir(o),p=Xc(i);return E.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(Dg,{...a,children:y.jsx(IOe,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:c,children:y.jsx(kOe,{scope:t,onClose:E.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:p,modal:s,children:r})})})};GB.displayName=tm;var NOe="MenuAnchor",FP=E.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=mx(n);return y.jsx(xf,{...i,...r,ref:t})});FP.displayName=NOe;var jP="MenuPortal",[LOe,qB]=nu(jP,{forceMount:void 0}),YB=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,o=ru(jP,t);return y.jsx(LOe,{scope:t,forceMount:n,children:y.jsx(Jn,{present:n||o.open,children:y.jsx(Ng,{asChild:!0,container:i,children:r})})})};YB.displayName=jP;var mo="MenuContent",[FOe,$P]=nu(mo),KB=E.forwardRef((e,t)=>{const n=qB(mo,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=ru(mo,e.__scopeMenu),s=nm(mo,e.__scopeMenu);return y.jsx(tg.Provider,{scope:e.__scopeMenu,children:y.jsx(Jn,{present:r||o.open,children:y.jsx(tg.Slot,{scope:e.__scopeMenu,children:s.modal?y.jsx(jOe,{...i,ref:t}):y.jsx($Oe,{...i,ref:t})})})})}),jOe=E.forwardRef((e,t)=>{const n=ru(mo,e.__scopeMenu),r=E.useRef(null),i=rt(t,r);return E.useEffect(()=>{const o=r.current;if(o)return Bv(o)},[]),y.jsx(zP,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Re(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),$Oe=E.forwardRef((e,t)=>{const n=ru(mo,e.__scopeMenu);return y.jsx(zP,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),zP=E.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=ru(mo,n),x=nm(mo,n),w=mx(n),_=UB(n),R=AOe(n),[C,T]=E.useState(null),M=E.useRef(null),I=rt(t,M,v.onContentChange),k=E.useRef(0),L=E.useRef(""),j=E.useRef(0),$=E.useRef(null),X=E.useRef("right"),H=E.useRef(0),F=m?$g:E.Fragment,G=m?{as:ca,allowPinchZoom:!0}:void 0,B=K=>{var J,ee;const D=L.current+K,Y=R().filter(ae=>!ae.disabled),U=document.activeElement,A=(J=Y.find(ae=>ae.ref.current===U))==null?void 0:J.textValue,te=Y.map(ae=>ae.textValue),q=QOe(te,D,A),se=(ee=Y.find(ae=>ae.textValue===q))==null?void 0:ee.ref.current;(function ae(ce){L.current=ce,window.clearTimeout(k.current),ce!==""&&(k.current=window.setTimeout(()=>ae(""),1e3))})(D),se&&setTimeout(()=>se.focus())};E.useEffect(()=>()=>window.clearTimeout(k.current),[]),$v();const W=E.useCallback(K=>{var Y,U;return X.current===((Y=$.current)==null?void 0:Y.side)&&ZOe(K,(U=$.current)==null?void 0:U.area)},[]);return y.jsx(FOe,{scope:n,searchRef:L,onItemEnter:E.useCallback(K=>{W(K)&&K.preventDefault()},[W]),onItemLeave:E.useCallback(K=>{var D;W(K)||((D=M.current)==null||D.focus(),T(null))},[W]),onTriggerLeave:E.useCallback(K=>{W(K)&&K.preventDefault()},[W]),pointerGraceTimerRef:j,onPointerGraceIntentChange:E.useCallback(K=>{$.current=K},[]),children:y.jsx(F,{...G,children:y.jsx(jg,{asChild:!0,trapped:i,onMountAutoFocus:Re(o,K=>{var D;K.preventDefault(),(D=M.current)==null||D.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:y.jsx(eu,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,onDismiss:h,children:y.jsx($E,{asChild:!0,..._,dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:T,onEntryFocus:Re(l,K=>{x.isUsingKeyboardRef.current||K.preventDefault()}),preventScrollOnEntryFocus:!0,children:y.jsx(Ig,{role:"menu","aria-orientation":"vertical","data-state":dH(v.open),"data-radix-menu-content":"",dir:x.dir,...w,...b,ref:I,style:{outline:"none",...b.style},onKeyDown:Re(b.onKeyDown,K=>{const Y=K.target.closest("[data-radix-menu-content]")===K.currentTarget,U=K.ctrlKey||K.altKey||K.metaKey,A=K.key.length===1;Y&&(K.key==="Tab"&&K.preventDefault(),!U&&A&&B(K.key));const te=M.current;if(K.target!==te||!TOe.includes(K.key))return;K.preventDefault();const se=R().filter(J=>!J.disabled).map(J=>J.ref.current);VB.includes(K.key)&&se.reverse(),KOe(se)}),onBlur:Re(e.onBlur,K=>{K.currentTarget.contains(K.target)||(window.clearTimeout(k.current),L.current="")}),onPointerMove:Re(e.onPointerMove,ng(K=>{const D=K.target,Y=H.current!==K.clientX;if(K.currentTarget.contains(D)&&Y){const U=K.clientX>H.current?"right":"left";X.current=U,H.current=K.clientX}}))})})})})})})});KB.displayName=mo;var zOe="MenuGroup",BP=E.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return y.jsx(Fe.div,{role:"group",...r,ref:t})});BP.displayName=zOe;var BOe="MenuLabel",XB=E.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return y.jsx(Fe.div,{...r,ref:t})});XB.displayName=BOe;var N0="MenuItem",p5="menu.itemSelect",bx=E.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=E.useRef(null),s=nm(N0,e.__scopeMenu),a=$P(N0,e.__scopeMenu),l=rt(t,o),c=E.useRef(!1),u=()=>{const d=o.current;if(!n&&d){const p=new CustomEvent(p5,{bubbles:!0,cancelable:!0});d.addEventListener(p5,h=>r==null?void 0:r(h),{once:!0}),a4(d,p),p.defaultPrevented?c.current=!1:s.onClose()}};return y.jsx(QB,{...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===" "||hE.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});bx.displayName=N0;var QB=E.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,s=$P(N0,n),a=UB(n),l=E.useRef(null),c=rt(t,l),[u,d]=E.useState(!1),[p,h]=E.useState("");return E.useEffect(()=>{const m=l.current;m&&h((m.textContent??"").trim())},[o.children]),y.jsx(tg.ItemSlot,{scope:n,disabled:r,textValue:i??p,children:y.jsx(zE,{asChild:!0,...a,focusable:!r,children:y.jsx(Fe.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,ng(m=>{r?s.onItemLeave(m):(s.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Re(e.onPointerLeave,ng(m=>s.onItemLeave(m))),onFocus:Re(e.onFocus,()=>d(!0)),onBlur:Re(e.onBlur,()=>d(!1))})})})}),HOe="MenuCheckboxItem",JB=E.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return y.jsx(rH,{scope:e.__scopeMenu,checked:n,children:y.jsx(bx,{role:"menuitemcheckbox","aria-checked":L0(n)?"mixed":n,...i,ref:t,"data-state":VP(n),onSelect:Re(i.onSelect,()=>r==null?void 0:r(L0(n)?!0:!n),{checkForDefaultPrevented:!1})})})});JB.displayName=HOe;var ZB="MenuRadioGroup",[VOe,WOe]=nu(ZB,{value:void 0,onValueChange:()=>{}}),eH=E.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,o=ir(r);return y.jsx(VOe,{scope:e.__scopeMenu,value:n,onValueChange:o,children:y.jsx(BP,{...i,ref:t})})});eH.displayName=ZB;var tH="MenuRadioItem",nH=E.forwardRef((e,t)=>{const{value:n,...r}=e,i=WOe(tH,e.__scopeMenu),o=n===i.value;return y.jsx(rH,{scope:e.__scopeMenu,checked:o,children:y.jsx(bx,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":VP(o),onSelect:Re(r.onSelect,()=>{var s;return(s=i.onValueChange)==null?void 0:s.call(i,n)},{checkForDefaultPrevented:!1})})})});nH.displayName=tH;var HP="MenuItemIndicator",[rH,UOe]=nu(HP,{checked:!1}),iH=E.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,o=UOe(HP,n);return y.jsx(Jn,{present:r||L0(o.checked)||o.checked===!0,children:y.jsx(Fe.span,{...i,ref:t,"data-state":VP(o.checked)})})});iH.displayName=HP;var GOe="MenuSeparator",oH=E.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return y.jsx(Fe.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});oH.displayName=GOe;var qOe="MenuArrow",sH=E.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=mx(n);return y.jsx(kg,{...i,...r,ref:t})});sH.displayName=qOe;var YOe="MenuSub",[EIe,aH]=nu(YOe),Lh="MenuSubTrigger",lH=E.forwardRef((e,t)=>{const n=ru(Lh,e.__scopeMenu),r=nm(Lh,e.__scopeMenu),i=aH(Lh,e.__scopeMenu),o=$P(Lh,e.__scopeMenu),s=E.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=o,c={__scopeMenu:e.__scopeMenu},u=E.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return E.useEffect(()=>u,[u]),E.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),l(null)}},[a,l]),y.jsx(FP,{asChild:!0,...c,children:y.jsx(QB,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":dH(n.open),...e,ref:J0(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,ng(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,ng(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,w=p[v?"left":"right"],_=p[v?"right":"left"];o.onPointerGraceIntentChange({area:[{x:d.clientX+x,y:d.clientY},{x:w,y:p.top},{x:_,y:p.top},{x:_,y:p.bottom},{x:w,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===" "||OOe[r.dir].includes(d.key)&&(n.onOpenChange(!0),(h=n.content)==null||h.focus(),d.preventDefault())})})})});lH.displayName=Lh;var cH="MenuSubContent",uH=E.forwardRef((e,t)=>{const n=qB(mo,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=ru(mo,e.__scopeMenu),s=nm(mo,e.__scopeMenu),a=aH(cH,e.__scopeMenu),l=E.useRef(null),c=rt(t,l);return y.jsx(tg.Provider,{scope:e.__scopeMenu,children:y.jsx(Jn,{present:r||o.open,children:y.jsx(tg.Slot,{scope:e.__scopeMenu,children:y.jsx(zP,{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=MOe[s.dir].includes(u.key);d&&p&&(o.onOpenChange(!1),(h=a.trigger)==null||h.focus(),u.preventDefault())})})})})})});uH.displayName=cH;function dH(e){return e?"open":"closed"}function L0(e){return e==="indeterminate"}function VP(e){return L0(e)?"indeterminate":e?"checked":"unchecked"}function KOe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function XOe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function QOe(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=XOe(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 JOe(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 ZOe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return JOe(n,t)}function ng(e){return t=>t.pointerType==="mouse"?e(t):void 0}var eMe=GB,tMe=FP,nMe=YB,rMe=KB,iMe=BP,oMe=XB,sMe=bx,aMe=JB,lMe=eH,cMe=nH,uMe=iH,dMe=oH,fMe=sH,hMe=lH,pMe=uH,WP="DropdownMenu",[gMe,RIe]=or(WP,[WB]),oi=WB(),[mMe,fH]=gMe(WP),hH=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:s,modal:a=!0}=e,l=oi(t),c=E.useRef(null),[u=!1,d]=$r({prop:i,defaultProp:o,onChange:s});return y.jsx(mMe,{scope:t,triggerId:Qn(),triggerRef:c,contentId:Qn(),open:u,onOpenChange:d,onOpenToggle:E.useCallback(()=>d(p=>!p),[d]),modal:a,children:y.jsx(eMe,{...l,open:u,onOpenChange:d,dir:r,modal:a,children:n})})};hH.displayName=WP;var pH="DropdownMenuTrigger",gH=E.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,o=fH(pH,n),s=oi(n);return y.jsx(tMe,{asChild:!0,...s,children:y.jsx(Fe.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:J0(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())})})})});gH.displayName=pH;var bMe="DropdownMenuPortal",mH=e=>{const{__scopeDropdownMenu:t,...n}=e,r=oi(t);return y.jsx(nMe,{...r,...n})};mH.displayName=bMe;var bH="DropdownMenuContent",yH=E.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=fH(bH,n),o=oi(n),s=E.useRef(!1);return y.jsx(rMe,{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)"}})});yH.displayName=bH;var yMe="DropdownMenuGroup",vMe=E.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=oi(n);return y.jsx(iMe,{...i,...r,ref:t})});vMe.displayName=yMe;var xMe="DropdownMenuLabel",vH=E.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=oi(n);return y.jsx(oMe,{...i,...r,ref:t})});vH.displayName=xMe;var wMe="DropdownMenuItem",xH=E.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=oi(n);return y.jsx(sMe,{...i,...r,ref:t})});xH.displayName=wMe;var SMe="DropdownMenuCheckboxItem",wH=E.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=oi(n);return y.jsx(aMe,{...i,...r,ref:t})});wH.displayName=SMe;var _Me="DropdownMenuRadioGroup",SH=E.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=oi(n);return y.jsx(lMe,{...i,...r,ref:t})});SH.displayName=_Me;var CMe="DropdownMenuRadioItem",_H=E.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=oi(n);return y.jsx(cMe,{...i,...r,ref:t})});_H.displayName=CMe;var EMe="DropdownMenuItemIndicator",CH=E.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=oi(n);return y.jsx(uMe,{...i,...r,ref:t})});CH.displayName=EMe;var RMe="DropdownMenuSeparator",EH=E.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=oi(n);return y.jsx(dMe,{...i,...r,ref:t})});EH.displayName=RMe;var PMe="DropdownMenuArrow",TMe=E.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=oi(n);return y.jsx(fMe,{...i,...r,ref:t})});TMe.displayName=PMe;var OMe="DropdownMenuSubTrigger",RH=E.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=oi(n);return y.jsx(hMe,{...i,...r,ref:t})});RH.displayName=OMe;var MMe="DropdownMenuSubContent",PH=E.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=oi(n);return y.jsx(pMe,{...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)"}})});PH.displayName=MMe;var AMe=hH,DMe=gH,IMe=mH,TH=yH,OH=vH,MH=xH,AH=wH,kMe=SH,DH=_H,IH=CH,kH=EH,NH=RH,LH=PH;const NMe=AMe,LMe=DMe,FMe=kMe,jMe=E.forwardRef(({className:e,inset:t,children:n,...r},i)=>y.jsxs(NH,{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(bv,{className:"ml-auto h-4 w-4"})]}));jMe.displayName=NH.displayName;const $Me=E.forwardRef(({className:e,...t},n)=>y.jsx(Kc,{children:y.jsx(LH,{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})}));$Me.displayName=LH.displayName;const FH=E.forwardRef(({className:e,sideOffset:t=4,...n},r)=>y.jsx(IMe,{children:y.jsx(Kc,{children:y.jsx(TH,{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})})}));FH.displayName=TH.displayName;const jH=E.forwardRef(({className:e,inset:t,...n},r)=>y.jsx(MH,{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}));jH.displayName=MH.displayName;const zMe=E.forwardRef(({className:e,children:t,checked:n,...r},i)=>y.jsxs(AH,{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(IH,{children:y.jsx(Rg,{className:"h-4 w-4"})})}),t]}));zMe.displayName=AH.displayName;const $H=E.forwardRef(({className:e,children:t,...n},r)=>y.jsxs(DH,{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(IH,{children:y.jsx(mR,{className:"h-2 w-2 fill-current"})})}),t]}));$H.displayName=DH.displayName;const zH=E.forwardRef(({className:e,inset:t,...n},r)=>y.jsx(OH,{ref:r,className:be("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));zH.displayName=OH.displayName;const BH=E.forwardRef(({className:e,...t},n)=>y.jsx(kH,{ref:n,className:be("-mx-1 my-1 h-px bg-muted",e),...t}));BH.displayName=kH.displayName;const BMe=DP,HMe=hB,VMe=IP,HH=E.forwardRef(({className:e,...t},n)=>y.jsx(px,{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}));HH.displayName=px.displayName;const VH=E.forwardRef(({className:e,children:t,...n},r)=>y.jsx(VMe,{children:y.jsxs(Kc,{children:[y.jsx(HH,{}),y.jsxs(gx,{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(LP,{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(hf,{className:"h-4 w-4"}),y.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}));VH.displayName=gx.displayName;const WH=({className:e,...t})=>y.jsx("div",{className:be("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});WH.displayName="DialogHeader";const UH=({className:e,...t})=>y.jsx("div",{className:be("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});UH.displayName="DialogFooter";const GH=E.forwardRef(({className:e,...t},n)=>y.jsx(kP,{ref:n,className:be("text-lg font-semibold leading-none tracking-tight",e),...t}));GH.displayName=kP.displayName;const qH=E.forwardRef(({className:e,...t},n)=>y.jsx(NP,{ref:n,className:be("text-sm text-muted-foreground",e),...t}));qH.displayName=NP.displayName;const YH=P.forwardRef(({className:e,...t},n)=>y.jsx("div",{role:"editor-panel",ref:n,className:be("flex grow h-full",e),...t}));YH.displayName="EditorPanel";const KH=P.forwardRef(({className:e,...t},n)=>y.jsx("div",{ref:n,className:be(" flex flex-col space-y-2 w-[270px]",e),...t}));KH.displayName="EditorAside";const XH=P.forwardRef(({className:e,...t},n)=>y.jsx("div",{ref:n,className:be(" grow",e),...t}));XH.displayName="EditorMain";function WMe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g5(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 m5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?g5(Object(n),!0).forEach(function(r){WMe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function UMe(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 GMe(e,t){if(e==null)return{};var n=UMe(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 qMe(e,t){return YMe(e)||KMe(e,t)||XMe(e,t)||QMe()}function YMe(e){if(Array.isArray(e))return e}function KMe(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 XMe(e,t){if(e){if(typeof e=="string")return b5(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 b5(e,t)}}function b5(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 QMe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
383
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function JMe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y5(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 v5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?y5(Object(n),!0).forEach(function(r){JMe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ZMe(){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 Fh(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 F0(e){return{}.toString.call(e).includes("Object")}function eAe(e){return!Object.keys(e).length}function rg(e){return typeof e=="function"}function tAe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function nAe(e,t){return F0(t)||nl("changeType"),Object.keys(t).some(function(n){return!tAe(e,n)})&&nl("changeField"),t}function rAe(e){rg(e)||nl("selectorType")}function iAe(e){rg(e)||F0(e)||nl("handlerType"),F0(e)&&Object.values(e).some(function(t){return!rg(t)})&&nl("handlersType")}function oAe(e){e||nl("initialIsRequired"),F0(e)||nl("initialType"),eAe(e)&&nl("initialContent")}function sAe(e,t){throw new Error(e[t]||e.default)}var aAe={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"},nl=Fh(sAe)(aAe),ey={changes:nAe,selector:rAe,handler:iAe,initial:oAe};function lAe(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};ey.initial(e),ey.handler(t);var n={current:e},r=Fh(dAe)(n,t),i=Fh(uAe)(n),o=Fh(ey.changes)(e),s=Fh(cAe)(n);function a(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(u){return u};return ey.selector(c),c(n.current)}function l(c){ZMe(r,i,o,s)(c)}return[a,l]}function cAe(e,t){return rg(t)?t(e.current):t}function uAe(e,t){return e.current=v5(v5({},e.current),t),t}function dAe(e,t,n){return rg(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 fAe={create:lAe},hAe={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function pAe(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 gAe(e){return{}.toString.call(e).includes("Object")}function mAe(e){return e||x5("configIsRequired"),gAe(e)||x5("configType"),e.urls?(bAe(),{paths:{vs:e.urls.monacoBase}}):e}function bAe(){console.warn(QH.deprecation)}function yAe(e,t){throw new Error(e[t]||e.default)}var QH={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!
|
|
384
|
+
You are using deprecated way of configuration.
|
|
385
|
+
|
|
386
|
+
Instead of using
|
|
387
|
+
monaco.config({ urls: { monacoBase: '...' } })
|
|
388
|
+
use
|
|
389
|
+
monaco.config({ paths: { vs: '...' } })
|
|
390
|
+
|
|
391
|
+
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
392
|
+
`},x5=pAe(yAe)(QH),vAe={config:mAe},xAe=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 JH(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],JH(e[n],t[n]))}),m5(m5({},e),t)}var wAe={type:"cancelation",msg:"operation is manually canceled"};function OS(e){var t=!1,n=new Promise(function(r,i){e.then(function(o){return t?i(wAe):r(o)}),e.catch(i)});return n.cancel=function(){return t=!0},n}var SAe=fAe.create({config:hAe,isInitialized:!1,resolve:null,reject:null,monaco:null}),ZH=qMe(SAe,2),rm=ZH[0],yx=ZH[1];function _Ae(e){var t=vAe.config(e),n=t.monaco,r=GMe(t,["monaco"]);yx(function(i){return{config:JH(i.config,r),monaco:n}})}function CAe(){var e=rm(function(t){var n=t.monaco,r=t.isInitialized,i=t.resolve;return{monaco:n,isInitialized:r,resolve:i}});if(!e.isInitialized){if(yx({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),OS(MS);if(window.monaco&&window.monaco.editor)return eV(window.monaco),e.resolve(window.monaco),OS(MS);xAe(EAe,PAe)(TAe)}return OS(MS)}function EAe(e){return document.body.appendChild(e)}function RAe(e){var t=document.createElement("script");return e&&(t.src=e),t}function PAe(e){var t=rm(function(r){var i=r.config,o=r.reject;return{config:i,reject:o}}),n=RAe("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function TAe(){var e=rm(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){eV(n),e.resolve(n)},function(n){e.reject(n)})}function eV(e){rm().monaco||yx({monaco:e})}function OAe(){return rm(function(e){var t=e.monaco;return t})}var MS=new Promise(function(e,t){return yx({resolve:e,reject:t})}),j0={config:_Ae,init:CAe,__getMonacoInstance:OAe},MAe={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},AS=MAe,AAe={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},DAe=AAe;function IAe({children:e}){return P.createElement("div",{style:DAe.container},e)}var kAe=IAe,NAe=kAe;function LAe({width:e,height:t,isEditorReady:n,loading:r,_ref:i,className:o,wrapperProps:s}){return P.createElement("section",{style:{...AS.wrapper,width:e,height:t},...s},!n&&P.createElement(NAe,null,r),P.createElement("div",{ref:i,style:{...AS.fullWidth,...!n&&AS.hide},className:o}))}var FAe=LAe,tV=P.memo(FAe);function jAe(e){P.useEffect(e,[])}var UP=jAe;function $Ae(e,t,n=!0){let r=P.useRef(!0);P.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var zi=$Ae;function sp(){}function Wu(e,t,n,r){return zAe(e,r)||BAe(e,t,n,r)}function zAe(e,t){return e.editor.getModel(nV(e,t))}function BAe(e,t,n,r){return e.editor.createModel(t,n,r?nV(e,r):void 0)}function nV(e,t){return e.Uri.parse(t)}function HAe({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=sp,onMount:x=sp}){let[w,_]=P.useState(!1),[R,C]=P.useState(!0),T=P.useRef(null),M=P.useRef(null),I=P.useRef(null),k=P.useRef(x),L=P.useRef(v),j=P.useRef(!1);UP(()=>{let F=j0.init();return F.then(G=>(M.current=G)&&C(!1)).catch(G=>(G==null?void 0:G.type)!=="cancelation"&&console.error("Monaco initialization: error:",G)),()=>T.current?H():F.cancel()}),zi(()=>{if(T.current&&M.current){let F=T.current.getOriginalEditor(),G=Wu(M.current,e||"",r||n||"text",o||"");G!==F.getModel()&&F.setModel(G)}},[o],w),zi(()=>{if(T.current&&M.current){let F=T.current.getModifiedEditor(),G=Wu(M.current,t||"",i||n||"text",s||"");G!==F.getModel()&&F.setModel(G)}},[s],w),zi(()=>{let F=T.current.getModifiedEditor();F.getOption(M.current.editor.EditorOption.readOnly)?F.setValue(t||""):t!==F.getValue()&&(F.executeEdits("",[{range:F.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),F.pushUndoStop())},[t],w),zi(()=>{var F,G;(G=(F=T.current)==null?void 0:F.getModel())==null||G.original.setValue(e||"")},[e],w),zi(()=>{let{original:F,modified:G}=T.current.getModel();M.current.editor.setModelLanguage(F,r||n||"text"),M.current.editor.setModelLanguage(G,i||n||"text")},[n,r,i],w),zi(()=>{var F;(F=M.current)==null||F.editor.setTheme(c)},[c],w),zi(()=>{var F;(F=T.current)==null||F.updateOptions(d)},[d],w);let $=P.useCallback(()=>{var B;if(!M.current)return;L.current(M.current);let F=Wu(M.current,e||"",r||n||"text",o||""),G=Wu(M.current,t||"",i||n||"text",s||"");(B=T.current)==null||B.setModel({original:F,modified:G})},[n,t,i,e,r,o,s]),X=P.useCallback(()=>{var F;!j.current&&I.current&&(T.current=M.current.editor.createDiffEditor(I.current,{automaticLayout:!0,...d}),$(),(F=M.current)==null||F.editor.setTheme(c),_(!0),j.current=!0)},[d,c,$]);P.useEffect(()=>{w&&k.current(T.current,M.current)},[w]),P.useEffect(()=>{!R&&!w&&X()},[R,w,X]);function H(){var G,B,W,K;let F=(G=T.current)==null?void 0:G.getModel();a||((B=F==null?void 0:F.original)==null||B.dispose()),l||((W=F==null?void 0:F.modified)==null||W.dispose()),(K=T.current)==null||K.dispose()}return P.createElement(tV,{width:h,height:p,isEditorReady:w,loading:u,_ref:I,className:m,wrapperProps:b})}var VAe=HAe;P.memo(VAe);function WAe(){let[e,t]=P.useState(j0.__getMonacoInstance());return UP(()=>{let n;return e||(n=j0.init(),n.then(r=>{t(r)})),()=>n==null?void 0:n.cancel()}),e}var UAe=WAe;function GAe(e){let t=P.useRef();return P.useEffect(()=>{t.current=e},[e]),t.current}var qAe=GAe,ty=new Map;function YAe({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=sp,onMount:w=sp,onChange:_,onValidate:R=sp}){let[C,T]=P.useState(!1),[M,I]=P.useState(!0),k=P.useRef(null),L=P.useRef(null),j=P.useRef(null),$=P.useRef(w),X=P.useRef(x),H=P.useRef(),F=P.useRef(r),G=qAe(o),B=P.useRef(!1),W=P.useRef(!1);UP(()=>{let Y=j0.init();return Y.then(U=>(k.current=U)&&I(!1)).catch(U=>(U==null?void 0:U.type)!=="cancelation"&&console.error("Monaco initialization: error:",U)),()=>L.current?D():Y.cancel()}),zi(()=>{var U,A,te,q;let Y=Wu(k.current,e||r||"",t||i||"",o||n||"");Y!==((U=L.current)==null?void 0:U.getModel())&&(d&&ty.set(G,(A=L.current)==null?void 0:A.saveViewState()),(te=L.current)==null||te.setModel(Y),d&&((q=L.current)==null||q.restoreViewState(ty.get(o))))},[o],C),zi(()=>{var Y;(Y=L.current)==null||Y.updateOptions(c)},[c],C),zi(()=>{!L.current||r===void 0||(L.current.getOption(k.current.editor.EditorOption.readOnly)?L.current.setValue(r):r!==L.current.getValue()&&(W.current=!0,L.current.executeEdits("",[{range:L.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),L.current.pushUndoStop(),W.current=!1))},[r],C),zi(()=>{var U,A;let Y=(U=L.current)==null?void 0:U.getModel();Y&&i&&((A=k.current)==null||A.editor.setModelLanguage(Y,i))},[i],C),zi(()=>{var Y;a!==void 0&&((Y=L.current)==null||Y.revealLine(a))},[a],C),zi(()=>{var Y;(Y=k.current)==null||Y.editor.setTheme(s)},[s],C);let K=P.useCallback(()=>{var Y;if(!(!j.current||!k.current)&&!B.current){X.current(k.current);let U=o||n,A=Wu(k.current,r||e||"",t||i||"",U||"");L.current=(Y=k.current)==null?void 0:Y.editor.create(j.current,{model:A,automaticLayout:!0,...c},u),d&&L.current.restoreViewState(ty.get(U)),k.current.editor.setTheme(s),a!==void 0&&L.current.revealLine(a),T(!0),B.current=!0}},[e,t,n,r,i,o,c,u,d,s,a]);P.useEffect(()=>{C&&$.current(L.current,k.current)},[C]),P.useEffect(()=>{!M&&!C&&K()},[M,C,K]),F.current=r,P.useEffect(()=>{var Y,U;C&&_&&((Y=H.current)==null||Y.dispose(),H.current=(U=L.current)==null?void 0:U.onDidChangeModelContent(A=>{W.current||_(L.current.getValue(),A)}))},[C,_]),P.useEffect(()=>{if(C){let Y=k.current.editor.onDidChangeMarkers(U=>{var te;let A=(te=L.current.getModel())==null?void 0:te.uri;if(A&&U.find(q=>q.path===A.path)){let q=k.current.editor.getModelMarkers({resource:A});R==null||R(q)}});return()=>{Y==null||Y.dispose()}}return()=>{}},[C,R]);function D(){var Y,U;(Y=H.current)==null||Y.dispose(),p?d&&ty.set(o,L.current.saveViewState()):(U=L.current.getModel())==null||U.dispose(),L.current.dispose()}return P.createElement(tV,{width:h,height:m,isEditorReady:C,loading:l,_ref:j,className:b,wrapperProps:v})}var KAe=YAe,rV=P.memo(KAe),XAe=rV,GP="Collapsible",[QAe,iV]=or(GP),[JAe,qP]=QAe(GP),oV=E.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:s,...a}=e,[l=!1,c]=$r({prop:r,defaultProp:i,onChange:s});return y.jsx(JAe,{scope:n,disabled:o,contentId:Qn(),open:l,onOpenToggle:E.useCallback(()=>c(u=>!u),[c]),children:y.jsx(Fe.div,{"data-state":KP(l),"data-disabled":o?"":void 0,...a,ref:t})})});oV.displayName=GP;var sV="CollapsibleTrigger",aV=E.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=qP(sV,n);return y.jsx(Fe.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":KP(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:Re(e.onClick,i.onOpenToggle)})});aV.displayName=sV;var YP="CollapsibleContent",lV=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=qP(YP,e.__scopeCollapsible);return y.jsx(Jn,{present:n||i.open,children:({present:o})=>y.jsx(ZAe,{...r,ref:t,present:o})})});lV.displayName=YP;var ZAe=E.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=e,s=qP(YP,n),[a,l]=E.useState(r),c=E.useRef(null),u=rt(t,c),d=E.useRef(0),p=d.current,h=E.useRef(0),m=h.current,b=s.open||a,v=E.useRef(b),x=E.useRef(void 0);return E.useEffect(()=>{const w=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(w)},[]),Sr(()=>{const w=c.current;if(w){x.current=x.current||{transitionDuration:w.style.transitionDuration,animationName:w.style.animationName},w.style.transitionDuration="0s",w.style.animationName="none";const _=w.getBoundingClientRect();d.current=_.height,h.current=_.width,v.current||(w.style.transitionDuration=x.current.transitionDuration,w.style.animationName=x.current.animationName),l(r)}},[s.open,r]),y.jsx(Fe.div,{"data-state":KP(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 KP(e){return e?"open":"closed"}var eDe=oV,tDe=aV,nDe=lV,ma="Accordion",rDe=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[XP,iDe,oDe]=Z0(ma),[vx,PIe]=or(ma,[oDe,iV]),QP=iV(),cV=P.forwardRef((e,t)=>{const{type:n,...r}=e,i=r,o=r;return y.jsx(XP.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?y.jsx(cDe,{...o,ref:t}):y.jsx(lDe,{...i,ref:t})})});cV.displayName=ma;var[uV,sDe]=vx(ma),[dV,aDe]=vx(ma,{collapsible:!1}),lDe=P.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:o=!1,...s}=e,[a,l]=$r({prop:n,defaultProp:r,onChange:i});return y.jsx(uV,{scope:e.__scopeAccordion,value:a?[a]:[],onItemOpen:l,onItemClose:P.useCallback(()=>o&&l(""),[o,l]),children:y.jsx(dV,{scope:e.__scopeAccordion,collapsible:o,children:y.jsx(fV,{...s,ref:t})})})}),cDe=P.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...o}=e,[s=[],a]=$r({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(uV,{scope:e.__scopeAccordion,value:s,onItemOpen:l,onItemClose:c,children:y.jsx(dV,{scope:e.__scopeAccordion,collapsible:!0,children:y.jsx(fV,{...o,ref:t})})})}),[uDe,xx]=vx(ma),fV=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=iDe(n),d=Xc(i)==="ltr",p=Re(e.onKeyDown,h=>{var I;if(!rDe.includes(h.key))return;const m=h.target,b=c().filter(k=>{var L;return!((L=k.ref.current)!=null&&L.disabled)}),v=b.findIndex(k=>k.ref.current===m),x=b.length;if(v===-1)return;h.preventDefault();let w=v;const _=0,R=x-1,C=()=>{w=v+1,w>R&&(w=_)},T=()=>{w=v-1,w<_&&(w=R)};switch(h.key){case"Home":w=_;break;case"End":w=R;break;case"ArrowRight":o==="horizontal"&&(d?C():T());break;case"ArrowDown":o==="vertical"&&C();break;case"ArrowLeft":o==="horizontal"&&(d?T():C());break;case"ArrowUp":o==="vertical"&&T();break}const M=w%x;(I=b[M].ref.current)==null||I.focus()});return y.jsx(uDe,{scope:n,disabled:r,direction:i,orientation:o,children:y.jsx(XP.Slot,{scope:n,children:y.jsx(Fe.div,{...s,"data-orientation":o,ref:l,onKeyDown:r?void 0:p})})})}),$0="AccordionItem",[dDe,JP]=vx($0),hV=P.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...i}=e,o=xx($0,n),s=sDe($0,n),a=QP(n),l=Qn(),c=r&&s.value.includes(r)||!1,u=o.disabled||e.disabled;return y.jsx(dDe,{scope:n,open:c,disabled:u,triggerId:l,children:y.jsx(eDe,{"data-orientation":o.orientation,"data-state":vV(c),...a,...i,ref:t,disabled:u,open:c,onOpenChange:d=>{d?s.onItemOpen(r):s.onItemClose(r)}})})});hV.displayName=$0;var pV="AccordionHeader",gV=P.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=xx(ma,n),o=JP(pV,n);return y.jsx(Fe.h3,{"data-orientation":i.orientation,"data-state":vV(o.open),"data-disabled":o.disabled?"":void 0,...r,ref:t})});gV.displayName=pV;var pE="AccordionTrigger",mV=P.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=xx(ma,n),o=JP(pE,n),s=aDe(pE,n),a=QP(n);return y.jsx(XP.ItemSlot,{scope:n,children:y.jsx(tDe,{"aria-disabled":o.open&&!s.collapsible||void 0,"data-orientation":i.orientation,id:o.triggerId,...a,...r,ref:t})})});mV.displayName=pE;var bV="AccordionContent",yV=P.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=xx(ma,n),o=JP(bV,n),s=QP(n);return y.jsx(nDe,{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}})});yV.displayName=bV;function vV(e){return e?"open":"closed"}var fDe=cV,hDe=hV,pDe=gV,xV=mV,wV=yV;const gDe=fDe,SV=E.forwardRef(({className:e,...t},n)=>y.jsx(hDe,{ref:n,className:be("border-b",e),...t}));SV.displayName="AccordionItem";const _V=E.forwardRef(({className:e,children:t,...n},r)=>y.jsx(pDe,{className:"flex",children:y.jsxs(xV,{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(mv,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));_V.displayName=xV.displayName;const CV=E.forwardRef(({className:e,children:t,...n},r)=>y.jsx(wV,{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})}));CV.displayName=wV.displayName;var w5=1,mDe=.9,bDe=.8,yDe=.17,DS=.1,IS=.999,vDe=.9999,xDe=.99,wDe=/[\\\/_+.#"@\[\(\{&]/,SDe=/[\\\/_+.#"@\[\(\{&]/g,_De=/[\s-]/,EV=/[\s-]/g;function gE(e,t,n,r,i,o,s){if(o===t.length)return i===e.length?w5:xDe;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=gE(e,t,n,r,c+1,o+1,s),d>u&&(c===i?d*=w5:wDe.test(e.charAt(c-1))?(d*=bDe,h=e.slice(i,c-1).match(SDe),h&&i>0&&(d*=Math.pow(IS,h.length))):_De.test(e.charAt(c-1))?(d*=mDe,m=e.slice(i,c-1).match(EV),m&&i>0&&(d*=Math.pow(IS,m.length))):(d*=yDe,i>0&&(d*=Math.pow(IS,c-i))),e.charAt(c)!==t.charAt(o)&&(d*=vDe)),(d<DS&&n.charAt(c-1)===r.charAt(o+1)||r.charAt(o+1)===r.charAt(o)&&n.charAt(c-1)!==r.charAt(o))&&(p=gE(e,t,n,r,c+1,o+2,s),p*DS>d&&(d=p*DS)),d>u&&(u=d),c=n.indexOf(l,c+1);return s[a]=u,u}function S5(e){return e.toLowerCase().replace(EV," ")}function CDe(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,gE(e,t,S5(e),S5(t),0,0,{})}var gh='[cmdk-group=""]',kS='[cmdk-group-items=""]',EDe='[cmdk-group-heading=""]',ZP='[cmdk-item=""]',_5=`${ZP}:not([aria-disabled="true"])`,mE="cmdk-item-select",Ql="data-value",RDe=(e,t,n)=>CDe(e,t,n),RV=E.createContext(void 0),im=()=>E.useContext(RV),PV=E.createContext(void 0),eT=()=>E.useContext(PV),TV=E.createContext(void 0),OV=E.forwardRef((e,t)=>{let n=Lu(()=>{var U,A;return{search:"",value:(A=(U=e.value)!=null?U:e.defaultValue)!=null?A:"",filtered:{count:0,items:new Map,groups:new Set}}}),r=Lu(()=>new Set),i=Lu(()=>new Map),o=Lu(()=>new Map),s=Lu(()=>new Set),a=MV(e),{label:l,children:c,value:u,onValueChange:d,filter:p,shouldFilter:h,loop:m,disablePointerSelection:b=!1,vimBindings:v=!0,...x}=e,w=Qn(),_=Qn(),R=Qn(),C=E.useRef(null),T=FDe();Uc(()=>{if(u!==void 0){let U=u.trim();n.current.value=U,M.emit()}},[u]),Uc(()=>{T(6,X)},[]);let M=E.useMemo(()=>({subscribe:U=>(s.current.add(U),()=>s.current.delete(U)),snapshot:()=>n.current,setState:(U,A,te)=>{var q,se,J;if(!Object.is(n.current[U],A)){if(n.current[U]=A,U==="search")$(),L(),T(1,j);else if(U==="value"&&(te||T(5,X),((q=a.current)==null?void 0:q.value)!==void 0)){let ee=A??"";(J=(se=a.current).onValueChange)==null||J.call(se,ee);return}M.emit()}},emit:()=>{s.current.forEach(U=>U())}}),[]),I=E.useMemo(()=>({value:(U,A,te)=>{var q;A!==((q=o.current.get(U))==null?void 0:q.value)&&(o.current.set(U,{value:A,keywords:te}),n.current.filtered.items.set(U,k(A,te)),T(2,()=>{L(),M.emit()}))},item:(U,A)=>(r.current.add(U),A&&(i.current.has(A)?i.current.get(A).add(U):i.current.set(A,new Set([U]))),T(3,()=>{$(),L(),n.current.value||j(),M.emit()}),()=>{o.current.delete(U),r.current.delete(U),n.current.filtered.items.delete(U);let te=H();T(4,()=>{$(),(te==null?void 0:te.getAttribute("id"))===U&&j(),M.emit()})}),group:U=>(i.current.has(U)||i.current.set(U,new Set),()=>{o.current.delete(U),i.current.delete(U)}),filter:()=>a.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:w,inputId:R,labelId:_,listInnerRef:C}),[]);function k(U,A){var te,q;let se=(q=(te=a.current)==null?void 0:te.filter)!=null?q:RDe;return U?se(U,n.current.search,A):0}function L(){if(!n.current.search||a.current.shouldFilter===!1)return;let U=n.current.filtered.items,A=[];n.current.filtered.groups.forEach(q=>{let se=i.current.get(q),J=0;se.forEach(ee=>{let ae=U.get(ee);J=Math.max(ae,J)}),A.push([q,J])});let te=C.current;F().sort((q,se)=>{var J,ee;let ae=q.getAttribute("id"),ce=se.getAttribute("id");return((J=U.get(ce))!=null?J:0)-((ee=U.get(ae))!=null?ee:0)}).forEach(q=>{let se=q.closest(kS);se?se.appendChild(q.parentElement===se?q:q.closest(`${kS} > *`)):te.appendChild(q.parentElement===te?q:q.closest(`${kS} > *`))}),A.sort((q,se)=>se[1]-q[1]).forEach(q=>{var se;let J=(se=C.current)==null?void 0:se.querySelector(`${gh}[${Ql}="${encodeURIComponent(q[0])}"]`);J==null||J.parentElement.appendChild(J)})}function j(){let U=F().find(te=>te.getAttribute("aria-disabled")!=="true"),A=U==null?void 0:U.getAttribute(Ql);M.setState("value",A||void 0)}function $(){var U,A,te,q;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let se=0;for(let J of r.current){let ee=(A=(U=o.current.get(J))==null?void 0:U.value)!=null?A:"",ae=(q=(te=o.current.get(J))==null?void 0:te.keywords)!=null?q:[],ce=k(ee,ae);n.current.filtered.items.set(J,ce),ce>0&&se++}for(let[J,ee]of i.current)for(let ae of ee)if(n.current.filtered.items.get(ae)>0){n.current.filtered.groups.add(J);break}n.current.filtered.count=se}function X(){var U,A,te;let q=H();q&&(((U=q.parentElement)==null?void 0:U.firstChild)===q&&((te=(A=q.closest(gh))==null?void 0:A.querySelector(EDe))==null||te.scrollIntoView({block:"nearest"})),q.scrollIntoView({block:"nearest"}))}function H(){var U;return(U=C.current)==null?void 0:U.querySelector(`${ZP}[aria-selected="true"]`)}function F(){var U;return Array.from(((U=C.current)==null?void 0:U.querySelectorAll(_5))||[])}function G(U){let A=F()[U];A&&M.setState("value",A.getAttribute(Ql))}function B(U){var A;let te=H(),q=F(),se=q.findIndex(ee=>ee===te),J=q[se+U];(A=a.current)!=null&&A.loop&&(J=se+U<0?q[q.length-1]:se+U===q.length?q[0]:q[se+U]),J&&M.setState("value",J.getAttribute(Ql))}function W(U){let A=H(),te=A==null?void 0:A.closest(gh),q;for(;te&&!q;)te=U>0?NDe(te,gh):LDe(te,gh),q=te==null?void 0:te.querySelector(_5);q?M.setState("value",q.getAttribute(Ql)):B(U)}let K=()=>G(F().length-1),D=U=>{U.preventDefault(),U.metaKey?K():U.altKey?W(1):B(1)},Y=U=>{U.preventDefault(),U.metaKey?G(0):U.altKey?W(-1):B(-1)};return E.createElement(Fe.div,{ref:t,tabIndex:-1,...x,"cmdk-root":"",onKeyDown:U=>{var A;if((A=x.onKeyDown)==null||A.call(x,U),!U.defaultPrevented)switch(U.key){case"n":case"j":{v&&U.ctrlKey&&D(U);break}case"ArrowDown":{D(U);break}case"p":case"k":{v&&U.ctrlKey&&Y(U);break}case"ArrowUp":{Y(U);break}case"Home":{U.preventDefault(),G(0);break}case"End":{U.preventDefault(),K();break}case"Enter":if(!U.nativeEvent.isComposing&&U.keyCode!==229){U.preventDefault();let te=H();if(te){let q=new Event(mE);te.dispatchEvent(q)}}}}},E.createElement("label",{"cmdk-label":"",htmlFor:I.inputId,id:I.labelId,style:$De},l),wx(e,U=>E.createElement(PV.Provider,{value:M},E.createElement(RV.Provider,{value:I},U))))}),PDe=E.forwardRef((e,t)=>{var n,r;let i=Qn(),o=E.useRef(null),s=E.useContext(TV),a=im(),l=MV(e),c=(r=(n=l.current)==null?void 0:n.forceMount)!=null?r:s==null?void 0:s.forceMount;Uc(()=>{if(!c)return a.item(i,s==null?void 0:s.id)},[c]);let u=AV(i,o,[e.value,e.children,o],e.keywords),d=eT(),p=Gc(T=>T.value&&T.value===u.current),h=Gc(T=>c||a.filter()===!1?!0:T.search?T.filtered.items.get(i)>0:!0);E.useEffect(()=>{let T=o.current;if(!(!T||e.disabled))return T.addEventListener(mE,m),()=>T.removeEventListener(mE,m)},[h,e.onSelect,e.disabled]);function m(){var T,M;b(),(M=(T=l.current).onSelect)==null||M.call(T,u.current)}function b(){d.setState("value",u.current,!0)}if(!h)return null;let{disabled:v,value:x,onSelect:w,forceMount:_,keywords:R,...C}=e;return E.createElement(Fe.div,{ref:ig([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)}),TDe=E.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...o}=e,s=Qn(),a=E.useRef(null),l=E.useRef(null),c=Qn(),u=im(),d=Gc(h=>i||u.filter()===!1?!0:h.search?h.filtered.groups.has(s):!0);Uc(()=>u.group(s),[]),AV(s,a,[e.value,e.heading,l]);let p=E.useMemo(()=>({id:s,forceMount:i}),[i]);return E.createElement(Fe.div,{ref:ig([a,t]),...o,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&E.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:c},n),wx(e,h=>E.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?c:void 0},E.createElement(TV.Provider,{value:p},h))))}),ODe=E.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=E.useRef(null),o=Gc(s=>!s.search);return!n&&!o?null:E.createElement(Fe.div,{ref:ig([i,t]),...r,"cmdk-separator":"",role:"separator"})}),MDe=E.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,o=eT(),s=Gc(u=>u.search),a=Gc(u=>u.value),l=im(),c=E.useMemo(()=>{var u;let d=(u=l.listInnerRef.current)==null?void 0:u.querySelector(`${ZP}[${Ql}="${encodeURIComponent(a)}"]`);return d==null?void 0:d.getAttribute("id")},[]);return E.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),E.createElement(Fe.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)}})}),ADe=E.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...i}=e,o=E.useRef(null),s=E.useRef(null),a=im();return E.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)}}},[]),E.createElement(Fe.div,{ref:ig([o,t]),...i,"cmdk-list":"",role:"listbox","aria-label":r,id:a.listId},wx(e,l=>E.createElement("div",{ref:ig([s,a.listInnerRef]),"cmdk-list-sizer":""},l)))}),DDe=E.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:o,container:s,...a}=e;return E.createElement(DP,{open:n,onOpenChange:r},E.createElement(IP,{container:s},E.createElement(px,{"cmdk-overlay":"",className:i}),E.createElement(gx,{"aria-label":e.label,"cmdk-dialog":"",className:o},E.createElement(OV,{ref:t,...a}))))}),IDe=E.forwardRef((e,t)=>Gc(n=>n.filtered.count===0)?E.createElement(Fe.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),kDe=E.forwardRef((e,t)=>{let{progress:n,children:r,label:i="Loading...",...o}=e;return E.createElement(Fe.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},wx(e,s=>E.createElement("div",{"aria-hidden":!0},s)))}),Pi=Object.assign(OV,{List:ADe,Item:PDe,Input:MDe,Group:TDe,Separator:ODe,Dialog:DDe,Empty:IDe,Loading:kDe});function NDe(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function LDe(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function MV(e){let t=E.useRef(e);return Uc(()=>{t.current=e}),t}var Uc=typeof window>"u"?E.useEffect:E.useLayoutEffect;function Lu(e){let t=E.useRef();return t.current===void 0&&(t.current=e()),t}function ig(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function Gc(e){let t=eT(),n=()=>e(t.snapshot());return P$.useSyncExternalStore(t.subscribe,n,n)}function AV(e,t,n,r=[]){let i=E.useRef(),o=im();return Uc(()=>{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(Ql,a),i.current=a}),i}var FDe=()=>{let[e,t]=E.useState(),n=Lu(()=>new Map);return Uc(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,i)=>{n.current.set(r,i),t({})}};function jDe(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function wx({asChild:e,children:t},n){return e&&E.isValidElement(t)?E.cloneElement(jDe(t),{ref:t.ref},n(t.props.children)):n(t)}var $De={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const DV=E.forwardRef(({className:e,...t},n)=>y.jsx(Pi,{ref:n,className:be("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));DV.displayName=Pi.displayName;const IV=E.forwardRef(({className:e,...t},n)=>y.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[y.jsx(D3,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),y.jsx(Pi.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})]}));IV.displayName=Pi.Input.displayName;const kV=E.forwardRef(({className:e,...t},n)=>y.jsx(Pi.List,{ref:n,className:be("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));kV.displayName=Pi.List.displayName;const NV=E.forwardRef((e,t)=>y.jsx(Pi.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));NV.displayName=Pi.Empty.displayName;const LV=E.forwardRef(({className:e,...t},n)=>y.jsx(Pi.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}));LV.displayName=Pi.Group.displayName;const zDe=E.forwardRef(({className:e,...t},n)=>y.jsx(Pi.Separator,{ref:n,className:be("-mx-1 h-px bg-border",e),...t}));zDe.displayName=Pi.Separator.displayName;const FV=E.forwardRef(({className:e,...t},n)=>y.jsx(Pi.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}));FV.displayName=Pi.Item.displayName;var BDe=Object.defineProperty,HDe=(e,t,n)=>t in e?BDe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ny=(e,t,n)=>HDe(e,typeof t!="symbol"?t+"":t,n);const VDe={stringify:e=>e?"true":"false",parse:e=>/^[ty1-9]/i.test(e)},WDe={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}},UDe={stringify:e=>JSON.stringify(e),parse:e=>JSON.parse(e)},GDe={stringify:e=>`${e}`,parse:e=>parseFloat(e)},qDe={stringify:e=>e,parse:e=>e},NS={string:qDe,number:GDe,boolean:VDe,function:WDe,json:UDe};function YDe(e){return e.replace(/([a-z0-9])([A-Z])/g,(t,n,r)=>`${n}-${r.toLowerCase()}`)}const ry=Symbol.for("r2wc.render"),iy=Symbol.for("r2wc.connected"),Bl=Symbol.for("r2wc.context"),Vs=Symbol.for("r2wc.props");function KDe(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=YDe(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(),ny(this,o,!0),ny(this,i),ny(this,r,{}),ny(this,"container"),t.shadow?this.container=this.attachShadow({mode:t.shadow}):this.container=this,this[Vs].container=this.container;for(const m of s){const b=u[m],v=this.getAttribute(b),x=l[m],w=x?NS[x]:null;w!=null&&w.parse&&v&&(this[Vs][m]=w.parse(v,b,this))}for(const m of a)this[Vs][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[iy]=!0,this[ry]()}disconnectedCallback(){this[iy]=!1,this[Bl]&&n.unmount(this[Bl]),delete this[Bl]}attributeChangedCallback(m,b,v){const x=d[m],w=l[x],_=w?NS[w]:null;x in l&&_!=null&&_.parse&&v&&(this[Vs][x]=_.parse(v,m,this),this[ry]())}[(o=iy,i=Bl,r=Vs,ry)](){this[iy]&&(this[Bl]?n.update(this[Bl],this[Vs]):this[Bl]=n.mount(this.container,e,this[Vs]))}}for(const h of s){const m=u[h],b=l[h];Object.defineProperty(p.prototype,h,{enumerable:!0,configurable:!0,get(){return this[Vs][h]},set(v){this[Vs][h]=v;const x=b?NS[b]:null;if(x!=null&&x.stringify){const w=x.stringify(v,m,this);this.getAttribute(m)!==w&&this.setAttribute(m,w)}else this[ry]()}})}return p}function XDe(e,t,n){const r=GS(e),i=P.createElement(t,n);return r.render(i),{root:r,ReactComponent:t}}function QDe({root:e,ReactComponent:t},n){const r=P.createElement(t,n);e.render(r)}function JDe({root:e}){e.unmount()}function ZDe(e,t={}){return KDe(e,t,{mount:XDe,update:QDe,unmount:JDe})}const eIe={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"},tIe=ZDe(HB,{props:eIe});exports.$TRACK=DE;exports.Accordion=gDe;exports.AccordionContent=CV;exports.AccordionItem=SV;exports.AccordionTrigger=_V;exports.BOOLEAN_DATA_TYPES=EE;exports.Bot=I_;exports.Button=Si;exports.Calendar=x3;exports.Card=i4;exports.CardContent=Q0;exports.CardDescription=FE;exports.CardHeader=X0;exports.CardTitle=df;exports.CaretSortIcon=nie;exports.ChartJsVisual=E2;exports.Check=Rg;exports.CheckIcon=h3;exports.Checkbox=ix;exports.ChevronDown=mv;exports.ChevronLeft=gR;exports.ChevronRight=bv;exports.ChevronUp=w3;exports.Circle=mR;exports.ClipboardCopyIcon=aie;exports.ColorFormat=rj;exports.Command=DV;exports.CommandEmpty=NV;exports.CommandGroup=LV;exports.CommandInput=IV;exports.CommandItem=FV;exports.CommandList=kV;exports.Cross2Icon=p3;exports.DATAMODEL_NAMESPCACE=tL;exports.DATE_DATA_TYPES=cf;exports.Dashboard=HB;exports.DashboardPanel=s4;exports.DashboardTabs=zB;exports.DashboardWC=tIe;exports.Dialog=BMe;exports.DialogContent=VH;exports.DialogDescription=qH;exports.DialogFooter=UH;exports.DialogHeader=WH;exports.DialogTitle=GH;exports.DialogTrigger=HMe;exports.Download=S3;exports.DropdownMenu=NMe;exports.DropdownMenuContent=FH;exports.DropdownMenuItem=jH;exports.DropdownMenuLabel=zH;exports.DropdownMenuRadioGroup=FMe;exports.DropdownMenuRadioItem=$H;exports.DropdownMenuSeparator=BH;exports.DropdownMenuTrigger=LMe;exports.Dynamic=GZ;exports.Editable=fs;exports.EditorAside=KH;exports.EditorMain=XH;exports.EditorPanel=YH;exports.ErrorBoundary=yv;exports.Fallback=vR;exports.FallbackEditorCard=Zie;exports.Filter=_3;exports.FilterComponent=rP;exports.FilterHeader=l$;exports.FilterX=bR;exports.For=vZ;exports.Ft=XAe;exports.GripVertical=C3;exports.HoverCard=Dv;exports.HoverCardContent=Lg;exports.HoverCardTrigger=Iv;exports.Icon=v3;exports.Index=xZ;exports.Info=E3;exports.Input=Ec;exports.KPICard=p0;exports.LOCALE_CURRENCY_PAIRS=qS;exports.Label=En;exports.Le=UAe;exports.Lightbulb=P3;exports.LightbulbOff=R3;exports.Markdown=Rz;exports.Match=_Z;exports.MultiInputEmptyRenderer=cj;exports.NUMBER_DATA_TYPES=vg;exports.Oe=O_e;exports.PYTHON_DEFAULT_CODE=eL;exports.PaperPlaneIcon=g3;exports.Pencil=T3;exports.Percent=O3;exports.PlayIcon=bie;exports.Plus=yR;exports.Popover=Gv;exports.PopoverContent=Hg;exports.PopoverTrigger=qv;exports.Portal=UZ;exports.RadioGroup=kp;exports.RadioGroupItem=ic;exports.ResizableHandle=nOe;exports.ResizablePanel=fE;exports.ResizablePanelGroup=Kz;exports.ScanSearch=M3;exports.ScrollArea=Rc;exports.ScrollBar=Vg;exports.Search=D3;exports.SearchX=A3;exports.Select=Ys;exports.SelectContent=Zo;exports.SelectGroup=ku;exports.SelectItem=Un;exports.SelectLabel=Yl;exports.SelectSeparator=Zh;exports.SelectTrigger=Jo;exports.SelectValue=Ks;exports.SemaphorContextProvider=n4;exports.SemaphorQueryClient=e4;exports.Separator=Fg;exports.Settings=I3;exports.Show=wZ;exports.SliderIcon=vie;exports.Switch=SZ;exports.Switch$1=B$;exports.TEXT_DATA_TYPES=U0;exports.Table=k3;exports.TableBody=m2;exports.TableCell=y2;exports.TableHead=b2;exports.TableHeader=g2;exports.TableRow=Qh;exports.TableVisual=sj;exports.Tabs=VE;exports.TabsContent=WE;exports.TabsList=tv;exports.TabsTrigger=nv;exports.TextCard=x0;exports.Textarea=iP;exports.Toggle=Yv;exports.Tooltip=O8;exports.TooltipContent=h2;exports.TooltipTrigger=M8;exports.TooltipTrigger$1=f2;exports.TreePalm=N3;exports.TriangleDownIcon=m3;exports.TriangleUpIcon=b3;exports.UXProvider=BB;exports.UserRound=L3;exports.X=hf;exports._=gc;exports.addEventListener=AL;exports.batch=tZ;exports.ce=c$;exports.className=ML;exports.clearDelegatedEvents=NZ;exports.cn=be;exports.convertRemToPixels=kee;exports.createChartConfig=QR;exports.createComponent=NE;exports.createComputed=yL;exports.createContext=aZ;exports.createEffect=IE;exports.createLucideIcon=fn;exports.createMemo=ni;exports.createRenderEffect=Za;exports.createRoot=Ja;exports.createSignal=Fn;exports.createSqlGenConfig=dJ;exports.createUniqueId=yZ;exports.de=rV;exports.delegateEvents=OL;exports.deleteNestedDataByPath=wh;exports.displayValue=Tee;exports.flexRender=CC;exports.fmt=RE;exports.getCanvasBackgroundColor=cp;exports.getColumnDataType=fJ;exports.getContrastColor=Ld;exports.getCoreRowModel=q8;exports.getDefaultFilterSql=$Se;exports.getFilterValueType=Gu;exports.getKeys=ur;exports.getMutationStatusColor=Ree;exports.getNumberAxis=wR;exports.getPaginationRowModel=Y8;exports.getPlugins=LQ;exports.getPreferredColorScheme=Nee;exports.getQualifiedTableName=nL;exports.getQueryStatusColor=Eee;exports.getQueryStatusColorByLabel=Pee;exports.getQueryStatusLabel=_ee;exports.getRequest=OQ;exports.getSidedProp=Cee;exports.getSortedRowModel=K8;exports.getSql=uJ;exports.getTenantAndEndUserId=MQ;exports.getTokenParams=H5;exports.hslStringToHex=$3;exports.insert=jy;exports.isColumnInSqlGen=hJ;exports.jsxRuntimeExports=y;exports.loadManifest=aj;exports.mergeProps=LE;exports.mutationSortFns=Iee;exports.on=nZ;exports.onCleanup=jd;exports.onMount=vL;exports.pivotData=Vy;exports.postRequest=z0;exports.removeRing=jh;exports.resolveDataType=G0;exports.serialize=XL;exports.setAttribute=Fy;exports.sortFns=Aee;exports.splitProps=EL;exports.spread=DL;exports.stringify=See;exports.template=kZ;exports.titleCase=kQ;exports.untrack=pr;exports.updateNestedDataByPath=xh;exports.use=IL;exports.useCard=fhe;exports.useContext=lZ;exports.useCustomVisual=lj;exports.useDashboardActions=hr;exports.useDashboardCardQuery=ol;exports.useDashboardStore=ve;exports.useEditorActions=gv;exports.useEditorStore=Jr;exports.useQuery=Sg;exports.useQueryClient=wg;exports.useReactTable=X8;exports.useSemaphorContext=vo;exports.useTheme=iL;exports.useTopoJson=j6;exports.useTransition=sZ;exports.v4=il;
|