react-semaphor 0.0.3773 → 0.0.3774

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.
@@ -0,0 +1,440 @@
1
+ "use strict";var tK=Object.defineProperty;var YP=e=>{throw TypeError(e)};var nK=(e,t,n)=>t in e?tK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Me=(e,t,n)=>nK(e,typeof t!="symbol"?t+"":t,n),mx=(e,t,n)=>t.has(e)||YP("Cannot "+n);var ae=(e,t,n)=>(mx(e,t,"read from private field"),n?n.call(e):t.get(e)),ot=(e,t,n)=>t.has(e)?YP("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Be=(e,t,n,r)=>(mx(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Wt=(e,t,n)=>(mx(e,t,"access private method"),n);var Vg=(e,t,n,r)=>({set _(o){Be(e,t,o,n)},get _(){return ae(e,t,r)}});const k=require("react"),Ir=require("react-dom");function lN(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 T=lN(k),wc=lN(Ir);var Xi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ol(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function U_(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 o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var g1={exports:{}},mf={};/**
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 KP;function rK(){if(KP)return mf;KP=1;var e=k,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={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)&&!i.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:o.current}}return mf.Fragment=n,mf.jsx=s,mf.jsxs=s,mf}var bf={};/**
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 XP;function oK(){return XP||(XP=1,process.env.NODE_ENV!=="production"&&function(){var e=k,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=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 y(te){if(te===null||typeof te!="object")return null;var Re=m&&te[m]||te[b];return typeof Re=="function"?Re:null}var v=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w(te){{for(var Re=arguments.length,Ae=new Array(Re>1?Re-1:0),qe=1;qe<Re;qe++)Ae[qe-1]=arguments[qe];_("error",te,Ae)}}function _(te,Re,Ae){{var qe=v.ReactDebugCurrentFrame,Bt=qe.getStackAddendum();Bt!==""&&(Re+="%s",Ae=Ae.concat([Bt]));var qt=Ae.map(function(Ot){return String(Ot)});qt.unshift("Warning: "+Re),Function.prototype.apply.call(console[te],console,qt)}}var R=!1,C=!1,E=!1,P=!1,A=!1,I;I=Symbol.for("react.module.reference");function F(te){return!!(typeof te=="string"||typeof te=="function"||te===r||te===i||A||te===o||te===c||te===u||P||te===h||R||C||E||typeof te=="object"&&te!==null&&(te.$$typeof===p||te.$$typeof===d||te.$$typeof===s||te.$$typeof===a||te.$$typeof===l||te.$$typeof===I||te.getModuleId!==void 0))}function L(te,Re,Ae){var qe=te.displayName;if(qe)return qe;var Bt=Re.displayName||Re.name||"";return Bt!==""?Ae+"("+Bt+")":Ae}function j(te){return te.displayName||"Context"}function X(te){if(te==null)return null;if(typeof te.tag=="number"&&w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof te=="function")return te.displayName||te.name||null;if(typeof te=="string")return te;switch(te){case r:return"Fragment";case n:return"Portal";case i:return"Profiler";case o:return"StrictMode";case c:return"Suspense";case u:return"SuspenseList"}if(typeof te=="object")switch(te.$$typeof){case a:var Re=te;return j(Re)+".Consumer";case s:var Ae=te;return j(Ae._context)+".Provider";case l:return L(te,te.render,"ForwardRef");case d:var qe=te.displayName||null;return qe!==null?qe:X(te.type)||"Memo";case p:{var Bt=te,qt=Bt._payload,Ot=Bt._init;try{return X(Ot(qt))}catch{return null}}}return null}var U=Object.assign,$=0,B,W,q,Q,D,G,V;function M(){}M.__reactDisabledLog=!0;function ee(){{if($===0){B=console.log,W=console.info,q=console.warn,Q=console.error,D=console.group,G=console.groupCollapsed,V=console.groupEnd;var te={configurable:!0,enumerable:!0,value:M,writable:!0};Object.defineProperties(console,{info:te,log:te,warn:te,error:te,group:te,groupCollapsed:te,groupEnd:te})}$++}}function K(){{if($--,$===0){var te={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:U({},te,{value:B}),info:U({},te,{value:W}),warn:U({},te,{value:q}),error:U({},te,{value:Q}),group:U({},te,{value:D}),groupCollapsed:U({},te,{value:G}),groupEnd:U({},te,{value:V})})}$<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var re=v.ReactCurrentDispatcher,Y;function J(te,Re,Ae){{if(Y===void 0)try{throw Error()}catch(Bt){var qe=Bt.stack.trim().match(/\n( *(at )?)/);Y=qe&&qe[1]||""}return`
18
+ `+Y+te}}var ie=!1,de;{var he=typeof WeakMap=="function"?WeakMap:Map;de=new he}function se(te,Re){if(!te||ie)return"";{var Ae=de.get(te);if(Ae!==void 0)return Ae}var qe;ie=!0;var Bt=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var qt;qt=re.current,re.current=null,ee();try{if(Re){var Ot=function(){throw Error()};if(Object.defineProperty(Ot.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ot,[])}catch(It){qe=It}Reflect.construct(te,[],Ot)}else{try{Ot.call()}catch(It){qe=It}te.call(Ot.prototype)}}else{try{throw Error()}catch(It){qe=It}te()}}catch(It){if(It&&qe&&typeof It.stack=="string"){for(var Et=It.stack.split(`
19
+ `),Fe=qe.stack.split(`
20
+ `),ne=Et.length-1,Se=Fe.length-1;ne>=1&&Se>=0&&Et[ne]!==Fe[Se];)Se--;for(;ne>=1&&Se>=0;ne--,Se--)if(Et[ne]!==Fe[Se]){if(ne!==1||Se!==1)do if(ne--,Se--,Se<0||Et[ne]!==Fe[Se]){var De=`
21
+ `+Et[ne].replace(" at new "," at ");return te.displayName&&De.includes("<anonymous>")&&(De=De.replace("<anonymous>",te.displayName)),typeof te=="function"&&de.set(te,De),De}while(ne>=1&&Se>=0);break}}}finally{ie=!1,re.current=qt,K(),Error.prepareStackTrace=Bt}var jt=te?te.displayName||te.name:"",yn=jt?J(jt):"";return typeof te=="function"&&de.set(te,yn),yn}function ge(te,Re,Ae){return se(te,!1)}function ue(te){var Re=te.prototype;return!!(Re&&Re.isReactComponent)}function Ce(te,Re,Ae){if(te==null)return"";if(typeof te=="function")return se(te,ue(te));if(typeof te=="string")return J(te);switch(te){case c:return J("Suspense");case u:return J("SuspenseList")}if(typeof te=="object")switch(te.$$typeof){case l:return ge(te.render);case d:return Ce(te.type,Re,Ae);case p:{var qe=te,Bt=qe._payload,qt=qe._init;try{return Ce(qt(Bt),Re,Ae)}catch{}}}return""}var ke=Object.prototype.hasOwnProperty,Ne={},Oe=v.ReactDebugCurrentFrame;function Le(te){if(te){var Re=te._owner,Ae=Ce(te.type,te._source,Re?Re.type:null);Oe.setExtraStackFrame(Ae)}else Oe.setExtraStackFrame(null)}function Je(te,Re,Ae,qe,Bt){{var qt=Function.call.bind(ke);for(var Ot in te)if(qt(te,Ot)){var Et=void 0;try{if(typeof te[Ot]!="function"){var Fe=Error((qe||"React class")+": "+Ae+" type `"+Ot+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof te[Ot]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Fe.name="Invariant Violation",Fe}Et=te[Ot](Re,Ot,qe,Ae,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(ne){Et=ne}Et&&!(Et instanceof Error)&&(Le(Bt),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).",qe||"React class",Ae,Ot,typeof Et),Le(null)),Et instanceof Error&&!(Et.message in Ne)&&(Ne[Et.message]=!0,Le(Bt),w("Failed %s type: %s",Ae,Et.message),Le(null))}}}var it=Array.isArray;function ln(te){return it(te)}function vt(te){{var Re=typeof Symbol=="function"&&Symbol.toStringTag,Ae=Re&&te[Symbol.toStringTag]||te.constructor.name||"Object";return Ae}}function $n(te){try{return Ct(te),!1}catch{return!0}}function Ct(te){return""+te}function fe(te){if($n(te))return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",vt(te)),Ct(te)}var _e=v.ReactCurrentOwner,He={key:!0,ref:!0,__self:!0,__source:!0},Ve,rt;function An(te){if(ke.call(te,"ref")){var Re=Object.getOwnPropertyDescriptor(te,"ref").get;if(Re&&Re.isReactWarning)return!1}return te.ref!==void 0}function Ue(te){if(ke.call(te,"key")){var Re=Object.getOwnPropertyDescriptor(te,"key").get;if(Re&&Re.isReactWarning)return!1}return te.key!==void 0}function lt(te,Re){typeof te.ref=="string"&&_e.current}function Ge(te,Re){{var Ae=function(){Ve||(Ve=!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)",Re))};Ae.isReactWarning=!0,Object.defineProperty(te,"key",{get:Ae,configurable:!0})}}function tn(te,Re){{var Ae=function(){rt||(rt=!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)",Re))};Ae.isReactWarning=!0,Object.defineProperty(te,"ref",{get:Ae,configurable:!0})}}var gt=function(te,Re,Ae,qe,Bt,qt,Ot){var Et={$$typeof:t,type:te,key:Re,ref:Ae,props:Ot,_owner:qt};return Et._store={},Object.defineProperty(Et._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Et,"_self",{configurable:!1,enumerable:!1,writable:!1,value:qe}),Object.defineProperty(Et,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Bt}),Object.freeze&&(Object.freeze(Et.props),Object.freeze(Et)),Et};function In(te,Re,Ae,qe,Bt){{var qt,Ot={},Et=null,Fe=null;Ae!==void 0&&(fe(Ae),Et=""+Ae),Ue(Re)&&(fe(Re.key),Et=""+Re.key),An(Re)&&(Fe=Re.ref,lt(Re,Bt));for(qt in Re)ke.call(Re,qt)&&!He.hasOwnProperty(qt)&&(Ot[qt]=Re[qt]);if(te&&te.defaultProps){var ne=te.defaultProps;for(qt in ne)Ot[qt]===void 0&&(Ot[qt]=ne[qt])}if(Et||Fe){var Se=typeof te=="function"?te.displayName||te.name||"Unknown":te;Et&&Ge(Ot,Se),Fe&&tn(Ot,Se)}return gt(te,Et,Fe,Bt,qe,_e.current,Ot)}}var $t=v.ReactCurrentOwner,Nn=v.ReactDebugCurrentFrame;function st(te){if(te){var Re=te._owner,Ae=Ce(te.type,te._source,Re?Re.type:null);Nn.setExtraStackFrame(Ae)}else Nn.setExtraStackFrame(null)}var qo;qo=!1;function cr(te){return typeof te=="object"&&te!==null&&te.$$typeof===t}function br(){{if($t.current){var te=X($t.current.type);if(te)return`
22
+
23
+ Check the render method of \``+te+"`."}return""}}function mi(te){return""}var $e={};function Pt(te){{var Re=br();if(!Re){var Ae=typeof te=="string"?te:te.displayName||te.name;Ae&&(Re=`
24
+
25
+ Check the top-level render call using <`+Ae+">.")}return Re}}function Xt(te,Re){{if(!te._store||te._store.validated||te.key!=null)return;te._store.validated=!0;var Ae=Pt(Re);if($e[Ae])return;$e[Ae]=!0;var qe="";te&&te._owner&&te._owner!==$t.current&&(qe=" It was passed a child from "+X(te._owner.type)+"."),st(te),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,qe),st(null)}}function tr(te,Re){{if(typeof te!="object")return;if(ln(te))for(var Ae=0;Ae<te.length;Ae++){var qe=te[Ae];cr(qe)&&Xt(qe,Re)}else if(cr(te))te._store&&(te._store.validated=!0);else if(te){var Bt=y(te);if(typeof Bt=="function"&&Bt!==te.entries)for(var qt=Bt.call(te),Ot;!(Ot=qt.next()).done;)cr(Ot.value)&&Xt(Ot.value,Re)}}}function nr(te){{var Re=te.type;if(Re==null||typeof Re=="string")return;var Ae;if(typeof Re=="function")Ae=Re.propTypes;else if(typeof Re=="object"&&(Re.$$typeof===l||Re.$$typeof===d))Ae=Re.propTypes;else return;if(Ae){var qe=X(Re);Je(Ae,te.props,"prop",qe,te)}else if(Re.PropTypes!==void 0&&!qo){qo=!0;var Bt=X(Re);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Bt||"Unknown")}typeof Re.getDefaultProps=="function"&&!Re.getDefaultProps.isReactClassApproved&&w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function zr(te){{for(var Re=Object.keys(te.props),Ae=0;Ae<Re.length;Ae++){var qe=Re[Ae];if(qe!=="children"&&qe!=="key"){st(te),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",qe),st(null);break}}te.ref!==null&&(st(te),w("Invalid attribute `ref` supplied to `React.Fragment`."),st(null))}}var yr={};function ur(te,Re,Ae,qe,Bt,qt){{var Ot=F(te);if(!Ot){var Et="";(te===void 0||typeof te=="object"&&te!==null&&Object.keys(te).length===0)&&(Et+=" 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 Fe=mi();Fe?Et+=Fe:Et+=br();var ne;te===null?ne="null":ln(te)?ne="array":te!==void 0&&te.$$typeof===t?(ne="<"+(X(te.type)||"Unknown")+" />",Et=" Did you accidentally export a JSX literal instead of a component?"):ne=typeof te,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",ne,Et)}var Se=In(te,Re,Ae,Bt,qt);if(Se==null)return Se;if(Ot){var De=Re.children;if(De!==void 0)if(qe)if(ln(De)){for(var jt=0;jt<De.length;jt++)tr(De[jt],te);Object.freeze&&Object.freeze(De)}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 tr(De,te)}if(ke.call(Re,"key")){var yn=X(te),It=Object.keys(Re).filter(function(ws){return ws!=="key"}),Kn=It.length>0?"{key: someKey, "+It.join(": ..., ")+": ...}":"{key: someKey}";if(!yr[yn+Kn]){var no=It.length>0?"{"+It.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} />`,Kn,yn,no,yn),yr[yn+Kn]=!0}}return te===r?zr(Se):nr(Se),Se}}function _n(te,Re,Ae){return ur(te,Re,Ae,!0)}function la(te,Re,Ae){return ur(te,Re,Ae,!1)}var qc=la,Yc=_n;bf.Fragment=r,bf.jsx=qc,bf.jsxs=Yc}()),bf}process.env.NODE_ENV==="production"?g1.exports=rK():g1.exports=oK();var x=g1.exports;function cN(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=cN(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ad(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=cN(e))&&(r&&(r+=" "),r+=t);return r}const iK=Object.freeze(Object.defineProperty({__proto__:null,clsx:ad,default:ad},Symbol.toStringTag,{value:"Module"})),G_="-",sK=e=>{const t=lK(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(G_);return a[0]===""&&a.length!==1&&a.shift(),uN(a,t)||aK(s)},getConflictingClassGroupIds:(s,a)=>{const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}}},uN=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?uN(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(G_);return(s=t.validators.find(({validator:a})=>a(i)))==null?void 0:s.classGroupId},QP=/^\[(.+)\]$/,aK=e=>{if(QP.test(e)){const t=QP.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},lK=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return uK(Object.entries(e.classGroups),n).forEach(([i,s])=>{m1(s,r,i,t)}),r},m1=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:ZP(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(cK(o)){m1(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{m1(s,ZP(t,i),n,r)})})},ZP=(e,t)=>{let n=e;return t.split(G_).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},cK=e=>e.isThemeGetter,uK=(e,t)=>t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,a])=>[t+s,a])):i);return[n,o]}):e,dK=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(i,s)=>{n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}},dN="!",fK=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],i=t.length,s=a=>{const l=[];let c=0,u=0,d;for(let y=0;y<a.length;y++){let v=a[y];if(c===0){if(v===o&&(r||a.slice(y,y+i)===t)){l.push(a.slice(u,y)),u=y+i;continue}if(v==="/"){d=y;continue}}v==="["?c++:v==="]"&&c--}const p=l.length===0?a:a.substring(u),h=p.startsWith(dN),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},hK=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},pK=e=>({cache:dK(e.cacheSize),parseClassName:fK(e),...sK(e)}),gK=/\s+/,mK=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],s=e.trim().split(gK);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 y=hK(u).join(":"),v=d?y+dN:y,w=v+b;if(i.includes(w))continue;i.push(w);const _=o(b,m);for(let R=0;R<_.length;++R){const C=_[R];i.push(v+C)}a=c+(a.length>0?" "+a:a)}return a};function bK(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=fN(t))&&(r&&(r+=" "),r+=n);return r}const fN=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=fN(e[r]))&&(n&&(n+=" "),n+=t);return n};function yK(e,...t){let n,r,o,i=s;function s(l){const c=t.reduce((u,d)=>d(u),e());return n=pK(c),r=n.cache.get,o=n.cache.set,i=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=mK(l,n);return o(l,u),u}return function(){return i(bK.apply(null,arguments))}}const En=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},hN=/^\[(?:([a-z-]+):)?(.+)\]$/i,vK=/^\d+\/\d+$/,xK=new Set(["px","full","screen"]),wK=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,SK=/\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$/,_K=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,CK=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,EK=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ms=e=>Du(e)||xK.has(e)||vK.test(e),ya=e=>Ad(e,"length",DK),Du=e=>!!e&&!Number.isNaN(Number(e)),bx=e=>Ad(e,"number",Du),yf=e=>!!e&&Number.isInteger(Number(e)),RK=e=>e.endsWith("%")&&Du(e.slice(0,-1)),wt=e=>hN.test(e),va=e=>wK.test(e),TK=new Set(["length","size","percentage"]),kK=e=>Ad(e,TK,pN),PK=e=>Ad(e,"position",pN),OK=new Set(["image","url"]),MK=e=>Ad(e,OK,NK),AK=e=>Ad(e,"",IK),vf=()=>!0,Ad=(e,t,n)=>{const r=hN.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},DK=e=>SK.test(e)&&!_K.test(e),pN=()=>!1,IK=e=>CK.test(e),NK=e=>EK.test(e),FK=()=>{const e=En("colors"),t=En("spacing"),n=En("blur"),r=En("brightness"),o=En("borderColor"),i=En("borderRadius"),s=En("borderSpacing"),a=En("borderWidth"),l=En("contrast"),c=En("grayscale"),u=En("hueRotate"),d=En("invert"),p=En("gap"),h=En("gradientColorStops"),m=En("gradientColorStopPositions"),b=En("inset"),y=En("margin"),v=En("opacity"),w=En("padding"),_=En("saturate"),R=En("scale"),C=En("sepia"),E=En("skew"),P=En("space"),A=En("translate"),I=()=>["auto","contain","none"],F=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto",wt,t],j=()=>[wt,t],X=()=>["",Ms,ya],U=()=>["auto",Du,wt],$=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],B=()=>["solid","dashed","dotted","double","none"],W=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],q=()=>["start","end","center","between","around","evenly","stretch"],Q=()=>["","0",wt],D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],G=()=>[Du,wt];return{cacheSize:500,separator:":",theme:{colors:[vf],spacing:[Ms,ya],blur:["none","",va,wt],brightness:G(),borderColor:[e],borderRadius:["none","","full",va,wt],borderSpacing:j(),borderWidth:X(),contrast:G(),grayscale:Q(),hueRotate:G(),invert:Q(),gap:j(),gradientColorStops:[e],gradientColorStopPositions:[RK,ya],inset:L(),margin:L(),opacity:G(),padding:j(),saturate:G(),scale:G(),sepia:Q(),skew:G(),space:j(),translate:j()},classGroups:{aspect:[{aspect:["auto","square","video",wt]}],container:["container"],columns:[{columns:[va]}],"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:[...$(),wt]}],overflow:[{overflow:F()}],"overflow-x":[{"overflow-x":F()}],"overflow-y":[{"overflow-y":F()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],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",yf,wt]}],basis:[{basis:L()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",wt]}],grow:[{grow:Q()}],shrink:[{shrink:Q()}],order:[{order:["first","last","none",yf,wt]}],"grid-cols":[{"grid-cols":[vf]}],"col-start-end":[{col:["auto",{span:["full",yf,wt]},wt]}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":[vf]}],"row-start-end":[{row:["auto",{span:[yf,wt]},wt]}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",wt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",wt]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...q()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...q(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...q(),"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:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[P]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[P]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",wt,t]}],"min-w":[{"min-w":[wt,t,"min","max","fit"]}],"max-w":[{"max-w":[wt,t,"none","full","min","max","fit","prose",{screen:[va]},va]}],h:[{h:[wt,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[wt,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[wt,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[wt,t,"auto","min","max","fit"]}],"font-size":[{text:["base",va,ya]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",bx]}],"font-family":[{font:[vf]}],"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",wt]}],"line-clamp":[{"line-clamp":["none",Du,bx]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ms,wt]}],"list-image":[{"list-image":["none",wt]}],"list-style-type":[{list:["none","disc","decimal",wt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...B(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ms,ya]}],"underline-offset":[{"underline-offset":["auto",Ms,wt]}],"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:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",wt]}],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",wt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...$(),PK]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",kK]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},MK]}],"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:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"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":[v]}],"border-style":[{border:[...B(),"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":[v]}],"divide-style":[{divide:B()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...B()]}],"outline-offset":[{"outline-offset":[Ms,wt]}],"outline-w":[{outline:[Ms,ya]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[Ms,ya]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",va,AK]}],"shadow-color":[{shadow:[vf]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...W(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":W()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",va,wt]}],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":[v]}],"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",wt]}],duration:[{duration:G()}],ease:[{ease:["linear","in","out","in-out",wt]}],delay:[{delay:G()}],animate:[{animate:["none","spin","ping","pulse","bounce",wt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[R]}],"scale-x":[{"scale-x":[R]}],"scale-y":[{"scale-y":[R]}],rotate:[{rotate:[yf,wt]}],"translate-x":[{"translate-x":[A]}],"translate-y":[{"translate-y":[A]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",wt]}],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",wt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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",wt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ms,ya,bx]}],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"]}}},LK=yK(FK);class Wf extends Error{}Wf.prototype.name="InvalidTokenError";function $K(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 jK(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 $K(t)}catch{return atob(t)}}function q_(e,t){if(typeof e!="string")throw new Wf("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 Wf(`Invalid token specified: missing part #${n+1}`);let o;try{o=jK(r)}catch(i){throw new Wf(`Invalid token specified: invalid base64 for part #${n+1} (${i.message})`)}try{return JSON.parse(o)}catch(i){throw new Wf(`Invalid token specified: invalid json for part #${n+1} (${i.message})`)}}const zK={},JP=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))}},o=()=>t,l={setState:r,getState:o,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(zK?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},c=t=e(r,o,l);return l},BK=e=>e?JP(e):JP;var b1={exports:{}},yx={},Ug={exports:{}},vx={};/**
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 eO;function HK(){if(eO)return vx;eO=1;var e=k;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,o=e.useEffect,i=e.useLayoutEffect,s=e.useDebugValue;function a(d,p){var h=p(),m=r({inst:{value:h,getSnapshot:p}}),b=m[0].inst,y=m[1];return i(function(){b.value=h,b.getSnapshot=p,l(b)&&y({inst:b})},[d,h,p]),o(function(){return l(b)&&y({inst:b}),d(function(){l(b)&&y({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 vx.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,vx}var xx={};/**
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 tO;function WK(){return tO||(tO=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||o.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 y=m();i(b,y)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}y=s({inst:{value:b,getSnapshot:m}});var v=y[0].inst,w=y[1];return l(function(){v.value=b,v.getSnapshot=m,n(v)&&w({inst:v})},[h,b,m]),a(function(){return n(v)&&w({inst:v}),h(function(){n(v)&&w({inst:v})})},[h]),c(b),b}function n(h){var m=h.getSnapshot;h=h.value;try{var b=m();return!i(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 o=k,i=typeof Object.is=="function"?Object.is:e,s=o.useState,a=o.useEffect,l=o.useLayoutEffect,c=o.useDebugValue,u=!1,d=!1,p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;xx.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:p,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),xx}var nO;function Y_(){return nO||(nO=1,process.env.NODE_ENV==="production"?Ug.exports=HK():Ug.exports=WK()),Ug.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 rO;function VK(){if(rO)return yx;rO=1;var e=k,t=Y_();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,o=t.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return yx.useSyncExternalStoreWithSelector=function(c,u,d,p,h){var m=i(null);if(m.current===null){var b={hasValue:!1,value:null};m.current=b}else b=m.current;m=a(function(){function v(E){if(!w){if(w=!0,_=E,E=p(E),h!==void 0&&b.hasValue){var P=b.value;if(h(P,E))return R=P}return R=E}if(P=R,r(_,E))return P;var A=p(E);return h!==void 0&&h(P,A)?(_=E,P):(_=E,R=A)}var w=!1,_,R,C=d===void 0?null:d;return[function(){return v(u())},C===null?void 0:function(){return v(C())}]},[u,d,p,h]);var y=o(c,m[0],m[1]);return s(function(){b.hasValue=!0,b.value=y},[y]),l(y),y},yx}var wx={};/**
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 oO;function UK(){return oO||(oO=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=k,n=Y_(),r=typeof Object.is=="function"?Object.is:e,o=n.useSyncExternalStore,i=t.useRef,s=t.useEffect,a=t.useMemo,l=t.useDebugValue;wx.useSyncExternalStoreWithSelector=function(c,u,d,p,h){var m=i(null);if(m.current===null){var b={hasValue:!1,value:null};m.current=b}else b=m.current;m=a(function(){function v(E){if(!w){if(w=!0,_=E,E=p(E),h!==void 0&&b.hasValue){var P=b.value;if(h(P,E))return R=P}return R=E}if(P=R,r(_,E))return P;var A=p(E);return h!==void 0&&h(P,A)?(_=E,P):(_=E,R=A)}var w=!1,_,R,C=d===void 0?null:d;return[function(){return v(u())},C===null?void 0:function(){return v(C())}]},[u,d,p,h]);var y=o(c,m[0],m[1]);return s(function(){b.hasValue=!0,b.value=y},[y]),l(y),y},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),wx}process.env.NODE_ENV==="production"?b1.exports=VK():b1.exports=UK();var GK=b1.exports;const qK=ol(GK),gN={},{useDebugValue:YK}=k,{useSyncExternalStoreWithSelector:KK}=qK;let iO=!1;const XK=e=>e;function QK(e,t=XK,n){(gN?"production":void 0)!=="production"&&n&&!iO&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),iO=!0);const r=KK(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return YK(r),r}const ZK=e=>{(gN?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?BK(e):e,n=(r,o)=>QK(t,r,o);return Object.assign(n,t),n},mN=e=>ZK;var bN=Symbol.for("immer-nothing"),sO=Symbol.for("immer-draftable"),Bo=Symbol.for("immer-state"),JK=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 vo(e,...t){if(process.env.NODE_ENV!=="production"){const n=JK[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 ld=Object.getPrototypeOf;function cd(e){return!!e&&!!e[Bo]}function Sc(e){var t;return e?yN(e)||Array.isArray(e)||!!e[sO]||!!((t=e.constructor)!=null&&t[sO])||Ty(e)||ky(e):!1}var eX=Object.prototype.constructor.toString();function yN(e){if(!e||typeof e!="object")return!1;const t=ld(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)===eX}function yb(e,t){Ry(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function Ry(e){const t=e[Bo];return t?t.type_:Array.isArray(e)?1:Ty(e)?2:ky(e)?3:0}function y1(e,t){return Ry(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function vN(e,t,n){const r=Ry(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function tX(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Ty(e){return e instanceof Map}function ky(e){return e instanceof Set}function Al(e){return e.copy_||e.base_}function v1(e,t){if(Ty(e))return new Map(e);if(ky(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=yN(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Bo];let o=Reflect.ownKeys(r);for(let i=0;i<o.length;i++){const s=o[i],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(ld(e),r)}else{const r=ld(e);if(r!==null&&n)return{...e};const o=Object.create(r);return Object.assign(o,e)}}function K_(e,t=!1){return Py(e)||cd(e)||!Sc(e)||(Ry(e)>1&&(e.set=e.add=e.clear=e.delete=nX),Object.freeze(e),t&&Object.entries(e).forEach(([n,r])=>K_(r,!0))),e}function nX(){vo(2)}function Py(e){return Object.isFrozen(e)}var rX={};function _c(e){const t=rX[e];return t||vo(0,e),t}var Ah;function xN(){return Ah}function oX(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function aO(e,t){t&&(_c("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function x1(e){w1(e),e.drafts_.forEach(iX),e.drafts_=null}function w1(e){e===Ah&&(Ah=e.parent_)}function lO(e){return Ah=oX(Ah,e)}function iX(e){const t=e[Bo];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function cO(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Bo].modified_&&(x1(t),vo(4)),Sc(e)&&(e=vb(t,e),t.parent_||xb(t,e)),t.patches_&&_c("Patches").generateReplacementPatches_(n[Bo].base_,e,t.patches_,t.inversePatches_)):e=vb(t,n,[]),x1(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==bN?e:void 0}function vb(e,t,n){if(Py(t))return t;const r=t[Bo];if(!r)return yb(t,(o,i)=>uO(e,r,t,o,i,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return xb(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const o=r.copy_;let i=o,s=!1;r.type_===3&&(i=new Set(o),o.clear(),s=!0),yb(i,(a,l)=>uO(e,r,o,a,l,n,s)),xb(e,o,!1),n&&e.patches_&&_c("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function uO(e,t,n,r,o,i,s){if(process.env.NODE_ENV!=="production"&&o===n&&vo(5),cd(o)){const a=i&&t&&t.type_!==3&&!y1(t.assigned_,r)?i.concat(r):void 0,l=vb(e,o,a);if(vN(n,r,l),cd(l))e.canAutoFreeze_=!1;else return}else s&&n.add(o);if(Sc(o)&&!Py(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;vb(e,o),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,r)&&xb(e,o)}}function xb(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&K_(t,n)}function sX(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:xN(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=X_;n&&(o=[r],i=Dh);const{revoke:s,proxy:a}=Proxy.revocable(o,i);return r.draft_=a,r.revoke_=s,a}var X_={get(e,t){if(t===Bo)return e;const n=Al(e);if(!y1(n,t))return aX(e,n,t);const r=n[t];return e.finalized_||!Sc(r)?r:r===Sx(e.base_,t)?(_x(e),e.copy_[t]=_1(r,e)):r},has(e,t){return t in Al(e)},ownKeys(e){return Reflect.ownKeys(Al(e))},set(e,t,n){const r=wN(Al(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const o=Sx(Al(e),t),i=o==null?void 0:o[Bo];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(tX(n,o)&&(n!==void 0||y1(e.base_,t)))return!0;_x(e),S1(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 Sx(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,_x(e),S1(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Al(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){vo(11)},getPrototypeOf(e){return ld(e.base_)},setPrototypeOf(){vo(12)}},Dh={};yb(X_,(e,t)=>{Dh[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Dh.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&vo(13),Dh.set.call(this,e,t,void 0)};Dh.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&vo(14),X_.set.call(this,e[0],t,n,e[0])};function Sx(e,t){const n=e[Bo];return(n?Al(n):e)[t]}function aX(e,t,n){var o;const r=wN(t,n);return r?"value"in r?r.value:(o=r.get)==null?void 0:o.call(e.draft_):void 0}function wN(e,t){if(!(t in e))return;let n=ld(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=ld(n)}}function S1(e){e.modified_||(e.modified_=!0,e.parent_&&S1(e.parent_))}function _x(e){e.copy_||(e.copy_=v1(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var lX=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const i=n;n=t;const s=this;return function(l=i,...c){return s.produce(l,u=>n.call(this,u,...c))}}typeof n!="function"&&vo(6),r!==void 0&&typeof r!="function"&&vo(7);let o;if(Sc(t)){const i=lO(this),s=_1(t,void 0);let a=!0;try{o=n(s),a=!1}finally{a?x1(i):w1(i)}return aO(i,r),cO(o,i)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===bN&&(o=void 0),this.autoFreeze_&&K_(o,!0),r){const i=[],s=[];_c("Patches").generateReplacementPatches_(t,o,i,s),r(i,s)}return o}else vo(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...a)=>this.produceWithPatches(s,l=>t(l,...a));let r,o;return[this.produce(t,n,(s,a)=>{r=s,o=a}),r,o]},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){Sc(e)||vo(8),cd(e)&&(e=cX(e));const t=lO(this),n=_1(e,void 0);return n[Bo].isManual_=!0,w1(t),n}finishDraft(e,t){const n=e&&e[Bo];(!n||!n.isManual_)&&vo(9);const{scope_:r}=n;return aO(r,t),cO(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 o=t[n];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}n>-1&&(t=t.slice(n+1));const r=_c("Patches").applyPatches_;return cd(e)?r(e,t):this.produce(e,o=>r(o,t))}};function _1(e,t){const n=Ty(e)?_c("MapSet").proxyMap_(e,t):ky(e)?_c("MapSet").proxySet_(e,t):sX(e,t);return(t?t.scope_:xN()).drafts_.push(n),n}function cX(e){return cd(e)||vo(10,e),SN(e)}function SN(e){if(!Sc(e)||Py(e))return e;const t=e[Bo];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=v1(e,t.scope_.immer_.useStrictShallowCopy_)}else n=v1(e,!0);return yb(n,(r,o)=>{vN(n,r,SN(o))}),t&&(t.finalized_=!1),n}var Ho=new lX,uX=Ho.produce;Ho.produceWithPatches.bind(Ho);Ho.setAutoFreeze.bind(Ho);Ho.setUseStrictShallowCopy.bind(Ho);Ho.applyPatches.bind(Ho);Ho.createDraft.bind(Ho);Ho.finishDraft.bind(Ho);const dX=e=>(t,n,r)=>(r.setState=(o,i,...s)=>{const a=typeof o=="function"?uX(o):o;return t(a,i,...s)},e(r.setState,n,r)),_N=dX;var C1,Gg=Ir;if(process.env.NODE_ENV==="production")C1=Gg.createRoot,Gg.hydrateRoot;else{var dO=Gg.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;C1=function(e,t){dO.usingClientEntryPoint=!0;try{return Gg.createRoot(e,t)}finally{dO.usingClientEntryPoint=!1}}}var CN={},EN={},Q_={exports:{}},St=String,RN=function(){return{isColorSupported:!1,reset:St,bold:St,dim:St,italic:St,underline:St,inverse:St,hidden:St,strikethrough:St,black:St,red:St,green:St,yellow:St,blue:St,magenta:St,cyan:St,white:St,gray:St,bgBlack:St,bgRed:St,bgGreen:St,bgYellow:St,bgBlue:St,bgMagenta:St,bgCyan:St,bgWhite:St,blackBright:St,redBright:St,greenBright:St,yellowBright:St,blueBright:St,magentaBright:St,cyanBright:St,whiteBright:St,bgBlackBright:St,bgRedBright:St,bgGreenBright:St,bgYellowBright:St,bgBlueBright:St,bgMagentaBright:St,bgCyanBright:St,bgWhiteBright:St}};Q_.exports=RN();Q_.exports.createColors=RN;var fX=Q_.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(fX);function r(l){return l&&l.__esModule?l:{default:l}}let o=new Set;function i(l,c,u){typeof process<"u"&&process.env.JEST_WORKER_ID||u&&o.has(u)||(u&&o.add(u),console.warn(""),c.forEach(d=>console.warn(l,"-",d)))}function s(l){return n.default.dim(l)}const a={info(l,c){i(n.default.bold(n.default.cyan("info")),...Array.isArray(l)?[l]:[c,l])},warn(l,c){i(n.default.bold(n.default.yellow("warn")),...Array.isArray(l)?[l]:[c,l])},risk(l,c){i(n.default.bold(n.default.magenta("risk")),...Array.isArray(l)?[l]:[c,l])}}})(EN);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});const t=n(EN);function n(i){return i&&i.__esModule?i:{default:i}}function r({version:i,from:s,to:a}){t.default.warn(`${s}-color-renamed`,[`As of Tailwind CSS ${i}, \`${s}\` has been renamed to \`${a}\`.`,"Update your configuration file to silence this warning."])}const o={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}}})(CN);let Cx=CN;var hX=(Cx.__esModule?Cx:{default:Cx}).default;const Ut=ol(hX),Z_=`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
+ `,J_="dm",E1=[{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"}],pX=[{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)"}]}],eC=["lg","md","sm","xs","xxs"],wb={default:{dashboardPanel:"",dashboardTabsContainer:"",gridLayout:{className:""},chart:{font:{family:"Open Sans, Arial, sans-serif"},dataset:{backgroundColor:[Ut.blue[500],Ut.teal[500],Ut.amber[500],Ut.red[500],Ut.indigo[500],Ut.green[500]],borderColor:[Ut.blue[500],Ut.teal[500],Ut.amber[500],Ut.red[500],Ut.indigo[500],Ut.green[500]]},options:{interaction:{mode:"index"},plugins:{datalabels:{display:!1,color:R1},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:[Ut.blue[500],Ut.teal[500],Ut.amber[500],Ut.red[500],Ut.indigo[500],Ut.green[500]],borderColor:[Ut.blue[500],Ut.teal[500],Ut.amber[500],Ut.red[500],Ut.indigo[500],Ut.green[500]],datalables:{color:R1}},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:Ut.slate[800]}},y:{grid:{display:!0,color:Ut.slate[800]}}}}}}};function R1(e){var r,o,i,s,a,l;const t=(a=(s=(i=(o=(r=e==null?void 0:e.chart)==null?void 0:r.config)==null?void 0:o._config)==null?void 0:i.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=Ih()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=Ih()),ud(n)}function Ih(){return ye.getState().theme==="dark"?"#000000":"#FFFFFF"}function ud(e){let t=0,n=0,r=0,o=0;const i=u=>{if(!u)return Ut.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,o++};Array.isArray(e)?e.forEach(u=>{i(u)}):i(e);const s=t/o,a=n/o,l=r/o;return(s*299+a*587+l*114)/1e3>=180?"black":"white"}const gX=["text","enum","varchar","nvarchar","nvarchar2","char","character","longtext","nchar","char varying","nchar varying","character varying","string"],mX=["number","integer","int","int64","bigint","smallint","tinyint","byteint","numeric","decimal","dec","double","real","double precision","float","float4","float8","float64"],bX=["date","datetime","time","timestamp","timestamp without time zone","timestamp_ns"],yX=["boolean"];function tC(e){return e.match(/[A-Z]/)?`"${e}"`:e}function Oy(e){return gX.includes(e.toLowerCase())||/varchar/i.test(e)}function xp(e){return mX.includes(e.toLowerCase())||/int|decimal|float|double/i.test(e)}function Dd(e){return bX.includes(e.toLowerCase())||/date|time|timestamp/i.test(e)}function nC(e){return yX.includes(e.toLowerCase())||/boolean/i.test(e)}function vX(e,t,n,r,o){const{measures:i,dimensions:s}=e,a=i==null?void 0:i.map(d=>`${d.calc}(${d.name}) as ${d.calc}_${d.name.replace(/"/g,"")}`).join(", "),l=(s==null?void 0:s.join(", "))||"";let c="";const u=r?`${J_}.${r}`:rC(t,n,o);if(a&&l)return c=`SELECT ${l}, COUNT(*) as count, ${a} FROM ${u} GROUP BY ${l} ORDER BY ${l} DESC LIMIT 100`,c;if(!a&&l)return c=`SELECT ${l}, COUNT(*) as count FROM ${u} GROUP BY ${l} ORDER BY ${l} DESC LIMIT 100`,c;if(a&&!l)return c=`SELECT ${a} FROM ${u} LIMIT 100`,c}function xX(e,t,n="AVG"){var i,s,a,l;let r={};const o=tC(e.column_name);return Oy(e.data_type)&&(((i=t.dimensions)==null?void 0:i.includes(o))?r={...t,dimensions:(s=t.dimensions)==null?void 0:s.filter(u=>u!==o)}:r={...t,dimensions:[...t.dimensions||[],o]}),xp(e.data_type)&&(((a=t.measures)==null?void 0:a.some(u=>u.name===o&&u.calc===n))?r={...t,measures:(l=t.measures)==null?void 0:l.filter(u=>!(u.name===o&&u.calc===n))}:r={...t,measures:[...t.measures||[],{name:o,calc:n||"SUM"}]}),r}function Iu(e){return Oy(e.dataType)?"string":xp(e.dataType)?"number":Dd(e.dataType)?"date":nC(e.dataType)?"boolean":"string"}function wX(e){let t;const n=e.data_type.toLowerCase();return Oy(n)?t="T":xp(n)?t="#":Dd(n)?t="D":nC(n)?t="B":t="?",t}function SX(e,t){const{dimensions:n,measures:r}=t,o=n==null?void 0:n.includes(e.column_name),i=r==null?void 0:r.some(s=>s.name===e.column_name);return o||i}function TN({schemaName:e,tableName:t,modelName:n,connectionType:r}){let o=rC(e,t,r);n&&(o=`${J_}.${n}`);let i=o;return(a=>/[A-Z]/.test(a))(t)&&(i=i.split(".").map(l=>`"${l}"`).join(".")),i}function rC(e,t,n){return t==="api"||e===tC("NA")||n==="S3"||n==="API"?t:e?`${e}.${t}`:`${t}`}const _X=e=>{const t=new Date(e);return!isNaN(t.getTime())},CX=e=>!isNaN(Number(e))&&!isNaN(parseFloat(e)),My=e=>{let t;return typeof e=="number"?t="number":typeof e=="string"?_X(e)?t="date":CX(e)?t="number":t="string":typeof e=="boolean"?t="boolean":e instanceof Date?t="date":t="unknown",t};function EX({get:e,dataPoint:t,card:n}){var p;const{addOrUpdateFilterValue:r,addFilteringCard:o,removeFilterValues:i,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:My(u),operation:"=",values:[u]};if(l!=null&&l.find(h=>h.id===n.id)){const h=n.id;if(u==null){a(n),i(h);return}else s(d)}o(n),r(d)}var Sb={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
+ */Sb.exports;(function(e,t){(function(){var n,r="4.17.21",o=200,i="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,y=1,v=2,w=4,_=8,R=16,C=32,E=64,P=128,A=256,I=512,F=30,L="...",j=800,X=16,U=1,$=2,B=3,W=1/0,q=9007199254740991,Q=17976931348623157e292,D=NaN,G=4294967295,V=G-1,M=G>>>1,ee=[["ary",P],["bind",y],["bindKey",v],["curry",_],["curryRight",R],["flip",I],["partial",C],["partialRight",E],["rearg",A]],K="[object Arguments]",re="[object Array]",Y="[object AsyncFunction]",J="[object Boolean]",ie="[object Date]",de="[object DOMException]",he="[object Error]",se="[object Function]",ge="[object GeneratorFunction]",ue="[object Map]",Ce="[object Number]",ke="[object Null]",Ne="[object Object]",Oe="[object Promise]",Le="[object Proxy]",Je="[object RegExp]",it="[object Set]",ln="[object String]",vt="[object Symbol]",$n="[object Undefined]",Ct="[object WeakMap]",fe="[object WeakSet]",_e="[object ArrayBuffer]",He="[object DataView]",Ve="[object Float32Array]",rt="[object Float64Array]",An="[object Int8Array]",Ue="[object Int16Array]",lt="[object Int32Array]",Ge="[object Uint8Array]",tn="[object Uint8ClampedArray]",gt="[object Uint16Array]",In="[object Uint32Array]",$t=/\b__p \+= '';/g,Nn=/\b(__p \+=) '' \+/g,st=/(__e\(.*?\)|\b__t\)) \+\n'';/g,qo=/&(?:amp|lt|gt|quot|#39);/g,cr=/[&<>"']/g,br=RegExp(qo.source),mi=RegExp(cr.source),$e=/<%-([\s\S]+?)%>/g,Pt=/<%([\s\S]+?)%>/g,Xt=/<%=([\s\S]+?)%>/g,tr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nr=/^\w*$/,zr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,yr=/[\\^$.*+?()[\]{}|]/g,ur=RegExp(yr.source),_n=/^\s+/,la=/\s/,qc=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Yc=/\{\n\/\* \[wrapped with (.+)\] \*/,te=/,? & /,Re=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Ae=/[()=,{}\[\]\/\s]/,qe=/\\(\\)?/g,Bt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,qt=/\w*$/,Ot=/^[-+]0x[0-9a-f]+$/i,Et=/^0b[01]+$/i,Fe=/^\[object .+?Constructor\]$/,ne=/^0o[0-7]+$/i,Se=/^(?:0|[1-9]\d*)$/,De=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,jt=/($^)/,yn=/['\n\r\u2028\u2029\\]/g,It="\\ud800-\\udfff",Kn="\\u0300-\\u036f",no="\\ufe20-\\ufe2f",ws="\\u20d0-\\u20ff",dr=Kn+no+ws,Zd="\\u2700-\\u27bf",Jd="a-z\\xdf-\\xf6\\xf8-\\xff",QB="\\xac\\xb1\\xd7\\xf7",ZB="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",JB="\\u2000-\\u206f",eH=" \\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",RT="A-Z\\xc0-\\xd6\\xd8-\\xde",TT="\\ufe0e\\ufe0f",kT=QB+ZB+JB+eH,sv="['’]",tH="["+It+"]",PT="["+kT+"]",og="["+dr+"]",OT="\\d+",nH="["+Zd+"]",MT="["+Jd+"]",AT="[^"+It+kT+OT+Zd+Jd+RT+"]",av="\\ud83c[\\udffb-\\udfff]",rH="(?:"+og+"|"+av+")",DT="[^"+It+"]",lv="(?:\\ud83c[\\udde6-\\uddff]){2}",cv="[\\ud800-\\udbff][\\udc00-\\udfff]",Kc="["+RT+"]",IT="\\u200d",NT="(?:"+MT+"|"+AT+")",oH="(?:"+Kc+"|"+AT+")",FT="(?:"+sv+"(?:d|ll|m|re|s|t|ve))?",LT="(?:"+sv+"(?:D|LL|M|RE|S|T|VE))?",$T=rH+"?",jT="["+TT+"]?",iH="(?:"+IT+"(?:"+[DT,lv,cv].join("|")+")"+jT+$T+")*",sH="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",aH="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",zT=jT+$T+iH,lH="(?:"+[nH,lv,cv].join("|")+")"+zT,cH="(?:"+[DT+og+"?",og,lv,cv,tH].join("|")+")",uH=RegExp(sv,"g"),dH=RegExp(og,"g"),uv=RegExp(av+"(?="+av+")|"+cH+zT,"g"),fH=RegExp([Kc+"?"+MT+"+"+FT+"(?="+[PT,Kc,"$"].join("|")+")",oH+"+"+LT+"(?="+[PT,Kc+NT,"$"].join("|")+")",Kc+"?"+NT+"+"+FT,Kc+"+"+LT,aH,sH,OT,lH].join("|"),"g"),hH=RegExp("["+IT+It+dr+TT+"]"),pH=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,gH=["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"],mH=-1,Cn={};Cn[Ve]=Cn[rt]=Cn[An]=Cn[Ue]=Cn[lt]=Cn[Ge]=Cn[tn]=Cn[gt]=Cn[In]=!0,Cn[K]=Cn[re]=Cn[_e]=Cn[J]=Cn[He]=Cn[ie]=Cn[he]=Cn[se]=Cn[ue]=Cn[Ce]=Cn[Ne]=Cn[Je]=Cn[it]=Cn[ln]=Cn[Ct]=!1;var vn={};vn[K]=vn[re]=vn[_e]=vn[He]=vn[J]=vn[ie]=vn[Ve]=vn[rt]=vn[An]=vn[Ue]=vn[lt]=vn[ue]=vn[Ce]=vn[Ne]=vn[Je]=vn[it]=vn[ln]=vn[vt]=vn[Ge]=vn[tn]=vn[gt]=vn[In]=!0,vn[he]=vn[se]=vn[Ct]=!1;var bH={À:"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"},yH={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},vH={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},xH={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},wH=parseFloat,SH=parseInt,BT=typeof Xi=="object"&&Xi&&Xi.Object===Object&&Xi,_H=typeof self=="object"&&self&&self.Object===Object&&self,vr=BT||_H||Function("return this")(),dv=t&&!t.nodeType&&t,pl=dv&&!0&&e&&!e.nodeType&&e,HT=pl&&pl.exports===dv,fv=HT&&BT.process,Yo=function(){try{var le=pl&&pl.require&&pl.require("util").types;return le||fv&&fv.binding&&fv.binding("util")}catch{}}(),WT=Yo&&Yo.isArrayBuffer,VT=Yo&&Yo.isDate,UT=Yo&&Yo.isMap,GT=Yo&&Yo.isRegExp,qT=Yo&&Yo.isSet,YT=Yo&&Yo.isTypedArray;function Eo(le,be,pe){switch(pe.length){case 0:return le.call(be);case 1:return le.call(be,pe[0]);case 2:return le.call(be,pe[0],pe[1]);case 3:return le.call(be,pe[0],pe[1],pe[2])}return le.apply(be,pe)}function CH(le,be,pe,ze){for(var ht=-1,Qt=le==null?0:le.length;++ht<Qt;){var rr=le[ht];be(ze,rr,pe(rr),le)}return ze}function Ko(le,be){for(var pe=-1,ze=le==null?0:le.length;++pe<ze&&be(le[pe],pe,le)!==!1;);return le}function EH(le,be){for(var pe=le==null?0:le.length;pe--&&be(le[pe],pe,le)!==!1;);return le}function KT(le,be){for(var pe=-1,ze=le==null?0:le.length;++pe<ze;)if(!be(le[pe],pe,le))return!1;return!0}function ca(le,be){for(var pe=-1,ze=le==null?0:le.length,ht=0,Qt=[];++pe<ze;){var rr=le[pe];be(rr,pe,le)&&(Qt[ht++]=rr)}return Qt}function ig(le,be){var pe=le==null?0:le.length;return!!pe&&Xc(le,be,0)>-1}function hv(le,be,pe){for(var ze=-1,ht=le==null?0:le.length;++ze<ht;)if(pe(be,le[ze]))return!0;return!1}function Dn(le,be){for(var pe=-1,ze=le==null?0:le.length,ht=Array(ze);++pe<ze;)ht[pe]=be(le[pe],pe,le);return ht}function ua(le,be){for(var pe=-1,ze=be.length,ht=le.length;++pe<ze;)le[ht+pe]=be[pe];return le}function pv(le,be,pe,ze){var ht=-1,Qt=le==null?0:le.length;for(ze&&Qt&&(pe=le[++ht]);++ht<Qt;)pe=be(pe,le[ht],ht,le);return pe}function RH(le,be,pe,ze){var ht=le==null?0:le.length;for(ze&&ht&&(pe=le[--ht]);ht--;)pe=be(pe,le[ht],ht,le);return pe}function gv(le,be){for(var pe=-1,ze=le==null?0:le.length;++pe<ze;)if(be(le[pe],pe,le))return!0;return!1}var TH=mv("length");function kH(le){return le.split("")}function PH(le){return le.match(Re)||[]}function XT(le,be,pe){var ze;return pe(le,function(ht,Qt,rr){if(be(ht,Qt,rr))return ze=Qt,!1}),ze}function sg(le,be,pe,ze){for(var ht=le.length,Qt=pe+(ze?1:-1);ze?Qt--:++Qt<ht;)if(be(le[Qt],Qt,le))return Qt;return-1}function Xc(le,be,pe){return be===be?BH(le,be,pe):sg(le,QT,pe)}function OH(le,be,pe,ze){for(var ht=pe-1,Qt=le.length;++ht<Qt;)if(ze(le[ht],be))return ht;return-1}function QT(le){return le!==le}function ZT(le,be){var pe=le==null?0:le.length;return pe?yv(le,be)/pe:D}function mv(le){return function(be){return be==null?n:be[le]}}function bv(le){return function(be){return le==null?n:le[be]}}function JT(le,be,pe,ze,ht){return ht(le,function(Qt,rr,mn){pe=ze?(ze=!1,Qt):be(pe,Qt,rr,mn)}),pe}function MH(le,be){var pe=le.length;for(le.sort(be);pe--;)le[pe]=le[pe].value;return le}function yv(le,be){for(var pe,ze=-1,ht=le.length;++ze<ht;){var Qt=be(le[ze]);Qt!==n&&(pe=pe===n?Qt:pe+Qt)}return pe}function vv(le,be){for(var pe=-1,ze=Array(le);++pe<le;)ze[pe]=be(pe);return ze}function AH(le,be){return Dn(be,function(pe){return[pe,le[pe]]})}function ek(le){return le&&le.slice(0,ok(le)+1).replace(_n,"")}function Ro(le){return function(be){return le(be)}}function xv(le,be){return Dn(be,function(pe){return le[pe]})}function ef(le,be){return le.has(be)}function tk(le,be){for(var pe=-1,ze=le.length;++pe<ze&&Xc(be,le[pe],0)>-1;);return pe}function nk(le,be){for(var pe=le.length;pe--&&Xc(be,le[pe],0)>-1;);return pe}function DH(le,be){for(var pe=le.length,ze=0;pe--;)le[pe]===be&&++ze;return ze}var IH=bv(bH),NH=bv(yH);function FH(le){return"\\"+xH[le]}function LH(le,be){return le==null?n:le[be]}function Qc(le){return hH.test(le)}function $H(le){return pH.test(le)}function jH(le){for(var be,pe=[];!(be=le.next()).done;)pe.push(be.value);return pe}function wv(le){var be=-1,pe=Array(le.size);return le.forEach(function(ze,ht){pe[++be]=[ht,ze]}),pe}function rk(le,be){return function(pe){return le(be(pe))}}function da(le,be){for(var pe=-1,ze=le.length,ht=0,Qt=[];++pe<ze;){var rr=le[pe];(rr===be||rr===u)&&(le[pe]=u,Qt[ht++]=pe)}return Qt}function ag(le){var be=-1,pe=Array(le.size);return le.forEach(function(ze){pe[++be]=ze}),pe}function zH(le){var be=-1,pe=Array(le.size);return le.forEach(function(ze){pe[++be]=[ze,ze]}),pe}function BH(le,be,pe){for(var ze=pe-1,ht=le.length;++ze<ht;)if(le[ze]===be)return ze;return-1}function HH(le,be,pe){for(var ze=pe+1;ze--;)if(le[ze]===be)return ze;return ze}function Zc(le){return Qc(le)?VH(le):TH(le)}function bi(le){return Qc(le)?UH(le):kH(le)}function ok(le){for(var be=le.length;be--&&la.test(le.charAt(be)););return be}var WH=bv(vH);function VH(le){for(var be=uv.lastIndex=0;uv.test(le);)++be;return be}function UH(le){return le.match(uv)||[]}function GH(le){return le.match(fH)||[]}var qH=function le(be){be=be==null?vr:Jc.defaults(vr.Object(),be,Jc.pick(vr,gH));var pe=be.Array,ze=be.Date,ht=be.Error,Qt=be.Function,rr=be.Math,mn=be.Object,Sv=be.RegExp,YH=be.String,Xo=be.TypeError,lg=pe.prototype,KH=Qt.prototype,eu=mn.prototype,cg=be["__core-js_shared__"],ug=KH.toString,cn=eu.hasOwnProperty,XH=0,ik=function(){var f=/[^.]+$/.exec(cg&&cg.keys&&cg.keys.IE_PROTO||"");return f?"Symbol(src)_1."+f:""}(),dg=eu.toString,QH=ug.call(mn),ZH=vr._,JH=Sv("^"+ug.call(cn).replace(yr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),fg=HT?be.Buffer:n,fa=be.Symbol,hg=be.Uint8Array,sk=fg?fg.allocUnsafe:n,pg=rk(mn.getPrototypeOf,mn),ak=mn.create,lk=eu.propertyIsEnumerable,gg=lg.splice,ck=fa?fa.isConcatSpreadable:n,tf=fa?fa.iterator:n,gl=fa?fa.toStringTag:n,mg=function(){try{var f=xl(mn,"defineProperty");return f({},"",{}),f}catch{}}(),eW=be.clearTimeout!==vr.clearTimeout&&be.clearTimeout,tW=ze&&ze.now!==vr.Date.now&&ze.now,nW=be.setTimeout!==vr.setTimeout&&be.setTimeout,bg=rr.ceil,yg=rr.floor,_v=mn.getOwnPropertySymbols,rW=fg?fg.isBuffer:n,uk=be.isFinite,oW=lg.join,iW=rk(mn.keys,mn),or=rr.max,Rr=rr.min,sW=ze.now,aW=be.parseInt,dk=rr.random,lW=lg.reverse,Cv=xl(be,"DataView"),nf=xl(be,"Map"),Ev=xl(be,"Promise"),tu=xl(be,"Set"),rf=xl(be,"WeakMap"),of=xl(mn,"create"),vg=rf&&new rf,nu={},cW=wl(Cv),uW=wl(nf),dW=wl(Ev),fW=wl(tu),hW=wl(rf),xg=fa?fa.prototype:n,sf=xg?xg.valueOf:n,fk=xg?xg.toString:n;function z(f){if(jn(f)&&!pt(f)&&!(f instanceof zt)){if(f instanceof Qo)return f;if(cn.call(f,"__wrapped__"))return hP(f)}return new Qo(f)}var ru=function(){function f(){}return function(g){if(!Fn(g))return{};if(ak)return ak(g);f.prototype=g;var S=new f;return f.prototype=n,S}}();function wg(){}function Qo(f,g){this.__wrapped__=f,this.__actions__=[],this.__chain__=!!g,this.__index__=0,this.__values__=n}z.templateSettings={escape:$e,evaluate:Pt,interpolate:Xt,variable:"",imports:{_:z}},z.prototype=wg.prototype,z.prototype.constructor=z,Qo.prototype=ru(wg.prototype),Qo.prototype.constructor=Qo;function zt(f){this.__wrapped__=f,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=G,this.__views__=[]}function pW(){var f=new zt(this.__wrapped__);return f.__actions__=ro(this.__actions__),f.__dir__=this.__dir__,f.__filtered__=this.__filtered__,f.__iteratees__=ro(this.__iteratees__),f.__takeCount__=this.__takeCount__,f.__views__=ro(this.__views__),f}function gW(){if(this.__filtered__){var f=new zt(this);f.__dir__=-1,f.__filtered__=!0}else f=this.clone(),f.__dir__*=-1;return f}function mW(){var f=this.__wrapped__.value(),g=this.__dir__,S=pt(f),O=g<0,N=S?f.length:0,H=kV(0,N,this.__views__),Z=H.start,oe=H.end,ce=oe-Z,ve=O?oe:Z-1,we=this.__iteratees__,Ee=we.length,Ie=0,We=Rr(ce,this.__takeCount__);if(!S||!O&&N==ce&&We==ce)return Fk(f,this.__actions__);var Ke=[];e:for(;ce--&&Ie<We;){ve+=g;for(var Rt=-1,Xe=f[ve];++Rt<Ee;){var Nt=we[Rt],Ht=Nt.iteratee,Po=Nt.type,Wr=Ht(Xe);if(Po==$)Xe=Wr;else if(!Wr){if(Po==U)continue e;break e}}Ke[Ie++]=Xe}return Ke}zt.prototype=ru(wg.prototype),zt.prototype.constructor=zt;function ml(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 bW(){this.__data__=of?of(null):{},this.size=0}function yW(f){var g=this.has(f)&&delete this.__data__[f];return this.size-=g?1:0,g}function vW(f){var g=this.__data__;if(of){var S=g[f];return S===l?n:S}return cn.call(g,f)?g[f]:n}function xW(f){var g=this.__data__;return of?g[f]!==n:cn.call(g,f)}function wW(f,g){var S=this.__data__;return this.size+=this.has(f)?0:1,S[f]=of&&g===n?l:g,this}ml.prototype.clear=bW,ml.prototype.delete=yW,ml.prototype.get=vW,ml.prototype.has=xW,ml.prototype.set=wW;function Ss(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 SW(){this.__data__=[],this.size=0}function _W(f){var g=this.__data__,S=Sg(g,f);if(S<0)return!1;var O=g.length-1;return S==O?g.pop():gg.call(g,S,1),--this.size,!0}function CW(f){var g=this.__data__,S=Sg(g,f);return S<0?n:g[S][1]}function EW(f){return Sg(this.__data__,f)>-1}function RW(f,g){var S=this.__data__,O=Sg(S,f);return O<0?(++this.size,S.push([f,g])):S[O][1]=g,this}Ss.prototype.clear=SW,Ss.prototype.delete=_W,Ss.prototype.get=CW,Ss.prototype.has=EW,Ss.prototype.set=RW;function _s(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 TW(){this.size=0,this.__data__={hash:new ml,map:new(nf||Ss),string:new ml}}function kW(f){var g=Ig(this,f).delete(f);return this.size-=g?1:0,g}function PW(f){return Ig(this,f).get(f)}function OW(f){return Ig(this,f).has(f)}function MW(f,g){var S=Ig(this,f),O=S.size;return S.set(f,g),this.size+=S.size==O?0:1,this}_s.prototype.clear=TW,_s.prototype.delete=kW,_s.prototype.get=PW,_s.prototype.has=OW,_s.prototype.set=MW;function bl(f){var g=-1,S=f==null?0:f.length;for(this.__data__=new _s;++g<S;)this.add(f[g])}function AW(f){return this.__data__.set(f,l),this}function DW(f){return this.__data__.has(f)}bl.prototype.add=bl.prototype.push=AW,bl.prototype.has=DW;function yi(f){var g=this.__data__=new Ss(f);this.size=g.size}function IW(){this.__data__=new Ss,this.size=0}function NW(f){var g=this.__data__,S=g.delete(f);return this.size=g.size,S}function FW(f){return this.__data__.get(f)}function LW(f){return this.__data__.has(f)}function $W(f,g){var S=this.__data__;if(S instanceof Ss){var O=S.__data__;if(!nf||O.length<o-1)return O.push([f,g]),this.size=++S.size,this;S=this.__data__=new _s(O)}return S.set(f,g),this.size=S.size,this}yi.prototype.clear=IW,yi.prototype.delete=NW,yi.prototype.get=FW,yi.prototype.has=LW,yi.prototype.set=$W;function hk(f,g){var S=pt(f),O=!S&&Sl(f),N=!S&&!O&&ba(f),H=!S&&!O&&!N&&au(f),Z=S||O||N||H,oe=Z?vv(f.length,YH):[],ce=oe.length;for(var ve in f)(g||cn.call(f,ve))&&!(Z&&(ve=="length"||N&&(ve=="offset"||ve=="parent")||H&&(ve=="buffer"||ve=="byteLength"||ve=="byteOffset")||Ts(ve,ce)))&&oe.push(ve);return oe}function pk(f){var g=f.length;return g?f[Fv(0,g-1)]:n}function jW(f,g){return Ng(ro(f),yl(g,0,f.length))}function zW(f){return Ng(ro(f))}function Rv(f,g,S){(S!==n&&!vi(f[g],S)||S===n&&!(g in f))&&Cs(f,g,S)}function af(f,g,S){var O=f[g];(!(cn.call(f,g)&&vi(O,S))||S===n&&!(g in f))&&Cs(f,g,S)}function Sg(f,g){for(var S=f.length;S--;)if(vi(f[S][0],g))return S;return-1}function BW(f,g,S,O){return ha(f,function(N,H,Z){g(O,N,S(N),Z)}),O}function gk(f,g){return f&&ji(g,fr(g),f)}function HW(f,g){return f&&ji(g,io(g),f)}function Cs(f,g,S){g=="__proto__"&&mg?mg(f,g,{configurable:!0,enumerable:!0,value:S,writable:!0}):f[g]=S}function Tv(f,g){for(var S=-1,O=g.length,N=pe(O),H=f==null;++S<O;)N[S]=H?n:ax(f,g[S]);return N}function yl(f,g,S){return f===f&&(S!==n&&(f=f<=S?f:S),g!==n&&(f=f>=g?f:g)),f}function Zo(f,g,S,O,N,H){var Z,oe=g&d,ce=g&p,ve=g&h;if(S&&(Z=N?S(f,O,N,H):S(f)),Z!==n)return Z;if(!Fn(f))return f;var we=pt(f);if(we){if(Z=OV(f),!oe)return ro(f,Z)}else{var Ee=Tr(f),Ie=Ee==se||Ee==ge;if(ba(f))return jk(f,oe);if(Ee==Ne||Ee==K||Ie&&!N){if(Z=ce||Ie?{}:oP(f),!oe)return ce?vV(f,HW(Z,f)):yV(f,gk(Z,f))}else{if(!vn[Ee])return N?f:{};Z=MV(f,Ee,oe)}}H||(H=new yi);var We=H.get(f);if(We)return We;H.set(f,Z),DP(f)?f.forEach(function(Xe){Z.add(Zo(Xe,g,S,Xe,f,H))}):MP(f)&&f.forEach(function(Xe,Nt){Z.set(Nt,Zo(Xe,g,S,Nt,f,H))});var Ke=ve?ce?qv:Gv:ce?io:fr,Rt=we?n:Ke(f);return Ko(Rt||f,function(Xe,Nt){Rt&&(Nt=Xe,Xe=f[Nt]),af(Z,Nt,Zo(Xe,g,S,Nt,f,H))}),Z}function WW(f){var g=fr(f);return function(S){return mk(S,f,g)}}function mk(f,g,S){var O=S.length;if(f==null)return!O;for(f=mn(f);O--;){var N=S[O],H=g[N],Z=f[N];if(Z===n&&!(N in f)||!H(Z))return!1}return!0}function bk(f,g,S){if(typeof f!="function")throw new Xo(s);return pf(function(){f.apply(n,S)},g)}function lf(f,g,S,O){var N=-1,H=ig,Z=!0,oe=f.length,ce=[],ve=g.length;if(!oe)return ce;S&&(g=Dn(g,Ro(S))),O?(H=hv,Z=!1):g.length>=o&&(H=ef,Z=!1,g=new bl(g));e:for(;++N<oe;){var we=f[N],Ee=S==null?we:S(we);if(we=O||we!==0?we:0,Z&&Ee===Ee){for(var Ie=ve;Ie--;)if(g[Ie]===Ee)continue e;ce.push(we)}else H(g,Ee,O)||ce.push(we)}return ce}var ha=Vk($i),yk=Vk(Pv,!0);function VW(f,g){var S=!0;return ha(f,function(O,N,H){return S=!!g(O,N,H),S}),S}function _g(f,g,S){for(var O=-1,N=f.length;++O<N;){var H=f[O],Z=g(H);if(Z!=null&&(oe===n?Z===Z&&!ko(Z):S(Z,oe)))var oe=Z,ce=H}return ce}function UW(f,g,S,O){var N=f.length;for(S=xt(S),S<0&&(S=-S>N?0:N+S),O=O===n||O>N?N:xt(O),O<0&&(O+=N),O=S>O?0:NP(O);S<O;)f[S++]=g;return f}function vk(f,g){var S=[];return ha(f,function(O,N,H){g(O,N,H)&&S.push(O)}),S}function xr(f,g,S,O,N){var H=-1,Z=f.length;for(S||(S=DV),N||(N=[]);++H<Z;){var oe=f[H];g>0&&S(oe)?g>1?xr(oe,g-1,S,O,N):ua(N,oe):O||(N[N.length]=oe)}return N}var kv=Uk(),xk=Uk(!0);function $i(f,g){return f&&kv(f,g,fr)}function Pv(f,g){return f&&xk(f,g,fr)}function Cg(f,g){return ca(g,function(S){return ks(f[S])})}function vl(f,g){g=ga(g,f);for(var S=0,O=g.length;f!=null&&S<O;)f=f[zi(g[S++])];return S&&S==O?f:n}function wk(f,g,S){var O=g(f);return pt(f)?O:ua(O,S(f))}function Br(f){return f==null?f===n?$n:ke:gl&&gl in mn(f)?TV(f):zV(f)}function Ov(f,g){return f>g}function GW(f,g){return f!=null&&cn.call(f,g)}function qW(f,g){return f!=null&&g in mn(f)}function YW(f,g,S){return f>=Rr(g,S)&&f<or(g,S)}function Mv(f,g,S){for(var O=S?hv:ig,N=f[0].length,H=f.length,Z=H,oe=pe(H),ce=1/0,ve=[];Z--;){var we=f[Z];Z&&g&&(we=Dn(we,Ro(g))),ce=Rr(we.length,ce),oe[Z]=!S&&(g||N>=120&&we.length>=120)?new bl(Z&&we):n}we=f[0];var Ee=-1,Ie=oe[0];e:for(;++Ee<N&&ve.length<ce;){var We=we[Ee],Ke=g?g(We):We;if(We=S||We!==0?We:0,!(Ie?ef(Ie,Ke):O(ve,Ke,S))){for(Z=H;--Z;){var Rt=oe[Z];if(!(Rt?ef(Rt,Ke):O(f[Z],Ke,S)))continue e}Ie&&Ie.push(Ke),ve.push(We)}}return ve}function KW(f,g,S,O){return $i(f,function(N,H,Z){g(O,S(N),H,Z)}),O}function cf(f,g,S){g=ga(g,f),f=lP(f,g);var O=f==null?f:f[zi(ei(g))];return O==null?n:Eo(O,f,S)}function Sk(f){return jn(f)&&Br(f)==K}function XW(f){return jn(f)&&Br(f)==_e}function QW(f){return jn(f)&&Br(f)==ie}function uf(f,g,S,O,N){return f===g?!0:f==null||g==null||!jn(f)&&!jn(g)?f!==f&&g!==g:ZW(f,g,S,O,uf,N)}function ZW(f,g,S,O,N,H){var Z=pt(f),oe=pt(g),ce=Z?re:Tr(f),ve=oe?re:Tr(g);ce=ce==K?Ne:ce,ve=ve==K?Ne:ve;var we=ce==Ne,Ee=ve==Ne,Ie=ce==ve;if(Ie&&ba(f)){if(!ba(g))return!1;Z=!0,we=!1}if(Ie&&!we)return H||(H=new yi),Z||au(f)?tP(f,g,S,O,N,H):EV(f,g,ce,S,O,N,H);if(!(S&m)){var We=we&&cn.call(f,"__wrapped__"),Ke=Ee&&cn.call(g,"__wrapped__");if(We||Ke){var Rt=We?f.value():f,Xe=Ke?g.value():g;return H||(H=new yi),N(Rt,Xe,S,O,H)}}return Ie?(H||(H=new yi),RV(f,g,S,O,N,H)):!1}function JW(f){return jn(f)&&Tr(f)==ue}function Av(f,g,S,O){var N=S.length,H=N,Z=!O;if(f==null)return!H;for(f=mn(f);N--;){var oe=S[N];if(Z&&oe[2]?oe[1]!==f[oe[0]]:!(oe[0]in f))return!1}for(;++N<H;){oe=S[N];var ce=oe[0],ve=f[ce],we=oe[1];if(Z&&oe[2]){if(ve===n&&!(ce in f))return!1}else{var Ee=new yi;if(O)var Ie=O(ve,we,ce,f,g,Ee);if(!(Ie===n?uf(we,ve,m|b,O,Ee):Ie))return!1}}return!0}function _k(f){if(!Fn(f)||NV(f))return!1;var g=ks(f)?JH:Fe;return g.test(wl(f))}function eV(f){return jn(f)&&Br(f)==Je}function tV(f){return jn(f)&&Tr(f)==it}function nV(f){return jn(f)&&Bg(f.length)&&!!Cn[Br(f)]}function Ck(f){return typeof f=="function"?f:f==null?so:typeof f=="object"?pt(f)?Tk(f[0],f[1]):Rk(f):GP(f)}function Dv(f){if(!hf(f))return iW(f);var g=[];for(var S in mn(f))cn.call(f,S)&&S!="constructor"&&g.push(S);return g}function rV(f){if(!Fn(f))return jV(f);var g=hf(f),S=[];for(var O in f)O=="constructor"&&(g||!cn.call(f,O))||S.push(O);return S}function Iv(f,g){return f<g}function Ek(f,g){var S=-1,O=oo(f)?pe(f.length):[];return ha(f,function(N,H,Z){O[++S]=g(N,H,Z)}),O}function Rk(f){var g=Kv(f);return g.length==1&&g[0][2]?sP(g[0][0],g[0][1]):function(S){return S===f||Av(S,f,g)}}function Tk(f,g){return Qv(f)&&iP(g)?sP(zi(f),g):function(S){var O=ax(S,f);return O===n&&O===g?lx(S,f):uf(g,O,m|b)}}function Eg(f,g,S,O,N){f!==g&&kv(g,function(H,Z){if(N||(N=new yi),Fn(H))oV(f,g,Z,S,Eg,O,N);else{var oe=O?O(Jv(f,Z),H,Z+"",f,g,N):n;oe===n&&(oe=H),Rv(f,Z,oe)}},io)}function oV(f,g,S,O,N,H,Z){var oe=Jv(f,S),ce=Jv(g,S),ve=Z.get(ce);if(ve){Rv(f,S,ve);return}var we=H?H(oe,ce,S+"",f,g,Z):n,Ee=we===n;if(Ee){var Ie=pt(ce),We=!Ie&&ba(ce),Ke=!Ie&&!We&&au(ce);we=ce,Ie||We||Ke?pt(oe)?we=oe:Un(oe)?we=ro(oe):We?(Ee=!1,we=jk(ce,!0)):Ke?(Ee=!1,we=zk(ce,!0)):we=[]:gf(ce)||Sl(ce)?(we=oe,Sl(oe)?we=FP(oe):(!Fn(oe)||ks(oe))&&(we=oP(ce))):Ee=!1}Ee&&(Z.set(ce,we),N(we,ce,O,H,Z),Z.delete(ce)),Rv(f,S,we)}function kk(f,g){var S=f.length;if(S)return g+=g<0?S:0,Ts(g,S)?f[g]:n}function Pk(f,g,S){g.length?g=Dn(g,function(H){return pt(H)?function(Z){return vl(Z,H.length===1?H[0]:H)}:H}):g=[so];var O=-1;g=Dn(g,Ro(Ye()));var N=Ek(f,function(H,Z,oe){var ce=Dn(g,function(ve){return ve(H)});return{criteria:ce,index:++O,value:H}});return MH(N,function(H,Z){return bV(H,Z,S)})}function iV(f,g){return Ok(f,g,function(S,O){return lx(f,O)})}function Ok(f,g,S){for(var O=-1,N=g.length,H={};++O<N;){var Z=g[O],oe=vl(f,Z);S(oe,Z)&&df(H,ga(Z,f),oe)}return H}function sV(f){return function(g){return vl(g,f)}}function Nv(f,g,S,O){var N=O?OH:Xc,H=-1,Z=g.length,oe=f;for(f===g&&(g=ro(g)),S&&(oe=Dn(f,Ro(S)));++H<Z;)for(var ce=0,ve=g[H],we=S?S(ve):ve;(ce=N(oe,we,ce,O))>-1;)oe!==f&&gg.call(oe,ce,1),gg.call(f,ce,1);return f}function Mk(f,g){for(var S=f?g.length:0,O=S-1;S--;){var N=g[S];if(S==O||N!==H){var H=N;Ts(N)?gg.call(f,N,1):jv(f,N)}}return f}function Fv(f,g){return f+yg(dk()*(g-f+1))}function aV(f,g,S,O){for(var N=-1,H=or(bg((g-f)/(S||1)),0),Z=pe(H);H--;)Z[O?H:++N]=f,f+=S;return Z}function Lv(f,g){var S="";if(!f||g<1||g>q)return S;do g%2&&(S+=f),g=yg(g/2),g&&(f+=f);while(g);return S}function Mt(f,g){return ex(aP(f,g,so),f+"")}function lV(f){return pk(lu(f))}function cV(f,g){var S=lu(f);return Ng(S,yl(g,0,S.length))}function df(f,g,S,O){if(!Fn(f))return f;g=ga(g,f);for(var N=-1,H=g.length,Z=H-1,oe=f;oe!=null&&++N<H;){var ce=zi(g[N]),ve=S;if(ce==="__proto__"||ce==="constructor"||ce==="prototype")return f;if(N!=Z){var we=oe[ce];ve=O?O(we,ce,oe):n,ve===n&&(ve=Fn(we)?we:Ts(g[N+1])?[]:{})}af(oe,ce,ve),oe=oe[ce]}return f}var Ak=vg?function(f,g){return vg.set(f,g),f}:so,uV=mg?function(f,g){return mg(f,"toString",{configurable:!0,enumerable:!1,value:ux(g),writable:!0})}:so;function dV(f){return Ng(lu(f))}function Jo(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 H=pe(N);++O<N;)H[O]=f[O+g];return H}function fV(f,g){var S;return ha(f,function(O,N,H){return S=g(O,N,H),!S}),!!S}function Rg(f,g,S){var O=0,N=f==null?O:f.length;if(typeof g=="number"&&g===g&&N<=M){for(;O<N;){var H=O+N>>>1,Z=f[H];Z!==null&&!ko(Z)&&(S?Z<=g:Z<g)?O=H+1:N=H}return N}return $v(f,g,so,S)}function $v(f,g,S,O){var N=0,H=f==null?0:f.length;if(H===0)return 0;g=S(g);for(var Z=g!==g,oe=g===null,ce=ko(g),ve=g===n;N<H;){var we=yg((N+H)/2),Ee=S(f[we]),Ie=Ee!==n,We=Ee===null,Ke=Ee===Ee,Rt=ko(Ee);if(Z)var Xe=O||Ke;else ve?Xe=Ke&&(O||Ie):oe?Xe=Ke&&Ie&&(O||!We):ce?Xe=Ke&&Ie&&!We&&(O||!Rt):We||Rt?Xe=!1:Xe=O?Ee<=g:Ee<g;Xe?N=we+1:H=we}return Rr(H,V)}function Dk(f,g){for(var S=-1,O=f.length,N=0,H=[];++S<O;){var Z=f[S],oe=g?g(Z):Z;if(!S||!vi(oe,ce)){var ce=oe;H[N++]=Z===0?0:Z}}return H}function Ik(f){return typeof f=="number"?f:ko(f)?D:+f}function To(f){if(typeof f=="string")return f;if(pt(f))return Dn(f,To)+"";if(ko(f))return fk?fk.call(f):"";var g=f+"";return g=="0"&&1/f==-1/0?"-0":g}function pa(f,g,S){var O=-1,N=ig,H=f.length,Z=!0,oe=[],ce=oe;if(S)Z=!1,N=hv;else if(H>=o){var ve=g?null:_V(f);if(ve)return ag(ve);Z=!1,N=ef,ce=new bl}else ce=g?[]:oe;e:for(;++O<H;){var we=f[O],Ee=g?g(we):we;if(we=S||we!==0?we:0,Z&&Ee===Ee){for(var Ie=ce.length;Ie--;)if(ce[Ie]===Ee)continue e;g&&ce.push(Ee),oe.push(we)}else N(ce,Ee,S)||(ce!==oe&&ce.push(Ee),oe.push(we))}return oe}function jv(f,g){return g=ga(g,f),f=lP(f,g),f==null||delete f[zi(ei(g))]}function Nk(f,g,S,O){return df(f,g,S(vl(f,g)),O)}function Tg(f,g,S,O){for(var N=f.length,H=O?N:-1;(O?H--:++H<N)&&g(f[H],H,f););return S?Jo(f,O?0:H,O?H+1:N):Jo(f,O?H+1:0,O?N:H)}function Fk(f,g){var S=f;return S instanceof zt&&(S=S.value()),pv(g,function(O,N){return N.func.apply(N.thisArg,ua([O],N.args))},S)}function zv(f,g,S){var O=f.length;if(O<2)return O?pa(f[0]):[];for(var N=-1,H=pe(O);++N<O;)for(var Z=f[N],oe=-1;++oe<O;)oe!=N&&(H[N]=lf(H[N]||Z,f[oe],g,S));return pa(xr(H,1),g,S)}function Lk(f,g,S){for(var O=-1,N=f.length,H=g.length,Z={};++O<N;){var oe=O<H?g[O]:n;S(Z,f[O],oe)}return Z}function Bv(f){return Un(f)?f:[]}function Hv(f){return typeof f=="function"?f:so}function ga(f,g){return pt(f)?f:Qv(f,g)?[f]:fP(nn(f))}var hV=Mt;function ma(f,g,S){var O=f.length;return S=S===n?O:S,!g&&S>=O?f:Jo(f,g,S)}var $k=eW||function(f){return vr.clearTimeout(f)};function jk(f,g){if(g)return f.slice();var S=f.length,O=sk?sk(S):new f.constructor(S);return f.copy(O),O}function Wv(f){var g=new f.constructor(f.byteLength);return new hg(g).set(new hg(f)),g}function pV(f,g){var S=g?Wv(f.buffer):f.buffer;return new f.constructor(S,f.byteOffset,f.byteLength)}function gV(f){var g=new f.constructor(f.source,qt.exec(f));return g.lastIndex=f.lastIndex,g}function mV(f){return sf?mn(sf.call(f)):{}}function zk(f,g){var S=g?Wv(f.buffer):f.buffer;return new f.constructor(S,f.byteOffset,f.length)}function Bk(f,g){if(f!==g){var S=f!==n,O=f===null,N=f===f,H=ko(f),Z=g!==n,oe=g===null,ce=g===g,ve=ko(g);if(!oe&&!ve&&!H&&f>g||H&&Z&&ce&&!oe&&!ve||O&&Z&&ce||!S&&ce||!N)return 1;if(!O&&!H&&!ve&&f<g||ve&&S&&N&&!O&&!H||oe&&S&&N||!Z&&N||!ce)return-1}return 0}function bV(f,g,S){for(var O=-1,N=f.criteria,H=g.criteria,Z=N.length,oe=S.length;++O<Z;){var ce=Bk(N[O],H[O]);if(ce){if(O>=oe)return ce;var ve=S[O];return ce*(ve=="desc"?-1:1)}}return f.index-g.index}function Hk(f,g,S,O){for(var N=-1,H=f.length,Z=S.length,oe=-1,ce=g.length,ve=or(H-Z,0),we=pe(ce+ve),Ee=!O;++oe<ce;)we[oe]=g[oe];for(;++N<Z;)(Ee||N<H)&&(we[S[N]]=f[N]);for(;ve--;)we[oe++]=f[N++];return we}function Wk(f,g,S,O){for(var N=-1,H=f.length,Z=-1,oe=S.length,ce=-1,ve=g.length,we=or(H-oe,0),Ee=pe(we+ve),Ie=!O;++N<we;)Ee[N]=f[N];for(var We=N;++ce<ve;)Ee[We+ce]=g[ce];for(;++Z<oe;)(Ie||N<H)&&(Ee[We+S[Z]]=f[N++]);return Ee}function ro(f,g){var S=-1,O=f.length;for(g||(g=pe(O));++S<O;)g[S]=f[S];return g}function ji(f,g,S,O){var N=!S;S||(S={});for(var H=-1,Z=g.length;++H<Z;){var oe=g[H],ce=O?O(S[oe],f[oe],oe,S,f):n;ce===n&&(ce=f[oe]),N?Cs(S,oe,ce):af(S,oe,ce)}return S}function yV(f,g){return ji(f,Xv(f),g)}function vV(f,g){return ji(f,nP(f),g)}function kg(f,g){return function(S,O){var N=pt(S)?CH:BW,H=g?g():{};return N(S,f,Ye(O,2),H)}}function ou(f){return Mt(function(g,S){var O=-1,N=S.length,H=N>1?S[N-1]:n,Z=N>2?S[2]:n;for(H=f.length>3&&typeof H=="function"?(N--,H):n,Z&&Hr(S[0],S[1],Z)&&(H=N<3?n:H,N=1),g=mn(g);++O<N;){var oe=S[O];oe&&f(g,oe,O,H)}return g})}function Vk(f,g){return function(S,O){if(S==null)return S;if(!oo(S))return f(S,O);for(var N=S.length,H=g?N:-1,Z=mn(S);(g?H--:++H<N)&&O(Z[H],H,Z)!==!1;);return S}}function Uk(f){return function(g,S,O){for(var N=-1,H=mn(g),Z=O(g),oe=Z.length;oe--;){var ce=Z[f?oe:++N];if(S(H[ce],ce,H)===!1)break}return g}}function xV(f,g,S){var O=g&y,N=ff(f);function H(){var Z=this&&this!==vr&&this instanceof H?N:f;return Z.apply(O?S:this,arguments)}return H}function Gk(f){return function(g){g=nn(g);var S=Qc(g)?bi(g):n,O=S?S[0]:g.charAt(0),N=S?ma(S,1).join(""):g.slice(1);return O[f]()+N}}function iu(f){return function(g){return pv(VP(WP(g).replace(uH,"")),f,"")}}function ff(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=ru(f.prototype),O=f.apply(S,g);return Fn(O)?O:S}}function wV(f,g,S){var O=ff(f);function N(){for(var H=arguments.length,Z=pe(H),oe=H,ce=su(N);oe--;)Z[oe]=arguments[oe];var ve=H<3&&Z[0]!==ce&&Z[H-1]!==ce?[]:da(Z,ce);if(H-=ve.length,H<S)return Qk(f,g,Pg,N.placeholder,n,Z,ve,n,n,S-H);var we=this&&this!==vr&&this instanceof N?O:f;return Eo(we,this,Z)}return N}function qk(f){return function(g,S,O){var N=mn(g);if(!oo(g)){var H=Ye(S,3);g=fr(g),S=function(oe){return H(N[oe],oe,N)}}var Z=f(g,S,O);return Z>-1?N[H?g[Z]:Z]:n}}function Yk(f){return Rs(function(g){var S=g.length,O=S,N=Qo.prototype.thru;for(f&&g.reverse();O--;){var H=g[O];if(typeof H!="function")throw new Xo(s);if(N&&!Z&&Dg(H)=="wrapper")var Z=new Qo([],!0)}for(O=Z?O:S;++O<S;){H=g[O];var oe=Dg(H),ce=oe=="wrapper"?Yv(H):n;ce&&Zv(ce[0])&&ce[1]==(P|_|C|A)&&!ce[4].length&&ce[9]==1?Z=Z[Dg(ce[0])].apply(Z,ce[3]):Z=H.length==1&&Zv(H)?Z[oe]():Z.thru(H)}return function(){var ve=arguments,we=ve[0];if(Z&&ve.length==1&&pt(we))return Z.plant(we).value();for(var Ee=0,Ie=S?g[Ee].apply(this,ve):we;++Ee<S;)Ie=g[Ee].call(this,Ie);return Ie}})}function Pg(f,g,S,O,N,H,Z,oe,ce,ve){var we=g&P,Ee=g&y,Ie=g&v,We=g&(_|R),Ke=g&I,Rt=Ie?n:ff(f);function Xe(){for(var Nt=arguments.length,Ht=pe(Nt),Po=Nt;Po--;)Ht[Po]=arguments[Po];if(We)var Wr=su(Xe),Oo=DH(Ht,Wr);if(O&&(Ht=Hk(Ht,O,N,We)),H&&(Ht=Wk(Ht,H,Z,We)),Nt-=Oo,We&&Nt<ve){var Gn=da(Ht,Wr);return Qk(f,g,Pg,Xe.placeholder,S,Ht,Gn,oe,ce,ve-Nt)}var xi=Ee?S:this,Os=Ie?xi[f]:f;return Nt=Ht.length,oe?Ht=BV(Ht,oe):Ke&&Nt>1&&Ht.reverse(),we&&ce<Nt&&(Ht.length=ce),this&&this!==vr&&this instanceof Xe&&(Os=Rt||ff(Os)),Os.apply(xi,Ht)}return Xe}function Kk(f,g){return function(S,O){return KW(S,f,g(O),{})}}function Og(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=To(S),O=To(O)):(S=Ik(S),O=Ik(O)),N=f(S,O)}return N}}function Vv(f){return Rs(function(g){return g=Dn(g,Ro(Ye())),Mt(function(S){var O=this;return f(g,function(N){return Eo(N,O,S)})})})}function Mg(f,g){g=g===n?" ":To(g);var S=g.length;if(S<2)return S?Lv(g,f):g;var O=Lv(g,bg(f/Zc(g)));return Qc(g)?ma(bi(O),0,f).join(""):O.slice(0,f)}function SV(f,g,S,O){var N=g&y,H=ff(f);function Z(){for(var oe=-1,ce=arguments.length,ve=-1,we=O.length,Ee=pe(we+ce),Ie=this&&this!==vr&&this instanceof Z?H:f;++ve<we;)Ee[ve]=O[ve];for(;ce--;)Ee[ve++]=arguments[++oe];return Eo(Ie,N?S:this,Ee)}return Z}function Xk(f){return function(g,S,O){return O&&typeof O!="number"&&Hr(g,S,O)&&(S=O=n),g=Ps(g),S===n?(S=g,g=0):S=Ps(S),O=O===n?g<S?1:-1:Ps(O),aV(g,S,O,f)}}function Ag(f){return function(g,S){return typeof g=="string"&&typeof S=="string"||(g=ti(g),S=ti(S)),f(g,S)}}function Qk(f,g,S,O,N,H,Z,oe,ce,ve){var we=g&_,Ee=we?Z:n,Ie=we?n:Z,We=we?H:n,Ke=we?n:H;g|=we?C:E,g&=~(we?E:C),g&w||(g&=-4);var Rt=[f,g,N,We,Ee,Ke,Ie,oe,ce,ve],Xe=S.apply(n,Rt);return Zv(f)&&cP(Xe,Rt),Xe.placeholder=O,uP(Xe,f,g)}function Uv(f){var g=rr[f];return function(S,O){if(S=ti(S),O=O==null?0:Rr(xt(O),292),O&&uk(S)){var N=(nn(S)+"e").split("e"),H=g(N[0]+"e"+(+N[1]+O));return N=(nn(H)+"e").split("e"),+(N[0]+"e"+(+N[1]-O))}return g(S)}}var _V=tu&&1/ag(new tu([,-0]))[1]==W?function(f){return new tu(f)}:hx;function Zk(f){return function(g){var S=Tr(g);return S==ue?wv(g):S==it?zH(g):AH(g,f(g))}}function Es(f,g,S,O,N,H,Z,oe){var ce=g&v;if(!ce&&typeof f!="function")throw new Xo(s);var ve=O?O.length:0;if(ve||(g&=-97,O=N=n),Z=Z===n?Z:or(xt(Z),0),oe=oe===n?oe:xt(oe),ve-=N?N.length:0,g&E){var we=O,Ee=N;O=N=n}var Ie=ce?n:Yv(f),We=[f,g,S,O,N,we,Ee,H,Z,oe];if(Ie&&$V(We,Ie),f=We[0],g=We[1],S=We[2],O=We[3],N=We[4],oe=We[9]=We[9]===n?ce?0:f.length:or(We[9]-ve,0),!oe&&g&(_|R)&&(g&=-25),!g||g==y)var Ke=xV(f,g,S);else g==_||g==R?Ke=wV(f,g,oe):(g==C||g==(y|C))&&!N.length?Ke=SV(f,g,S,O):Ke=Pg.apply(n,We);var Rt=Ie?Ak:cP;return uP(Rt(Ke,We),f,g)}function Jk(f,g,S,O){return f===n||vi(f,eu[S])&&!cn.call(O,S)?g:f}function eP(f,g,S,O,N,H){return Fn(f)&&Fn(g)&&(H.set(g,f),Eg(f,g,n,eP,H),H.delete(g)),f}function CV(f){return gf(f)?n:f}function tP(f,g,S,O,N,H){var Z=S&m,oe=f.length,ce=g.length;if(oe!=ce&&!(Z&&ce>oe))return!1;var ve=H.get(f),we=H.get(g);if(ve&&we)return ve==g&&we==f;var Ee=-1,Ie=!0,We=S&b?new bl:n;for(H.set(f,g),H.set(g,f);++Ee<oe;){var Ke=f[Ee],Rt=g[Ee];if(O)var Xe=Z?O(Rt,Ke,Ee,g,f,H):O(Ke,Rt,Ee,f,g,H);if(Xe!==n){if(Xe)continue;Ie=!1;break}if(We){if(!gv(g,function(Nt,Ht){if(!ef(We,Ht)&&(Ke===Nt||N(Ke,Nt,S,O,H)))return We.push(Ht)})){Ie=!1;break}}else if(!(Ke===Rt||N(Ke,Rt,S,O,H))){Ie=!1;break}}return H.delete(f),H.delete(g),Ie}function EV(f,g,S,O,N,H,Z){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||!H(new hg(f),new hg(g)));case J:case ie:case Ce:return vi(+f,+g);case he:return f.name==g.name&&f.message==g.message;case Je:case ln:return f==g+"";case ue:var oe=wv;case it:var ce=O&m;if(oe||(oe=ag),f.size!=g.size&&!ce)return!1;var ve=Z.get(f);if(ve)return ve==g;O|=b,Z.set(f,g);var we=tP(oe(f),oe(g),O,N,H,Z);return Z.delete(f),we;case vt:if(sf)return sf.call(f)==sf.call(g)}return!1}function RV(f,g,S,O,N,H){var Z=S&m,oe=Gv(f),ce=oe.length,ve=Gv(g),we=ve.length;if(ce!=we&&!Z)return!1;for(var Ee=ce;Ee--;){var Ie=oe[Ee];if(!(Z?Ie in g:cn.call(g,Ie)))return!1}var We=H.get(f),Ke=H.get(g);if(We&&Ke)return We==g&&Ke==f;var Rt=!0;H.set(f,g),H.set(g,f);for(var Xe=Z;++Ee<ce;){Ie=oe[Ee];var Nt=f[Ie],Ht=g[Ie];if(O)var Po=Z?O(Ht,Nt,Ie,g,f,H):O(Nt,Ht,Ie,f,g,H);if(!(Po===n?Nt===Ht||N(Nt,Ht,S,O,H):Po)){Rt=!1;break}Xe||(Xe=Ie=="constructor")}if(Rt&&!Xe){var Wr=f.constructor,Oo=g.constructor;Wr!=Oo&&"constructor"in f&&"constructor"in g&&!(typeof Wr=="function"&&Wr instanceof Wr&&typeof Oo=="function"&&Oo instanceof Oo)&&(Rt=!1)}return H.delete(f),H.delete(g),Rt}function Rs(f){return ex(aP(f,n,mP),f+"")}function Gv(f){return wk(f,fr,Xv)}function qv(f){return wk(f,io,nP)}var Yv=vg?function(f){return vg.get(f)}:hx;function Dg(f){for(var g=f.name+"",S=nu[g],O=cn.call(nu,g)?S.length:0;O--;){var N=S[O],H=N.func;if(H==null||H==f)return N.name}return g}function su(f){var g=cn.call(z,"placeholder")?z:f;return g.placeholder}function Ye(){var f=z.iteratee||dx;return f=f===dx?Ck:f,arguments.length?f(arguments[0],arguments[1]):f}function Ig(f,g){var S=f.__data__;return IV(g)?S[typeof g=="string"?"string":"hash"]:S.map}function Kv(f){for(var g=fr(f),S=g.length;S--;){var O=g[S],N=f[O];g[S]=[O,N,iP(N)]}return g}function xl(f,g){var S=LH(f,g);return _k(S)?S:n}function TV(f){var g=cn.call(f,gl),S=f[gl];try{f[gl]=n;var O=!0}catch{}var N=dg.call(f);return O&&(g?f[gl]=S:delete f[gl]),N}var Xv=_v?function(f){return f==null?[]:(f=mn(f),ca(_v(f),function(g){return lk.call(f,g)}))}:px,nP=_v?function(f){for(var g=[];f;)ua(g,Xv(f)),f=pg(f);return g}:px,Tr=Br;(Cv&&Tr(new Cv(new ArrayBuffer(1)))!=He||nf&&Tr(new nf)!=ue||Ev&&Tr(Ev.resolve())!=Oe||tu&&Tr(new tu)!=it||rf&&Tr(new rf)!=Ct)&&(Tr=function(f){var g=Br(f),S=g==Ne?f.constructor:n,O=S?wl(S):"";if(O)switch(O){case cW:return He;case uW:return ue;case dW:return Oe;case fW:return it;case hW:return Ct}return g});function kV(f,g,S){for(var O=-1,N=S.length;++O<N;){var H=S[O],Z=H.size;switch(H.type){case"drop":f+=Z;break;case"dropRight":g-=Z;break;case"take":g=Rr(g,f+Z);break;case"takeRight":f=or(f,g-Z);break}}return{start:f,end:g}}function PV(f){var g=f.match(Yc);return g?g[1].split(te):[]}function rP(f,g,S){g=ga(g,f);for(var O=-1,N=g.length,H=!1;++O<N;){var Z=zi(g[O]);if(!(H=f!=null&&S(f,Z)))break;f=f[Z]}return H||++O!=N?H:(N=f==null?0:f.length,!!N&&Bg(N)&&Ts(Z,N)&&(pt(f)||Sl(f)))}function OV(f){var g=f.length,S=new f.constructor(g);return g&&typeof f[0]=="string"&&cn.call(f,"index")&&(S.index=f.index,S.input=f.input),S}function oP(f){return typeof f.constructor=="function"&&!hf(f)?ru(pg(f)):{}}function MV(f,g,S){var O=f.constructor;switch(g){case _e:return Wv(f);case J:case ie:return new O(+f);case He:return pV(f,S);case Ve:case rt:case An:case Ue:case lt:case Ge:case tn:case gt:case In:return zk(f,S);case ue:return new O;case Ce:case ln:return new O(f);case Je:return gV(f);case it:return new O;case vt:return mV(f)}}function AV(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(qc,`{
73
+ /* [wrapped with `+g+`] */
74
+ `)}function DV(f){return pt(f)||Sl(f)||!!(ck&&f&&f[ck])}function Ts(f,g){var S=typeof f;return g=g??q,!!g&&(S=="number"||S!="symbol"&&Se.test(f))&&f>-1&&f%1==0&&f<g}function Hr(f,g,S){if(!Fn(S))return!1;var O=typeof g;return(O=="number"?oo(S)&&Ts(g,S.length):O=="string"&&g in S)?vi(S[g],f):!1}function Qv(f,g){if(pt(f))return!1;var S=typeof f;return S=="number"||S=="symbol"||S=="boolean"||f==null||ko(f)?!0:nr.test(f)||!tr.test(f)||g!=null&&f in mn(g)}function IV(f){var g=typeof f;return g=="string"||g=="number"||g=="symbol"||g=="boolean"?f!=="__proto__":f===null}function Zv(f){var g=Dg(f),S=z[g];if(typeof S!="function"||!(g in zt.prototype))return!1;if(f===S)return!0;var O=Yv(S);return!!O&&f===O[0]}function NV(f){return!!ik&&ik in f}var FV=cg?ks:gx;function hf(f){var g=f&&f.constructor,S=typeof g=="function"&&g.prototype||eu;return f===S}function iP(f){return f===f&&!Fn(f)}function sP(f,g){return function(S){return S==null?!1:S[f]===g&&(g!==n||f in mn(S))}}function LV(f){var g=jg(f,function(O){return S.size===c&&S.clear(),O}),S=g.cache;return g}function $V(f,g){var S=f[1],O=g[1],N=S|O,H=N<(y|v|P),Z=O==P&&S==_||O==P&&S==A&&f[7].length<=g[8]||O==(P|A)&&g[7].length<=g[8]&&S==_;if(!(H||Z))return f;O&y&&(f[2]=g[2],N|=S&y?0:w);var oe=g[3];if(oe){var ce=f[3];f[3]=ce?Hk(ce,oe,g[4]):oe,f[4]=ce?da(f[3],u):g[4]}return oe=g[5],oe&&(ce=f[5],f[5]=ce?Wk(ce,oe,g[6]):oe,f[6]=ce?da(f[5],u):g[6]),oe=g[7],oe&&(f[7]=oe),O&P&&(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 jV(f){var g=[];if(f!=null)for(var S in mn(f))g.push(S);return g}function zV(f){return dg.call(f)}function aP(f,g,S){return g=or(g===n?f.length-1:g,0),function(){for(var O=arguments,N=-1,H=or(O.length-g,0),Z=pe(H);++N<H;)Z[N]=O[g+N];N=-1;for(var oe=pe(g+1);++N<g;)oe[N]=O[N];return oe[g]=S(Z),Eo(f,this,oe)}}function lP(f,g){return g.length<2?f:vl(f,Jo(g,0,-1))}function BV(f,g){for(var S=f.length,O=Rr(g.length,S),N=ro(f);O--;){var H=g[O];f[O]=Ts(H,S)?N[H]:n}return f}function Jv(f,g){if(!(g==="constructor"&&typeof f[g]=="function")&&g!="__proto__")return f[g]}var cP=dP(Ak),pf=nW||function(f,g){return vr.setTimeout(f,g)},ex=dP(uV);function uP(f,g,S){var O=g+"";return ex(f,AV(O,HV(PV(O),S)))}function dP(f){var g=0,S=0;return function(){var O=sW(),N=X-(O-S);if(S=O,N>0){if(++g>=j)return arguments[0]}else g=0;return f.apply(n,arguments)}}function Ng(f,g){var S=-1,O=f.length,N=O-1;for(g=g===n?O:g;++S<g;){var H=Fv(S,N),Z=f[H];f[H]=f[S],f[S]=Z}return f.length=g,f}var fP=LV(function(f){var g=[];return f.charCodeAt(0)===46&&g.push(""),f.replace(zr,function(S,O,N,H){g.push(N?H.replace(qe,"$1"):O||S)}),g});function zi(f){if(typeof f=="string"||ko(f))return f;var g=f+"";return g=="0"&&1/f==-1/0?"-0":g}function wl(f){if(f!=null){try{return ug.call(f)}catch{}try{return f+""}catch{}}return""}function HV(f,g){return Ko(ee,function(S){var O="_."+S[0];g&S[1]&&!ig(f,O)&&f.push(O)}),f.sort()}function hP(f){if(f instanceof zt)return f.clone();var g=new Qo(f.__wrapped__,f.__chain__);return g.__actions__=ro(f.__actions__),g.__index__=f.__index__,g.__values__=f.__values__,g}function WV(f,g,S){(S?Hr(f,g,S):g===n)?g=1:g=or(xt(g),0);var O=f==null?0:f.length;if(!O||g<1)return[];for(var N=0,H=0,Z=pe(bg(O/g));N<O;)Z[H++]=Jo(f,N,N+=g);return Z}function VV(f){for(var g=-1,S=f==null?0:f.length,O=0,N=[];++g<S;){var H=f[g];H&&(N[O++]=H)}return N}function UV(){var f=arguments.length;if(!f)return[];for(var g=pe(f-1),S=arguments[0],O=f;O--;)g[O-1]=arguments[O];return ua(pt(S)?ro(S):[S],xr(g,1))}var GV=Mt(function(f,g){return Un(f)?lf(f,xr(g,1,Un,!0)):[]}),qV=Mt(function(f,g){var S=ei(g);return Un(S)&&(S=n),Un(f)?lf(f,xr(g,1,Un,!0),Ye(S,2)):[]}),YV=Mt(function(f,g){var S=ei(g);return Un(S)&&(S=n),Un(f)?lf(f,xr(g,1,Un,!0),n,S):[]});function KV(f,g,S){var O=f==null?0:f.length;return O?(g=S||g===n?1:xt(g),Jo(f,g<0?0:g,O)):[]}function XV(f,g,S){var O=f==null?0:f.length;return O?(g=S||g===n?1:xt(g),g=O-g,Jo(f,0,g<0?0:g)):[]}function QV(f,g){return f&&f.length?Tg(f,Ye(g,3),!0,!0):[]}function ZV(f,g){return f&&f.length?Tg(f,Ye(g,3),!0):[]}function JV(f,g,S,O){var N=f==null?0:f.length;return N?(S&&typeof S!="number"&&Hr(f,g,S)&&(S=0,O=N),UW(f,g,S,O)):[]}function pP(f,g,S){var O=f==null?0:f.length;if(!O)return-1;var N=S==null?0:xt(S);return N<0&&(N=or(O+N,0)),sg(f,Ye(g,3),N)}function gP(f,g,S){var O=f==null?0:f.length;if(!O)return-1;var N=O-1;return S!==n&&(N=xt(S),N=S<0?or(O+N,0):Rr(N,O-1)),sg(f,Ye(g,3),N,!0)}function mP(f){var g=f==null?0:f.length;return g?xr(f,1):[]}function eU(f){var g=f==null?0:f.length;return g?xr(f,W):[]}function tU(f,g){var S=f==null?0:f.length;return S?(g=g===n?1:xt(g),xr(f,g)):[]}function nU(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 bP(f){return f&&f.length?f[0]:n}function rU(f,g,S){var O=f==null?0:f.length;if(!O)return-1;var N=S==null?0:xt(S);return N<0&&(N=or(O+N,0)),Xc(f,g,N)}function oU(f){var g=f==null?0:f.length;return g?Jo(f,0,-1):[]}var iU=Mt(function(f){var g=Dn(f,Bv);return g.length&&g[0]===f[0]?Mv(g):[]}),sU=Mt(function(f){var g=ei(f),S=Dn(f,Bv);return g===ei(S)?g=n:S.pop(),S.length&&S[0]===f[0]?Mv(S,Ye(g,2)):[]}),aU=Mt(function(f){var g=ei(f),S=Dn(f,Bv);return g=typeof g=="function"?g:n,g&&S.pop(),S.length&&S[0]===f[0]?Mv(S,n,g):[]});function lU(f,g){return f==null?"":oW.call(f,g)}function ei(f){var g=f==null?0:f.length;return g?f[g-1]:n}function cU(f,g,S){var O=f==null?0:f.length;if(!O)return-1;var N=O;return S!==n&&(N=xt(S),N=N<0?or(O+N,0):Rr(N,O-1)),g===g?HH(f,g,N):sg(f,QT,N,!0)}function uU(f,g){return f&&f.length?kk(f,xt(g)):n}var dU=Mt(yP);function yP(f,g){return f&&f.length&&g&&g.length?Nv(f,g):f}function fU(f,g,S){return f&&f.length&&g&&g.length?Nv(f,g,Ye(S,2)):f}function hU(f,g,S){return f&&f.length&&g&&g.length?Nv(f,g,n,S):f}var pU=Rs(function(f,g){var S=f==null?0:f.length,O=Tv(f,g);return Mk(f,Dn(g,function(N){return Ts(N,S)?+N:N}).sort(Bk)),O});function gU(f,g){var S=[];if(!(f&&f.length))return S;var O=-1,N=[],H=f.length;for(g=Ye(g,3);++O<H;){var Z=f[O];g(Z,O,f)&&(S.push(Z),N.push(O))}return Mk(f,N),S}function tx(f){return f==null?f:lW.call(f)}function mU(f,g,S){var O=f==null?0:f.length;return O?(S&&typeof S!="number"&&Hr(f,g,S)?(g=0,S=O):(g=g==null?0:xt(g),S=S===n?O:xt(S)),Jo(f,g,S)):[]}function bU(f,g){return Rg(f,g)}function yU(f,g,S){return $v(f,g,Ye(S,2))}function vU(f,g){var S=f==null?0:f.length;if(S){var O=Rg(f,g);if(O<S&&vi(f[O],g))return O}return-1}function xU(f,g){return Rg(f,g,!0)}function wU(f,g,S){return $v(f,g,Ye(S,2),!0)}function SU(f,g){var S=f==null?0:f.length;if(S){var O=Rg(f,g,!0)-1;if(vi(f[O],g))return O}return-1}function _U(f){return f&&f.length?Dk(f):[]}function CU(f,g){return f&&f.length?Dk(f,Ye(g,2)):[]}function EU(f){var g=f==null?0:f.length;return g?Jo(f,1,g):[]}function RU(f,g,S){return f&&f.length?(g=S||g===n?1:xt(g),Jo(f,0,g<0?0:g)):[]}function TU(f,g,S){var O=f==null?0:f.length;return O?(g=S||g===n?1:xt(g),g=O-g,Jo(f,g<0?0:g,O)):[]}function kU(f,g){return f&&f.length?Tg(f,Ye(g,3),!1,!0):[]}function PU(f,g){return f&&f.length?Tg(f,Ye(g,3)):[]}var OU=Mt(function(f){return pa(xr(f,1,Un,!0))}),MU=Mt(function(f){var g=ei(f);return Un(g)&&(g=n),pa(xr(f,1,Un,!0),Ye(g,2))}),AU=Mt(function(f){var g=ei(f);return g=typeof g=="function"?g:n,pa(xr(f,1,Un,!0),n,g)});function DU(f){return f&&f.length?pa(f):[]}function IU(f,g){return f&&f.length?pa(f,Ye(g,2)):[]}function NU(f,g){return g=typeof g=="function"?g:n,f&&f.length?pa(f,n,g):[]}function nx(f){if(!(f&&f.length))return[];var g=0;return f=ca(f,function(S){if(Un(S))return g=or(S.length,g),!0}),vv(g,function(S){return Dn(f,mv(S))})}function vP(f,g){if(!(f&&f.length))return[];var S=nx(f);return g==null?S:Dn(S,function(O){return Eo(g,n,O)})}var FU=Mt(function(f,g){return Un(f)?lf(f,g):[]}),LU=Mt(function(f){return zv(ca(f,Un))}),$U=Mt(function(f){var g=ei(f);return Un(g)&&(g=n),zv(ca(f,Un),Ye(g,2))}),jU=Mt(function(f){var g=ei(f);return g=typeof g=="function"?g:n,zv(ca(f,Un),n,g)}),zU=Mt(nx);function BU(f,g){return Lk(f||[],g||[],af)}function HU(f,g){return Lk(f||[],g||[],df)}var WU=Mt(function(f){var g=f.length,S=g>1?f[g-1]:n;return S=typeof S=="function"?(f.pop(),S):n,vP(f,S)});function xP(f){var g=z(f);return g.__chain__=!0,g}function VU(f,g){return g(f),f}function Fg(f,g){return g(f)}var UU=Rs(function(f){var g=f.length,S=g?f[0]:0,O=this.__wrapped__,N=function(H){return Tv(H,f)};return g>1||this.__actions__.length||!(O instanceof zt)||!Ts(S)?this.thru(N):(O=O.slice(S,+S+(g?1:0)),O.__actions__.push({func:Fg,args:[N],thisArg:n}),new Qo(O,this.__chain__).thru(function(H){return g&&!H.length&&H.push(n),H}))});function GU(){return xP(this)}function qU(){return new Qo(this.value(),this.__chain__)}function YU(){this.__values__===n&&(this.__values__=IP(this.value()));var f=this.__index__>=this.__values__.length,g=f?n:this.__values__[this.__index__++];return{done:f,value:g}}function KU(){return this}function XU(f){for(var g,S=this;S instanceof wg;){var O=hP(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 QU(){var f=this.__wrapped__;if(f instanceof zt){var g=f;return this.__actions__.length&&(g=new zt(this)),g=g.reverse(),g.__actions__.push({func:Fg,args:[tx],thisArg:n}),new Qo(g,this.__chain__)}return this.thru(tx)}function ZU(){return Fk(this.__wrapped__,this.__actions__)}var JU=kg(function(f,g,S){cn.call(f,S)?++f[S]:Cs(f,S,1)});function eG(f,g,S){var O=pt(f)?KT:VW;return S&&Hr(f,g,S)&&(g=n),O(f,Ye(g,3))}function tG(f,g){var S=pt(f)?ca:vk;return S(f,Ye(g,3))}var nG=qk(pP),rG=qk(gP);function oG(f,g){return xr(Lg(f,g),1)}function iG(f,g){return xr(Lg(f,g),W)}function sG(f,g,S){return S=S===n?1:xt(S),xr(Lg(f,g),S)}function wP(f,g){var S=pt(f)?Ko:ha;return S(f,Ye(g,3))}function SP(f,g){var S=pt(f)?EH:yk;return S(f,Ye(g,3))}var aG=kg(function(f,g,S){cn.call(f,S)?f[S].push(g):Cs(f,S,[g])});function lG(f,g,S,O){f=oo(f)?f:lu(f),S=S&&!O?xt(S):0;var N=f.length;return S<0&&(S=or(N+S,0)),Hg(f)?S<=N&&f.indexOf(g,S)>-1:!!N&&Xc(f,g,S)>-1}var cG=Mt(function(f,g,S){var O=-1,N=typeof g=="function",H=oo(f)?pe(f.length):[];return ha(f,function(Z){H[++O]=N?Eo(g,Z,S):cf(Z,g,S)}),H}),uG=kg(function(f,g,S){Cs(f,S,g)});function Lg(f,g){var S=pt(f)?Dn:Ek;return S(f,Ye(g,3))}function dG(f,g,S,O){return f==null?[]:(pt(g)||(g=g==null?[]:[g]),S=O?n:S,pt(S)||(S=S==null?[]:[S]),Pk(f,g,S))}var fG=kg(function(f,g,S){f[S?0:1].push(g)},function(){return[[],[]]});function hG(f,g,S){var O=pt(f)?pv:JT,N=arguments.length<3;return O(f,Ye(g,4),S,N,ha)}function pG(f,g,S){var O=pt(f)?RH:JT,N=arguments.length<3;return O(f,Ye(g,4),S,N,yk)}function gG(f,g){var S=pt(f)?ca:vk;return S(f,zg(Ye(g,3)))}function mG(f){var g=pt(f)?pk:lV;return g(f)}function bG(f,g,S){(S?Hr(f,g,S):g===n)?g=1:g=xt(g);var O=pt(f)?jW:cV;return O(f,g)}function yG(f){var g=pt(f)?zW:dV;return g(f)}function vG(f){if(f==null)return 0;if(oo(f))return Hg(f)?Zc(f):f.length;var g=Tr(f);return g==ue||g==it?f.size:Dv(f).length}function xG(f,g,S){var O=pt(f)?gv:fV;return S&&Hr(f,g,S)&&(g=n),O(f,Ye(g,3))}var wG=Mt(function(f,g){if(f==null)return[];var S=g.length;return S>1&&Hr(f,g[0],g[1])?g=[]:S>2&&Hr(g[0],g[1],g[2])&&(g=[g[0]]),Pk(f,xr(g,1),[])}),$g=tW||function(){return vr.Date.now()};function SG(f,g){if(typeof g!="function")throw new Xo(s);return f=xt(f),function(){if(--f<1)return g.apply(this,arguments)}}function _P(f,g,S){return g=S?n:g,g=f&&g==null?f.length:g,Es(f,P,n,n,n,n,g)}function CP(f,g){var S;if(typeof g!="function")throw new Xo(s);return f=xt(f),function(){return--f>0&&(S=g.apply(this,arguments)),f<=1&&(g=n),S}}var rx=Mt(function(f,g,S){var O=y;if(S.length){var N=da(S,su(rx));O|=C}return Es(f,O,g,S,N)}),EP=Mt(function(f,g,S){var O=y|v;if(S.length){var N=da(S,su(EP));O|=C}return Es(g,O,f,S,N)});function RP(f,g,S){g=S?n:g;var O=Es(f,_,n,n,n,n,n,g);return O.placeholder=RP.placeholder,O}function TP(f,g,S){g=S?n:g;var O=Es(f,R,n,n,n,n,n,g);return O.placeholder=TP.placeholder,O}function kP(f,g,S){var O,N,H,Z,oe,ce,ve=0,we=!1,Ee=!1,Ie=!0;if(typeof f!="function")throw new Xo(s);g=ti(g)||0,Fn(S)&&(we=!!S.leading,Ee="maxWait"in S,H=Ee?or(ti(S.maxWait)||0,g):H,Ie="trailing"in S?!!S.trailing:Ie);function We(Gn){var xi=O,Os=N;return O=N=n,ve=Gn,Z=f.apply(Os,xi),Z}function Ke(Gn){return ve=Gn,oe=pf(Nt,g),we?We(Gn):Z}function Rt(Gn){var xi=Gn-ce,Os=Gn-ve,qP=g-xi;return Ee?Rr(qP,H-Os):qP}function Xe(Gn){var xi=Gn-ce,Os=Gn-ve;return ce===n||xi>=g||xi<0||Ee&&Os>=H}function Nt(){var Gn=$g();if(Xe(Gn))return Ht(Gn);oe=pf(Nt,Rt(Gn))}function Ht(Gn){return oe=n,Ie&&O?We(Gn):(O=N=n,Z)}function Po(){oe!==n&&$k(oe),ve=0,O=ce=N=oe=n}function Wr(){return oe===n?Z:Ht($g())}function Oo(){var Gn=$g(),xi=Xe(Gn);if(O=arguments,N=this,ce=Gn,xi){if(oe===n)return Ke(ce);if(Ee)return $k(oe),oe=pf(Nt,g),We(ce)}return oe===n&&(oe=pf(Nt,g)),Z}return Oo.cancel=Po,Oo.flush=Wr,Oo}var _G=Mt(function(f,g){return bk(f,1,g)}),CG=Mt(function(f,g,S){return bk(f,ti(g)||0,S)});function EG(f){return Es(f,I)}function jg(f,g){if(typeof f!="function"||g!=null&&typeof g!="function")throw new Xo(s);var S=function(){var O=arguments,N=g?g.apply(this,O):O[0],H=S.cache;if(H.has(N))return H.get(N);var Z=f.apply(this,O);return S.cache=H.set(N,Z)||H,Z};return S.cache=new(jg.Cache||_s),S}jg.Cache=_s;function zg(f){if(typeof f!="function")throw new Xo(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 RG(f){return CP(2,f)}var TG=hV(function(f,g){g=g.length==1&&pt(g[0])?Dn(g[0],Ro(Ye())):Dn(xr(g,1),Ro(Ye()));var S=g.length;return Mt(function(O){for(var N=-1,H=Rr(O.length,S);++N<H;)O[N]=g[N].call(this,O[N]);return Eo(f,this,O)})}),ox=Mt(function(f,g){var S=da(g,su(ox));return Es(f,C,n,g,S)}),PP=Mt(function(f,g){var S=da(g,su(PP));return Es(f,E,n,g,S)}),kG=Rs(function(f,g){return Es(f,A,n,n,n,g)});function PG(f,g){if(typeof f!="function")throw new Xo(s);return g=g===n?g:xt(g),Mt(f,g)}function OG(f,g){if(typeof f!="function")throw new Xo(s);return g=g==null?0:or(xt(g),0),Mt(function(S){var O=S[g],N=ma(S,0,g);return O&&ua(N,O),Eo(f,this,N)})}function MG(f,g,S){var O=!0,N=!0;if(typeof f!="function")throw new Xo(s);return Fn(S)&&(O="leading"in S?!!S.leading:O,N="trailing"in S?!!S.trailing:N),kP(f,g,{leading:O,maxWait:g,trailing:N})}function AG(f){return _P(f,1)}function DG(f,g){return ox(Hv(g),f)}function IG(){if(!arguments.length)return[];var f=arguments[0];return pt(f)?f:[f]}function NG(f){return Zo(f,h)}function FG(f,g){return g=typeof g=="function"?g:n,Zo(f,h,g)}function LG(f){return Zo(f,d|h)}function $G(f,g){return g=typeof g=="function"?g:n,Zo(f,d|h,g)}function jG(f,g){return g==null||mk(f,g,fr(g))}function vi(f,g){return f===g||f!==f&&g!==g}var zG=Ag(Ov),BG=Ag(function(f,g){return f>=g}),Sl=Sk(function(){return arguments}())?Sk:function(f){return jn(f)&&cn.call(f,"callee")&&!lk.call(f,"callee")},pt=pe.isArray,HG=WT?Ro(WT):XW;function oo(f){return f!=null&&Bg(f.length)&&!ks(f)}function Un(f){return jn(f)&&oo(f)}function WG(f){return f===!0||f===!1||jn(f)&&Br(f)==J}var ba=rW||gx,VG=VT?Ro(VT):QW;function UG(f){return jn(f)&&f.nodeType===1&&!gf(f)}function GG(f){if(f==null)return!0;if(oo(f)&&(pt(f)||typeof f=="string"||typeof f.splice=="function"||ba(f)||au(f)||Sl(f)))return!f.length;var g=Tr(f);if(g==ue||g==it)return!f.size;if(hf(f))return!Dv(f).length;for(var S in f)if(cn.call(f,S))return!1;return!0}function qG(f,g){return uf(f,g)}function YG(f,g,S){S=typeof S=="function"?S:n;var O=S?S(f,g):n;return O===n?uf(f,g,n,S):!!O}function ix(f){if(!jn(f))return!1;var g=Br(f);return g==he||g==de||typeof f.message=="string"&&typeof f.name=="string"&&!gf(f)}function KG(f){return typeof f=="number"&&uk(f)}function ks(f){if(!Fn(f))return!1;var g=Br(f);return g==se||g==ge||g==Y||g==Le}function OP(f){return typeof f=="number"&&f==xt(f)}function Bg(f){return typeof f=="number"&&f>-1&&f%1==0&&f<=q}function Fn(f){var g=typeof f;return f!=null&&(g=="object"||g=="function")}function jn(f){return f!=null&&typeof f=="object"}var MP=UT?Ro(UT):JW;function XG(f,g){return f===g||Av(f,g,Kv(g))}function QG(f,g,S){return S=typeof S=="function"?S:n,Av(f,g,Kv(g),S)}function ZG(f){return AP(f)&&f!=+f}function JG(f){if(FV(f))throw new ht(i);return _k(f)}function eq(f){return f===null}function tq(f){return f==null}function AP(f){return typeof f=="number"||jn(f)&&Br(f)==Ce}function gf(f){if(!jn(f)||Br(f)!=Ne)return!1;var g=pg(f);if(g===null)return!0;var S=cn.call(g,"constructor")&&g.constructor;return typeof S=="function"&&S instanceof S&&ug.call(S)==QH}var sx=GT?Ro(GT):eV;function nq(f){return OP(f)&&f>=-9007199254740991&&f<=q}var DP=qT?Ro(qT):tV;function Hg(f){return typeof f=="string"||!pt(f)&&jn(f)&&Br(f)==ln}function ko(f){return typeof f=="symbol"||jn(f)&&Br(f)==vt}var au=YT?Ro(YT):nV;function rq(f){return f===n}function oq(f){return jn(f)&&Tr(f)==Ct}function iq(f){return jn(f)&&Br(f)==fe}var sq=Ag(Iv),aq=Ag(function(f,g){return f<=g});function IP(f){if(!f)return[];if(oo(f))return Hg(f)?bi(f):ro(f);if(tf&&f[tf])return jH(f[tf]());var g=Tr(f),S=g==ue?wv:g==it?ag:lu;return S(f)}function Ps(f){if(!f)return f===0?f:0;if(f=ti(f),f===W||f===-1/0){var g=f<0?-1:1;return g*Q}return f===f?f:0}function xt(f){var g=Ps(f),S=g%1;return g===g?S?g-S:g:0}function NP(f){return f?yl(xt(f),0,G):0}function ti(f){if(typeof f=="number")return f;if(ko(f))return D;if(Fn(f)){var g=typeof f.valueOf=="function"?f.valueOf():f;f=Fn(g)?g+"":g}if(typeof f!="string")return f===0?f:+f;f=ek(f);var S=Et.test(f);return S||ne.test(f)?SH(f.slice(2),S?2:8):Ot.test(f)?D:+f}function FP(f){return ji(f,io(f))}function lq(f){return f?yl(xt(f),-9007199254740991,q):f===0?f:0}function nn(f){return f==null?"":To(f)}var cq=ou(function(f,g){if(hf(g)||oo(g)){ji(g,fr(g),f);return}for(var S in g)cn.call(g,S)&&af(f,S,g[S])}),LP=ou(function(f,g){ji(g,io(g),f)}),Wg=ou(function(f,g,S,O){ji(g,io(g),f,O)}),uq=ou(function(f,g,S,O){ji(g,fr(g),f,O)}),dq=Rs(Tv);function fq(f,g){var S=ru(f);return g==null?S:gk(S,g)}var hq=Mt(function(f,g){f=mn(f);var S=-1,O=g.length,N=O>2?g[2]:n;for(N&&Hr(g[0],g[1],N)&&(O=1);++S<O;)for(var H=g[S],Z=io(H),oe=-1,ce=Z.length;++oe<ce;){var ve=Z[oe],we=f[ve];(we===n||vi(we,eu[ve])&&!cn.call(f,ve))&&(f[ve]=H[ve])}return f}),pq=Mt(function(f){return f.push(n,eP),Eo($P,n,f)});function gq(f,g){return XT(f,Ye(g,3),$i)}function mq(f,g){return XT(f,Ye(g,3),Pv)}function bq(f,g){return f==null?f:kv(f,Ye(g,3),io)}function yq(f,g){return f==null?f:xk(f,Ye(g,3),io)}function vq(f,g){return f&&$i(f,Ye(g,3))}function xq(f,g){return f&&Pv(f,Ye(g,3))}function wq(f){return f==null?[]:Cg(f,fr(f))}function Sq(f){return f==null?[]:Cg(f,io(f))}function ax(f,g,S){var O=f==null?n:vl(f,g);return O===n?S:O}function _q(f,g){return f!=null&&rP(f,g,GW)}function lx(f,g){return f!=null&&rP(f,g,qW)}var Cq=Kk(function(f,g,S){g!=null&&typeof g.toString!="function"&&(g=dg.call(g)),f[g]=S},ux(so)),Eq=Kk(function(f,g,S){g!=null&&typeof g.toString!="function"&&(g=dg.call(g)),cn.call(f,g)?f[g].push(S):f[g]=[S]},Ye),Rq=Mt(cf);function fr(f){return oo(f)?hk(f):Dv(f)}function io(f){return oo(f)?hk(f,!0):rV(f)}function Tq(f,g){var S={};return g=Ye(g,3),$i(f,function(O,N,H){Cs(S,g(O,N,H),O)}),S}function kq(f,g){var S={};return g=Ye(g,3),$i(f,function(O,N,H){Cs(S,N,g(O,N,H))}),S}var Pq=ou(function(f,g,S){Eg(f,g,S)}),$P=ou(function(f,g,S,O){Eg(f,g,S,O)}),Oq=Rs(function(f,g){var S={};if(f==null)return S;var O=!1;g=Dn(g,function(H){return H=ga(H,f),O||(O=H.length>1),H}),ji(f,qv(f),S),O&&(S=Zo(S,d|p|h,CV));for(var N=g.length;N--;)jv(S,g[N]);return S});function Mq(f,g){return jP(f,zg(Ye(g)))}var Aq=Rs(function(f,g){return f==null?{}:iV(f,g)});function jP(f,g){if(f==null)return{};var S=Dn(qv(f),function(O){return[O]});return g=Ye(g),Ok(f,S,function(O,N){return g(O,N[0])})}function Dq(f,g,S){g=ga(g,f);var O=-1,N=g.length;for(N||(N=1,f=n);++O<N;){var H=f==null?n:f[zi(g[O])];H===n&&(O=N,H=S),f=ks(H)?H.call(f):H}return f}function Iq(f,g,S){return f==null?f:df(f,g,S)}function Nq(f,g,S,O){return O=typeof O=="function"?O:n,f==null?f:df(f,g,S,O)}var zP=Zk(fr),BP=Zk(io);function Fq(f,g,S){var O=pt(f),N=O||ba(f)||au(f);if(g=Ye(g,4),S==null){var H=f&&f.constructor;N?S=O?new H:[]:Fn(f)?S=ks(H)?ru(pg(f)):{}:S={}}return(N?Ko:$i)(f,function(Z,oe,ce){return g(S,Z,oe,ce)}),S}function Lq(f,g){return f==null?!0:jv(f,g)}function $q(f,g,S){return f==null?f:Nk(f,g,Hv(S))}function jq(f,g,S,O){return O=typeof O=="function"?O:n,f==null?f:Nk(f,g,Hv(S),O)}function lu(f){return f==null?[]:xv(f,fr(f))}function zq(f){return f==null?[]:xv(f,io(f))}function Bq(f,g,S){return S===n&&(S=g,g=n),S!==n&&(S=ti(S),S=S===S?S:0),g!==n&&(g=ti(g),g=g===g?g:0),yl(ti(f),g,S)}function Hq(f,g,S){return g=Ps(g),S===n?(S=g,g=0):S=Ps(S),f=ti(f),YW(f,g,S)}function Wq(f,g,S){if(S&&typeof S!="boolean"&&Hr(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=Ps(f),g===n?(g=f,f=0):g=Ps(g)),f>g){var O=f;f=g,g=O}if(S||f%1||g%1){var N=dk();return Rr(f+N*(g-f+wH("1e-"+((N+"").length-1))),g)}return Fv(f,g)}var Vq=iu(function(f,g,S){return g=g.toLowerCase(),f+(S?HP(g):g)});function HP(f){return cx(nn(f).toLowerCase())}function WP(f){return f=nn(f),f&&f.replace(De,IH).replace(dH,"")}function Uq(f,g,S){f=nn(f),g=To(g);var O=f.length;S=S===n?O:yl(xt(S),0,O);var N=S;return S-=g.length,S>=0&&f.slice(S,N)==g}function Gq(f){return f=nn(f),f&&mi.test(f)?f.replace(cr,NH):f}function qq(f){return f=nn(f),f&&ur.test(f)?f.replace(yr,"\\$&"):f}var Yq=iu(function(f,g,S){return f+(S?"-":"")+g.toLowerCase()}),Kq=iu(function(f,g,S){return f+(S?" ":"")+g.toLowerCase()}),Xq=Gk("toLowerCase");function Qq(f,g,S){f=nn(f),g=xt(g);var O=g?Zc(f):0;if(!g||O>=g)return f;var N=(g-O)/2;return Mg(yg(N),S)+f+Mg(bg(N),S)}function Zq(f,g,S){f=nn(f),g=xt(g);var O=g?Zc(f):0;return g&&O<g?f+Mg(g-O,S):f}function Jq(f,g,S){f=nn(f),g=xt(g);var O=g?Zc(f):0;return g&&O<g?Mg(g-O,S)+f:f}function eY(f,g,S){return S||g==null?g=0:g&&(g=+g),aW(nn(f).replace(_n,""),g||0)}function tY(f,g,S){return(S?Hr(f,g,S):g===n)?g=1:g=xt(g),Lv(nn(f),g)}function nY(){var f=arguments,g=nn(f[0]);return f.length<3?g:g.replace(f[1],f[2])}var rY=iu(function(f,g,S){return f+(S?"_":"")+g.toLowerCase()});function oY(f,g,S){return S&&typeof S!="number"&&Hr(f,g,S)&&(g=S=n),S=S===n?G:S>>>0,S?(f=nn(f),f&&(typeof g=="string"||g!=null&&!sx(g))&&(g=To(g),!g&&Qc(f))?ma(bi(f),0,S):f.split(g,S)):[]}var iY=iu(function(f,g,S){return f+(S?" ":"")+cx(g)});function sY(f,g,S){return f=nn(f),S=S==null?0:yl(xt(S),0,f.length),g=To(g),f.slice(S,S+g.length)==g}function aY(f,g,S){var O=z.templateSettings;S&&Hr(f,g,S)&&(g=n),f=nn(f),g=Wg({},g,O,Jk);var N=Wg({},g.imports,O.imports,Jk),H=fr(N),Z=xv(N,H),oe,ce,ve=0,we=g.interpolate||jt,Ee="__p += '",Ie=Sv((g.escape||jt).source+"|"+we.source+"|"+(we===Xt?Bt:jt).source+"|"+(g.evaluate||jt).source+"|$","g"),We="//# sourceURL="+(cn.call(g,"sourceURL")?(g.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++mH+"]")+`
75
+ `;f.replace(Ie,function(Xe,Nt,Ht,Po,Wr,Oo){return Ht||(Ht=Po),Ee+=f.slice(ve,Oo).replace(yn,FH),Nt&&(oe=!0,Ee+=`' +
76
+ __e(`+Nt+`) +
77
+ '`),Wr&&(ce=!0,Ee+=`';
78
+ `+Wr+`;
79
+ __p += '`),Ht&&(Ee+=`' +
80
+ ((__t = (`+Ht+`)) == null ? '' : __t) +
81
+ '`),ve=Oo+Xe.length,Xe}),Ee+=`';
82
+ `;var Ke=cn.call(g,"variable")&&g.variable;if(!Ke)Ee=`with (obj) {
83
+ `+Ee+`
84
+ }
85
+ `;else if(Ae.test(Ke))throw new ht(a);Ee=(ce?Ee.replace($t,""):Ee).replace(Nn,"$1").replace(st,"$1;"),Ee="function("+(Ke||"obj")+`) {
86
+ `+(Ke?"":`obj || (obj = {});
87
+ `)+"var __t, __p = ''"+(oe?", __e = _.escape":"")+(ce?`, __j = Array.prototype.join;
88
+ function print() { __p += __j.call(arguments, '') }
89
+ `:`;
90
+ `)+Ee+`return __p
91
+ }`;var Rt=UP(function(){return Qt(H,We+"return "+Ee).apply(n,Z)});if(Rt.source=Ee,ix(Rt))throw Rt;return Rt}function lY(f){return nn(f).toLowerCase()}function cY(f){return nn(f).toUpperCase()}function uY(f,g,S){if(f=nn(f),f&&(S||g===n))return ek(f);if(!f||!(g=To(g)))return f;var O=bi(f),N=bi(g),H=tk(O,N),Z=nk(O,N)+1;return ma(O,H,Z).join("")}function dY(f,g,S){if(f=nn(f),f&&(S||g===n))return f.slice(0,ok(f)+1);if(!f||!(g=To(g)))return f;var O=bi(f),N=nk(O,bi(g))+1;return ma(O,0,N).join("")}function fY(f,g,S){if(f=nn(f),f&&(S||g===n))return f.replace(_n,"");if(!f||!(g=To(g)))return f;var O=bi(f),N=tk(O,bi(g));return ma(O,N).join("")}function hY(f,g){var S=F,O=L;if(Fn(g)){var N="separator"in g?g.separator:N;S="length"in g?xt(g.length):S,O="omission"in g?To(g.omission):O}f=nn(f);var H=f.length;if(Qc(f)){var Z=bi(f);H=Z.length}if(S>=H)return f;var oe=S-Zc(O);if(oe<1)return O;var ce=Z?ma(Z,0,oe).join(""):f.slice(0,oe);if(N===n)return ce+O;if(Z&&(oe+=ce.length-oe),sx(N)){if(f.slice(oe).search(N)){var ve,we=ce;for(N.global||(N=Sv(N.source,nn(qt.exec(N))+"g")),N.lastIndex=0;ve=N.exec(we);)var Ee=ve.index;ce=ce.slice(0,Ee===n?oe:Ee)}}else if(f.indexOf(To(N),oe)!=oe){var Ie=ce.lastIndexOf(N);Ie>-1&&(ce=ce.slice(0,Ie))}return ce+O}function pY(f){return f=nn(f),f&&br.test(f)?f.replace(qo,WH):f}var gY=iu(function(f,g,S){return f+(S?" ":"")+g.toUpperCase()}),cx=Gk("toUpperCase");function VP(f,g,S){return f=nn(f),g=S?n:g,g===n?$H(f)?GH(f):PH(f):f.match(g)||[]}var UP=Mt(function(f,g){try{return Eo(f,n,g)}catch(S){return ix(S)?S:new ht(S)}}),mY=Rs(function(f,g){return Ko(g,function(S){S=zi(S),Cs(f,S,rx(f[S],f))}),f});function bY(f){var g=f==null?0:f.length,S=Ye();return f=g?Dn(f,function(O){if(typeof O[1]!="function")throw new Xo(s);return[S(O[0]),O[1]]}):[],Mt(function(O){for(var N=-1;++N<g;){var H=f[N];if(Eo(H[0],this,O))return Eo(H[1],this,O)}})}function yY(f){return WW(Zo(f,d))}function ux(f){return function(){return f}}function vY(f,g){return f==null||f!==f?g:f}var xY=Yk(),wY=Yk(!0);function so(f){return f}function dx(f){return Ck(typeof f=="function"?f:Zo(f,d))}function SY(f){return Rk(Zo(f,d))}function _Y(f,g){return Tk(f,Zo(g,d))}var CY=Mt(function(f,g){return function(S){return cf(S,f,g)}}),EY=Mt(function(f,g){return function(S){return cf(f,S,g)}});function fx(f,g,S){var O=fr(g),N=Cg(g,O);S==null&&!(Fn(g)&&(N.length||!O.length))&&(S=g,g=f,f=this,N=Cg(g,fr(g)));var H=!(Fn(S)&&"chain"in S)||!!S.chain,Z=ks(f);return Ko(N,function(oe){var ce=g[oe];f[oe]=ce,Z&&(f.prototype[oe]=function(){var ve=this.__chain__;if(H||ve){var we=f(this.__wrapped__),Ee=we.__actions__=ro(this.__actions__);return Ee.push({func:ce,args:arguments,thisArg:f}),we.__chain__=ve,we}return ce.apply(f,ua([this.value()],arguments))})}),f}function RY(){return vr._===this&&(vr._=ZH),this}function hx(){}function TY(f){return f=xt(f),Mt(function(g){return kk(g,f)})}var kY=Vv(Dn),PY=Vv(KT),OY=Vv(gv);function GP(f){return Qv(f)?mv(zi(f)):sV(f)}function MY(f){return function(g){return f==null?n:vl(f,g)}}var AY=Xk(),DY=Xk(!0);function px(){return[]}function gx(){return!1}function IY(){return{}}function NY(){return""}function FY(){return!0}function LY(f,g){if(f=xt(f),f<1||f>q)return[];var S=G,O=Rr(f,G);g=Ye(g),f-=G;for(var N=vv(O,g);++S<f;)g(S);return N}function $Y(f){return pt(f)?Dn(f,zi):ko(f)?[f]:ro(fP(nn(f)))}function jY(f){var g=++XH;return nn(f)+g}var zY=Og(function(f,g){return f+g},0),BY=Uv("ceil"),HY=Og(function(f,g){return f/g},1),WY=Uv("floor");function VY(f){return f&&f.length?_g(f,so,Ov):n}function UY(f,g){return f&&f.length?_g(f,Ye(g,2),Ov):n}function GY(f){return ZT(f,so)}function qY(f,g){return ZT(f,Ye(g,2))}function YY(f){return f&&f.length?_g(f,so,Iv):n}function KY(f,g){return f&&f.length?_g(f,Ye(g,2),Iv):n}var XY=Og(function(f,g){return f*g},1),QY=Uv("round"),ZY=Og(function(f,g){return f-g},0);function JY(f){return f&&f.length?yv(f,so):0}function eK(f,g){return f&&f.length?yv(f,Ye(g,2)):0}return z.after=SG,z.ary=_P,z.assign=cq,z.assignIn=LP,z.assignInWith=Wg,z.assignWith=uq,z.at=dq,z.before=CP,z.bind=rx,z.bindAll=mY,z.bindKey=EP,z.castArray=IG,z.chain=xP,z.chunk=WV,z.compact=VV,z.concat=UV,z.cond=bY,z.conforms=yY,z.constant=ux,z.countBy=JU,z.create=fq,z.curry=RP,z.curryRight=TP,z.debounce=kP,z.defaults=hq,z.defaultsDeep=pq,z.defer=_G,z.delay=CG,z.difference=GV,z.differenceBy=qV,z.differenceWith=YV,z.drop=KV,z.dropRight=XV,z.dropRightWhile=QV,z.dropWhile=ZV,z.fill=JV,z.filter=tG,z.flatMap=oG,z.flatMapDeep=iG,z.flatMapDepth=sG,z.flatten=mP,z.flattenDeep=eU,z.flattenDepth=tU,z.flip=EG,z.flow=xY,z.flowRight=wY,z.fromPairs=nU,z.functions=wq,z.functionsIn=Sq,z.groupBy=aG,z.initial=oU,z.intersection=iU,z.intersectionBy=sU,z.intersectionWith=aU,z.invert=Cq,z.invertBy=Eq,z.invokeMap=cG,z.iteratee=dx,z.keyBy=uG,z.keys=fr,z.keysIn=io,z.map=Lg,z.mapKeys=Tq,z.mapValues=kq,z.matches=SY,z.matchesProperty=_Y,z.memoize=jg,z.merge=Pq,z.mergeWith=$P,z.method=CY,z.methodOf=EY,z.mixin=fx,z.negate=zg,z.nthArg=TY,z.omit=Oq,z.omitBy=Mq,z.once=RG,z.orderBy=dG,z.over=kY,z.overArgs=TG,z.overEvery=PY,z.overSome=OY,z.partial=ox,z.partialRight=PP,z.partition=fG,z.pick=Aq,z.pickBy=jP,z.property=GP,z.propertyOf=MY,z.pull=dU,z.pullAll=yP,z.pullAllBy=fU,z.pullAllWith=hU,z.pullAt=pU,z.range=AY,z.rangeRight=DY,z.rearg=kG,z.reject=gG,z.remove=gU,z.rest=PG,z.reverse=tx,z.sampleSize=bG,z.set=Iq,z.setWith=Nq,z.shuffle=yG,z.slice=mU,z.sortBy=wG,z.sortedUniq=_U,z.sortedUniqBy=CU,z.split=oY,z.spread=OG,z.tail=EU,z.take=RU,z.takeRight=TU,z.takeRightWhile=kU,z.takeWhile=PU,z.tap=VU,z.throttle=MG,z.thru=Fg,z.toArray=IP,z.toPairs=zP,z.toPairsIn=BP,z.toPath=$Y,z.toPlainObject=FP,z.transform=Fq,z.unary=AG,z.union=OU,z.unionBy=MU,z.unionWith=AU,z.uniq=DU,z.uniqBy=IU,z.uniqWith=NU,z.unset=Lq,z.unzip=nx,z.unzipWith=vP,z.update=$q,z.updateWith=jq,z.values=lu,z.valuesIn=zq,z.without=FU,z.words=VP,z.wrap=DG,z.xor=LU,z.xorBy=$U,z.xorWith=jU,z.zip=zU,z.zipObject=BU,z.zipObjectDeep=HU,z.zipWith=WU,z.entries=zP,z.entriesIn=BP,z.extend=LP,z.extendWith=Wg,fx(z,z),z.add=zY,z.attempt=UP,z.camelCase=Vq,z.capitalize=HP,z.ceil=BY,z.clamp=Bq,z.clone=NG,z.cloneDeep=LG,z.cloneDeepWith=$G,z.cloneWith=FG,z.conformsTo=jG,z.deburr=WP,z.defaultTo=vY,z.divide=HY,z.endsWith=Uq,z.eq=vi,z.escape=Gq,z.escapeRegExp=qq,z.every=eG,z.find=nG,z.findIndex=pP,z.findKey=gq,z.findLast=rG,z.findLastIndex=gP,z.findLastKey=mq,z.floor=WY,z.forEach=wP,z.forEachRight=SP,z.forIn=bq,z.forInRight=yq,z.forOwn=vq,z.forOwnRight=xq,z.get=ax,z.gt=zG,z.gte=BG,z.has=_q,z.hasIn=lx,z.head=bP,z.identity=so,z.includes=lG,z.indexOf=rU,z.inRange=Hq,z.invoke=Rq,z.isArguments=Sl,z.isArray=pt,z.isArrayBuffer=HG,z.isArrayLike=oo,z.isArrayLikeObject=Un,z.isBoolean=WG,z.isBuffer=ba,z.isDate=VG,z.isElement=UG,z.isEmpty=GG,z.isEqual=qG,z.isEqualWith=YG,z.isError=ix,z.isFinite=KG,z.isFunction=ks,z.isInteger=OP,z.isLength=Bg,z.isMap=MP,z.isMatch=XG,z.isMatchWith=QG,z.isNaN=ZG,z.isNative=JG,z.isNil=tq,z.isNull=eq,z.isNumber=AP,z.isObject=Fn,z.isObjectLike=jn,z.isPlainObject=gf,z.isRegExp=sx,z.isSafeInteger=nq,z.isSet=DP,z.isString=Hg,z.isSymbol=ko,z.isTypedArray=au,z.isUndefined=rq,z.isWeakMap=oq,z.isWeakSet=iq,z.join=lU,z.kebabCase=Yq,z.last=ei,z.lastIndexOf=cU,z.lowerCase=Kq,z.lowerFirst=Xq,z.lt=sq,z.lte=aq,z.max=VY,z.maxBy=UY,z.mean=GY,z.meanBy=qY,z.min=YY,z.minBy=KY,z.stubArray=px,z.stubFalse=gx,z.stubObject=IY,z.stubString=NY,z.stubTrue=FY,z.multiply=XY,z.nth=uU,z.noConflict=RY,z.noop=hx,z.now=$g,z.pad=Qq,z.padEnd=Zq,z.padStart=Jq,z.parseInt=eY,z.random=Wq,z.reduce=hG,z.reduceRight=pG,z.repeat=tY,z.replace=nY,z.result=Dq,z.round=QY,z.runInContext=le,z.sample=mG,z.size=vG,z.snakeCase=rY,z.some=xG,z.sortedIndex=bU,z.sortedIndexBy=yU,z.sortedIndexOf=vU,z.sortedLastIndex=xU,z.sortedLastIndexBy=wU,z.sortedLastIndexOf=SU,z.startCase=iY,z.startsWith=sY,z.subtract=ZY,z.sum=JY,z.sumBy=eK,z.template=aY,z.times=LY,z.toFinite=Ps,z.toInteger=xt,z.toLength=NP,z.toLower=lY,z.toNumber=ti,z.toSafeInteger=lq,z.toString=nn,z.toUpper=cY,z.trim=uY,z.trimEnd=dY,z.trimStart=fY,z.truncate=hY,z.unescape=pY,z.uniqueId=jY,z.upperCase=gY,z.upperFirst=cx,z.each=wP,z.eachRight=SP,z.first=bP,fx(z,function(){var f={};return $i(z,function(g,S){cn.call(z.prototype,S)||(f[S]=g)}),f}(),{chain:!1}),z.VERSION=r,Ko(["bind","bindKey","curry","curryRight","partial","partialRight"],function(f){z[f].placeholder=z}),Ko(["drop","take"],function(f,g){zt.prototype[f]=function(S){S=S===n?1:or(xt(S),0);var O=this.__filtered__&&!g?new zt(this):this.clone();return O.__filtered__?O.__takeCount__=Rr(S,O.__takeCount__):O.__views__.push({size:Rr(S,G),type:f+(O.__dir__<0?"Right":"")}),O},zt.prototype[f+"Right"]=function(S){return this.reverse()[f](S).reverse()}}),Ko(["filter","map","takeWhile"],function(f,g){var S=g+1,O=S==U||S==B;zt.prototype[f]=function(N){var H=this.clone();return H.__iteratees__.push({iteratee:Ye(N,3),type:S}),H.__filtered__=H.__filtered__||O,H}}),Ko(["head","last"],function(f,g){var S="take"+(g?"Right":"");zt.prototype[f]=function(){return this[S](1).value()[0]}}),Ko(["initial","tail"],function(f,g){var S="drop"+(g?"":"Right");zt.prototype[f]=function(){return this.__filtered__?new zt(this):this[S](1)}}),zt.prototype.compact=function(){return this.filter(so)},zt.prototype.find=function(f){return this.filter(f).head()},zt.prototype.findLast=function(f){return this.reverse().find(f)},zt.prototype.invokeMap=Mt(function(f,g){return typeof f=="function"?new zt(this):this.map(function(S){return cf(S,f,g)})}),zt.prototype.reject=function(f){return this.filter(zg(Ye(f)))},zt.prototype.slice=function(f,g){f=xt(f);var S=this;return S.__filtered__&&(f>0||g<0)?new zt(S):(f<0?S=S.takeRight(-f):f&&(S=S.drop(f)),g!==n&&(g=xt(g),S=g<0?S.dropRight(-g):S.take(g-f)),S)},zt.prototype.takeRightWhile=function(f){return this.reverse().takeWhile(f).reverse()},zt.prototype.toArray=function(){return this.take(G)},$i(zt.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],H=O||/^find/.test(g);N&&(z.prototype[g]=function(){var Z=this.__wrapped__,oe=O?[1]:arguments,ce=Z instanceof zt,ve=oe[0],we=ce||pt(Z),Ee=function(Nt){var Ht=N.apply(z,ua([Nt],oe));return O&&Ie?Ht[0]:Ht};we&&S&&typeof ve=="function"&&ve.length!=1&&(ce=we=!1);var Ie=this.__chain__,We=!!this.__actions__.length,Ke=H&&!Ie,Rt=ce&&!We;if(!H&&we){Z=Rt?Z:new zt(this);var Xe=f.apply(Z,oe);return Xe.__actions__.push({func:Fg,args:[Ee],thisArg:n}),new Qo(Xe,Ie)}return Ke&&Rt?f.apply(this,oe):(Xe=this.thru(Ee),Ke?O?Xe.value()[0]:Xe.value():Xe)})}),Ko(["pop","push","shift","sort","splice","unshift"],function(f){var g=lg[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 H=this.value();return g.apply(pt(H)?H:[],N)}return this[S](function(Z){return g.apply(pt(Z)?Z:[],N)})}}),$i(zt.prototype,function(f,g){var S=z[g];if(S){var O=S.name+"";cn.call(nu,O)||(nu[O]=[]),nu[O].push({name:g,func:S})}}),nu[Pg(n,v).name]=[{name:"wrapper",func:n}],zt.prototype.clone=pW,zt.prototype.reverse=gW,zt.prototype.value=mW,z.prototype.at=UU,z.prototype.chain=GU,z.prototype.commit=qU,z.prototype.next=YU,z.prototype.plant=XU,z.prototype.reverse=QU,z.prototype.toJSON=z.prototype.valueOf=z.prototype.value=ZU,z.prototype.first=z.prototype.head,tf&&(z.prototype[tf]=KU),z},Jc=qH();pl?((pl.exports=Jc)._=Jc,dv._=Jc):vr._=Jc}).call(Xi)})(Sb,Sb.exports);var Vf=Sb.exports;const sc=ol(Vf);function fO({id:e,layouts:t,initialHeight:n,y:r,x:o,w:i,minH:s}){const a={i:e,x:o??0,y:r??1/0,w:i||20,h:n||35,minW:6,minH:s||10},l=t?{...t}:{};return eC.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 hO(e,t){if(!t)return;const n={...t};return eC.forEach(r=>{n[r]&&(n[r]=n[r].filter(o=>o.i!==e))}),n}function oC(e){const t=ye.getState().dashboard.globalCacheConfig,{card:n,filter:r}=e;return t}const ye=mN()(_N((e,t)=>({isSessionExpired:!1,currentBreakpoint:"lg",dashboard:{id:"",style:wb},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:wb},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})},setIsDownloadingPdf:n=>{e(r=>{r.isDownloadingPdf=n})},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 i,s,a,l,c,u,d,p;const o=(i=r.dashboard.sheets)==null?void 0:i.findIndex(h=>h.id===n);if(o!==void 0&&o>-1){(s=r.dashboard.sheets)==null||s.splice(o,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(y=>y.id===b.filterId));r.filterValues=(c=r.filterValues)==null?void 0:c.filter(b=>!(m!=null&&m.some(y=>y.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 o=r.dashboard.filters;let i={};o==null||o.forEach(a=>{eC.forEach(l=>{i!=null&&i[l]||(i={...i,[l]:[]});const c={i:a.id,x:0,y:0,w:10,h:8};i[l].push(c)})});const s={...n,layouts:i};r.dashboard.sheets.push(s)})},setGlobalStyle:n=>{e(r=>{r.dashboard.globalStyle=n})},setAIScopeTables:n=>{e(r=>{r.dashboard.aiScopeTables=n})},addToAIScope:n=>{e(r=>{const{connectionId:o,connectionType:i,databaseName:s,schemaName:a,tableName:l,datamodelName:c}=n,u={connectionId:o||"",connectionType:i||"",databaseName:s||"",schemaName:a||"",tableName:l||"",datamodelName:c||""};let p=[...r.dashboard.aiScopeTables||[],u];p=p.filter((h,m,b)=>b.findIndex(y=>y.tableName===h.tableName&&y.datamodelName===h.datamodelName)===m),r.dashboard.aiScopeTables=p})},removeFromAIScope:n=>{e(r=>{const{connectionId:o,tableName:i,datamodelName:s}=n,a=r.dashboard.aiScopeTables||[];if(s){const l=a.filter(c=>!(c.datamodelName===s&&c.connectionId===o));r.dashboard.aiScopeTables=l}else if(i){const l=a.filter(c=>!(c.tableName===i&&c.connectionId===o));r.dashboard.aiScopeTables=l}})},setIsSessionExpired:n=>{e(()=>({isSessionExpired:n}))},setCardPython:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===o.selectedSheetId);i&&Vf.forEach(i.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 o;r.dashboard.baseQueries||(r.dashboard.baseQueries=[]),(o=r.dashboard.baseQueries)==null||o.push(n)})},removeBaseQuery:n=>{e(r=>{var i,s;const o=(i=r.dashboard.baseQueries)==null?void 0:i.findIndex(a=>a.id===n);o!=null&&o>-1&&((s=r.dashboard.baseQueries)==null||s.splice(o,1))})},setBaseQueries:n=>{e(r=>{r.dashboard.baseQueries=n})},setCurrentBreakpoint:n=>{e(()=>({currentBreakpoint:n}))},setFilteringCards:n=>{e(()=>({filteringCards:n}))},addFilteringCard:n=>{e(r=>{var o;(o=r.filteringCards)==null||o.push(n)})},removeFilteringCard:n=>{e(r=>{var i,s;const o=(i=r.filteringCards)==null?void 0:i.findIndex(a=>a.id===n.id);o!==void 0&&o>-1&&((s=r.filteringCards)==null||s.splice(o,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(o=>{o.dashboard=n,o.filterValues=r})},setDashboardTheme:n=>{e(r=>{r.theme=n})},setSheets:n=>{e(r=>{r.dashboard&&(r.dashboard.sheets=n)})},setSheetTitle:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.title=r)})},setCardTitle:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&Vf.forEach(s.frames,c=>{var d;const u=(d=c.cards)==null?void 0:d.find(p=>p.id===r);u&&(u.title=o)})})},setCardInfo:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===o.selectedSheetId);i&&Vf.forEach(i.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,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&Vf.forEach(s.frames,c=>{var d;const u=(d=c.cards)==null?void 0:d.find(p=>p.id===r);u&&(u.description=o)})})},setCardSql:(n,r,o)=>{e(i=>{var a,l,c,u;const s=(l=(a=i.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=o,(u=i.onUpdateCard)==null||u.call(i,d,n))}})},setSheetLayout:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layout=r)})},setSheetLayouts:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.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 o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1?r.filterValues.splice(o,1,n):r.filterValues.push(n)}else r.filterValues=[n]})},addOrUpdateFilterValues:n=>{e(r=>{r.filterValues?n.forEach(o=>{var s,a,l;const i=(s=r==null?void 0:r.filterValues)==null?void 0:s.findIndex(c=>c.filterId===o.filterId);i!==void 0&&i>-1?(a=r.filterValues)==null||a.splice(i,1,o):(l=r.filterValues)==null||l.push(o)}):r.filterValues=n})},removeFilterValues:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.filter(i=>i.filterId!==n&&!i.filterId.startsWith(n));r.filterValues=o}})},replaceFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1&&r.filterValues.splice(o,1,n)}})},addFilter:n=>{e(r=>{var i,s;r.dashboard.filters?(i=r.dashboard.filters)==null||i.push(n):r.dashboard.filters=[n],(s=r.dashboard.sheets)==null||s.find(a=>a.id===r.selectedSheetId);const o=r.dashboard.sheets;o==null||o.forEach(a=>{fO({id:n.id,layouts:a.layouts,y:0,initialHeight:8,minH:7,w:10})})})},removeFilter:n=>{e(r=>{var o,i,s;if(r.dashboard.filters){const a=(o=r.dashboard.filters)==null?void 0:o.findIndex(l=>l.id===n);if(a>-1){(i=r.dashboard.filters)==null||i.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=hO(n,c.layouts);c.layouts=u})}}})},updateFrameCard:(n,r,o)=>{e(i=>{var l,c,u,d,p;const s=(c=(l=i.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===o.id);h>-1&&((p=a.cards)==null||p.splice(h,1,o))}})},updateFilter:n=>{e(r=>{var o,i;if(r.dashboard.filters){const s=(o=r.dashboard.filters)==null?void 0:o.findIndex(a=>a.id===n.id);s>-1&&((i=r.dashboard.filters)==null||i.splice(s,1,n))}})},updateFilterId:(n,r)=>{e(o=>{var a,l;const i=(a=o.dashboard.filters)==null?void 0:a.find(c=>c.id===n),s=(l=o.dashboard.filters)==null?void 0:l.some(c=>c.id===r);i&&!s&&(i.id=r)})},setIsDashboardEditing:n=>{e(()=>({isDashboardEditing:n}))},setShowDashboardJSON:n=>{e(()=>({showDashboardJSON:n}))},setIsVisualEditing:n=>{e(()=>({isVisualEditing:n}))},addFrame:(n,r,o)=>{e(i=>{var a,l,c,u;const s=(l=(a=i.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;o==="start"&&(d=0);const h=fO({id:r.id,layouts:s.layouts,minH:10,x:p,y:d});s.layouts=h,(u=i.onAddFrame)==null||u.call(i,r,n)}})},removeFrame:(n,r)=>{e(o=>{var s,a,l,c,u;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(d=>d.id===n);if(i){const d=(l=i.frames)==null?void 0:l.findIndex(p=>p.id===r);console.log(d),typeof d=="number"&&d>-1&&((c=i.frames)==null||c.splice(d,1),(u=i.layout)==null||u.splice(d,1),hO(r,i.layouts))}})},updateFrame:(n,r)=>{e(o=>{var a,l,c,u,d;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(p=>p.id===n),s=(c=i==null?void 0:i.frames)==null?void 0:c.findIndex(p=>p.id===r.id);i&&((u=i.frames)==null||u.splice(s,1,r)),(d=o.onAcceptChanges)==null||d.call(o,r,o.dashboard)})},updateCard:(n,r)=>{e(o=>{var a,l,c,u,d;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(p=>p.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(p=>p.id===r.id);i&&((u=i.cards)==null||u.splice(s,1,r),(d=o.onUpdateCard)==null||d.call(o,r,n))})},removeCard:(n,r)=>{e(o=>{var a,l,c,u,d,p;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(h=>h.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(h=>h.id===r.id);i&&((u=i.cards)==null||u.splice(s,1),(d=i.layout)==null||d.splice(s,1),(p=o.onRemoveCard)==null||p.call(o,r,n))})},setStyle:n=>{e(r=>{r.dashboard&&(r.dashboard.style=n)})},setSelectedCardId:(n,r)=>{e(o=>{var s,a,l;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===n);i&&(((l=i.cards)==null?void 0:l.find(u=>u.id===r))?o.selectedCardId=r:o.selectedCardId=null)})},setSelectedFrameId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId))&&(r.selectedFrameId=n)})},setSelectedSheetId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.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(o=>o.id===t().selectedSheetId)},getCardFrame:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.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((i=a[l].cards)==null?void 0:i.find(u=>u.id===n))return a[l]}}},getSelectedFrame:()=>{var r,o,i;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(s=>s.id===t().selectedSheetId);return(i=n==null?void 0:n.frames)==null?void 0:i.find(s=>s.id===t().selectedFrameId)},getCard:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.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=(i=a[l].cards)==null?void 0:i.find(u=>u.id===n);if(c)return c}}},getSelectedSheetLayout:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layout},getSelectedSheetLayouts:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.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 o,i;const r=(o=t().dashboard)==null?void 0:o.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((i=a[l].cards)==null?void 0:i.find(u=>u.id===n))return r[s]}}},handleDataPointClickAction:(n,r)=>{EX({card:n,dataPoint:r,get:t})}}}))),Yn=()=>ye(e=>e.actions);async function RX(e,t){const n=t.slice(0,16),r=new TextEncoder,o=await window.crypto.subtle.importKey("raw",r.encode(n),{name:"PBKDF2"},!1,["deriveKey"]),i=await window.crypto.subtle.deriveKey({name:"PBKDF2",salt:r.encode(n),iterations:1e5,hash:"SHA-256"},o,{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},i,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 kN(e,t){const n=t.slice(0,16),r=new TextEncoder,o=new TextDecoder,i=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"},i,{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:o.decode(p)}}catch(p){throw new Error(`Decryption failed: ${p}`)}}function me(...e){return LK(ad(e))}const TX=e=>Object.keys(e).length===0;async function kX(e,t,n={}){try{const r=new URLSearchParams(n).toString(),o=`${e}?${r}`,i=await fetch(o,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(!i.ok){const a=await i.json();throw new Error((a==null?void 0:a.error)||`HTTP error! status: ${i.status}`)}return await i.json()}catch(r){throw console.error("Error during fetch:",r),r}}async function Ay(e,t,n={}){try{const r=JSON.stringify(n),o=await RX(r,t),i=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(o)});if(!i.ok)return i.json().then(a=>{throw console.log(a.detail||"Unknown error occurred"),new Error((a==null?void 0:a.error)||`HTTP error! status: ${i.status}`)});const s=await i.json();if(s.payload){const a=await kN(s.payload,t);return JSON.parse(a.decryptedData)}return s}catch(r){throw console.error("Error during fetch:",r),r}}function PX(e){if(!e)return{tenantId:"",endUserId:""};const t=q_(e);return{tenantId:t==null?void 0:t.tenantId,endUserId:t==null?void 0:t.endUserId}}function OX(e){if(!e)return;const t=q_(e);if(t.params&&t.params.currencyFormat)return t.params.currencyFormat}function PN(e){return e?q_(e).params:void 0}function MX(e){return e.charAt(0).toUpperCase()+e.slice(1)}const ch="focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";async function AX(){var o,i;const e=(i=(o=ye.getState())==null?void 0:o.authToken)==null?void 0:i.accessToken;if(!e)return;const n=await fetch("https://semaphor.cloud/api/v1/invalidate-token",{method:"POST",headers:{Authorization:`Bearer ${e}`}});if(!n.ok)throw new Error("Failed to invalidate token");const r=await n.json();return console.log("invalidateToken",r),r}async function DX(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)),o=new URLSearchParams(r).toString();o&&(n+=`?${o}`);let s=await(await fetch(n,{headers:{Authorization:`Bearer ${e}`}})).json();if("payload"in s){const a=await kN(atob(s.payload),e);s=JSON.parse(a.decryptedData)}return s}async function IX(e){return e?await(await fetch("https://semaphor.cloud/api/v1/plugins",{headers:{Authorization:`Bearer ${e}`}})).json():null}const NX={theme:"system",setTheme:()=>null},ON=k.createContext(NX);function FX({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[o,i]=k.useState(()=>localStorage.getItem(n)||t);k.useEffect(()=>{const a=window.document.documentElement;if(a.classList.remove("light","dark"),o==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a.classList.add(l);return}a.classList.add(o)},[o]);const s={theme:o,setTheme:a=>{localStorage.setItem(n,a),i(a)}};return x.jsx(ON.Provider,{...r,value:s,children:e})}const MN=()=>{const e=k.useContext(ON);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};var wp=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(){}},Cc=typeof window>"u"||"Deno"in globalThis;function oi(){}function LX(e,t){return typeof e=="function"?e(t):e}function T1(e){return typeof e=="number"&&e>=0&&e!==1/0}function AN(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Nu(e,t){return typeof e=="function"?e(t):e}function Ti(e,t){return typeof e=="function"?e(t):e}function pO(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==iC(s,t.options))return!1}else if(!Fh(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||o&&o!==t.state.fetchStatus||i&&!i(t))}function gO(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Nh(t.options.mutationKey)!==Nh(i))return!1}else if(!Fh(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function iC(e,t){return((t==null?void 0:t.queryKeyHashFn)||Nh)(e)}function Nh(e){return JSON.stringify(e,(t,n)=>O1(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Fh(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Fh(e[n],t[n])):!1}function k1(e,t){if(e===t)return e;const n=mO(e)&&mO(t);if(n||O1(e)&&O1(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),s=i.length,a=n?[]:{};let l=0;for(let c=0;c<s;c++){const u=n?c:i[c];(!n&&r.includes(u)||n)&&e[u]===void 0&&t[u]===void 0?(a[u]=void 0,l++):(a[u]=k1(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return o===s&&l===o?e:a}return t}function P1(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 mO(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function O1(e){if(!bO(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!bO(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function bO(e){return Object.prototype.toString.call(e)==="[object Object]"}function $X(e){return new Promise(t=>{setTimeout(t,e)})}function M1(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 k1(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 k1(e,t)}return t}function jX(e){return e}function zX(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function BX(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var _b=Symbol();function DN(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===_b&&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===_b?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Zl,Pa,Yu,JI,HX=(JI=class extends wp{constructor(){super();ot(this,Zl);ot(this,Pa);ot(this,Yu);Be(this,Yu,t=>{if(!Cc&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){ae(this,Pa)||this.setEventListener(ae(this,Yu))}onUnsubscribe(){var t;this.hasListeners()||((t=ae(this,Pa))==null||t.call(this),Be(this,Pa,void 0))}setEventListener(t){var n;Be(this,Yu,t),(n=ae(this,Pa))==null||n.call(this),Be(this,Pa,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){ae(this,Zl)!==t&&(Be(this,Zl,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof ae(this,Zl)=="boolean"?ae(this,Zl):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Zl=new WeakMap,Pa=new WeakMap,Yu=new WeakMap,JI),sC=new HX,Ku,Oa,Xu,eN,WX=(eN=class extends wp{constructor(){super();ot(this,Ku,!0);ot(this,Oa);ot(this,Xu);Be(this,Xu,t=>{if(!Cc&&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(){ae(this,Oa)||this.setEventListener(ae(this,Xu))}onUnsubscribe(){var t;this.hasListeners()||((t=ae(this,Oa))==null||t.call(this),Be(this,Oa,void 0))}setEventListener(t){var n;Be(this,Xu,t),(n=ae(this,Oa))==null||n.call(this),Be(this,Oa,t(this.setOnline.bind(this)))}setOnline(t){ae(this,Ku)!==t&&(Be(this,Ku,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return ae(this,Ku)}},Ku=new WeakMap,Oa=new WeakMap,Xu=new WeakMap,eN),Cb=new WX;function A1(){let e,t;const n=new Promise((o,i)=>{e=o,t=i});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function VX(e){return Math.min(1e3*2**e,3e4)}function IN(e){return(e??"online")==="online"?Cb.isOnline():!0}var NN=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Ex(e){return e instanceof NN}function FN(e){let t=!1,n=0,r=!1,o;const i=A1(),s=b=>{var y;r||(p(new NN(b)),(y=e.abort)==null||y.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>sC.isFocused()&&(e.networkMode==="always"||Cb.isOnline())&&e.canRun(),u=()=>IN(e.networkMode)&&e.canRun(),d=b=>{var y;r||(r=!0,(y=e.onSuccess)==null||y.call(e,b),o==null||o(),i.resolve(b))},p=b=>{var y;r||(r=!0,(y=e.onError)==null||y.call(e,b),o==null||o(),i.reject(b))},h=()=>new Promise(b=>{var y;o=v=>{(r||c())&&b(v)},(y=e.onPause)==null||y.call(e)}).then(()=>{var b;o=void 0,r||(b=e.onContinue)==null||b.call(e)}),m=()=>{if(r)return;let b;const y=n===0?e.initialPromise:void 0;try{b=y??e.fn()}catch(v){b=Promise.reject(v)}Promise.resolve(b).then(d).catch(v=>{var E;if(r)return;const w=e.retry??(Cc?0:3),_=e.retryDelay??VX,R=typeof _=="function"?_(n,v):_,C=w===!0||typeof w=="number"&&n<w||typeof w=="function"&&w(n,v);if(t||!C){p(v);return}n++,(E=e.onFail)==null||E.call(e,n,v),$X(R).then(()=>c()?void 0:h()).then(()=>{t?p(v):m()})})};return{promise:i,cancel:s,continue:()=>(o==null||o(),i),cancelRetry:a,continueRetry:l,canStart:u,start:()=>(u()?m():h().then(m),i)}}function UX(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=a=>setTimeout(a,0);const i=a=>{t?e.push(a):o(()=>{n(a)})},s=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||s()}return l},batchCalls:a=>(...l)=>{i(()=>{a(...l)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var _r=UX(),Jl,tN,LN=(tN=class{constructor(){ot(this,Jl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),T1(this.gcTime)&&Be(this,Jl,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Cc?1/0:5*60*1e3))}clearGcTimeout(){ae(this,Jl)&&(clearTimeout(ae(this,Jl)),Be(this,Jl,void 0))}},Jl=new WeakMap,tN),Qu,Zu,ri,ec,Mr,mp,tc,Ei,Is,nN,GX=(nN=class extends LN{constructor(t){super();ot(this,Ei);ot(this,Qu);ot(this,Zu);ot(this,ri);ot(this,ec);ot(this,Mr);ot(this,mp);ot(this,tc);Be(this,tc,!1),Be(this,mp,t.defaultOptions),this.setOptions(t.options),this.observers=[],Be(this,ec,t.client),Be(this,ri,ae(this,ec).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Be(this,Qu,qX(this.options)),this.state=t.state??ae(this,Qu),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=ae(this,Mr))==null?void 0:t.promise}setOptions(t){this.options={...ae(this,mp),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&ae(this,ri).remove(this)}setData(t,n){const r=M1(this.state.data,t,this.options);return Wt(this,Ei,Is).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Wt(this,Ei,Is).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=ae(this,Mr))==null?void 0:r.promise;return(o=ae(this,Mr))==null||o.cancel(t),n?n.then(oi).catch(oi):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(ae(this,Qu))}isActive(){return this.observers.some(t=>Ti(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===_b||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||!AN(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=ae(this,Mr))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=ae(this,Mr))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),ae(this,ri).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(ae(this,Mr)&&(ae(this,tc)?ae(this,Mr).cancel({revert:!0}):ae(this,Mr).cancelRetry()),this.scheduleGc()),ae(this,ri).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Wt(this,Ei,Is).call(this,{type:"invalidate"})}fetch(t,n){var l,c,u;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(ae(this,Mr))return ae(this,Mr).continueRetry(),ae(this,Mr).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,o=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(Be(this,tc,!0),r.signal)})},i=()=>{const d=DN(this.options,n),p={client:ae(this,ec),queryKey:this.queryKey,meta:this.meta};return o(p),Be(this,tc,!1),this.options.persister?this.options.persister(d,p,this):d(p)},s={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:ae(this,ec),state:this.state,fetchFn:i};o(s),(l=this.options.behavior)==null||l.onFetch(s,this),Be(this,Zu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=s.fetchOptions)==null?void 0:c.meta))&&Wt(this,Ei,Is).call(this,{type:"fetch",meta:(u=s.fetchOptions)==null?void 0:u.meta});const a=d=>{var p,h,m,b;Ex(d)&&d.silent||Wt(this,Ei,Is).call(this,{type:"error",error:d}),Ex(d)||((h=(p=ae(this,ri).config).onError)==null||h.call(p,d,this),(b=(m=ae(this,ri).config).onSettled)==null||b.call(m,this.state.data,d,this)),this.scheduleGc()};return Be(this,Mr,FN({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(y){a(y);return}(h=(p=ae(this,ri).config).onSuccess)==null||h.call(p,d,this),(b=(m=ae(this,ri).config).onSettled)==null||b.call(m,d,this.state.error,this),this.scheduleGc()},onError:a,onFail:(d,p)=>{Wt(this,Ei,Is).call(this,{type:"failed",failureCount:d,error:p})},onPause:()=>{Wt(this,Ei,Is).call(this,{type:"pause"})},onContinue:()=>{Wt(this,Ei,Is).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0})),ae(this,Mr).start()}},Qu=new WeakMap,Zu=new WeakMap,ri=new WeakMap,ec=new WeakMap,Mr=new WeakMap,mp=new WeakMap,tc=new WeakMap,Ei=new WeakSet,Is=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...$N(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 o=t.error;return Ex(o)&&o.revert&&ae(this,Zu)?{...ae(this,Zu),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),_r.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),ae(this,ri).notify({query:this,type:"updated",action:t})})},nN);function $N(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:IN(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function qX(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 Gi,rN,jN=(rN=class extends wp{constructor(t={}){super();ot(this,Gi);this.config=t,Be(this,Gi,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??iC(o,n);let s=this.get(i);return s||(s=new GX({client:t,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){ae(this,Gi).has(t.queryHash)||(ae(this,Gi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=ae(this,Gi).get(t.queryHash);n&&(t.destroy(),n===t&&ae(this,Gi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){_r.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return ae(this,Gi).get(t)}getAll(){return[...ae(this,Gi).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>pO(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>pO(t,r)):n}notify(t){_r.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){_r.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){_r.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Gi=new WeakMap,rN),qi,Gr,nc,Yi,Ea,oN,YX=(oN=class extends LN{constructor(t){super();ot(this,Yi);ot(this,qi);ot(this,Gr);ot(this,nc);this.mutationId=t.mutationId,Be(this,Gr,t.mutationCache),Be(this,qi,[]),this.state=t.state||KX(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){ae(this,qi).includes(t)||(ae(this,qi).push(t),this.clearGcTimeout(),ae(this,Gr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Be(this,qi,ae(this,qi).filter(n=>n!==t)),this.scheduleGc(),ae(this,Gr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){ae(this,qi).length||(this.state.status==="pending"?this.scheduleGc():ae(this,Gr).remove(this))}continue(){var t;return((t=ae(this,nc))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,l,c,u,d,p,h,m,b,y,v,w,_,R,C,E,P;Be(this,nc,FN({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(A,I)=>{Wt(this,Yi,Ea).call(this,{type:"failed",failureCount:A,error:I})},onPause:()=>{Wt(this,Yi,Ea).call(this,{type:"pause"})},onContinue:()=>{Wt(this,Yi,Ea).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>ae(this,Gr).canRun(this)}));const n=this.state.status==="pending",r=!ae(this,nc).canStart();try{if(!n){Wt(this,Yi,Ea).call(this,{type:"pending",variables:t,isPaused:r}),await((i=(o=ae(this,Gr).config).onMutate)==null?void 0:i.call(o,t,this));const I=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));I!==this.state.context&&Wt(this,Yi,Ea).call(this,{type:"pending",context:I,variables:t,isPaused:r})}const A=await ae(this,nc).start();return await((c=(l=ae(this,Gr).config).onSuccess)==null?void 0:c.call(l,A,t,this.state.context,this)),await((d=(u=this.options).onSuccess)==null?void 0:d.call(u,A,t,this.state.context)),await((h=(p=ae(this,Gr).config).onSettled)==null?void 0:h.call(p,A,null,this.state.variables,this.state.context,this)),await((b=(m=this.options).onSettled)==null?void 0:b.call(m,A,null,t,this.state.context)),Wt(this,Yi,Ea).call(this,{type:"success",data:A}),A}catch(A){try{throw await((v=(y=ae(this,Gr).config).onError)==null?void 0:v.call(y,A,t,this.state.context,this)),await((_=(w=this.options).onError)==null?void 0:_.call(w,A,t,this.state.context)),await((C=(R=ae(this,Gr).config).onSettled)==null?void 0:C.call(R,void 0,A,this.state.variables,this.state.context,this)),await((P=(E=this.options).onSettled)==null?void 0:P.call(E,void 0,A,t,this.state.context)),A}finally{Wt(this,Yi,Ea).call(this,{type:"error",error:A})}}finally{ae(this,Gr).runNext(this)}}},qi=new WeakMap,Gr=new WeakMap,nc=new WeakMap,Yi=new WeakSet,Ea=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),_r.batch(()=>{ae(this,qi).forEach(r=>{r.onMutationUpdate(t)}),ae(this,Gr).notify({mutation:this,type:"updated",action:t})})},oN);function KX(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Bs,Ri,bp,iN,XX=(iN=class extends wp{constructor(t={}){super();ot(this,Bs);ot(this,Ri);ot(this,bp);this.config=t,Be(this,Bs,new Set),Be(this,Ri,new Map),Be(this,bp,0)}build(t,n,r){const o=new YX({mutationCache:this,mutationId:++Vg(this,bp)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){ae(this,Bs).add(t);const n=qg(t);if(typeof n=="string"){const r=ae(this,Ri).get(n);r?r.push(t):ae(this,Ri).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(ae(this,Bs).delete(t)){const n=qg(t);if(typeof n=="string"){const r=ae(this,Ri).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&ae(this,Ri).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=qg(t);if(typeof n=="string"){const r=ae(this,Ri).get(n),o=r==null?void 0:r.find(i=>i.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=qg(t);if(typeof n=="string"){const o=(r=ae(this,Ri).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){_r.batch(()=>{ae(this,Bs).forEach(t=>{this.notify({type:"removed",mutation:t})}),ae(this,Bs).clear(),ae(this,Ri).clear()})}getAll(){return Array.from(ae(this,Bs))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>gO(n,r))}findAll(t={}){return this.getAll().filter(n=>gO(t,n))}notify(t){_r.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return _r.batch(()=>Promise.all(t.map(n=>n.continue().catch(oi))))}},Bs=new WeakMap,Ri=new WeakMap,bp=new WeakMap,iN);function qg(e){var t;return(t=e.options.scope)==null?void 0:t.id}function yO(e){return{onFetch:(t,n)=>{var u,d,p,h,m;const r=t.options,o=(p=(d=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:p.direction,i=((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 y=_=>{Object.defineProperty(_,"signal",{enumerable:!0,get:()=>(t.signal.aborted?b=!0:t.signal.addEventListener("abort",()=>{b=!0}),t.signal)})},v=DN(t.options,t.fetchOptions),w=async(_,R,C)=>{if(b)return Promise.reject();if(R==null&&_.pages.length)return Promise.resolve(_);const E={client:t.client,queryKey:t.queryKey,pageParam:R,direction:C?"backward":"forward",meta:t.options.meta};y(E);const P=await v(E),{maxPages:A}=t.options,I=C?BX:zX;return{pages:I(_.pages,P,A),pageParams:I(_.pageParams,R,A)}};if(o&&i.length){const _=o==="backward",R=_?QX:vO,C={pages:i,pageParams:s},E=R(r,C);a=await w(C,E,_)}else{const _=e??i.length;do{const R=l===0?s[0]??r.initialPageParam:vO(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,y;return(y=(b=t.options).persister)==null?void 0:y.call(b,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function vO(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 QX(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 zn,Ma,Aa,Ju,ed,Da,td,nd,sN,ZX=(sN=class{constructor(e={}){ot(this,zn);ot(this,Ma);ot(this,Aa);ot(this,Ju);ot(this,ed);ot(this,Da);ot(this,td);ot(this,nd);Be(this,zn,e.queryCache||new jN),Be(this,Ma,e.mutationCache||new XX),Be(this,Aa,e.defaultOptions||{}),Be(this,Ju,new Map),Be(this,ed,new Map),Be(this,Da,0)}mount(){Vg(this,Da)._++,ae(this,Da)===1&&(Be(this,td,sC.subscribe(async e=>{e&&(await this.resumePausedMutations(),ae(this,zn).onFocus())})),Be(this,nd,Cb.subscribe(async e=>{e&&(await this.resumePausedMutations(),ae(this,zn).onOnline())})))}unmount(){var e,t;Vg(this,Da)._--,ae(this,Da)===0&&((e=ae(this,td))==null||e.call(this),Be(this,td,void 0),(t=ae(this,nd))==null||t.call(this),Be(this,nd,void 0))}isFetching(e){return ae(this,zn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return ae(this,Ma).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=ae(this,zn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=ae(this,zn).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Nu(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return ae(this,zn).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=ae(this,zn).get(r.queryHash),i=o==null?void 0:o.state.data,s=LX(t,i);if(s!==void 0)return ae(this,zn).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return _r.batch(()=>ae(this,zn).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=ae(this,zn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=ae(this,zn);_r.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=ae(this,zn);return _r.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=_r.batch(()=>ae(this,zn).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(oi).catch(oi)}invalidateQueries(e,t={}){return _r.batch(()=>(ae(this,zn).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=_r.batch(()=>ae(this,zn).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(oi)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(oi)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=ae(this,zn).build(this,t);return n.isStaleByTime(Nu(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(oi).catch(oi)}fetchInfiniteQuery(e){return e.behavior=yO(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(oi).catch(oi)}ensureInfiniteQueryData(e){return e.behavior=yO(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Cb.isOnline()?ae(this,Ma).resumePausedMutations():Promise.resolve()}getQueryCache(){return ae(this,zn)}getMutationCache(){return ae(this,Ma)}getDefaultOptions(){return ae(this,Aa)}setDefaultOptions(e){Be(this,Aa,e)}setQueryDefaults(e,t){ae(this,Ju).set(Nh(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...ae(this,Ju).values()],n={};return t.forEach(r=>{Fh(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){ae(this,ed).set(Nh(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...ae(this,ed).values()],n={};return t.forEach(r=>{Fh(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...ae(this,Aa).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=iC(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===_b&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...ae(this,Aa).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){ae(this,zn).clear(),ae(this,Ma).clear()}},zn=new WeakMap,Ma=new WeakMap,Aa=new WeakMap,Ju=new WeakMap,ed=new WeakMap,Da=new WeakMap,td=new WeakMap,nd=new WeakMap,sN),po,Vt,yp,qr,rc,rd,Ia,Ki,vp,od,id,oc,ic,Na,sd,an,Uf,D1,I1,N1,F1,L1,$1,j1,zN,aN,JX=(aN=class extends wp{constructor(t,n){super();ot(this,an);ot(this,po);ot(this,Vt);ot(this,yp);ot(this,qr);ot(this,rc);ot(this,rd);ot(this,Ia);ot(this,Ki);ot(this,vp);ot(this,od);ot(this,id);ot(this,oc);ot(this,ic);ot(this,Na);ot(this,sd,new Set);this.options=n,Be(this,po,t),Be(this,Ki,null),Be(this,Ia,A1()),this.options.experimental_prefetchInRender||ae(this,Ia).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&&(ae(this,Vt).addObserver(this),xO(ae(this,Vt),this.options)?Wt(this,an,Uf).call(this):this.updateResult(),Wt(this,an,F1).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return z1(ae(this,Vt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return z1(ae(this,Vt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Wt(this,an,L1).call(this),Wt(this,an,$1).call(this),ae(this,Vt).removeObserver(this)}setOptions(t,n){const r=this.options,o=ae(this,Vt);if(this.options=ae(this,po).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ti(this.options.enabled,ae(this,Vt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Wt(this,an,j1).call(this),ae(this,Vt).setOptions(this.options),r._defaulted&&!P1(this.options,r)&&ae(this,po).getQueryCache().notify({type:"observerOptionsUpdated",query:ae(this,Vt),observer:this});const i=this.hasListeners();i&&wO(ae(this,Vt),o,this.options,r)&&Wt(this,an,Uf).call(this),this.updateResult(n),i&&(ae(this,Vt)!==o||Ti(this.options.enabled,ae(this,Vt))!==Ti(r.enabled,ae(this,Vt))||Nu(this.options.staleTime,ae(this,Vt))!==Nu(r.staleTime,ae(this,Vt)))&&Wt(this,an,D1).call(this);const s=Wt(this,an,I1).call(this);i&&(ae(this,Vt)!==o||Ti(this.options.enabled,ae(this,Vt))!==Ti(r.enabled,ae(this,Vt))||s!==ae(this,Na))&&Wt(this,an,N1).call(this,s)}getOptimisticResult(t){const n=ae(this,po).getQueryCache().build(ae(this,po),t),r=this.createResult(n,t);return tQ(this,r)&&(Be(this,qr,r),Be(this,rd,this.options),Be(this,rc,ae(this,Vt).state)),r}getCurrentResult(){return ae(this,qr)}trackResult(t,n){const r={};return Object.keys(t).forEach(o=>{Object.defineProperty(r,o,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(o),n==null||n(o),t[o])})}),r}trackProp(t){ae(this,sd).add(t)}getCurrentQuery(){return ae(this,Vt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=ae(this,po).defaultQueryOptions(t),r=ae(this,po).getQueryCache().build(ae(this,po),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Wt(this,an,Uf).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),ae(this,qr)))}createResult(t,n){var A;const r=ae(this,Vt),o=this.options,i=ae(this,qr),s=ae(this,rc),a=ae(this,rd),c=t!==r?t.state:ae(this,yp),{state:u}=t;let d={...u},p=!1,h;if(n._optimisticResults){const I=this.hasListeners(),F=!I&&xO(t,n),L=I&&wO(t,r,n,o);(F||L)&&(d={...d,...$N(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:m,errorUpdatedAt:b,status:y}=d;if(n.select&&d.data!==void 0)if(i&&d.data===(s==null?void 0:s.data)&&n.select===ae(this,vp))h=ae(this,od);else try{Be(this,vp,n.select),h=n.select(d.data),h=M1(i==null?void 0:i.data,h,n),Be(this,od,h),Be(this,Ki,null)}catch(I){Be(this,Ki,I)}else h=d.data;if(n.placeholderData!==void 0&&h===void 0&&y==="pending"){let I;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))I=i.data;else if(I=typeof n.placeholderData=="function"?n.placeholderData((A=ae(this,id))==null?void 0:A.state.data,ae(this,id)):n.placeholderData,n.select&&I!==void 0)try{I=n.select(I),Be(this,Ki,null)}catch(F){Be(this,Ki,F)}I!==void 0&&(y="success",h=M1(i==null?void 0:i.data,I,n),p=!0)}ae(this,Ki)&&(m=ae(this,Ki),h=ae(this,od),b=Date.now(),y="error");const v=d.fetchStatus==="fetching",w=y==="pending",_=y==="error",R=w&&v,C=h!==void 0,P={status:y,fetchStatus:d.fetchStatus,isPending:w,isSuccess:y==="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:v,isRefetching:v&&!w,isLoadingError:_&&!C,isPaused:d.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:_&&C,isStale:aC(t,n),refetch:this.refetch,promise:ae(this,Ia)};if(this.options.experimental_prefetchInRender){const I=j=>{P.status==="error"?j.reject(P.error):P.data!==void 0&&j.resolve(P.data)},F=()=>{const j=Be(this,Ia,P.promise=A1());I(j)},L=ae(this,Ia);switch(L.status){case"pending":t.queryHash===r.queryHash&&I(L);break;case"fulfilled":(P.status==="error"||P.data!==L.value)&&F();break;case"rejected":(P.status!=="error"||P.error!==L.reason)&&F();break}}return P}updateResult(t){const n=ae(this,qr),r=this.createResult(ae(this,Vt),this.options);if(Be(this,rc,ae(this,Vt).state),Be(this,rd,this.options),ae(this,rc).data!==void 0&&Be(this,id,ae(this,Vt)),P1(r,n))return;Be(this,qr,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!ae(this,sd).size)return!0;const l=new Set(a??ae(this,sd));return this.options.throwOnError&&l.add("error"),Object.keys(ae(this,qr)).some(c=>{const u=c;return ae(this,qr)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),Wt(this,an,zN).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Wt(this,an,F1).call(this)}},po=new WeakMap,Vt=new WeakMap,yp=new WeakMap,qr=new WeakMap,rc=new WeakMap,rd=new WeakMap,Ia=new WeakMap,Ki=new WeakMap,vp=new WeakMap,od=new WeakMap,id=new WeakMap,oc=new WeakMap,ic=new WeakMap,Na=new WeakMap,sd=new WeakMap,an=new WeakSet,Uf=function(t){Wt(this,an,j1).call(this);let n=ae(this,Vt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(oi)),n},D1=function(){Wt(this,an,L1).call(this);const t=Nu(this.options.staleTime,ae(this,Vt));if(Cc||ae(this,qr).isStale||!T1(t))return;const r=AN(ae(this,qr).dataUpdatedAt,t)+1;Be(this,oc,setTimeout(()=>{ae(this,qr).isStale||this.updateResult()},r))},I1=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(ae(this,Vt)):this.options.refetchInterval)??!1},N1=function(t){Wt(this,an,$1).call(this),Be(this,Na,t),!(Cc||Ti(this.options.enabled,ae(this,Vt))===!1||!T1(ae(this,Na))||ae(this,Na)===0)&&Be(this,ic,setInterval(()=>{(this.options.refetchIntervalInBackground||sC.isFocused())&&Wt(this,an,Uf).call(this)},ae(this,Na)))},F1=function(){Wt(this,an,D1).call(this),Wt(this,an,N1).call(this,Wt(this,an,I1).call(this))},L1=function(){ae(this,oc)&&(clearTimeout(ae(this,oc)),Be(this,oc,void 0))},$1=function(){ae(this,ic)&&(clearInterval(ae(this,ic)),Be(this,ic,void 0))},j1=function(){const t=ae(this,po).getQueryCache().build(ae(this,po),this.options);if(t===ae(this,Vt))return;const n=ae(this,Vt);Be(this,Vt,t),Be(this,yp,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},zN=function(t){_r.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(ae(this,qr))}),ae(this,po).getQueryCache().notify({query:ae(this,Vt),type:"observerResultsUpdated"})})},aN);function eQ(e,t){return Ti(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function xO(e,t){return eQ(e,t)||e.state.data!==void 0&&z1(e,t,t.refetchOnMount)}function z1(e,t,n){if(Ti(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&aC(e,t)}return!1}function wO(e,t,n,r){return(e!==t||Ti(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&aC(e,n)}function aC(e,t){return Ti(t.enabled,e)!==!1&&e.isStaleByTime(Nu(t.staleTime,e))}function tQ(e,t){return!P1(e.getCurrentResult(),t)}var lC=T.createContext(void 0),cC=e=>{const t=T.useContext(lC);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},nQ=({client:e,children:t})=>(T.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),x.jsx(lC.Provider,{value:e,children:t})),BN=T.createContext(!1),rQ=()=>T.useContext(BN);BN.Provider;function oQ(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var iQ=T.createContext(oQ()),sQ=()=>T.useContext(iQ);function aQ(e,t){return typeof e=="function"?e(...t):!!e}function SO(){}var lQ=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},cQ=e=>{T.useEffect(()=>{e.clearReset()},[e])},uQ=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||aQ(n,[e.error,r])),dQ=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)))},fQ=(e,t)=>e.isLoading&&e.isFetching&&!t,hQ=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,_O=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function pQ(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=cC(),o=rQ(),i=sQ(),s=r.defaultQueryOptions(e);(p=(d=r.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||p.call(d,s),process.env.NODE_ENV!=="production"&&(s.queryFn||console.error(`[${s.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),s._optimisticResults=o?"isRestoring":"optimistic",dQ(s),lQ(s,i),cQ(i);const a=!r.getQueryCache().get(s.queryHash),[l]=T.useState(()=>new t(r,s)),c=l.getOptimisticResult(s),u=!o&&e.subscribed!==!1;if(T.useSyncExternalStore(T.useCallback(y=>{const v=u?l.subscribe(_r.batchCalls(y)):SO;return l.updateResult(),v},[l,u]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),T.useEffect(()=>{l.setOptions(s,{listeners:!1})},[s,l]),hQ(s,c))throw _O(s,l,i);if(uQ({result:c,errorResetBoundary:i,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash),suspense:s.suspense}))throw c.error;if((m=(h=r.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||m.call(h,s,c),s.experimental_prefetchInRender&&!Cc&&fQ(c,o)){const y=a?_O(s,l,i):(b=r.getQueryCache().get(s.queryHash))==null?void 0:b.promise;y==null||y.catch(SO).finally(()=>{l.updateResult()})}return s.notifyOnChangeProps?c:l.trackResult(c)}function Sp(e,t){return pQ(e,JX)}function gQ(){const e=k.useContext(lC);if(e&&e.isSemaphorClient)return e}function HN({children:e}){const{setIsSessionExpired:t}=Yn(),n=gQ(),[r]=k.useState(()=>{const o=new ZX({queryCache:new jN({onError:i=>{i instanceof Error?(console.error(`Something went wrong: ${i.message}`),i.message==="invalid token"&&t(!0)):console.error("Something went wrong:",i)}}),defaultOptions:{queries:{gcTime:36e5,staleTime:3e5,refetchOnWindowFocus:!1,retry:1}}});return o.isSemaphorClient=!0,o});return n?x.jsx(x.Fragment,{children:e}):x.jsx(nQ,{client:r,children:e})}const Lc=k.forwardRef(({children:e,className:t,...n},r)=>x.jsx("div",{className:me("semaphor-scope",t),ref:r,...n,children:e})),mQ={id:"",authToken:void 0},WN=k.createContext(mQ),VN=({children:e,dashboardProps:t})=>x.jsx(HN,{children:x.jsx(WN.Provider,{value:t,children:x.jsx(Lc,{style:{height:"100%"},children:e})})});function Uo(){const e=k.useContext(WN);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function bQ(){const{authToken:e,version:t}=Uo(),n=ye(a=>a.selectedLensId),{data:r,isLoading:o,isFetching:i,isError:s}=Sp({queryKey:["dashboard",n,e==null?void 0:e.accessToken],queryFn:()=>DX(e==null?void 0:e.accessToken,{lensId:n,version:t}),enabled:!!(e!=null&&e.accessToken)});return{data:r,isLoading:o,isFetching:i,isError:s}}function yQ(){const{authToken:e}=Uo(),t=ye(r=>r.authToken),{setAuthToken:n}=Yn();return k.useEffect(()=>{e&&(e==null?void 0:e.toString())!==(t==null?void 0:t.toString())&&n(e)},[e,t,n]),e}function UN(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function CO(e,t){const n=UN(e);return n==="dark"?sc.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function vQ({customStyle:e,currentTheme:t,onSave:n,onEvent:r,defaultFilterValues:o,selectedSheetId:i,onFilterValuesChange:s}){const{authToken:a}=Uo();yQ();const l=ye(B=>B.selectedLensId),{data:c,isLoading:u,isFetching:d,isError:p}=bQ(),[h,m]=k.useState(o||[]),{theme:b,setTheme:y}=MN(),v=ye(B=>B.dashboard.globalStyle),{setDashboard:w,setDashboardWithFilterValues:_,setSelectedSheetId:R,setStyle:C,setOnSaveFunction:E,setLenses:P,setSelectedLensId:A,setInitStore:I}=Yn();ye(B=>B.actions.setCustomCards);const F=ye(B=>B.actions.setFilterValues),L=ye(B=>B.filterValues),j=ye(B=>B.actions.setThemeStyle),X=ye(B=>B.actions.setDashboardTheme),U=ye(B=>B.actions.setOnEvent);k.useEffect(()=>{a&&I()},[a,I]),k.useEffect(()=>{if(b){const B=UN(b);X(B)}},[b,X]),k.useEffect(()=>{t&&y(t)},[t,y]);const $=k.useCallback(()=>{const B=sc.cloneDeep(wb),W=sc.merge(B,v);if(e){const q=sc.merge(W,e),Q=CO(b,q);j(Q),C(q)}else{const q=CO(b,W);j(q),C(wb)}},[b,e,v,j,C]);return k.useEffect(()=>{c&&c.dashboard&&$()},[b,e,v,$,c]),k.useEffect(()=>{var V,M;function B(ee,K){const re=ee.filters||[],Y=[];for(const J of K){const ie=re.find(de=>de.id===J.filterId);ie&&Y.push({filterId:J.filterId,connectionType:ie.database==="NA"?"api":"database",name:ie.column,operation:ie.operation,valueType:Iu(ie),values:J.values})}return Y}if(!c||!c.dashboard)return;const{dashboard:W,filterValues:q,defaultLensId:Q,lenses:D}=c,G=B(W,h||[]);_(W,(!q||(q==null?void 0:q.length)===0?G:q)||[]),Q&&A(Q),D&&P(D),R(i||((M=(V=W==null?void 0:W.sheets)==null?void 0:V[0])==null?void 0:M.id)||null)},[c,w,R,F,l,P,_,A,h,i]),k.useEffect(()=>{s&&L&&s(L)},[L,s]),k.useEffect(()=>{n&&E(n),r&&U(r)},[n,E,r,U]),{isFetching:d,isLoading:u,isError:p}}function Fu({className:e,...t}){return x.jsx("div",{className:me("animate-pulse rounded-md bg-muted",e),...t})}const GN=T.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:me("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));GN.displayName="Card";const Dy=T.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:me("flex flex-col space-y-1.5 p-6",e),...t}));Dy.displayName="CardHeader";const Id=T.forwardRef(({className:e,...t},n)=>x.jsx("h3",{ref:n,className:me("text-2xl font-semibold leading-none tracking-tight",e),...t}));Id.displayName="CardTitle";const uC=T.forwardRef(({className:e,...t},n)=>x.jsx("p",{ref:n,className:me("text-sm text-muted-foreground",e),...t}));uC.displayName="CardDescription";const Iy=T.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:me("px-6 pt-0",e),...t}));Iy.displayName="CardContent";const qN=T.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:me("flex items-center p-6 pt-0",e),...t}));qN.displayName="CardFooter";function YN({className:e,customStyle:t,onSave:n,onEvent:r,LoadingComponent:o,ErrorComponent:i,onChartElementClicked:s,id:a,authToken:l,currentTheme:c,version:u,customCards:d,showAssistant:p,defaultFilterValues:h,onFilterValuesChange:m,selectedSheetId:b,...y}){const{placeholders:v}=Uo(),w=ye(E=>E.themeStyle),_=ye(E=>E.isSessionExpired),{isLoading:R,isError:C}=vQ({customStyle:t,currentTheme:c,onSave:n,onEvent:r,defaultFilterValues:h,onFilterValuesChange:m,selectedSheetId:b});return R||!l?(r==null||r({type:"info",message:"Loading dashboard"}),o?x.jsx(o,{message:"loading"}):x.jsx("div",{className:"flex items-center gap-3",children:x.jsx(Fu,{className:"h-1 w-full dark:h-[2px]"})})):C?(r==null||r({type:"error",message:"Error fetching dashboard"}),i?(console.log("Error fetching dashboard"),x.jsx(i,{})):x.jsx("div",{children:"Error"})):_?(r==null||r({type:"error",message:"Session Expired"}),v!=null&&v.SessionExpired?x.jsx("div",{className:"flex h-full items-center justify-center",children:x.jsx("div",{children:v.SessionExpired})}):x.jsx("div",{className:"flex h-full items-center justify-center",children:x.jsxs("div",{className:"space-y-4 rounded-md border border-muted p-10",children:[x.jsx(Id,{children:"Session Expired"}),x.jsx("p",{className:"text-muted-foreground",children:"Please refresh your page to continue."})]})})):x.jsx("div",{className:me("flex h-full flex-col justify-between",w==null?void 0:w.dashboardPanel,e),style:{},role:"dashboard-panel",...y})}function Te(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function xQ(e,t){const n=T.createContext(t),r=i=>{const{children:s,...a}=i,l=T.useMemo(()=>a,Object.values(a));return x.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function o(i){const s=T.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function lr(e,t=[]){let n=[];function r(i,s){const a=T.createContext(s),l=n.length;n=[...n,s];const c=d=>{var v;const{scope:p,children:h,...m}=d,b=((v=p==null?void 0:p[e])==null?void 0:v[l])||a,y=T.useMemo(()=>m,Object.values(m));return x.jsx(b.Provider,{value:y,children:h})};c.displayName=i+"Provider";function u(d,p){var b;const h=((b=p==null?void 0:p[e])==null?void 0:b[l])||a,m=T.useContext(h);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[c,u]}const o=()=>{const i=n.map(s=>T.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return T.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,wQ(o,...t)]}function wQ(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(i)[`__scope${c}`];return{...a,...d}},{});return T.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function EO(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ny(...e){return t=>{let n=!1;const r=e.map(o=>{const i=EO(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():EO(e[o],null)}}}}function dt(...e){return T.useCallback(Ny(...e),e)}var Js=T.forwardRef((e,t)=>{const{children:n,...r}=e,o=T.Children.toArray(n),i=o.find(SQ);if(i){const s=i.props.children,a=o.map(l=>l===i?T.Children.count(s)>1?T.Children.only(null):T.isValidElement(s)?s.props.children:null:l);return x.jsx(B1,{...r,ref:t,children:T.isValidElement(s)?T.cloneElement(s,void 0,a):null})}return x.jsx(B1,{...r,ref:t,children:n})});Js.displayName="Slot";var B1=T.forwardRef((e,t)=>{const{children:n,...r}=e;if(T.isValidElement(n)){const o=CQ(n),i=_Q(r,n.props);return n.type!==T.Fragment&&(i.ref=t?Ny(t,o):o),T.cloneElement(n,i)}return T.Children.count(n)>1?T.Children.only(null):null});B1.displayName="SlotClone";var dC=({children:e})=>x.jsx(x.Fragment,{children:e});function SQ(e){return T.isValidElement(e)&&e.type===dC}function _Q(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function CQ(e){var r,o;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=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Fy(e){const t=e+"CollectionProvider",[n,r]=lr(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=h=>{const{scope:m,children:b}=h,y=k.useRef(null),v=k.useRef(new Map).current;return x.jsx(o,{scope:m,itemMap:v,collectionRef:y,children:b})};s.displayName=t;const a=e+"CollectionSlot",l=k.forwardRef((h,m)=>{const{scope:b,children:y}=h,v=i(a,b),w=dt(m,v.collectionRef);return x.jsx(Js,{ref:w,children:y})});l.displayName=a;const c=e+"CollectionItemSlot",u="data-radix-collection-item",d=k.forwardRef((h,m)=>{const{scope:b,children:y,...v}=h,w=k.useRef(null),_=dt(m,w),R=i(c,b);return k.useEffect(()=>(R.itemMap.set(w,{ref:w,...v}),()=>void R.itemMap.delete(w))),x.jsx(Js,{[u]:"",ref:_,children:y})});d.displayName=c;function p(h){const m=i(e+"CollectionConsumer",h);return k.useCallback(()=>{const y=m.collectionRef.current;if(!y)return[];const v=Array.from(y.querySelectorAll(`[${u}]`));return Array.from(m.itemMap.values()).sort((R,C)=>v.indexOf(R.ref.current)-v.indexOf(C.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:s,Slot:l,ItemSlot:d},p,r]}var Cr=globalThis!=null&&globalThis.document?T.useLayoutEffect:()=>{},EQ=T.useId||(()=>{}),RQ=0;function Jn(e){const[t,n]=T.useState(EQ());return Cr(()=>{n(r=>r??String(RQ++))},[e]),t?`radix-${t}`:""}var TQ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],je=TQ.reduce((e,t)=>{const n=T.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?Js:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(a,{...s,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function KN(e,t){e&&wc.flushSync(()=>e.dispatchEvent(t))}function ir(e){const t=T.useRef(e);return T.useEffect(()=>{t.current=e}),T.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,o]=kQ({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=ir(n),l=T.useCallback(c=>{if(i){const d=typeof c=="function"?c(e):c;d!==e&&a(d)}else o(c)},[i,e,o,a]);return[s,l]}function kQ({defaultProp:e,onChange:t}){const n=T.useState(e),[r]=n,o=T.useRef(r),i=ir(t);return T.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}var PQ=T.createContext(void 0);function $c(e){const t=T.useContext(PQ);return e||t||"ltr"}var Rx="rovingFocusGroup.onEntryFocus",OQ={bubbles:!1,cancelable:!0},Ly="RovingFocusGroup",[H1,XN,MQ]=Fy(Ly),[AQ,Nd]=lr(Ly,[MQ]),[DQ,IQ]=AQ(Ly),QN=T.forwardRef((e,t)=>x.jsx(H1.Provider,{scope:e.__scopeRovingFocusGroup,children:x.jsx(H1.Slot,{scope:e.__scopeRovingFocusGroup,children:x.jsx(NQ,{...e,ref:t})})}));QN.displayName=Ly;var NQ=T.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,p=T.useRef(null),h=dt(t,p),m=$c(i),[b=null,y]=$r({prop:s,defaultProp:a,onChange:l}),[v,w]=T.useState(!1),_=ir(c),R=XN(n),C=T.useRef(!1),[E,P]=T.useState(0);return T.useEffect(()=>{const A=p.current;if(A)return A.addEventListener(Rx,_),()=>A.removeEventListener(Rx,_)},[_]),x.jsx(DQ,{scope:n,orientation:r,dir:m,loop:o,currentTabStopId:b,onItemFocus:T.useCallback(A=>y(A),[y]),onItemShiftTab:T.useCallback(()=>w(!0),[]),onFocusableItemAdd:T.useCallback(()=>P(A=>A+1),[]),onFocusableItemRemove:T.useCallback(()=>P(A=>A-1),[]),children:x.jsx(je.div,{tabIndex:v||E===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:"none",...e.style},onMouseDown:Te(e.onMouseDown,()=>{C.current=!0}),onFocus:Te(e.onFocus,A=>{const I=!C.current;if(A.target===A.currentTarget&&I&&!v){const F=new CustomEvent(Rx,OQ);if(A.currentTarget.dispatchEvent(F),!F.defaultPrevented){const L=R().filter(B=>B.focusable),j=L.find(B=>B.active),X=L.find(B=>B.id===b),$=[j,X,...L].filter(Boolean).map(B=>B.ref.current);e5($,u)}}C.current=!1}),onBlur:Te(e.onBlur,()=>w(!1))})})}),ZN="RovingFocusGroupItem",JN=T.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=Jn(),l=i||a,c=IQ(ZN,n),u=c.currentTabStopId===l,d=XN(n),{onFocusableItemAdd:p,onFocusableItemRemove:h}=c;return T.useEffect(()=>{if(r)return p(),()=>h()},[r,p,h]),x.jsx(H1.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:x.jsx(je.span,{tabIndex:u?0:-1,"data-orientation":c.orientation,...s,ref:t,onMouseDown:Te(e.onMouseDown,m=>{r?c.onItemFocus(l):m.preventDefault()}),onFocus:Te(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:Te(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){c.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const b=$Q(m,c.orientation,c.dir);if(b!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let v=d().filter(w=>w.focusable).map(w=>w.ref.current);if(b==="last")v.reverse();else if(b==="prev"||b==="next"){b==="prev"&&v.reverse();const w=v.indexOf(m.currentTarget);v=c.loop?jQ(v,w+1):v.slice(w+1)}setTimeout(()=>e5(v))}})})})});JN.displayName=ZN;var FQ={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function LQ(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function $Q(e,t,n){const r=LQ(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return FQ[r]}function e5(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function jQ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var fC=QN,hC=JN;function zQ(e,t){return T.useReducer((n,r)=>t[n][r]??n,e)}var er=e=>{const{present:t,children:n}=e,r=BQ(t),o=typeof n=="function"?n({present:r.isPresent}):T.Children.only(n),i=dt(r.ref,HQ(o));return typeof n=="function"||r.isPresent?T.cloneElement(o,{ref:i}):null};er.displayName="Presence";function BQ(e){const[t,n]=T.useState(),r=T.useRef({}),o=T.useRef(e),i=T.useRef("none"),s=e?"mounted":"unmounted",[a,l]=zQ(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return T.useEffect(()=>{const c=Yg(r.current);i.current=a==="mounted"?c:"none"},[a]),Cr(()=>{const c=r.current,u=o.current;if(u!==e){const p=i.current,h=Yg(c);e?l("MOUNT"):h==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&p!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Cr(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,d=h=>{const b=Yg(r.current).includes(h.animationName);if(h.target===t&&b&&(l("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},p=h=>{h.target===t&&(i.current=Yg(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:T.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Yg(e){return(e==null?void 0:e.animationName)||"none"}function HQ(e){var r,o;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=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var pC="Tabs",[WQ,DAe]=lr(pC,[Nd]),t5=Nd(),[VQ,gC]=WQ(pC),n5=T.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=$c(a),[d,p]=$r({prop:r,onChange:o,defaultProp:i});return x.jsx(VQ,{scope:n,baseId:Jn(),value:d,onValueChange:p,orientation:s,dir:u,activationMode:l,children:x.jsx(je.div,{dir:u,"data-orientation":s,...c,ref:t})})});n5.displayName=pC;var r5="TabsList",o5=T.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=gC(r5,n),s=t5(n);return x.jsx(fC,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:r,children:x.jsx(je.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});o5.displayName=r5;var i5="TabsTrigger",s5=T.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=gC(i5,n),a=t5(n),l=c5(s.baseId,r),c=u5(s.baseId,r),u=r===s.value;return x.jsx(hC,{asChild:!0,...a,focusable:!o,active:u,children:x.jsx(je.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l,...i,ref:t,onMouseDown:Te(e.onMouseDown,d=>{!o&&d.button===0&&d.ctrlKey===!1?s.onValueChange(r):d.preventDefault()}),onKeyDown:Te(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&s.onValueChange(r)}),onFocus:Te(e.onFocus,()=>{const d=s.activationMode!=="manual";!u&&!o&&d&&s.onValueChange(r)})})})});s5.displayName=i5;var a5="TabsContent",l5=T.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=gC(a5,n),l=c5(a.baseId,r),c=u5(a.baseId,r),u=r===a.value,d=T.useRef(u);return T.useEffect(()=>{const p=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(p)},[]),x.jsx(er,{present:o||u,children:({present:p})=>x.jsx(je.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&&i})})});l5.displayName=a5;function c5(e,t){return`${e}-trigger-${t}`}function u5(e,t){return`${e}-content-${t}`}var UQ=n5,d5=o5,f5=s5,h5=l5;const mC=UQ,$y=T.forwardRef(({className:e,...t},n)=>x.jsx(d5,{ref:n,className:me("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));$y.displayName=d5.displayName;const jy=T.forwardRef(({className:e,...t},n)=>x.jsx(f5,{ref:n,className:me("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));jy.displayName=f5.displayName;const bC=T.forwardRef(({className:e,...t},n)=>x.jsx(h5,{ref:n,className:me("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));bC.displayName=h5.displayName;var p5={exports:{}},_p={},W1={exports:{}};(function(e,t){(function(n,r){r(t)})(Xi,function(n){function r(J){return function(de,he,se,ge,ue,Ce,ke){return J(de,he,ke)}}function o(J){return function(de,he,se,ge){if(!de||!he||typeof de!="object"||typeof he!="object")return J(de,he,se,ge);var ue=ge.get(de),Ce=ge.get(he);if(ue&&Ce)return ue===he&&Ce===de;ge.set(de,he),ge.set(he,de);var ke=J(de,he,se,ge);return ge.delete(de),ge.delete(he),ke}}function i(J,ie){var de={};for(var he in J)de[he]=J[he];for(var he in ie)de[he]=ie[he];return de}function s(J){return J.constructor===Object||J.constructor==null}function a(J){return typeof J.then=="function"}function l(J,ie){return J===ie||J!==J&&ie!==ie}var c="[object Arguments]",u="[object Boolean]",d="[object Date]",p="[object RegExp]",h="[object Map]",m="[object Number]",b="[object Object]",y="[object Set]",v="[object String]",w=Object.prototype.toString;function _(J){var ie=J.areArraysEqual,de=J.areDatesEqual,he=J.areMapsEqual,se=J.areObjectsEqual,ge=J.areRegExpsEqual,ue=J.areSetsEqual,Ce=J.createIsNestedEqual,ke=Ce(Ne);function Ne(Oe,Le,Je){if(Oe===Le)return!0;if(!Oe||!Le||typeof Oe!="object"||typeof Le!="object")return Oe!==Oe&&Le!==Le;if(s(Oe)&&s(Le))return se(Oe,Le,ke,Je);var it=Array.isArray(Oe),ln=Array.isArray(Le);if(it||ln)return it===ln&&ie(Oe,Le,ke,Je);var vt=w.call(Oe);return vt!==w.call(Le)?!1:vt===d?de(Oe,Le,ke,Je):vt===p?ge(Oe,Le,ke,Je):vt===h?he(Oe,Le,ke,Je):vt===y?ue(Oe,Le,ke,Je):vt===b||vt===c?a(Oe)||a(Le)?!1:se(Oe,Le,ke,Je):vt===u||vt===m||vt===v?l(Oe.valueOf(),Le.valueOf()):!1}return Ne}function R(J,ie,de,he){var se=J.length;if(ie.length!==se)return!1;for(;se-- >0;)if(!de(J[se],ie[se],se,se,J,ie,he))return!1;return!0}var C=o(R);function E(J,ie){return l(J.valueOf(),ie.valueOf())}function P(J,ie,de,he){var se=J.size===ie.size;if(!se)return!1;if(!J.size)return!0;var ge={},ue=0;return J.forEach(function(Ce,ke){if(se){var Ne=!1,Oe=0;ie.forEach(function(Le,Je){!Ne&&!ge[Oe]&&(Ne=de(ke,Je,ue,Oe,J,ie,he)&&de(Ce,Le,ke,Je,J,ie,he))&&(ge[Oe]=!0),Oe++}),ue++,se=Ne}}),se}var A=o(P),I="_owner",F=Object.prototype.hasOwnProperty;function L(J,ie,de,he){var se=Object.keys(J),ge=se.length;if(Object.keys(ie).length!==ge)return!1;for(var ue;ge-- >0;){if(ue=se[ge],ue===I){var Ce=!!J.$$typeof,ke=!!ie.$$typeof;if((Ce||ke)&&Ce!==ke)return!1}if(!F.call(ie,ue)||!de(J[ue],ie[ue],ue,ue,J,ie,he))return!1}return!0}var j=o(L);function X(J,ie){return J.source===ie.source&&J.flags===ie.flags}function U(J,ie,de,he){var se=J.size===ie.size;if(!se)return!1;if(!J.size)return!0;var ge={};return J.forEach(function(ue,Ce){if(se){var ke=!1,Ne=0;ie.forEach(function(Oe,Le){!ke&&!ge[Ne]&&(ke=de(ue,Oe,Ce,Le,J,ie,he))&&(ge[Ne]=!0),Ne++}),se=ke}}),se}var $=o(U),B=Object.freeze({areArraysEqual:R,areDatesEqual:E,areMapsEqual:P,areObjectsEqual:L,areRegExpsEqual:X,areSetsEqual:U,createIsNestedEqual:r}),W=Object.freeze({areArraysEqual:C,areDatesEqual:E,areMapsEqual:A,areObjectsEqual:j,areRegExpsEqual:X,areSetsEqual:$,createIsNestedEqual:r}),q=_(B);function Q(J,ie){return q(J,ie,void 0)}var D=_(i(B,{createIsNestedEqual:function(){return l}}));function G(J,ie){return D(J,ie,void 0)}var V=_(W);function M(J,ie){return V(J,ie,new WeakMap)}var ee=_(i(W,{createIsNestedEqual:function(){return l}}));function K(J,ie){return ee(J,ie,new WeakMap)}function re(J){return _(i(B,J(B)))}function Y(J){var ie=_(i(W,J(W)));return function(de,he,se){return se===void 0&&(se=new WeakMap),ie(de,he,se)}}n.circularDeepEqual=M,n.circularShallowEqual=K,n.createCustomCircularEqual=Y,n.createCustomEqual=re,n.deepEqual=Q,n.sameValueZeroEqual=l,n.shallowEqual=G,Object.defineProperty(n,"__esModule",{value:!0})})})(W1,W1.exports);var yC=W1.exports;const vC=U_(iK);var Dt={},GQ=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(Dt,"__esModule",{value:!0});Dt.bottom=xC;Dt.childrenEqual=XQ;Dt.cloneLayout=g5;Dt.cloneLayoutItem=ac;Dt.collides=zy;Dt.compact=b5;Dt.compactItem=y5;Dt.compactType=cZ;Dt.correctBounds=v5;Dt.fastPositionEqual=QQ;Dt.fastRGLPropsEqual=void 0;Dt.getAllCollisions=x5;Dt.getFirstCollision=Wl;Dt.getLayoutItem=wC;Dt.getStatics=SC;Dt.modifyLayout=m5;Dt.moveElement=qf;Dt.moveElementAwayFromCollision=U1;Dt.noop=void 0;Dt.perc=JQ;Dt.resizeItemInDirection=iZ;Dt.setTopLeft=aZ;Dt.setTransform=sZ;Dt.sortLayoutItems=kC;Dt.sortLayoutItemsByColRow=E5;Dt.sortLayoutItemsByRowCol=C5;Dt.synchronizeLayoutWithChildren=lZ;Dt.validateLayout=R5;Dt.withLayoutItem=KQ;var RO=yC,Gf=qQ(k);function qQ(e){return e&&e.__esModule?e:{default:e}}const YQ=process.env.NODE_ENV==="production";function xC(e){let t=0,n;for(let r=0,o=e.length;r<o;r++)n=e[r].y+e[r].h,n>t&&(t=n);return t}function g5(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=ac(e[n]);return t}function m5(e,t){const n=Array(e.length);for(let r=0,o=e.length;r<o;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function KQ(e,t,n){let r=wC(e,t);return r?(r=n(ac(r)),e=m5(e,r),[e,r]):[e,null]}function ac(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 XQ(e,t){return(0,RO.deepEqual)(Gf.default.Children.map(e,n=>n==null?void 0:n.key),Gf.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,RO.deepEqual)(Gf.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),Gf.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}Dt.fastRGLPropsEqual=GQ;function QQ(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function zy(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 b5(e,t,n,r){const o=SC(e),i=kC(e,t),s=Array(e.length);for(let a=0,l=i.length;a<l;a++){let c=ac(i[a]);c.static||(c=y5(o,c,t,n,i,r),o.push(c)),s[e.indexOf(i[a])]=c,c.moved=!1}return s}const ZQ={x:"w",y:"h"};function V1(e,t,n,r){const o=ZQ[r];t[r]+=1;const i=e.map(s=>s.i).indexOf(t.i);for(let s=i+1;s<e.length;s++){const a=e[s];if(!a.static){if(a.y>t.y+t.h)break;zy(t,a)&&V1(e,a,n+t[o],r)}}t[r]=n}function y5(e,t,n,r,o,i){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(xC(e),t.y);t.y>0&&!Wl(e,t);)t.y--;else if(a)for(;t.x>0&&!Wl(e,t);)t.x--;let l;for(;(l=Wl(e,t))&&!(n===null&&i);)if(a?V1(o,t,l.x+l.w,"x"):V1(o,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!Wl(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function v5(e,t){const n=SC(e);for(let r=0,o=e.length;r<o;r++){const i=e[r];if(i.x+i.w>t.cols&&(i.x=t.cols-i.w),i.x<0&&(i.x=0,i.w=t.cols),!i.static)n.push(i);else for(;Wl(n,i);)i.y++}return e}function wC(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function Wl(e,t){for(let n=0,r=e.length;n<r;n++)if(zy(e[n],t))return e[n]}function x5(e,t){return e.filter(n=>zy(n,t))}function SC(e){return e.filter(t=>t.static)}function qf(e,t,n,r,o,i,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=kC(e,s);(s==="vertical"&&typeof r=="number"?u>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(d=d.reverse());const h=x5(d,t),m=h.length>0;if(m&&l)return g5(e);if(m&&i)return`${t.i}`,t.x=c,t.y=u,t.moved=!1,e;for(let b=0,y=h.length;b<y;b++){const v=h[b];`${t.i}${t.x}${t.y}${v.i}${v.x}${v.y}`,!v.moved&&(v.static?e=U1(e,v,t,o,s):e=U1(e,t,v,o,s))}return e}function U1(e,t,n,r,o,i){const s=o==="horizontal",a=o==="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=Wl(e,d),h=p&&p.y+p.h>t.y,m=p&&t.x+t.w>p.x;if(p){if(h&&a)return qf(e,n,void 0,t.y+1,r,l,o);if(h&&o==null)return t.y=n.y,n.y=n.y+n.h,e;if(m&&s)return qf(e,t,n.x,void 0,r,l,o)}else return`${n.i}${d.x}${d.y}`,qf(e,n,s?d.x:void 0,a?d.y:void 0,r,l,o)}const c=s?n.x+1:void 0,u=a?n.y+1:void 0;return c==null&&u==null?e:qf(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,o)}function JQ(e){return e*100+"%"}const w5=(e,t,n,r)=>e+n>r?t:n,S5=(e,t,n)=>e<0?t:n,_5=e=>Math.max(0,e),_C=e=>Math.max(0,e),CC=(e,t,n)=>{let{left:r,height:o,width:i}=t;const s=e.top-(o-e.height);return{left:r,width:i,height:S5(s,e.height,o),top:_C(s)}},EC=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{top:r,height:i,width:w5(e.left,e.width,s,n),left:_5(o)}},RC=(e,t,n)=>{let{top:r,height:o,width:i}=t;const s=e.left-(i-e.width);return{height:o,width:s<0?e.width:w5(e.left,e.width,i,n),top:_C(r),left:_5(s)}},TC=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{width:s,left:o,height:S5(r,e.height,i),top:_C(r)}},eZ=function(){return CC(arguments.length<=0?void 0:arguments[0],EC(...arguments))},tZ=function(){return CC(arguments.length<=0?void 0:arguments[0],RC(...arguments))},nZ=function(){return TC(arguments.length<=0?void 0:arguments[0],EC(...arguments))},rZ=function(){return TC(arguments.length<=0?void 0:arguments[0],RC(...arguments))},oZ={n:CC,ne:eZ,e:EC,se:nZ,s:TC,sw:rZ,w:RC,nw:tZ};function iZ(e,t,n,r){const o=oZ[e];return o?o(t,{...t,...n},r):n}function sZ(e){let{top:t,left:n,width:r,height:o}=e;const i=`translate(${n}px,${t}px)`;return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:`${r}px`,height:`${o}px`,position:"absolute"}}function aZ(e){let{top:t,left:n,width:r,height:o}=e;return{top:`${t}px`,left:`${n}px`,width:`${r}px`,height:`${o}px`,position:"absolute"}}function kC(e,t){return t==="horizontal"?E5(e):t==="vertical"?C5(e):e}function C5(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 E5(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 lZ(e,t,n,r,o){e=e||[];const i=[];Gf.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=wC(e,String(a.key)),c=a.props["data-grid"];l&&c==null?i.push(ac(l)):c?(YQ||R5([c],"ReactGridLayout.children"),i.push(ac({...c,i:a.key}))):i.push(ac({w:1,h:1,x:0,y:xC(i),i:String(a.key)}))});const s=v5(i,{cols:n});return o?s:b5(s,r,n)}function R5(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,o=e.length;r<o;r++){const i=e[r];for(let s=0;s<n.length;s++){const a=n[s],l=i[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 i.i<"u"&&typeof i.i!="string")throw new Error(`ReactGridLayout: ${t}[${r}].i must be a string! Received: ${i.i} (${typeof i.i})`)}}function cZ(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const uZ=()=>{};Dt.noop=uZ;var ps={};Object.defineProperty(ps,"__esModule",{value:!0});ps.calcGridColWidth=By;ps.calcGridItemPosition=dZ;ps.calcGridItemWHPx=G1;ps.calcWH=hZ;ps.calcXY=fZ;ps.clamp=Vl;function By(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function G1(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function dZ(e,t,n,r,o,i){const{margin:s,containerPadding:a,rowHeight:l}=e,c=By(e),u={};return i&&i.resizing?(u.width=Math.round(i.resizing.width),u.height=Math.round(i.resizing.height)):(u.width=G1(r,c,s[0]),u.height=G1(o,l,s[1])),i&&i.dragging?(u.top=Math.round(i.dragging.top),u.left=Math.round(i.dragging.left)):i&&i.resizing&&typeof i.resizing.top=="number"&&typeof i.resizing.left=="number"?(u.top=Math.round(i.resizing.top),u.left=Math.round(i.resizing.left)):(u.top=Math.round((l+s[1])*n+a[1]),u.left=Math.round((c+s[0])*t+a[0])),u}function fZ(e,t,n,r,o){const{margin:i,containerPadding:s,cols:a,rowHeight:l,maxRows:c}=e,u=By(e);let d=Math.round((n-s[0])/(u+i[0])),p=Math.round((t-s[1])/(l+i[1]));return d=Vl(d,0,a-r),p=Vl(p,0,c-o),{x:d,y:p}}function hZ(e,t,n,r,o,i){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,u=By(e);let d=Math.round((t+s[0])/(u+s[0])),p=Math.round((n+s[1])/(c+s[1])),h=Vl(d,0,l-r),m=Vl(p,0,a-o);return["sw","w","nw"].indexOf(i)!==-1&&(h=Vl(d,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(m=Vl(p,0,a)),{w:h,h:m}}function Vl(e,t,n){return Math.max(Math.min(e,n),t)}var Hy={},q1={exports:{}},Kg={exports:{}},rn={};/** @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 TO;function pZ(){if(TO)return rn;TO=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,o=e?Symbol.for("react.strict_mode"):60108,i=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,y=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,w=e?Symbol.for("react.scope"):60119;function _(C){if(typeof C=="object"&&C!==null){var E=C.$$typeof;switch(E){case t:switch(C=C.type,C){case l:case c:case r:case i:case o: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 E}}case n:return E}}}function R(C){return _(C)===c}return rn.AsyncMode=l,rn.ConcurrentMode=c,rn.ContextConsumer=a,rn.ContextProvider=s,rn.Element=t,rn.ForwardRef=u,rn.Fragment=r,rn.Lazy=m,rn.Memo=h,rn.Portal=n,rn.Profiler=i,rn.StrictMode=o,rn.Suspense=d,rn.isAsyncMode=function(C){return R(C)||_(C)===l},rn.isConcurrentMode=R,rn.isContextConsumer=function(C){return _(C)===a},rn.isContextProvider=function(C){return _(C)===s},rn.isElement=function(C){return typeof C=="object"&&C!==null&&C.$$typeof===t},rn.isForwardRef=function(C){return _(C)===u},rn.isFragment=function(C){return _(C)===r},rn.isLazy=function(C){return _(C)===m},rn.isMemo=function(C){return _(C)===h},rn.isPortal=function(C){return _(C)===n},rn.isProfiler=function(C){return _(C)===i},rn.isStrictMode=function(C){return _(C)===o},rn.isSuspense=function(C){return _(C)===d},rn.isValidElementType=function(C){return typeof C=="string"||typeof C=="function"||C===r||C===c||C===i||C===o||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===y||C.$$typeof===v||C.$$typeof===w||C.$$typeof===b)},rn.typeOf=_,rn}var on={};/** @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 kO;function gZ(){return kO||(kO=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,o=e?Symbol.for("react.strict_mode"):60108,i=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,y=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,w=e?Symbol.for("react.scope"):60119;function _(se){return typeof se=="string"||typeof se=="function"||se===r||se===c||se===i||se===o||se===d||se===p||typeof se=="object"&&se!==null&&(se.$$typeof===m||se.$$typeof===h||se.$$typeof===s||se.$$typeof===a||se.$$typeof===u||se.$$typeof===y||se.$$typeof===v||se.$$typeof===w||se.$$typeof===b)}function R(se){if(typeof se=="object"&&se!==null){var ge=se.$$typeof;switch(ge){case t:var ue=se.type;switch(ue){case l:case c:case r:case i:case o:case d:return ue;default:var Ce=ue&&ue.$$typeof;switch(Ce){case a:case u:case m:case h:case s:return Ce;default:return ge}}case n:return ge}}}var C=l,E=c,P=a,A=s,I=t,F=u,L=r,j=m,X=h,U=n,$=i,B=o,W=d,q=!1;function Q(se){return q||(q=!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(se)||R(se)===l}function D(se){return R(se)===c}function G(se){return R(se)===a}function V(se){return R(se)===s}function M(se){return typeof se=="object"&&se!==null&&se.$$typeof===t}function ee(se){return R(se)===u}function K(se){return R(se)===r}function re(se){return R(se)===m}function Y(se){return R(se)===h}function J(se){return R(se)===n}function ie(se){return R(se)===i}function de(se){return R(se)===o}function he(se){return R(se)===d}on.AsyncMode=C,on.ConcurrentMode=E,on.ContextConsumer=P,on.ContextProvider=A,on.Element=I,on.ForwardRef=F,on.Fragment=L,on.Lazy=j,on.Memo=X,on.Portal=U,on.Profiler=$,on.StrictMode=B,on.Suspense=W,on.isAsyncMode=Q,on.isConcurrentMode=D,on.isContextConsumer=G,on.isContextProvider=V,on.isElement=M,on.isForwardRef=ee,on.isFragment=K,on.isLazy=re,on.isMemo=Y,on.isPortal=J,on.isProfiler=ie,on.isStrictMode=de,on.isSuspense=he,on.isValidElementType=_,on.typeOf=R}()),on}var PO;function T5(){return PO||(PO=1,process.env.NODE_ENV==="production"?Kg.exports=pZ():Kg.exports=gZ()),Kg.exports}/*
106
+ object-assign
107
+ (c) Sindre Sorhus
108
+ @license MIT
109
+ */var Tx,OO;function mZ(){if(OO)return Tx;OO=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function o(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[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 Tx=o()?Object.assign:function(i,s){for(var a,l=r(i),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},Tx}var kx,MO;function PC(){if(MO)return kx;MO=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return kx=e,kx}var Px,AO;function k5(){return AO||(AO=1,Px=Function.call.bind(Object.prototype.hasOwnProperty)),Px}var Ox,DO;function bZ(){if(DO)return Ox;DO=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=PC(),n={},r=k5();e=function(i){var s="Warning: "+i;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function o(i,s,a,l,c){if(process.env.NODE_ENV!=="production"){for(var u in i)if(r(i,u)){var d;try{if(typeof i[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 i[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw p.name="Invariant Violation",p}d=i[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 o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Ox=o,Ox}var Mx,IO;function yZ(){if(IO)return Mx;IO=1;var e=T5(),t=mZ(),n=PC(),r=k5(),o=bZ(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function s(){return null}return Mx=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function d(D){var G=D&&(c&&D[c]||D[u]);if(typeof G=="function")return G}var p="<<anonymous>>",h={array:v("array"),bigint:v("bigint"),bool:v("boolean"),func:v("function"),number:v("number"),object:v("object"),string:v("string"),symbol:v("symbol"),any:w(),arrayOf:_,element:R(),elementType:C(),instanceOf:E,node:F(),objectOf:A,oneOf:P,oneOfType:I,shape:j,exact:X};function m(D,G){return D===G?D!==0||1/D===1/G:D!==D&&G!==G}function b(D,G){this.message=D,this.data=G&&typeof G=="object"?G:{},this.stack=""}b.prototype=Error.prototype;function y(D){if(process.env.NODE_ENV!=="production")var G={},V=0;function M(K,re,Y,J,ie,de,he){if(J=J||p,de=de||Y,he!==n){if(l){var se=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 se.name="Invariant Violation",se}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ge=J+":"+Y;!G[ge]&&V<3&&(i("You are manually calling a React.PropTypes validation function for the `"+de+"` prop on `"+J+"`. 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."),G[ge]=!0,V++)}}return re[Y]==null?K?re[Y]===null?new b("The "+ie+" `"+de+"` is marked as required "+("in `"+J+"`, but its value is `null`.")):new b("The "+ie+" `"+de+"` is marked as required in "+("`"+J+"`, but its value is `undefined`.")):null:D(re,Y,J,ie,de)}var ee=M.bind(null,!1);return ee.isRequired=M.bind(null,!0),ee}function v(D){function G(V,M,ee,K,re,Y){var J=V[M],ie=B(J);if(ie!==D){var de=W(J);return new b("Invalid "+K+" `"+re+"` of type "+("`"+de+"` supplied to `"+ee+"`, expected ")+("`"+D+"`."),{expectedType:D})}return null}return y(G)}function w(){return y(s)}function _(D){function G(V,M,ee,K,re){if(typeof D!="function")return new b("Property `"+re+"` of component `"+ee+"` has invalid PropType notation inside arrayOf.");var Y=V[M];if(!Array.isArray(Y)){var J=B(Y);return new b("Invalid "+K+" `"+re+"` of type "+("`"+J+"` supplied to `"+ee+"`, expected an array."))}for(var ie=0;ie<Y.length;ie++){var de=D(Y,ie,ee,K,re+"["+ie+"]",n);if(de instanceof Error)return de}return null}return y(G)}function R(){function D(G,V,M,ee,K){var re=G[V];if(!a(re)){var Y=B(re);return new b("Invalid "+ee+" `"+K+"` of type "+("`"+Y+"` supplied to `"+M+"`, expected a single ReactElement."))}return null}return y(D)}function C(){function D(G,V,M,ee,K){var re=G[V];if(!e.isValidElementType(re)){var Y=B(re);return new b("Invalid "+ee+" `"+K+"` of type "+("`"+Y+"` supplied to `"+M+"`, expected a single ReactElement type."))}return null}return y(D)}function E(D){function G(V,M,ee,K,re){if(!(V[M]instanceof D)){var Y=D.name||p,J=Q(V[M]);return new b("Invalid "+K+" `"+re+"` of type "+("`"+J+"` supplied to `"+ee+"`, expected ")+("instance of `"+Y+"`."))}return null}return y(G)}function P(D){if(!Array.isArray(D))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("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])."):i("Invalid argument supplied to oneOf, expected an array.")),s;function G(V,M,ee,K,re){for(var Y=V[M],J=0;J<D.length;J++)if(m(Y,D[J]))return null;var ie=JSON.stringify(D,function(he,se){var ge=W(se);return ge==="symbol"?String(se):se});return new b("Invalid "+K+" `"+re+"` of value `"+String(Y)+"` "+("supplied to `"+ee+"`, expected one of "+ie+"."))}return y(G)}function A(D){function G(V,M,ee,K,re){if(typeof D!="function")return new b("Property `"+re+"` of component `"+ee+"` has invalid PropType notation inside objectOf.");var Y=V[M],J=B(Y);if(J!=="object")return new b("Invalid "+K+" `"+re+"` of type "+("`"+J+"` supplied to `"+ee+"`, expected an object."));for(var ie in Y)if(r(Y,ie)){var de=D(Y,ie,ee,K,re+"."+ie,n);if(de instanceof Error)return de}return null}return y(G)}function I(D){if(!Array.isArray(D))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var G=0;G<D.length;G++){var V=D[G];if(typeof V!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+q(V)+" at index "+G+"."),s}function M(ee,K,re,Y,J){for(var ie=[],de=0;de<D.length;de++){var he=D[de],se=he(ee,K,re,Y,J,n);if(se==null)return null;se.data&&r(se.data,"expectedType")&&ie.push(se.data.expectedType)}var ge=ie.length>0?", expected one of type ["+ie.join(", ")+"]":"";return new b("Invalid "+Y+" `"+J+"` supplied to "+("`"+re+"`"+ge+"."))}return y(M)}function F(){function D(G,V,M,ee,K){return U(G[V])?null:new b("Invalid "+ee+" `"+K+"` supplied to "+("`"+M+"`, expected a ReactNode."))}return y(D)}function L(D,G,V,M,ee){return new b((D||"React class")+": "+G+" type `"+V+"."+M+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+ee+"`.")}function j(D){function G(V,M,ee,K,re){var Y=V[M],J=B(Y);if(J!=="object")return new b("Invalid "+K+" `"+re+"` of type `"+J+"` "+("supplied to `"+ee+"`, expected `object`."));for(var ie in D){var de=D[ie];if(typeof de!="function")return L(ee,K,re,ie,W(de));var he=de(Y,ie,ee,K,re+"."+ie,n);if(he)return he}return null}return y(G)}function X(D){function G(V,M,ee,K,re){var Y=V[M],J=B(Y);if(J!=="object")return new b("Invalid "+K+" `"+re+"` of type `"+J+"` "+("supplied to `"+ee+"`, expected `object`."));var ie=t({},V[M],D);for(var de in ie){var he=D[de];if(r(D,de)&&typeof he!="function")return L(ee,K,re,de,W(he));if(!he)return new b("Invalid "+K+" `"+re+"` key `"+de+"` supplied to `"+ee+"`.\nBad object: "+JSON.stringify(V[M],null," ")+`
110
+ Valid keys: `+JSON.stringify(Object.keys(D),null," "));var se=he(Y,de,ee,K,re+"."+de,n);if(se)return se}return null}return y(G)}function U(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(U);if(D===null||a(D))return!0;var G=d(D);if(G){var V=G.call(D),M;if(G!==D.entries){for(;!(M=V.next()).done;)if(!U(M.value))return!1}else for(;!(M=V.next()).done;){var ee=M.value;if(ee&&!U(ee[1]))return!1}}else return!1;return!0;default:return!1}}function $(D,G){return D==="symbol"?!0:G?G["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&G instanceof Symbol:!1}function B(D){var G=typeof D;return Array.isArray(D)?"array":D instanceof RegExp?"object":$(G,D)?"symbol":G}function W(D){if(typeof D>"u"||D===null)return""+D;var G=B(D);if(G==="object"){if(D instanceof Date)return"date";if(D instanceof RegExp)return"regexp"}return G}function q(D){var G=W(D);switch(G){case"array":case"object":return"an "+G;case"boolean":case"date":case"regexp":return"a "+G;default:return G}}function Q(D){return!D.constructor||!D.constructor.name?p:D.constructor.name}return h.checkPropTypes=o,h.resetWarningCache=o.resetWarningCache,h.PropTypes=h,h},Mx}var Ax,NO;function vZ(){if(NO)return Ax;NO=1;var e=PC();function t(){}function n(){}return n.resetWarningCache=t,Ax=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 o(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},Ax}if(process.env.NODE_ENV!=="production"){var xZ=T5(),wZ=!0;q1.exports=yZ()(xZ.isElement,wZ)}else q1.exports=vZ()();var il=q1.exports,Wy={exports:{}},P5={};function O5(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=O5(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function FO(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=O5(e))&&(r&&(r+=" "),r+=t);return r}const SZ=Object.freeze(Object.defineProperty({__proto__:null,clsx:FO,default:FO},Symbol.toStringTag,{value:"Module"})),_Z=U_(SZ);var Vn={},gs={};Object.defineProperty(gs,"__esModule",{value:!0});gs.dontSetMe=kZ;gs.findInArray=CZ;gs.int=TZ;gs.isFunction=EZ;gs.isNum=RZ;function CZ(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function EZ(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function RZ(e){return typeof e=="number"&&!isNaN(e)}function TZ(e){return parseInt(e,10)}function kZ(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 jc={};Object.defineProperty(jc,"__esModule",{value:!0});jc.browserPrefixToKey=A5;jc.browserPrefixToStyle=PZ;jc.default=void 0;jc.getPrefix=M5;const Dx=["Moz","Webkit","O","ms"];function M5(){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<Dx.length;r++)if(A5(t,Dx[r])in n)return Dx[r];return""}function A5(e,t){return t?"".concat(t).concat(OZ(e)):e}function PZ(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function OZ(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}jc.default=M5();Object.defineProperty(Vn,"__esModule",{value:!0});Vn.addClassName=N5;Vn.addEvent=DZ;Vn.addUserSelectStyles=VZ;Vn.createCSSTransform=zZ;Vn.createSVGTransform=BZ;Vn.getTouch=HZ;Vn.getTouchIdentifier=WZ;Vn.getTranslation=OC;Vn.innerHeight=LZ;Vn.innerWidth=$Z;Vn.matchesSelector=I5;Vn.matchesSelectorAndParentsTo=AZ;Vn.offsetXYFromParent=jZ;Vn.outerHeight=NZ;Vn.outerWidth=FZ;Vn.removeClassName=F5;Vn.removeEvent=IZ;Vn.removeUserSelectStyles=UZ;var jo=gs,LO=MZ(jc);function D5(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(D5=function(r){return r?n:t})(e)}function MZ(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=D5(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}let Xg="";function I5(e,t){return Xg||(Xg=(0,jo.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,jo.isFunction)(e[n])})),(0,jo.isFunction)(e[Xg])?e[Xg](t):!1}function AZ(e,t,n){let r=e;do{if(I5(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function DZ(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,o):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n}function IZ(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,o):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null}function NZ(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,jo.int)(n.borderTopWidth),t+=(0,jo.int)(n.borderBottomWidth),t}function FZ(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,jo.int)(n.borderLeftWidth),t+=(0,jo.int)(n.borderRightWidth),t}function LZ(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,jo.int)(n.paddingTop),t-=(0,jo.int)(n.paddingBottom),t}function $Z(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,jo.int)(n.paddingLeft),t-=(0,jo.int)(n.paddingRight),t}function jZ(e,t,n){const o=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),i=(e.clientX+t.scrollLeft-o.left)/n,s=(e.clientY+t.scrollTop-o.top)/n;return{x:i,y:s}}function zZ(e,t){const n=OC(e,t,"px");return{[(0,LO.browserPrefixToKey)("transform",LO.default)]:n}}function BZ(e,t){return OC(e,t,"")}function OC(e,t,n){let{x:r,y:o}=e,i="translate(".concat(r).concat(n,",").concat(o).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);i="translate(".concat(s,", ").concat(a,")")+i}return i}function HZ(e,t){return e.targetTouches&&(0,jo.findInArray)(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&(0,jo.findInArray)(e.changedTouches,n=>t===n.identifier)}function WZ(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function VZ(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&&N5(e.body,"react-draggable-transparent-selection")}function UZ(e){if(e)try{if(e.body&&F5(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 N5(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function F5(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var ms={};Object.defineProperty(ms,"__esModule",{value:!0});ms.canDragX=YZ;ms.canDragY=KZ;ms.createCoreData=QZ;ms.createDraggableData=ZZ;ms.getBoundPosition=GZ;ms.getControlPosition=XZ;ms.snapToGrid=qZ;var Ao=gs,Ru=Vn;function GZ(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:JZ(r);const o=MC(e);if(typeof r=="string"){const{ownerDocument:i}=o,s=i.defaultView;let a;if(r==="parent"?a=o.parentNode:a=i.querySelector(r),!(a instanceof s.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=a,c=s.getComputedStyle(o),u=s.getComputedStyle(l);r={left:-o.offsetLeft+(0,Ao.int)(u.paddingLeft)+(0,Ao.int)(c.marginLeft),top:-o.offsetTop+(0,Ao.int)(u.paddingTop)+(0,Ao.int)(c.marginTop),right:(0,Ru.innerWidth)(l)-(0,Ru.outerWidth)(o)-o.offsetLeft+(0,Ao.int)(u.paddingRight)-(0,Ao.int)(c.marginRight),bottom:(0,Ru.innerHeight)(l)-(0,Ru.outerHeight)(o)-o.offsetTop+(0,Ao.int)(u.paddingBottom)-(0,Ao.int)(c.marginBottom)}}return(0,Ao.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,Ao.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,Ao.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,Ao.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function qZ(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]}function YZ(e){return e.props.axis==="both"||e.props.axis==="x"}function KZ(e){return e.props.axis==="both"||e.props.axis==="y"}function XZ(e,t,n){const r=typeof t=="number"?(0,Ru.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const o=MC(n),i=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,Ru.offsetXYFromParent)(r||e,i,n.props.scale)}function QZ(e,t,n){const r=!(0,Ao.isNum)(e.lastX),o=MC(e);return r?{node:o,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:o,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function ZZ(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 JZ(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function MC(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var Vy={},Uy={};Object.defineProperty(Uy,"__esModule",{value:!0});Uy.default=eJ;function eJ(){}Object.defineProperty(Vy,"__esModule",{value:!0});Vy.default=void 0;var Ix=nJ(k),ao=AC(il),tJ=AC(Ir),kr=Vn,xa=ms,Nx=gs,xf=AC(Uy);function AC(e){return e&&e.__esModule?e:{default:e}}function L5(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(L5=function(r){return r?n:t})(e)}function nJ(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=L5(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Ur(e,t,n){return t=rJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rJ(e){var t=oJ(e,"string");return typeof t=="symbol"?t:String(t)}function oJ(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);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const Si={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let wa=Si.mouse,Gy=class extends Ix.Component{constructor(){super(...arguments),Ur(this,"dragging",!1),Ur(this,"lastX",NaN),Ur(this,"lastY",NaN),Ur(this,"touchIdentifier",null),Ur(this,"mounted",!1),Ur(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,kr.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,kr.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const o=(0,kr.getTouchIdentifier)(t);this.touchIdentifier=o;const i=(0,xa.getControlPosition)(t,o,this);if(i==null)return;const{x:s,y:a}=i,l=(0,xa.createCoreData)(this,s,a);(0,xf.default)("DraggableCore: handleDragStart: %j",l),(0,xf.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,kr.addUserSelectStyles)(r),this.dragging=!0,this.lastX=s,this.lastY=a,(0,kr.addEvent)(r,wa.move,this.handleDrag),(0,kr.addEvent)(r,wa.stop,this.handleDragStop))}),Ur(this,"handleDrag",t=>{const n=(0,xa.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let a=r-this.lastX,l=o-this.lastY;if([a,l]=(0,xa.snapToGrid)(this.props.grid,a,l),!a&&!l)return;r=this.lastX+a,o=this.lastY+l}const i=(0,xa.createCoreData)(this,r,o);if((0,xf.default)("DraggableCore: handleDrag: %j",i),this.props.onDrag(t,i)===!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=o}),Ur(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,xa.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX||0,c=o-this.lastY||0;[l,c]=(0,xa.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,o=this.lastY+c}const i=(0,xa.createCoreData)(this,r,o);if(this.props.onStop(t,i)===!1||this.mounted===!1)return!1;const a=this.findDOMNode();a&&this.props.enableUserSelectHack&&(0,kr.removeUserSelectStyles)(a.ownerDocument),(0,xf.default)("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,xf.default)("DraggableCore: Removing handlers"),(0,kr.removeEvent)(a.ownerDocument,wa.move,this.handleDrag),(0,kr.removeEvent)(a.ownerDocument,wa.stop,this.handleDragStop))}),Ur(this,"onMouseDown",t=>(wa=Si.mouse,this.handleDragStart(t))),Ur(this,"onMouseUp",t=>(wa=Si.mouse,this.handleDragStop(t))),Ur(this,"onTouchStart",t=>(wa=Si.touch,this.handleDragStart(t))),Ur(this,"onTouchEnd",t=>(wa=Si.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,kr.addEvent)(t,Si.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,kr.removeEvent)(n,Si.mouse.move,this.handleDrag),(0,kr.removeEvent)(n,Si.touch.move,this.handleDrag),(0,kr.removeEvent)(n,Si.mouse.stop,this.handleDragStop),(0,kr.removeEvent)(n,Si.touch.stop,this.handleDragStop),(0,kr.removeEvent)(t,Si.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,kr.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:tJ.default.findDOMNode(this)}render(){return Ix.cloneElement(Ix.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Vy.default=Gy;Ur(Gy,"displayName","DraggableCore");Ur(Gy,"propTypes",{allowAnyClick:ao.default.bool,children:ao.default.node.isRequired,disabled:ao.default.bool,enableUserSelectHack:ao.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:ao.default.arrayOf(ao.default.number),handle:ao.default.string,cancel:ao.default.string,nodeRef:ao.default.object,onStart:ao.default.func,onDrag:ao.default.func,onStop:ao.default.func,onMouseDown:ao.default.func,scale:ao.default.number,className:Nx.dontSetMe,style:Nx.dontSetMe,transform:Nx.dontSetMe});Ur(Gy,"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(k),n=u(il),r=u(Ir),o=u(_Z),i=Vn,s=ms,a=gs,l=u(Vy),c=u(Uy);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={},E=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var P in w)if(P!=="default"&&Object.prototype.hasOwnProperty.call(w,P)){var A=E?Object.getOwnPropertyDescriptor(w,P):null;A&&(A.get||A.set)?Object.defineProperty(C,P,A):C[P]=w[P]}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 _=y(w,"string");return typeof _=="symbol"?_:String(_)}function y(w,_){if(typeof w!="object"||w===null)return w;var R=w[Symbol.toPrimitive];if(R!==void 0){var C=R.call(w,_);if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(_==="string"?String:Number)(w)}class v extends t.Component{static getDerivedStateFromProps(_,R){let{position:C}=_,{prevPropsPosition:E}=R;return C&&(!E||C.x!==E.x||C.y!==E.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:C,prevPropsPosition:E}),{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 E=(0,s.createDraggableData)(this,C),P={x:E.x,y:E.y,slackX:0,slackY:0};if(this.props.bounds){const{x:I,y:F}=P;P.x+=this.state.slackX,P.y+=this.state.slackY;const[L,j]=(0,s.getBoundPosition)(this,P.x,P.y);P.x=L,P.y=j,P.slackX=this.state.slackX+(I-P.x),P.slackY=this.state.slackY+(F-P.y),E.x=P.x,E.y=P.y,E.deltaX=P.x-this.state.x,E.deltaY=P.y-this.state.y}if(this.props.onDrag(R,E)===!1)return!1;this.setState(P)}),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 P={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:I,y:F}=this.props.position;P.x=I,P.y=F}this.setState(P)}),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:E,defaultClassName:P,defaultClassNameDragging:A,defaultClassNameDragged:I,position:F,positionOffset:L,scale:j,...X}=this.props;let U={},$=null;const W=!!!F||this.state.dragging,q=F||E,Q={x:(0,s.canDragX)(this)&&W?this.state.x:q.x,y:(0,s.canDragY)(this)&&W?this.state.y:q.y};this.state.isElementSVG?$=(0,i.createSVGTransform)(Q,L):U=(0,i.createCSSTransform)(Q,L);const D=(0,o.default)(C.props.className||"",P,{[A]:this.state.dragging,[I]: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,...U},transform:$}))}}e.default=v,m(v,"displayName","Draggable"),m(v,"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(v,"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})})(P5);const{default:$5,DraggableCore:iJ}=P5;Wy.exports=$5;Wy.exports.default=$5;Wy.exports.DraggableCore=iJ;var j5=Wy.exports,qy={exports:{}},Cp={},DC={};DC.__esModule=!0;DC.cloneElement=dJ;var sJ=aJ(k);function aJ(e){return e&&e.__esModule?e:{default:e}}function $O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function jO(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$O(Object(n),!0).forEach(function(r){lJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$O(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lJ(e,t,n){return t=cJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cJ(e){var t=uJ(e,"string");return typeof t=="symbol"?t:String(t)}function uJ(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);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dJ(e,t){return t.style&&e.props.style&&(t.style=jO(jO({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),sJ.default.cloneElement(e,t)}var Ep={};Ep.__esModule=!0;Ep.resizableProps=void 0;var _t=fJ(il);function fJ(e){return e&&e.__esModule?e:{default:e}}var hJ={axis:_t.default.oneOf(["both","x","y","none"]),className:_t.default.string,children:_t.default.element.isRequired,draggableOpts:_t.default.shape({allowAnyClick:_t.default.bool,cancel:_t.default.string,children:_t.default.node,disabled:_t.default.bool,enableUserSelectHack:_t.default.bool,offsetParent:_t.default.node,grid:_t.default.arrayOf(_t.default.number),handle:_t.default.string,nodeRef:_t.default.object,onStart:_t.default.func,onDrag:_t.default.func,onStop:_t.default.func,onMouseDown:_t.default.func,scale:_t.default.number}),height:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="y"){var i;return(i=_t.default.number).isRequired.apply(i,n)}return _t.default.number.apply(_t.default,n)},handle:_t.default.oneOfType([_t.default.node,_t.default.func]),handleSize:_t.default.arrayOf(_t.default.number),lockAspectRatio:_t.default.bool,maxConstraints:_t.default.arrayOf(_t.default.number),minConstraints:_t.default.arrayOf(_t.default.number),onResizeStop:_t.default.func,onResizeStart:_t.default.func,onResize:_t.default.func,resizeHandles:_t.default.arrayOf(_t.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:_t.default.number,width:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="x"){var i;return(i=_t.default.number).isRequired.apply(i,n)}return _t.default.number.apply(_t.default,n)}};Ep.resizableProps=hJ;Cp.__esModule=!0;Cp.default=void 0;var wf=yJ(k),pJ=j5,gJ=DC,mJ=Ep,bJ=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function z5(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(z5=function(o){return o?n:t})(e)}function yJ(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=z5(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Y1(){return Y1=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},Y1.apply(this,arguments)}function vJ(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function zO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Fx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zO(Object(n),!0).forEach(function(r){xJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xJ(e,t,n){return t=wJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wJ(e){var t=SJ(e,"string");return typeof t=="symbol"?t:String(t)}function SJ(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);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _J(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,K1(e,t)}function K1(e,t){return K1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},K1(e,t)}var IC=function(e){_J(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=e.call.apply(e,[this].concat(i))||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(o,i){var s=this.props,a=s.minConstraints,l=s.maxConstraints,c=s.lockAspectRatio;if(!a&&!l&&!c)return[o,i];if(c){var u=this.props.width/this.props.height,d=o-this.props.width,p=i-this.props.height;Math.abs(d)>Math.abs(p*u)?i=o/u:o=i*u}var h=o,m=i,b=this.slack||[0,0],y=b[0],v=b[1];return o+=y,i+=v,a&&(o=Math.max(a[0],o),i=Math.max(a[1],i)),l&&(o=Math.min(l[0],o),i=Math.min(l[1],i)),this.slack=[y+(h-o),v+(m-i)],[o,i]},n.resizeHandler=function(o,i){var s=this;return function(a,l){var c=l.node,u=l.deltaX,d=l.deltaY;o==="onResizeStart"&&s.resetData();var p=(s.props.axis==="both"||s.props.axis==="x")&&i!=="n"&&i!=="s",h=(s.props.axis==="both"||s.props.axis==="y")&&i!=="e"&&i!=="w";if(!(!p&&!h)){var m=i[0],b=i[i.length-1],y=c.getBoundingClientRect();if(s.lastHandleRect!=null){if(b==="w"){var v=y.left-s.lastHandleRect.left;u+=v}if(m==="n"){var w=y.top-s.lastHandleRect.top;d+=w}}s.lastHandleRect=y,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 E=_!==s.props.width||R!==s.props.height,P=typeof s.props[o]=="function"?s.props[o]:null,A=o==="onResize"&&!E;P&&!A&&(a.persist==null||a.persist(),P(a,{node:c,size:{width:_,height:R},handle:i})),o==="onResizeStop"&&s.resetData()}}},n.renderResizeHandle=function(o,i){var s=this.props.handle;if(!s)return wf.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+o,ref:i});if(typeof s=="function")return s(o,i);var a=typeof s.type=="string",l=Fx({ref:i},a?{}:{handleAxis:o});return wf.cloneElement(s,l)},n.render=function(){var o=this,i=this.props,s=i.children,a=i.className,l=i.draggableOpts;i.width,i.height,i.handle,i.handleSize,i.lockAspectRatio,i.axis,i.minConstraints,i.maxConstraints,i.onResize,i.onResizeStop,i.onResizeStart;var c=i.resizeHandles;i.transformScale;var u=vJ(i,bJ);return(0,gJ.cloneElement)(s,Fx(Fx({},u),{},{className:(a?a+" ":"")+"react-resizable",children:[].concat(s.props.children,c.map(function(d){var p,h=(p=o.handleRefs[d])!=null?p:o.handleRefs[d]=wf.createRef();return wf.createElement(pJ.DraggableCore,Y1({},l,{nodeRef:h,key:"resizableHandle-"+d,onStop:o.resizeHandler("onResizeStop",d),onStart:o.resizeHandler("onResizeStart",d),onDrag:o.resizeHandler("onResize",d)}),o.renderResizeHandle(d,h))}))}))},t}(wf.Component);Cp.default=IC;IC.propTypes=mJ.resizableProps;IC.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var Yy={};Yy.__esModule=!0;Yy.default=void 0;var Lx=kJ(k),CJ=B5(il),EJ=B5(Cp),RJ=Ep,TJ=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function B5(e){return e&&e.__esModule?e:{default:e}}function H5(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(H5=function(o){return o?n:t})(e)}function kJ(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=H5(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function X1(){return X1=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},X1.apply(this,arguments)}function BO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Eb(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BO(Object(n),!0).forEach(function(r){PJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function PJ(e,t,n){return t=OJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OJ(e){var t=MJ(e,"string");return typeof t=="symbol"?t:String(t)}function MJ(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);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function AJ(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function DJ(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Q1(e,t)}function Q1(e,t){return Q1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Q1(e,t)}var W5=function(e){DJ(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=e.call.apply(e,[this].concat(i))||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(o,i){return i.propsWidth!==o.width||i.propsHeight!==o.height?{width:o.width,height:o.height,propsWidth:o.width,propsHeight:o.height}:null};var n=t.prototype;return n.render=function(){var o=this.props,i=o.handle,s=o.handleSize;o.onResize;var a=o.onResizeStart,l=o.onResizeStop,c=o.draggableOpts,u=o.minConstraints,d=o.maxConstraints,p=o.lockAspectRatio,h=o.axis;o.width,o.height;var m=o.resizeHandles,b=o.style,y=o.transformScale,v=AJ(o,TJ);return Lx.createElement(EJ.default,{axis:h,draggableOpts:c,handle:i,handleSize:s,height:this.state.height,lockAspectRatio:p,maxConstraints:d,minConstraints:u,onResizeStart:a,onResize:this.onResize,onResizeStop:l,resizeHandles:m,transformScale:y,width:this.state.width},Lx.createElement("div",X1({},v,{style:Eb(Eb({},b),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(Lx.Component);Yy.default=W5;W5.propTypes=Eb(Eb({},RJ.resizableProps),{},{children:CJ.default.element});qy.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};qy.exports.Resizable=Cp.default;qy.exports.ResizableBox=Yy.default;var IJ=qy.exports,Zs={};Object.defineProperty(Zs,"__esModule",{value:!0});Zs.resizeHandleType=Zs.resizeHandleAxesType=Zs.default=void 0;var Tt=V5(il),NJ=V5(k);function V5(e){return e&&e.__esModule?e:{default:e}}const FJ=Zs.resizeHandleAxesType=Tt.default.arrayOf(Tt.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),LJ=Zs.resizeHandleType=Tt.default.oneOfType([Tt.default.node,Tt.default.func]);Zs.default={className:Tt.default.string,style:Tt.default.object,width:Tt.default.number,autoSize:Tt.default.bool,cols:Tt.default.number,draggableCancel:Tt.default.string,draggableHandle:Tt.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:Tt.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&Dt.validateLayout(t,"layout")},margin:Tt.default.arrayOf(Tt.default.number),containerPadding:Tt.default.arrayOf(Tt.default.number),rowHeight:Tt.default.number,maxRows:Tt.default.number,isBounded:Tt.default.bool,isDraggable:Tt.default.bool,isResizable:Tt.default.bool,allowOverlap:Tt.default.bool,preventCollision:Tt.default.bool,useCSSTransforms:Tt.default.bool,transformScale:Tt.default.number,isDroppable:Tt.default.bool,resizeHandles:FJ,resizeHandle:LJ,onLayoutChange:Tt.default.func,onDragStart:Tt.default.func,onDrag:Tt.default.func,onDragStop:Tt.default.func,onResizeStart:Tt.default.func,onResize:Tt.default.func,onResizeStop:Tt.default.func,onDrop:Tt.default.func,droppingItem:Tt.default.shape({i:Tt.default.string.isRequired,w:Tt.default.number.isRequired,h:Tt.default.number.isRequired}),children:function(e,t){const n=e[t],r={};NJ.default.Children.forEach(n,function(o){if((o==null?void 0:o.key)!=null){if(r[o.key])throw new Error('Duplicate child key "'+o.key+'" found! This will cause problems in ReactGridLayout.');r[o.key]=!0}})},innerRef:Tt.default.any};Object.defineProperty(Hy,"__esModule",{value:!0});Hy.default=void 0;var cu=NC(k),Zt=NC(il),$J=j5,jJ=IJ,uu=Dt,wr=ps,HO=Zs,zJ=NC(vC);function NC(e){return e&&e.__esModule?e:{default:e}}function Hi(e,t,n){return t=BJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BJ(e){var t=HJ(e,"string");return typeof t=="symbol"?t:String(t)}function HJ(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);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class FC extends cu.default.Component{constructor(){super(...arguments),Hi(this,"state",{resizing:null,dragging:null,className:""}),Hi(this,"elementRef",cu.default.createRef()),Hi(this,"onDragStart",(t,n)=>{let{node:r}=n;const{onDragStart:o,transformScale:i}=this.props;if(!o)return;const s={top:0,left:0},{offsetParent:a}=r;if(!a)return;const l=a.getBoundingClientRect(),c=r.getBoundingClientRect(),u=c.left/i,d=l.left/i,p=c.top/i,h=l.top/i;s.left=u-d+a.scrollLeft,s.top=p-h+a.scrollTop,this.setState({dragging:s});const{x:m,y:b}=(0,wr.calcXY)(this.getPositionParams(),s.top,s.left,this.props.w,this.props.h);return o.call(this,this.props.i,m,b,{e:t,node:r,newPosition:s})}),Hi(this,"onDrag",(t,n)=>{let{node:r,deltaX:o,deltaY:i}=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+i,l=this.state.dragging.left+o;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,E=w.clientHeight-(0,wr.calcGridItemWHPx)(p,R,_[1]);a=(0,wr.clamp)(a-C[1],0,E);const P=(0,wr.calcGridColWidth)(m),A=h-(0,wr.calcGridItemWHPx)(d,P,_[0]);l=(0,wr.clamp)(l-C[0],0,A)}}const b={top:a,left:l};this.setState({dragging:b});const{x:y,y:v}=(0,wr.calcXY)(m,a,l,d,p);return s.call(this,u,y,v,{e:t,node:r,newPosition:b})}),Hi(this,"onDragStop",(t,n)=>{let{node:r}=n;const{onDragStop:o}=this.props;if(!o)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:i,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,wr.calcXY)(this.getPositionParams(),c,l,i,s);return o.call(this,a,d,p,{e:t,node:r,newPosition:u})}),Hi(this,"onResizeStop",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStop")),Hi(this,"onResizeStart",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStart")),Hi(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,wr.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),o=(0,wr.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,uu.fastPositionEqual)(r,o)||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 o=t.droppingPosition||{left:0,top:0},{dragging:i}=this.state,s=i&&n.left!==o.left||n.top!==o.top;if(!i)this.onDragStart(n.e,{node:r,deltaX:n.left,deltaY:n.top});else if(s){const a=n.left-i.left,l=n.top-i.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:o}=this.props;let i;return o?i=(0,uu.setTransform)(t):(i=(0,uu.setTopLeft)(t),n&&(i.left=(0,uu.perc)(t.left/r),i.width=(0,uu.perc)(t.width/r))),i}mixinDraggable(t,n){return cu.default.createElement($J.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,o)=>n(r,o,t)}mixinResizable(t,n,r){const{cols:o,minW:i,minH:s,maxW:a,maxH:l,transformScale:c,resizeHandles:u,resizeHandle:d}=this.props,p=this.getPositionParams(),h=(0,wr.calcGridItemPosition)(p,0,0,o,0).width,m=(0,wr.calcGridItemPosition)(p,0,0,i,s),b=(0,wr.calcGridItemPosition)(p,0,0,a,l),y=[m.width,m.height],v=[Math.min(b.width,h),Math.min(b.height,1/0)];return cu.default.createElement(jJ.Resizable,{draggableOpts:{disabled:!r},className:r?void 0:"react-resizable-hide",width:n.width,height:n.height,minConstraints:y,maxConstraints:v,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,o){let{node:i,size:s,handle:a}=n;const l=this.props[o];if(!l)return;const{x:c,y:u,i:d,maxH:p,minH:h,containerWidth:m}=this.props,{minW:b,maxW:y}=this.props;let v=s;i&&(v=(0,uu.resizeItemInDirection)(a,r,s,m),this.setState({resizing:o==="onResizeStop"?null:v}));let{w,h:_}=(0,wr.calcWH)(this.getPositionParams(),v.width,v.height,c,u,a);w=(0,wr.clamp)(w,Math.max(b,1),y),_=(0,wr.clamp)(_,h,p),l.call(this,d,w,_,{e:t,node:i,size:v,handle:a})}render(){const{x:t,y:n,w:r,h:o,isDraggable:i,isResizable:s,droppingPosition:a,useCSSTransforms:l}=this.props,c=(0,wr.calcGridItemPosition)(this.getPositionParams(),t,n,r,o,this.state),u=cu.default.Children.only(this.props.children);let d=cu.default.cloneElement(u,{ref:this.elementRef,className:(0,zJ.default)("react-grid-item",u.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":i,"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,i),d}}Hy.default=FC;Hi(FC,"propTypes",{children:Zt.default.element,cols:Zt.default.number.isRequired,containerWidth:Zt.default.number.isRequired,rowHeight:Zt.default.number.isRequired,margin:Zt.default.array.isRequired,maxRows:Zt.default.number.isRequired,containerPadding:Zt.default.array.isRequired,x:Zt.default.number.isRequired,y:Zt.default.number.isRequired,w:Zt.default.number.isRequired,h:Zt.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:Zt.default.string.isRequired,resizeHandles:HO.resizeHandleAxesType,resizeHandle:HO.resizeHandleType,onDragStop:Zt.default.func,onDragStart:Zt.default.func,onDrag:Zt.default.func,onResizeStop:Zt.default.func,onResizeStart:Zt.default.func,onResize:Zt.default.func,isDraggable:Zt.default.bool.isRequired,isResizable:Zt.default.bool.isRequired,isBounded:Zt.default.bool.isRequired,static:Zt.default.bool,useCSSTransforms:Zt.default.bool.isRequired,transformScale:Zt.default.number,className:Zt.default.string,handle:Zt.default.string,cancel:Zt.default.string,droppingPosition:Zt.default.shape({e:Zt.default.object.isRequired,left:Zt.default.number.isRequired,top:Zt.default.number.isRequired})});Hi(FC,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1});Object.defineProperty(_p,"__esModule",{value:!0});_p.default=void 0;var _l=GJ(k),$x=yC,WJ=LC(vC),ct=Dt,VJ=ps,WO=LC(Hy),UJ=LC(Zs);function LC(e){return e&&e.__esModule?e:{default:e}}function U5(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(U5=function(r){return r?n:t})(e)}function GJ(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=U5(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Or(e,t,n){return t=qJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qJ(e){var t=YJ(e,"string");return typeof t=="symbol"?t:String(t)}function YJ(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);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const VO="react-grid-layout";let G5=!1;try{G5=/firefox/i.test(navigator.userAgent)}catch{}class Ky extends _l.Component{constructor(){super(...arguments),Or(this,"state",{activeDrag:null,layout:(0,ct.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,ct.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),Or(this,"dragEnterCounter",0),Or(this,"onDragStart",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a}=this.state,l=(0,ct.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,ct.cloneLayoutItem)(l),oldLayout:a,activeDrag:c}),this.props.onDragStart(a,l,l,null,i,s)}),Or(this,"onDrag",(t,n,r,o)=>{let{e:i,node:s}=o;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:c,allowOverlap:u,preventCollision:d}=this.props,p=(0,ct.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,ct.moveElement)(l,p,n,r,!0,d,(0,ct.compactType)(this.props),c,u),this.props.onDrag(l,a,p,h,i,s),this.setState({layout:u?l:(0,ct.compact)(l,(0,ct.compactType)(this.props),c),activeDrag:h})}),Or(this,"onDragStop",(t,n,r,o)=>{let{e:i,node:s}=o;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,ct.getLayoutItem)(l,t);if(!p)return;l=(0,ct.moveElement)(l,p,n,r,!0,u,(0,ct.compactType)(this.props),c,d);const m=d?l:(0,ct.compact)(l,(0,ct.compactType)(this.props),c);this.props.onDragStop(m,a,p,null,i,s);const{oldLayout:b}=this.state;this.setState({activeDrag:null,layout:m,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(m,b)}),Or(this,"onResizeStart",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a}=this.state,l=(0,ct.getLayoutItem)(a,t);l&&(this.setState({oldResizeItem:(0,ct.cloneLayoutItem)(l),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(a,l,l,null,i,s))}),Or(this,"onResize",(t,n,r,o)=>{let{e:i,node:s,size:a,handle:l}=o;const{oldResizeItem:c}=this.state,{layout:u}=this.state,{cols:d,preventCollision:p,allowOverlap:h}=this.props;let m=!1,b,y,v;const[w,_]=(0,ct.withLayoutItem)(u,t,C=>{let E;return y=C.x,v=C.y,["sw","w","nw","n","ne"].indexOf(l)!==-1&&(["sw","nw","w"].indexOf(l)!==-1&&(y=C.x+(C.w-n),n=C.x!==y&&y<0?C.w:n,y=y<0?0:y),["ne","n","nw"].indexOf(l)!==-1&&(v=C.y+(C.h-r),r=C.y!==v&&v<0?C.h:r,v=v<0?0:v),m=!0),p&&!h&&(E=(0,ct.getAllCollisions)(u,{...C,w:n,h:r,x:y,y:v}).filter(A=>A.i!==C.i).length>0,E&&(v=C.y,r=C.h,y=C.x,n=C.w,m=!1)),C.w=n,C.h=r,C});if(!_)return;b=w,m&&(b=(0,ct.moveElement)(w,_,y,v,!0,this.props.preventCollision,(0,ct.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,i,s),this.setState({layout:h?b:(0,ct.compact)(b,(0,ct.compactType)(this.props),d),activeDrag:R})}),Or(this,"onResizeStop",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a,oldResizeItem:l}=this.state,{cols:c,allowOverlap:u}=this.props,d=(0,ct.getLayoutItem)(a,t),p=u?a:(0,ct.compact)(a,(0,ct.compactType)(this.props),c);this.props.onResizeStop(p,l,d,null,i,s);const{oldLayout:h}=this.state;this.setState({activeDrag:null,layout:p,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(p,h)}),Or(this,"onDragOver",t=>{var w;if(t.preventDefault(),t.stopPropagation(),G5&&!((w=t.nativeEvent.target)!=null&&w.classList.contains(VO)))return!1;const{droppingItem:n,onDropDragOver:r,margin:o,cols:i,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,y=t.clientY-m.top,v={left:b/u,top:y/u,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:_,top:R}=this.state.droppingPosition;(_!=b||R!=y)&&this.setState({droppingPosition:v})}}else{const _={cols:i,margin:o,maxRows:a,rowHeight:s,containerWidth:l,containerPadding:c||o},R=(0,VJ.calcXY)(_,y,b,p.w,p.h);this.setState({droppingDOMNode:_l.createElement("div",{key:p.i}),droppingPosition:v,layout:[...h,{...p,x:R.x,y:R.y,static:!1,isDraggable:!0}]})}}),Or(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:n}=this.props,{layout:r}=this.state,o=(0,ct.compact)(r.filter(i=>i.i!==t.i),(0,ct.compactType)(this.props),n,this.props.allowOverlap);this.setState({layout:o,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),Or(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),Or(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),Or(this,"onDrop",t=>{t.preventDefault(),t.stopPropagation();const{droppingItem:n}=this.props,{layout:r}=this.state,o=r.find(i=>i.i===n.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(r,o,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,$x.deepEqual)(t.layout,n.propsLayout)||t.compactType!==n.compactType?r=t.layout:(0,ct.childrenEqual)(t.children,n.children)||(r=n.layout),r?{layout:(0,ct.synchronizeLayoutWithChildren)(r,t.children,t.cols,(0,ct.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,n){return this.props.children!==t.children||!(0,ct.fastRGLPropsEqual)(this.props,t,$x.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,o=n.layout;this.onLayoutMaybeChanged(r,o)}}containerHeight(){if(!this.props.autoSize)return;const t=(0,ct.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,$x.deepEqual)(n,t)||this.props.onLayoutChange(t)}placeholder(){const{activeDrag:t}=this.state;if(!t)return null;const{width:n,cols:r,margin:o,containerPadding:i,rowHeight:s,maxRows:a,useCSSTransforms:l,transformScale:c}=this.props;return _l.createElement(WO.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:o,containerPadding:i||o,maxRows:a,rowHeight:s,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:l,transformScale:c},_l.createElement("div",null))}processGridItem(t,n){if(!t||!t.key)return;const r=(0,ct.getLayoutItem)(this.state.layout,String(t.key));if(!r)return null;const{width:o,cols:i,margin:s,containerPadding:a,rowHeight:l,maxRows:c,isDraggable:u,isResizable:d,isBounded:p,useCSSTransforms:h,transformScale:m,draggableCancel:b,draggableHandle:y,resizeHandles:v,resizeHandle:w}=this.props,{mounted:_,droppingPosition:R}=this.state,C=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&u,E=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&d,P=r.resizeHandles||v,A=C&&p&&r.isBounded!==!1;return _l.createElement(WO.default,{containerWidth:o,cols:i,margin:s,containerPadding:a||s,maxRows:c,rowHeight:l,cancel:b,handle:y,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:C,isResizable:E,isBounded:A,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:P,resizeHandle:w},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:o}=this.props,i=(0,WJ.default)(VO,t),s={height:this.containerHeight(),...n};return _l.createElement("div",{ref:o,className:i,style:s,onDrop:r?this.onDrop:ct.noop,onDragLeave:r?this.onDragLeave:ct.noop,onDragEnter:r?this.onDragEnter:ct.noop,onDragOver:r?this.onDragOver:ct.noop},_l.Children.map(this.props.children,a=>this.processGridItem(a)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}_p.default=Ky;Or(Ky,"displayName","ReactGridLayout");Or(Ky,"propTypes",UJ.default);Or(Ky,"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:ct.noop,onDragStart:ct.noop,onDrag:ct.noop,onDragStop:ct.noop,onResizeStart:ct.noop,onResize:ct.noop,onResizeStop:ct.noop,onDrop:ct.noop,onDropDragOver:ct.noop});var Xy={},zc={};Object.defineProperty(zc,"__esModule",{value:!0});zc.findOrGenerateResponsiveLayout=QJ;zc.getBreakpointFromWidth=KJ;zc.getColsFromBreakpoint=XJ;zc.sortBreakpoints=$C;var Qg=Dt;function KJ(e,t){const n=$C(e);let r=n[0];for(let o=1,i=n.length;o<i;o++){const s=n[o];t>e[s]&&(r=s)}return r}function XJ(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function QJ(e,t,n,r,o,i){if(e[n])return(0,Qg.cloneLayout)(e[n]);let s=e[r];const a=$C(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,Qg.cloneLayout)(s||[]),(0,Qg.compact)((0,Qg.correctBounds)(s,{cols:o}),i,o)}function $C(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(Xy,"__esModule",{value:!0});Xy.default=void 0;var UO=JJ(k),lo=q5(il),jx=yC,Lu=Dt,Cl=zc,ZJ=q5(_p);function q5(e){return e&&e.__esModule?e:{default:e}}function Y5(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Y5=function(r){return r?n:t})(e)}function JJ(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Y5(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Z1(){return Z1=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},Z1.apply(this,arguments)}function Rb(e,t,n){return t=eee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eee(e){var t=tee(e,"string");return typeof t=="symbol"?t:String(t)}function tee(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);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const GO=e=>Object.prototype.toString.call(e);function Zg(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class jC extends UO.Component{constructor(){super(...arguments),Rb(this,"state",this.generateInitialState()),Rb(this,"onLayoutChange",t=>{this.props.onLayoutChange(t,{...this.props.layouts,[this.state.breakpoint]:t})})}generateInitialState(){const{width:t,breakpoints:n,layouts:r,cols:o}=this.props,i=(0,Cl.getBreakpointFromWidth)(n,t),s=(0,Cl.getColsFromBreakpoint)(i,o),a=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,Cl.findOrGenerateResponsiveLayout)(r,n,i,i,s,a),breakpoint:i,cols:s}}static getDerivedStateFromProps(t,n){if(!(0,jx.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:o}=n;return{layout:(0,Cl.findOrGenerateResponsiveLayout)(t.layouts,t.breakpoints,r,r,o,t.compactType),layouts:t.layouts}}return null}componentDidUpdate(t){(this.props.width!=t.width||this.props.breakpoint!==t.breakpoint||!(0,jx.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,jx.deepEqual)(this.props.cols,t.cols))&&this.onWidthChange(t)}onWidthChange(t){const{breakpoints:n,cols:r,layouts:o,compactType:i}=this.props,s=this.props.breakpoint||(0,Cl.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),a=this.state.breakpoint,l=(0,Cl.getColsFromBreakpoint)(s,r),c={...o};if(a!==s||t.breakpoints!==n||t.cols!==r){a in c||(c[a]=(0,Lu.cloneLayout)(this.state.layout));let p=(0,Cl.findOrGenerateResponsiveLayout)(c,n,s,a,l,i);p=(0,Lu.synchronizeLayoutWithChildren)(p,this.props.children,l,i,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=Zg(this.props.margin,s),d=Zg(this.props.containerPadding,s);this.props.onWidthChange(this.props.width,u,l,d)}render(){const{breakpoint:t,breakpoints:n,cols:r,layouts:o,margin:i,containerPadding:s,onBreakpointChange:a,onLayoutChange:l,onWidthChange:c,...u}=this.props;return UO.createElement(ZJ.default,Z1({},u,{margin:Zg(i,this.state.breakpoint),containerPadding:Zg(s,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}Xy.default=jC;Rb(jC,"propTypes",{breakpoint:lo.default.string,breakpoints:lo.default.object,allowOverlap:lo.default.bool,cols:lo.default.object,margin:lo.default.oneOfType([lo.default.array,lo.default.object]),containerPadding:lo.default.oneOfType([lo.default.array,lo.default.object]),layouts(e,t){if(GO(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+GO(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,Lu.validateLayout)(e.layouts[n],"layouts."+n)})},width:lo.default.number.isRequired,onBreakpointChange:lo.default.func,onLayoutChange:lo.default.func,onWidthChange:lo.default.func});Rb(jC,"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:Lu.noop,onLayoutChange:Lu.noop,onWidthChange:Lu.noop});var zC={},K5=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(o,i){return o[0]===n?(r=i,!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),o=this.__entries__[r];return o&&o[1]},t.prototype.set=function(n,r){var o=e(this.__entries__,n);~o?this.__entries__[o][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,o=e(r,n);~o&&r.splice(o,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 o=0,i=this.__entries__;o<i.length;o++){var s=i[o];n.call(r,s[1],s[0])}},t}()}(),J1=typeof window<"u"&&typeof document<"u"&&window.document===document,Tb=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")()}(),nee=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Tb):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),ree=2;function oee(e,t){var n=!1,r=!1,o=0;function i(){n&&(n=!1,e()),r&&a()}function s(){nee(i)}function a(){var l=Date.now();if(n){if(l-o<ree)return;r=!0}else n=!0,r=!1,setTimeout(s,t);o=l}return a}var iee=20,see=["top","right","bottom","left","width","height","size","weight"],aee=typeof MutationObserver<"u",lee=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=oee(this.refresh.bind(this),iee)}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(){!J1||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),aee?(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(){!J1||!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,o=see.some(function(i){return!!~r.indexOf(i)});o&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),X5=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e},dd=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||Tb},Q5=Qy(0,0,0,0);function kb(e){return parseFloat(e)||0}function qO(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,o){var i=e["border-"+o+"-width"];return r+kb(i)},0)}function cee(e){for(var t=["top","right","bottom","left"],n={},r=0,o=t;r<o.length;r++){var i=o[r],s=e["padding-"+i];n[i]=kb(s)}return n}function uee(e){var t=e.getBBox();return Qy(0,0,t.width,t.height)}function dee(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return Q5;var r=dd(e).getComputedStyle(e),o=cee(r),i=o.left+o.right,s=o.top+o.bottom,a=kb(r.width),l=kb(r.height);if(r.boxSizing==="border-box"&&(Math.round(a+i)!==t&&(a-=qO(r,"left","right")+i),Math.round(l+s)!==n&&(l-=qO(r,"top","bottom")+s)),!hee(e)){var c=Math.round(a+i)-t,u=Math.round(l+s)-n;Math.abs(c)!==1&&(a-=c),Math.abs(u)!==1&&(l-=u)}return Qy(o.left,o.top,a,l)}var fee=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof dd(e).SVGGraphicsElement}:function(e){return e instanceof dd(e).SVGElement&&typeof e.getBBox=="function"}}();function hee(e){return e===dd(e).document.documentElement}function pee(e){return J1?fee(e)?uee(e):dee(e):Q5}function gee(e){var t=e.x,n=e.y,r=e.width,o=e.height,i=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,s=Object.create(i.prototype);return X5(s,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),s}function Qy(e,t,n,r){return{x:e,y:t,width:n,height:r}}var mee=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Qy(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=pee(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}(),bee=function(){function e(t,n){var r=gee(n);X5(this,{target:t,contentRect:r})}return e}(),yee=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new K5,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 dd(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new mee(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 dd(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 bee(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}(),Z5=typeof WeakMap<"u"?new WeakMap:new K5,J5=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=lee.getInstance(),r=new yee(t,n,this);Z5.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){J5.prototype[e]=function(){var t;return(t=Z5.get(this))[e].apply(t,arguments)}});var vee=function(){return typeof Tb.ResizeObserver<"u"?Tb.ResizeObserver:J5}();const xee=Object.freeze(Object.defineProperty({__proto__:null,default:vee},Symbol.toStringTag,{value:"Module"})),wee=U_(xee);Object.defineProperty(zC,"__esModule",{value:!0});zC.default=Pee;var Jg=Eee(k),See=BC(il),_ee=BC(wee),Cee=BC(vC);function BC(e){return e&&e.__esModule?e:{default:e}}function eF(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(eF=function(r){return r?n:t})(e)}function Eee(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=eF(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function eS(){return eS=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},eS.apply(this,arguments)}function du(e,t,n){return t=Ree(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ree(e){var t=Tee(e,"string");return typeof t=="symbol"?t:String(t)}function Tee(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);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const kee="react-grid-layout";function Pee(e){var t;return t=class extends Jg.Component{constructor(){super(...arguments),du(this,"state",{width:1280}),du(this,"elementRef",Jg.createRef()),du(this,"mounted",!1),du(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new _ee.default(o=>{if(this.elementRef.current instanceof HTMLElement){const s=o[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,...o}=this.props;return r&&!this.mounted?Jg.createElement("div",{className:(0,Cee.default)(this.props.className,kee),style:this.props.style,ref:this.elementRef}):Jg.createElement(e,eS({innerRef:this.elementRef},o,this.state))}},du(t,"defaultProps",{measureBeforeMount:!1}),du(t,"propTypes",{measureBeforeMount:See.default.bool}),t}(function(e){e.exports=_p.default,e.exports.utils=Dt,e.exports.calculateUtils=ps,e.exports.Responsive=Xy.default,e.exports.Responsive.utils=zc,e.exports.WidthProvider=zC.default})(p5);var YO=p5.exports;function sl(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var Oee=["color"],Mee=k.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=sl(e,Oee);return k.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),k.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"}))}),Aee=["color"],HC=k.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=sl(e,Aee);return k.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),k.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"}))}),Dee=["color"],tF=k.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=sl(e,Dee);return k.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),k.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"}))}),Iee=["color"],Nee=k.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=sl(e,Iee);return k.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),k.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"}))}),Fee=["color"],Lee=k.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=sl(e,Fee);return k.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),k.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"}))}),$ee=["color"],jee=k.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=sl(e,$ee);return k.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),k.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"}))}),zee=["color"],nF=k.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=sl(e,zee);return k.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),k.createElement("path",{d:"M4 6H11L7.5 10.5L4 6Z",fill:r}))}),Bee=["color"],rF=k.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=sl(e,Bee);return k.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),k.createElement("path",{d:"M4 9H11L7.5 4.5L4 9Z",fill:r}))});let em;const Hee=new Uint8Array(16);function Wee(){if(!em&&(em=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!em))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return em(Hee)}const Sr=[];for(let e=0;e<256;++e)Sr.push((e+256).toString(16).slice(1));function Vee(e,t=0){return Sr[e[t+0]]+Sr[e[t+1]]+Sr[e[t+2]]+Sr[e[t+3]]+"-"+Sr[e[t+4]]+Sr[e[t+5]]+"-"+Sr[e[t+6]]+Sr[e[t+7]]+"-"+Sr[e[t+8]]+Sr[e[t+9]]+"-"+Sr[e[t+10]]+Sr[e[t+11]]+Sr[e[t+12]]+Sr[e[t+13]]+Sr[e[t+14]]+Sr[e[t+15]]}const Uee=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),KO={randomUUID:Uee};function Ga(e,t,n){if(KO.randomUUID&&!e)return KO.randomUUID();e=e||{};const r=e.random||(e.rng||Wee)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Vee(r)}const bo=mN()(_N((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:Ga(),title:"Editor Card",description:"Description",type:"bar",data:[]},frame:{id:Ga(),cards:[],activeCardId:""},actions:{updateCardTab:(n,r)=>{e(o=>{const i=o.frame,s={...i,cards:i.cards.map(l=>l.id===r.id?r:l),activeCardId:n};o.frame=s;const a=s.cards.find(l=>l.id===n);o.card=a})},setActiveTabCardId:n=>{e(r=>{r.activeTabCardId=n})},setCustomCardPreferences:n=>{e(r=>{r.card.customCardPreferences=n})},setChartOrientation:n=>{e(r=>{var s,a,l,c,u,d;const o=r.card.preferences;let i={};((s=o==null?void 0:o.chartOptions)==null?void 0:s.indexAxis)!==n&&(i={x:(l=(a=o==null?void 0:o.chartOptions)==null?void 0:a.scales)==null?void 0:l.y,y:(u=(c=o==null?void 0:o.chartOptions)==null?void 0:c.scales)==null?void 0:u.x}),r.card.preferences={...o,chartOptions:{...o==null?void 0:o.chartOptions,scales:{...(d=o==null?void 0:o.chartOptions)==null?void 0:d.scales,...i},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,o,i)=>{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:o,suffix:i,enabled:!0}}})},setColorRanges:n=>{e(r=>{var o,i;r.card.preferences={...r.card.preferences,formatNumber:{...(i=(o=r.card)==null?void 0:o.preferences)==null?void 0:i.formatNumber,colorRanges: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(o=>o.id===n.id?n:o)})},setFrame:n=>{e({frame:n})},setCard:n=>{e({card:n})},switchCardType:n=>{e(r=>{r.card.type=n,r.card.sql="",r.card.python="",r.card.cfg={},r.card.customCfg={},r.card.preferences={}})},setCardType:n=>{e(r=>{var o;r.card.type=n,n==="range"&&(r.card.preferences={...r.card.preferences,chartOptions:{...(o=r.card.preferences)==null?void 0:o.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(o=>{o.sqlGen.measures=[...o.sqlGen.measures||[],{name:n,calc:r}]})},setSqlGenDimension:n=>{e(r=>{r.sqlGen.dimensions=[...r.sqlGen.dimensions||[],n]})},setSelectedDatamodelId:n=>{var r,o;e(i=>{i.selectedDatamodelId=n,i.card.datamodelId=n}),(o=(r=t()).onDatamodelChange)==null||o.call(r,n)},setSelectedConnectionId:n=>{var r,o;e(i=>{i.selectedConnectionId=n,i.card.connectionId=n}),(o=(r=t()).onConnectionChange)==null||o.call(r,n)},setSelectedDatabaseName:n=>{var r,o;e(i=>{i.selectedDatabaseName=n,i.card.lastSelectedDatabase=n}),(o=(r=t()).onDatabaseChange)==null||o.call(r,n)},setSelectedSchemaName:n=>{var r,o;e(i=>{i.selectedSchemaName=n,i.card.lastSelectedSchema=n}),(o=(r=t()).onSchemaChange)==null||o.call(r,n)},setSelectedTableName:n=>{var r,o;e(i=>{i.selectedTableName=n,i.card.lastSelectedTable=n}),(o=(r=t()).onTableChange)==null||o.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})}}}))),Rp=()=>bo(e=>e.actions);function Gee(e){return/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/.test(e)}function qee(e,t=1){if(!Gee(e)||t===1)return e;e=e.replace(/^#/,"");const n=parseInt(e.substring(0,2),16),r=parseInt(e.substring(2,4),16),o=parseInt(e.substring(4,6),16);return t=Math.min(Math.max(t,0),1),`rgba(${n}, ${r}, ${o}, ${t})`}function Yee(e,t,n,r=1){var c,u,d,p;const o=n==null?void 0:n.datasetOptions,i=ye.getState().themeStyle,s=(u=(c=i==null?void 0:i.chart)==null?void 0:c.dataset)==null?void 0:u.backgroundColor,a=(p=(d=i==null?void 0:i.chart)==null?void 0:d.dataset)==null?void 0:p.borderColor;return e.map((h,m)=>{var R;const b=o==null?void 0:o.find(C=>C.idx===m),y=qee(s==null?void 0:s[m%s.length],r),v=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:Kee((R=b==null?void 0:b.datalabels)==null?void 0:R.align,y)},backgroundColor:y,pointBackgroundColor:v,borderColor:w}})}function Kee(e,t){return ud(e==="end"||e==="start"?Ih():t)}function Xee(e){var a,l,c,u;const{metricKeys:t,dimensionKeys:n}=hr(e);let r=[];const o=ye.getState().themeStyle,i=(l=(a=o==null?void 0:o.chart)==null?void 0:a.dataset)==null?void 0:l.backgroundColor,s=(u=(c=o==null?void 0:o.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:i==null?void 0:i[h%i.length],borderColor:s==null?void 0:s[h%s.length]}})),r}function Qee(e){var c,u,d,p;const{dimensionKeys:t,metricKeys:n}=hr(e),r=ye.getState().themeStyle,o=(u=(c=r==null?void 0:r.chart)==null?void 0:c.dataset)==null?void 0:u.backgroundColor,i=(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:o==null?void 0:o[m%o.length],borderColor:i==null?void 0:i[m%i.length],borderSkipped:!1}))}function Zee(e,t){var s,a,l,c;const n=ye.getState().themeStyle,r=(a=(s=n==null?void 0:n.chart)==null?void 0:s.dataset)==null?void 0:a.backgroundColor,o=(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)||(o==null?void 0:o[p%o.length]))}))}function Jee(e){let t=-1,n=0;return e.forEach((r,o)=>{const i=Object.keys(r).length;i>n&&(t=o,n=i)}),t}function hr(e){if(!e||e.length===0)return{keys:[],dimensionKeys:[],metricKeys:[]};const t=Jee(e),n=Object.keys(e[t]),r=n.filter(i=>{var s,a,l,c,u,d,p,h;return!!(typeof((s=e==null?void 0:e[t])==null?void 0:s[i])&&typeof((a=e==null?void 0:e[t])==null?void 0:a[i])=="string"||typeof((l=e==null?void 0:e[0])==null?void 0:l[i])&&typeof((c=e==null?void 0:e[0])==null?void 0:c[i])=="string"||typeof((u=e==null?void 0:e[1])==null?void 0:u[i])&&typeof((d=e==null?void 0:e[1])==null?void 0:d[i])=="string"||typeof((p=e==null?void 0:e[2])==null?void 0:p[i])&&typeof((h=e==null?void 0:e[2])==null?void 0:h[i])=="string")});r.length===0&&r.push(n[0]);const o=n.filter(i=>{var s,a;return((s=e==null?void 0:e[t])==null?void 0:s[i])===+((a=e==null?void 0:e[t])==null?void 0:a[i])});return{keys:n,dimensionKeys:r,metricKeys:o}}function Yf(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((i,s)=>({...i,...n==null?void 0:n[s],data:i.data,label:i.label})):e}function ete(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,o)=>{const i=n(r),s=n(o);return t==="asc"?i-s:s-i})}function Pb({dataArray:e,groupKey:t,pivotKey:n,valueKey:r,sortChart:o}){const i=e.reduce((l,c)=>{const u=c[t],d=c[n],p=c[r];return l[u]||(l[u]={[t]:u}),l[u][d]=p,l},{});let s=Object.values(i);return o!=="none"&&o!==void 0&&(s=ete(s,o)),s.map(l=>Object.fromEntries(Object.entries(l).filter(([c,u])=>u!==0)))}function go(e,t){var s;const n=ye.getState().themeStyle,r=(s=n==null?void 0:n.chart)==null?void 0:s.options,o=sc.cloneDeep(r);return sc.merge(o,e,t)}function tS(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 tte=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),oF=(...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 nte={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 iF=k.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},l)=>k.createElement("svg",{ref:l,...nte,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:oF("lucide",o),...a},[...s.map(([c,u])=>k.createElement(c,u)),...Array.isArray(i)?i:[i]]));/**
128
+ * @license lucide-react v0.453.0 - ISC
129
+ *
130
+ * This source code is licensed under the ISC license.
131
+ * See the LICENSE file in the root directory of this source tree.
132
+ */const Gt=(e,t)=>{const n=k.forwardRef(({className:r,...o},i)=>k.createElement(iF,{ref:i,iconNode:t,className:oF(`lucide-${tte(e)}`,r),...o}));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 sF=Gt("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
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 Fd=Gt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
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 Tp=Gt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
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 aF=Gt("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
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 WC=Gt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
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 lF=Gt("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
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 VC=Gt("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
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 UC=Gt("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
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 cF=Gt("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
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 uF=Gt("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
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 dF=Gt("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
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 GC=Gt("FilterX",[["path",{d:"M13.013 3H2l8 9.46V19l4 2v-8.54l.9-1.055",key:"1fi1da"}],["path",{d:"m22 3-5 5",key:"12jva0"}],["path",{d:"m17 3 5 5",key:"k36vhe"}]]);/**
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 fF=Gt("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
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 hF=Gt("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
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 pF=Gt("IdCard",[["path",{d:"M16 10h2",key:"8sgtl7"}],["path",{d:"M16 14h2",key:"epxaof"}],["path",{d:"M6.17 15a3 3 0 0 1 5.66 0",key:"n6f512"}],["circle",{cx:"9",cy:"11",r:"2",key:"yxgjnd"}],["rect",{x:"2",y:"5",width:"20",height:"14",rx:"2",key:"qneu4z"}]]);/**
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 gF=Gt("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
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 mF=Gt("LightbulbOff",[["path",{d:"M16.8 11.2c.8-.9 1.2-2 1.2-3.2a6 6 0 0 0-9.3-5",key:"1fkcox"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M6.3 6.3a4.67 4.67 0 0 0 1.2 5.2c.7.7 1.3 1.5 1.5 2.5",key:"10m8kw"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
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 bF=Gt("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
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 yF=Gt("Octagon",[["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}]]);/**
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 vF=Gt("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
233
+ * @license lucide-react v0.453.0 - ISC
234
+ *
235
+ * This source code is licensed under the ISC license.
236
+ * See the LICENSE file in the root directory of this source tree.
237
+ */const xF=Gt("Percent",[["line",{x1:"19",x2:"5",y1:"5",y2:"19",key:"1x9vlm"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5",key:"4mh3h7"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5",key:"1mdrzq"}]]);/**
238
+ * @license lucide-react v0.453.0 - ISC
239
+ *
240
+ * This source code is licensed under the ISC license.
241
+ * See the LICENSE file in the root directory of this source tree.
242
+ */const wF=Gt("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
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 Zy=Gt("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
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 SF=Gt("SearchX",[["path",{d:"m13.5 8.5-5 5",key:"1cs55j"}],["path",{d:"m8.5 8.5 5 5",key:"a8mexj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
253
+ * @license lucide-react v0.453.0 - ISC
254
+ *
255
+ * This source code is licensed under the ISC license.
256
+ * See the LICENSE file in the root directory of this source tree.
257
+ */const _F=Gt("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
258
+ * @license lucide-react v0.453.0 - ISC
259
+ *
260
+ * This source code is licensed under the ISC license.
261
+ * See the LICENSE file in the root directory of this source tree.
262
+ */const CF=Gt("SendHorizontal",[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]]);/**
263
+ * @license lucide-react v0.453.0 - ISC
264
+ *
265
+ * This source code is licensed under the ISC license.
266
+ * See the LICENSE file in the root directory of this source tree.
267
+ */const EF=Gt("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
268
+ * @license lucide-react v0.453.0 - ISC
269
+ *
270
+ * This source code is licensed under the ISC license.
271
+ * See the LICENSE file in the root directory of this source tree.
272
+ */const RF=Gt("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
273
+ * @license lucide-react v0.453.0 - ISC
274
+ *
275
+ * This source code is licensed under the ISC license.
276
+ * See the LICENSE file in the root directory of this source tree.
277
+ */const TF=Gt("Table2",[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]]);/**
278
+ * @license lucide-react v0.453.0 - ISC
279
+ *
280
+ * This source code is licensed under the ISC license.
281
+ * See the LICENSE file in the root directory of this source tree.
282
+ */const kF=Gt("TreePalm",[["path",{d:"M13 8c0-2.76-2.46-5-5.5-5S2 5.24 2 8h2l1-1 1 1h4",key:"foxbe7"}],["path",{d:"M13 7.14A5.82 5.82 0 0 1 16.5 6c3.04 0 5.5 2.24 5.5 5h-3l-1-1-1 1h-3",key:"18arnh"}],["path",{d:"M5.89 9.71c-2.15 2.15-2.3 5.47-.35 7.43l4.24-4.25.7-.7.71-.71 2.12-2.12c-1.95-1.96-5.27-1.8-7.42.35",key:"ywahnh"}],["path",{d:"M11 15.5c.5 2.5-.17 4.5-1 6.5h4c2-5.5-.5-12-1-14",key:"ft0feo"}]]);/**
283
+ * @license lucide-react v0.453.0 - ISC
284
+ *
285
+ * This source code is licensed under the ISC license.
286
+ * See the LICENSE file in the root directory of this source tree.
287
+ */const PF=Gt("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);/**
288
+ * @license lucide-react v0.453.0 - ISC
289
+ *
290
+ * This source code is licensed under the ISC license.
291
+ * See the LICENSE file in the root directory of this source tree.
292
+ */const OF=Gt("UserSearch",[["circle",{cx:"10",cy:"7",r:"4",key:"e45bow"}],["path",{d:"M10.3 15H7a4 4 0 0 0-4 4v2",key:"3bnktk"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["path",{d:"m21 21-1.9-1.9",key:"1g2n9r"}]]);/**
293
+ * @license lucide-react v0.453.0 - ISC
294
+ *
295
+ * This source code is licensed under the ISC license.
296
+ * See the LICENSE file in the root directory of this source tree.
297
+ */const Bc=Gt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),rte=({data:e,filename:t="output.csv"})=>{const n=()=>{if(e.length===0)return;const r=[],o=Object.keys(e[0]);r.push(o.join(","));for(const c of e){const u=o.map(d=>`"${(""+c[d]).replace(/"/g,'""')}"`);r.push(u.join(","))}const i=r.join(`
298
+ `),s=new Blob([i],{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 x.jsx(cF,{onClick:n,className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})};var fd=1e3,hd=fd*60,pd=hd*60,Ec=pd*24,ote=Ec*7,ite=Ec*365.25,ste=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return ate(e);if(n==="number"&&isFinite(e))return t.long?cte(e):lte(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function ate(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*ite;case"weeks":case"week":case"w":return n*ote;case"days":case"day":case"d":return n*Ec;case"hours":case"hour":case"hrs":case"hr":case"h":return n*pd;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*fd;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function lte(e){var t=Math.abs(e);return t>=Ec?Math.round(e/Ec)+"d":t>=pd?Math.round(e/pd)+"h":t>=hd?Math.round(e/hd)+"m":t>=fd?Math.round(e/fd)+"s":e+"ms"}function cte(e){var t=Math.abs(e);return t>=Ec?tm(e,t,Ec,"day"):t>=pd?tm(e,t,pd,"hour"):t>=hd?tm(e,t,hd,"minute"):t>=fd?tm(e,t,fd,"second"):e+" ms"}function tm(e,t,n,r){var o=t>=n*1.5;return Math.round(e/n)+" "+r+(o?"s":"")}const ute=ol(ste);function dte(e){const t=ye(u=>u.selectedSheetId),n=ye(u=>u.selectedLensId);ye(u=>u.dashboard.baseQueries);const r=ye(u=>u.dashboard.filters),o=ye(u=>u.filterValues),i=r==null?void 0:r.filter(u=>u.sheetId===t||!u.sheetId),s=o==null?void 0:o.filter(u=>(i==null?void 0:i.some(d=>d.id===u.filterId))||u.filterId.endsWith(t)),a=(e==null?void 0:e.sql)||"",l=fte((e==null?void 0:e.python)||"");return{queryKey:["query",e==null?void 0:e.id,e==null?void 0:e.title,a,l,n||"",JSON.stringify(s)],sql:a,sheetFilterValues:s}}function fte(e){return e===Z_?"":e}function qa(e,t){const{authToken:n}=Uo(),r=ye(p=>p.isVisualEditing),o=ye(p=>p.authToken),i=ute((e==null?void 0:e.refreshInterval)||"0"),{queryKey:s,sql:a,sheetFilterValues:l}=dte(e);let c={};return r||(c={refetchInterval:i}),{...Sp({queryKey:s,queryFn:async()=>{var p;if(!(e!=null&&e.connectionId)||!((p=e==null?void 0:e.sql)!=null&&p.trim()))return null;try{return await Ay("https://semaphor.cloud/api/v1/query",(n==null?void 0:n.accessToken)||(o==null?void 0:o.accessToken)||"",{connection_id:e.connectionId,sql:a,python:e.python===Z_?"":e.python,active_filters:l,cache_config:oC({card:e})})}catch(h){if(r)return{records:[],error:h};throw h}},placeholderData:jX,...c,enabled:!!(e!=null&&e.connectionId)&&!!(e!=null&&e.sql)&&!0&&!r}),queryKey:s}}function MF({frame:e}){var C;const t=ye(E=>E.isDashboardEditing),n=ye(E=>E.filterValues),r=ye(E=>E.isVisualEditing),o=ye(E=>E.selectedSheetId);ye(E=>E.currentBreakpoint);const{removeFrame:i}=ye(E=>E.actions),s=ye(E=>E.actions.setIsVisualEditing),a=bo(E=>E.actions.setFilterValues),l=bo(E=>E.actions.setApplyFilters),{setCard:c,setFrame:u,setQueryResultColumns:d,setActiveTabCardId:p}=Rp(),h=bo(E=>E.actions.setSelectedConnectionId),m=bo(E=>E.actions.setSelectedDatamodelId),b=bo(E=>E.actions.setSelectedDatabaseName),y=bo(E=>E.actions.setSelectedSchemaName),v=bo(E=>E.actions.setSelectedTableName),w=e.cards.find(E=>E.id===e.activeCardId),{data:_}=qa(w);function R(){s(!r),c(w),p(e.activeCardId);const{dimensionKeys:E}=hr((_==null?void 0:_.records)||[]);d(E),u(e),w!=null&&w.connectionId&&h(w==null?void 0:w.connectionId),w!=null&&w.datamodelId&&w.datamodelId!=="none"&&(m(w==null?void 0:w.datamodelId),b("")),w!=null&&w.lastSelectedDatabase&&w.lastSelectedDatabase!=="none"&&(b(w==null?void 0:w.lastSelectedDatabase),m("")),w!=null&&w.lastSelectedSchema&&y(w==null?void 0:w.lastSelectedSchema),w!=null&&w.lastSelectedTable&&v(w==null?void 0:w.lastSelectedTable),n&&(a(n),l(!0))}return x.jsx("section",{onMouseDown:E=>{E.stopPropagation()},className:"absolute right-2 top-2 z-50",children:x.jsxs("div",{className:"flex items-center gap-2",children:[t&&(r?x.jsx("button",{onClick:()=>{s(!r)},children:x.jsx(Nee,{className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})}):x.jsx("button",{role:"edit-visual",onClick:R,children:x.jsx(Lee,{className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})})),t&&x.jsx("button",{onClick:()=>i(o,e.id),children:x.jsx(tF,{className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})}),((C=w.preferences)==null?void 0:C.allowDownload)===!0&&x.jsx(rte,{data:(_==null?void 0:_.records)||[],filename:w.title})]})})}function hte(e,t){ye(c=>c.selectedSheetId);const n=ye(c=>c.selectedFrameId),r=ye(c=>c.isDashboardEditing),o=ye(c=>c.isVisualEditing),{addFrame:i,getSelectedFrame:s,setSelectedFrameId:a}=ye(c=>c.actions);k.useEffect(()=>{n===e.id&&r&&!o&&l()},[n,e.id,r,o]);function l(){const c=t==null?void 0:t.current;c==null||c.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}}const pte=k.createContext(null),zx={didCatch:!1,error:null};class Jy extends k.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=zx}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var n,r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];(n=(r=this.props).onReset)===null||n===void 0||n.call(r,{args:i,reason:"imperative-api"}),this.setState(zx)}}componentDidCatch(t,n){var r,o;(r=(o=this.props).onError)===null||r===void 0||r.call(o,t,n)}componentDidUpdate(t,n){const{didCatch:r}=this.state,{resetKeys:o}=this.props;if(r&&n.error!==null&&gte(t.resetKeys,o)){var i,s;(i=(s=this.props).onReset)===null||i===void 0||i.call(s,{next:o,prev:t.resetKeys,reason:"keys"}),this.setState(zx)}}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:o}=this.props,{didCatch:i,error:s}=this.state;let a=t;if(i){const l={error:s,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")a=n(l);else if(r)a=k.createElement(r,l);else if(o!==void 0)a=o;else throw s}return k.createElement(pte.Provider,{value:{didCatch:i,error:s,resetErrorBoundary:this.resetErrorBoundary}},a)}}function gte(){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 qC({error:e}){return x.jsx("div",{className:"flex flex-col items-center justify-center",role:"alert",style:{height:"100%",width:"100%"},children:x.jsxs("div",{className:"flex flex-col justify-center space-y-2 rounded-md bg-muted p-10",children:[x.jsx("p",{className:"text-lg font-semibold",children:"Oops! Looks like we tripped on a loose wire!"}),x.jsx("p",{className:"text-sm",children:"Something went wrong:"}),x.jsx("pre",{className:"text-xs",children:e.message})]})})}function mte({error:e,frame:t}){return x.jsxs("div",{className:"flex h-full flex-col items-center justify-center border",role:"alert",children:[x.jsx(MF,{frame:t}),x.jsx("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10"}),x.jsxs("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10",children:[x.jsx("p",{className:"text-lg font-semibold",children:"Oops! Looks like we tripped on a loose wire!"}),x.jsx("p",{className:"text-sm",children:"Something went wrong:"}),x.jsx("pre",{className:"text-xs",children:e.message})]})]})}function bte({error:e}){return x.jsxs("div",{className:"flex h-full flex-col items-center justify-center",role:"alert",children:[x.jsx("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10"}),x.jsxs("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10",children:[x.jsx("p",{className:"text-lg font-semibold",children:"Oops! Something went wrong!"}),x.jsx("p",{className:"text-sm",children:"Something went wrong:"}),x.jsx("pre",{className:"text-xs",children:e.message})]})]})}function li({number:e,decimalPlaces:t=0,useSuffix:n=!1,customSuffix:r="",currency:o="",locale:i="en-US"}){let s=1,a=r,l=i;const c=t;n&&!r&&(e>=1e9?(s=1e9,a="B"):e>=1e7&&i==="en-IN"?(s=1e7,a="Cr"):e>=1e5&&i==="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(o){d.style="currency",d.currency=o;try{new Intl.NumberFormat(i,d).format(0)}catch{}}try{new Intl.NumberFormat(i,d).format(0)}catch{l="en-US"}let h=new Intl.NumberFormat(l,d).format(u);return n&&(h+=a),h}function YC(e,t){if(!t)return"";const n=t.find(r=>e>=r.start&&e<=r.end);return(n==null?void 0:n.color)||""}function nS(e){try{const n=new Function("getDatalabelColor",e)(R1);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 yte(e){const t=getComputedStyle(document.documentElement).getPropertyValue(e);return AF(t)}function AF(e){const[t,n,r]=e.split(" "),o=parseFloat(t),i=parseFloat(n),s=parseFloat(r),a=i/100,l=s/100,c=(1-Math.abs(2*l-1))*a,u=c*(1-Math.abs(o/60%2-1)),d=l-c/2;let p=0,h=0,m=0;0<=o&&o<60?(p=c,h=u,m=0):60<=o&&o<120?(p=u,h=c,m=0):120<=o&&o<180?(p=0,h=c,m=u):180<=o&&o<240?(p=0,h=u,m=c):240<=o&&o<300?(p=u,h=0,m=c):300<=o&&o<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=y=>{const v=y.toString(16);return v.length==1?"0"+v:v};return`#${b(p)}${b(h)}${b(m)}`}function El({data:e,cfg:t,customCfg:n,preferences:r,cardType:o}){ye.getState().themeStyle;const i=o==="radar"?.2:1,{dimensionKeys:s,metricKeys:a}=hr(e),l=Yee(a,e,r,i),c=Yf(l,n),u=s[0],d=tS(e,u);KC(r,t),DF(r);const{options:p,plugins:h}=NF({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 KC(e,t){var o,i,s;const n=((o=t==null?void 0:t.options)==null?void 0:o.indexAxis)==="y"?"x":"y";return(i=e==null?void 0:e.chartOptions)!=null&&i.indexAxis?((s=e==null?void 0:e.chartOptions)==null?void 0:s.indexAxis)==="x"?"y":"x":n}function DF(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 IF(e,t){var i,s,a,l,c,u,d,p,h,m,b,y;const n=KC(t,e),r=DF(t);return{...e==null?void 0:e.options,scales:{...(i=e==null?void 0:e.options)==null?void 0:i.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:v=>{var w,_,R,C;return li({number:Number(v),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:{...(y=(b=e==null?void 0:e.options)==null?void 0:b.plugins)==null?void 0:y.datalabels,formatter:function(v){var w,_,R,C;return li({number:Number(v),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 NF({cfg:e,preferences:t,customCfg:n}){var p,h,m,b,y,v,w,_,R,C,E,P,A,I,F,L,j,X,U,$,B,W,q,Q,D,G,V,M,ee,K,re;const r=ye.getState().themeStyle,o=IF(e,t),i=go((e==null?void 0:e.options)||{},t==null?void 0:t.chartOptions),s=go(o,i),a=go(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=(v=(y=(b=r==null?void 0:r.chart)==null?void 0:b.options)==null?void 0:y.scales)==null?void 0:v.x)==null?void 0:w.grid)==null?void 0:_.color}},y:{...(R=a==null?void 0:a.scales)==null?void 0:R.y,grid:{...(E=(C=a==null?void 0:a.scales)==null?void 0:C.y)==null?void 0:E.grid,color:(L=(F=(I=(A=(P=r==null?void 0:r.chart)==null?void 0:P.options)==null?void 0:A.scales)==null?void 0:I.y)==null?void 0:F.grid)==null?void 0:L.color}}},plugins:{...a==null?void 0:a.plugins,tooltip:{filter:function(Y){return Y.raw!==void 0&&Y.raw!==0},callbacks:{title:function(Y){var ie,de,he,se,ge;const J=((ie=Y==null?void 0:Y[0])==null?void 0:ie.label)||"";if(Y.length>1){const ue=Y.reduce((ke,Ne)=>{const Oe=Ne.raw;return Oe!==void 0&&Oe!==0?ke+Oe:ke},0),Ce=li({number:ue,decimalPlaces:((de=t==null?void 0:t.numberAxisFormat)==null?void 0:de.decimalPlaces)||0,useSuffix:!!((he=t==null?void 0:t.numberAxisFormat)!=null&&he.suffix),customSuffix:"",locale:((se=t==null?void 0:t.numberAxisFormat)==null?void 0:se.locale)||"",currency:((ge=t==null?void 0:t.numberAxisFormat)==null?void 0:ge.currency)||""});return`${J} (${Ce})`}return J},label:function(Y){var he,se,ge,ue,Ce;const J=((he=Y==null?void 0:Y.dataset)==null?void 0:he.label)||"",ie=Y==null?void 0:Y.raw;if(ie===void 0||ie===0)return;const de=li({number:Number(ie),decimalPlaces:((se=t==null?void 0:t.numberAxisFormat)==null?void 0:se.decimalPlaces)||0,useSuffix:!!((ge=t==null?void 0:t.numberAxisFormat)!=null&&ge.suffix),customSuffix:"",locale:((ue=t==null?void 0:t.numberAxisFormat)==null?void 0:ue.locale)||"",currency:((Ce=t==null?void 0:t.numberAxisFormat)==null?void 0:Ce.currency)||""});return`${J}: ${de}`},...(X=(j=a==null?void 0:a.plugins)==null?void 0:j.tooltip)==null?void 0:X.callbacks},...(U=a==null?void 0:a.plugins)==null?void 0:U.tooltip,backgroundColor:(q=(W=(B=($=r==null?void 0:r.chart)==null?void 0:$.options)==null?void 0:B.plugins)==null?void 0:W.tooltip)==null?void 0:q.backgroundColor,bodyColor:(V=(G=(D=(Q=r==null?void 0:r.chart)==null?void 0:Q.options)==null?void 0:D.plugins)==null?void 0:G.tooltip)==null?void 0:V.bodyColor,titleColor:(re=(K=(ee=(M=r==null?void 0:r.chart)==null?void 0:M.options)==null?void 0:ee.plugins)==null?void 0:K.tooltip)==null?void 0:re.titleColor}}},{plugins:c,options:u}=nS((t==null?void 0:t.customVisualCode)||"");return{options:go(l,u),plugins:c}}/*!
299
+ * @kurkle/color v0.3.4
300
+ * https://github.com/kurkle/color#readme
301
+ * (c) 2024 Jukka Kurkela
302
+ * Released under the MIT License
303
+ */function kp(e){return e+.5|0}const Fa=(e,t,n)=>Math.max(Math.min(e,n),t);function Kf(e){return Fa(kp(e*2.55),0,255)}function Wa(e){return Fa(kp(e*255),0,255)}function zs(e){return Fa(kp(e/2.55)/100,0,1)}function XO(e){return Fa(kp(e*100),0,100)}const ni={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},rS=[..."0123456789ABCDEF"],vte=e=>rS[e&15],xte=e=>rS[(e&240)>>4]+rS[e&15],nm=e=>(e&240)>>4===(e&15),wte=e=>nm(e.r)&&nm(e.g)&&nm(e.b)&&nm(e.a);function Ste(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&ni[e[1]]*17,g:255&ni[e[2]]*17,b:255&ni[e[3]]*17,a:t===5?ni[e[4]]*17:255}:(t===7||t===9)&&(n={r:ni[e[1]]<<4|ni[e[2]],g:ni[e[3]]<<4|ni[e[4]],b:ni[e[5]]<<4|ni[e[6]],a:t===9?ni[e[7]]<<4|ni[e[8]]:255})),n}const _te=(e,t)=>e<255?t(e):"";function Cte(e){var t=wte(e)?vte:xte;return e?"#"+t(e.r)+t(e.g)+t(e.b)+_te(e.a,t):void 0}const Ete=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function FF(e,t,n){const r=t*Math.min(n,1-n),o=(i,s=(i+e/30)%12)=>n-r*Math.max(Math.min(s-3,9-s,1),-1);return[o(0),o(8),o(4)]}function Rte(e,t,n){const r=(o,i=(o+e/60)%6)=>n-n*t*Math.max(Math.min(i,4-i,1),0);return[r(5),r(3),r(1)]}function Tte(e,t,n){const r=FF(e,1,.5);let o;for(t+n>1&&(o=1/(t+n),t*=o,n*=o),o=0;o<3;o++)r[o]*=1-t-n,r[o]+=t;return r}function kte(e,t,n,r,o){return e===o?(t-n)/r+(t<n?6:0):t===o?(n-e)/r+2:(e-t)/r+4}function XC(e){const n=e.r/255,r=e.g/255,o=e.b/255,i=Math.max(n,r,o),s=Math.min(n,r,o),a=(i+s)/2;let l,c,u;return i!==s&&(u=i-s,c=a>.5?u/(2-i-s):u/(i+s),l=kte(n,r,o,u,i),l=l*60+.5),[l|0,c||0,a]}function QC(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(Wa)}function ZC(e,t,n){return QC(FF,e,t,n)}function Pte(e,t,n){return QC(Tte,e,t,n)}function Ote(e,t,n){return QC(Rte,e,t,n)}function LF(e){return(e%360+360)%360}function Mte(e){const t=Ete.exec(e);let n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?Kf(+t[5]):Wa(+t[5]));const o=LF(+t[2]),i=+t[3]/100,s=+t[4]/100;return t[1]==="hwb"?r=Pte(o,i,s):t[1]==="hsv"?r=Ote(o,i,s):r=ZC(o,i,s),{r:r[0],g:r[1],b:r[2],a:n}}function Ate(e,t){var n=XC(e);n[0]=LF(n[0]+t),n=ZC(n),e.r=n[0],e.g=n[1],e.b=n[2]}function Dte(e){if(!e)return;const t=XC(e),n=t[0],r=XO(t[1]),o=XO(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${o}%, ${zs(e.a)})`:`hsl(${n}, ${r}%, ${o}%)`}const QO={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"},ZO={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function Ite(){const e={},t=Object.keys(ZO),n=Object.keys(QO);let r,o,i,s,a;for(r=0;r<t.length;r++){for(s=a=t[r],o=0;o<n.length;o++)i=n[o],a=a.replace(i,QO[i]);i=parseInt(ZO[s],16),e[a]=[i>>16&255,i>>8&255,i&255]}return e}let rm;function Nte(e){rm||(rm=Ite(),rm.transparent=[0,0,0,0]);const t=rm[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Fte=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Lte(e){const t=Fte.exec(e);let n=255,r,o,i;if(t){if(t[7]!==r){const s=+t[7];n=t[8]?Kf(s):Fa(s*255,0,255)}return r=+t[1],o=+t[3],i=+t[5],r=255&(t[2]?Kf(r):Fa(r,0,255)),o=255&(t[4]?Kf(o):Fa(o,0,255)),i=255&(t[6]?Kf(i):Fa(i,0,255)),{r,g:o,b:i,a:n}}}function $te(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${zs(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const Bx=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,fu=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function jte(e,t,n){const r=fu(zs(e.r)),o=fu(zs(e.g)),i=fu(zs(e.b));return{r:Wa(Bx(r+n*(fu(zs(t.r))-r))),g:Wa(Bx(o+n*(fu(zs(t.g))-o))),b:Wa(Bx(i+n*(fu(zs(t.b))-i))),a:e.a+n*(t.a-e.a)}}function om(e,t,n){if(e){let r=XC(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=ZC(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function $F(e,t){return e&&Object.assign(t||{},e)}function JO(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=Wa(e[3]))):(t=$F(e,{r:0,g:0,b:0,a:1}),t.a=Wa(t.a)),t}function zte(e){return e.charAt(0)==="r"?Lte(e):Mte(e)}let jF=class oS{constructor(t){if(t instanceof oS)return t;const n=typeof t;let r;n==="object"?r=JO(t):n==="string"&&(r=Ste(t)||Nte(t)||zte(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var t=$F(this._rgb);return t&&(t.a=zs(t.a)),t}set rgb(t){this._rgb=JO(t)}rgbString(){return this._valid?$te(this._rgb):void 0}hexString(){return this._valid?Cte(this._rgb):void 0}hslString(){return this._valid?Dte(this._rgb):void 0}mix(t,n){if(t){const r=this.rgb,o=t.rgb;let i;const s=n===i?.5:n,a=2*s-1,l=r.a-o.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;i=1-c,r.r=255&c*r.r+i*o.r+.5,r.g=255&c*r.g+i*o.g+.5,r.b=255&c*r.b+i*o.b+.5,r.a=s*r.a+(1-s)*o.a,this.rgb=r}return this}interpolate(t,n){return t&&(this._rgb=jte(this._rgb,t._rgb,n)),this}clone(){return new oS(this.rgb)}alpha(t){return this._rgb.a=Wa(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=kp(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 om(this._rgb,2,t),this}darken(t){return om(this._rgb,2,-t),this}saturate(t){return om(this._rgb,1,t),this}desaturate(t){return om(this._rgb,1,-t),this}rotate(t){return Ate(this._rgb,t),this}};/*!
304
+ * Chart.js v4.4.8
305
+ * https://www.chartjs.org
306
+ * (c) 2025 Chart.js Contributors
307
+ * Released under the MIT License
308
+ */function As(){}const Bte=(()=>{let e=0;return()=>e++})();function yt(e){return e==null}function kn(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 Lt(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function Wn(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Io(e,t){return Wn(e)?e:t}function ut(e,t){return typeof e>"u"?t:e}const Hte=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,zF=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function hn(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function sn(e,t,n,r){let o,i,s;if(kn(e))for(i=e.length,o=0;o<i;o++)t.call(n,e[o],o);else if(Lt(e))for(s=Object.keys(e),i=s.length,o=0;o<i;o++)t.call(n,e[s[o]],s[o])}function Ob(e,t){let n,r,o,i;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(o=e[n],i=t[n],o.datasetIndex!==i.datasetIndex||o.index!==i.index)return!1;return!0}function Mb(e){if(kn(e))return e.map(Mb);if(Lt(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let o=0;for(;o<r;++o)t[n[o]]=Mb(e[n[o]]);return t}return e}function BF(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function Wte(e,t,n,r){if(!BF(e))return;const o=t[e],i=n[e];Lt(o)&&Lt(i)?mr(o,i,r):t[e]=Mb(i)}function mr(e,t,n){const r=kn(t)?t:[t],o=r.length;if(!Lt(e))return e;n=n||{};const i=n.merger||Wte;let s;for(let a=0;a<o;++a){if(s=r[a],!Lt(s))continue;const l=Object.keys(s);for(let c=0,u=l.length;c<u;++c)i(l[c],e,s,n)}return e}function uh(e,t){return mr(e,t,{merger:Vte})}function Vte(e,t,n){if(!BF(e))return;const r=t[e],o=n[e];Lt(r)&&Lt(o)?uh(r,o):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Mb(o))}const e2={"":e=>e,x:e=>e.x,y:e=>e.y};function Ute(e){const t=e.split("."),n=[];let r="";for(const o of t)r+=o,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function Gte(e){const t=Ute(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function Ya(e,t){return(e2[t]||(e2[t]=Gte(t)))(e)}function JC(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Lh=e=>typeof e<"u",Ka=e=>typeof e=="function",t2=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function qte(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Mn=Math.PI,Pn=2*Mn,Yte=Pn+Mn,Ab=Number.POSITIVE_INFINITY,Kte=Mn/180,qn=Mn/2,Rl=Mn/4,n2=Mn*2/3,La=Math.log10,rs=Math.sign;function dh(e,t,n){return Math.abs(e-t)<n}function r2(e){const t=Math.round(e);e=dh(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(La(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function Xte(e){const t=[],n=Math.sqrt(e);let r;for(r=1;r<n;r++)e%r===0&&(t.push(r),t.push(e/r));return n===(n|0)&&t.push(n),t.sort((o,i)=>o-i).pop(),t}function Qte(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function gd(e){return!Qte(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function Zte(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function HF(e,t,n){let r,o,i;for(r=0,o=e.length;r<o;r++)i=e[r][n],isNaN(i)||(t.min=Math.min(t.min,i),t.max=Math.max(t.max,i))}function Pi(e){return e*(Mn/180)}function eE(e){return e*(180/Mn)}function o2(e){if(!Wn(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function WF(e,t){const n=t.x-e.x,r=t.y-e.y,o=Math.sqrt(n*n+r*r);let i=Math.atan2(r,n);return i<-.5*Mn&&(i+=Pn),{angle:i,distance:o}}function iS(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function Jte(e,t){return(e-t+Yte)%Pn-Mn}function Fo(e){return(e%Pn+Pn)%Pn}function $h(e,t,n,r){const o=Fo(e),i=Fo(t),s=Fo(n),a=Fo(i-o),l=Fo(s-o),c=Fo(o-i),u=Fo(o-s);return o===i||o===s||r&&i===s||a>l&&c<u}function gr(e,t,n){return Math.max(t,Math.min(n,e))}function ene(e){return gr(e,-32768,32767)}function Gs(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function tE(e,t,n){n=n||(s=>e[s]<t);let r=e.length-1,o=0,i;for(;r-o>1;)i=o+r>>1,n(i)?o=i:r=i;return{lo:o,hi:r}}const qs=(e,t,n,r)=>tE(e,n,r?o=>{const i=e[o][t];return i<n||i===n&&e[o+1][t]===n}:o=>e[o][t]<n),tne=(e,t,n)=>tE(e,n,r=>e[r][t]>=n);function nne(e,t,n){let r=0,o=e.length;for(;r<o&&e[r]<t;)r++;for(;o>r&&e[o-1]>n;)o--;return r>0||o<e.length?e.slice(r,o):e}const VF=["push","pop","shift","splice","unshift"];function rne(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),VF.forEach(n=>{const r="_onData"+JC(n),o=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...i){const s=o.apply(this,i);return e._chartjs.listeners.forEach(a=>{typeof a[r]=="function"&&a[r](...i)}),s}})})}function i2(e,t){const n=e._chartjs;if(!n)return;const r=n.listeners,o=r.indexOf(t);o!==-1&&r.splice(o,1),!(r.length>0)&&(VF.forEach(i=>{delete e[i]}),delete e._chartjs)}function UF(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const GF=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function qF(e,t){let n=[],r=!1;return function(...o){n=o,r||(r=!0,GF.call(window,()=>{r=!1,e.apply(t,n)}))}}function one(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const nE=e=>e==="start"?"left":e==="end"?"right":"center",Ar=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,ine=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function YF(e,t,n){const r=t.length;let o=0,i=r;if(e._sorted){const{iScale:s,vScale:a,_parsed:l}=e,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=s.axis,{min:d,max:p,minDefined:h,maxDefined:m}=s.getUserBounds();if(h){if(o=Math.min(qs(l,u,d).lo,n?r:qs(t,u,s.getPixelForValue(d)).lo),c){const b=l.slice(0,o+1).reverse().findIndex(y=>!yt(y[a.axis]));o-=Math.max(0,b)}o=gr(o,0,r-1)}if(m){let b=Math.max(qs(l,s.axis,p,!0).hi+1,n?0:qs(t,u,s.getPixelForValue(p),!0).hi+1);if(c){const y=l.slice(b-1).findIndex(v=>!yt(v[a.axis]));b+=Math.max(0,y)}i=gr(b,o,r)-o}else i=r-o}return{start:o,count:i}}function KF(e){const{xScale:t,yScale:n,_scaleRanges:r}=e,o={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=o,!0;const i=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,o),i}const im=e=>e===0||e===1,s2=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Pn/n)),a2=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Pn/n)+1,fh={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*qn)+1,easeOutSine:e=>Math.sin(e*qn),easeInOutSine:e=>-.5*(Math.cos(Mn*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=>im(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=>im(e)?e:s2(e,.075,.3),easeOutElastic:e=>im(e)?e:a2(e,.075,.3),easeInOutElastic(e){return im(e)?e:e<.5?.5*s2(e*2,.1125,.45):.5+.5*a2(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-fh.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?fh.easeInBounce(e*2)*.5:fh.easeOutBounce(e*2-1)*.5+.5};function rE(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function l2(e){return rE(e)?e:new jF(e)}function Hx(e){return rE(e)?e:new jF(e).saturate(.5).darken(.1).hexString()}const sne=["x","y","borderWidth","radius","tension"],ane=["color","borderColor","backgroundColor"];function lne(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:ane},numbers:{type:"number",properties:sne}}),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 cne(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const c2=new Map;function une(e,t){t=t||{};const n=e+JSON.stringify(t);let r=c2.get(n);return r||(r=new Intl.NumberFormat(e,t),c2.set(n,r)),r}function Pp(e,t,n){return une(t,n).format(e)}const XF={values(e){return kn(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const r=this.chart.options.locale;let o,i=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)&&(o="scientific"),i=dne(e,n)}const s=La(Math.abs(i)),a=isNaN(s)?1:Math.max(Math.min(-1*Math.floor(s),20),0),l={notation:o,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Pp(e,r,l)},logarithmic(e,t,n){if(e===0)return"0";const r=n[t].significand||e/Math.pow(10,Math.floor(La(e)));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?XF.numeric.call(this,e,t,n):""}};function dne(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 e0={formatters:XF};function fne(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:e0.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 Rc=Object.create(null),sS=Object.create(null);function hh(e,t){if(!t)return e;const n=t.split(".");for(let r=0,o=n.length;r<o;++r){const i=n[r];e=e[i]||(e[i]=Object.create(null))}return e}function Wx(e,t,n){return typeof t=="string"?mr(hh(e,t),n):mr(hh(e,""),t)}class hne{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,o)=>Hx(o.backgroundColor),this.hoverBorderColor=(r,o)=>Hx(o.borderColor),this.hoverColor=(r,o)=>Hx(o.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 Wx(this,t,n)}get(t){return hh(this,t)}describe(t,n){return Wx(sS,t,n)}override(t,n){return Wx(Rc,t,n)}route(t,n,r,o){const i=hh(this,t),s=hh(this,r),a="_"+n;Object.defineProperties(i,{[a]:{value:i[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=s[o];return Lt(l)?Object.assign({},c,l):ut(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var On=new hne({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[lne,cne,fne]);function pne(e){return!e||yt(e.size)||yt(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Db(e,t,n,r,o){let i=t[o];return i||(i=t[o]=e.measureText(o).width,n.push(o)),i>r&&(r=i),r}function gne(e,t,n,r){r=r||{};let o=r.data=r.data||{},i=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(o=r.data={},i=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&&!kn(d))s=Db(e,o,i,s,d);else if(kn(d))for(c=0,u=d.length;c<u;c++)p=d[c],p!=null&&!kn(p)&&(s=Db(e,o,i,s,p));e.restore();const h=i.length/2;if(h>n.length){for(l=0;l<h;l++)delete o[i[l]];i.splice(0,h)}return s}function Tl(e,t,n){const r=e.currentDevicePixelRatio,o=n!==0?Math.max(n/2,.5):0;return Math.round((t-o)*r)/r+o}function u2(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Ib(e,t,n,r){QF(e,t,n,r,null)}function QF(e,t,n,r,o){let i,s,a,l,c,u,d,p;const h=t.pointStyle,m=t.rotation,b=t.radius;let y=(m||0)*Kte;if(h&&typeof h=="object"&&(i=h.toString(),i==="[object HTMLImageElement]"||i==="[object HTMLCanvasElement]")){e.save(),e.translate(n,r),e.rotate(y),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:o?e.ellipse(n,r,o/2,b,0,0,Pn):e.arc(n,r,b,0,Pn),e.closePath();break;case"triangle":u=o?o/2:b,e.moveTo(n+Math.sin(y)*u,r-Math.cos(y)*b),y+=n2,e.lineTo(n+Math.sin(y)*u,r-Math.cos(y)*b),y+=n2,e.lineTo(n+Math.sin(y)*u,r-Math.cos(y)*b),e.closePath();break;case"rectRounded":c=b*.516,l=b-c,s=Math.cos(y+Rl)*l,d=Math.cos(y+Rl)*(o?o/2-c:l),a=Math.sin(y+Rl)*l,p=Math.sin(y+Rl)*(o?o/2-c:l),e.arc(n-d,r-a,c,y-Mn,y-qn),e.arc(n+p,r-s,c,y-qn,y),e.arc(n+d,r+a,c,y,y+qn),e.arc(n-p,r+s,c,y+qn,y+Mn),e.closePath();break;case"rect":if(!m){l=Math.SQRT1_2*b,u=o?o/2:l,e.rect(n-u,r-l,2*u,2*l);break}y+=Rl;case"rectRot":d=Math.cos(y)*(o?o/2:b),s=Math.cos(y)*b,a=Math.sin(y)*b,p=Math.sin(y)*(o?o/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":y+=Rl;case"cross":d=Math.cos(y)*(o?o/2:b),s=Math.cos(y)*b,a=Math.sin(y)*b,p=Math.sin(y)*(o?o/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(y)*(o?o/2:b),s=Math.cos(y)*b,a=Math.sin(y)*b,p=Math.sin(y)*(o?o/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),y+=Rl,d=Math.cos(y)*(o?o/2:b),s=Math.cos(y)*b,a=Math.sin(y)*b,p=Math.sin(y)*(o?o/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=o?o/2:Math.cos(y)*b,a=Math.sin(y)*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(y)*(o?o/2:b),r+Math.sin(y)*b);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function Ys(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function lc(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function cc(e){e.restore()}function mne(e,t,n,r,o){if(!t)return e.lineTo(n.x,n.y);if(o==="middle"){const i=(t.x+n.x)/2;e.lineTo(i,t.y),e.lineTo(i,n.y)}else o==="after"!=!!r?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function bne(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 yne(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),yt(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 vne(e,t,n,r,o){if(o.strikethrough||o.underline){const i=e.measureText(r),s=t-i.actualBoundingBoxLeft,a=t+i.actualBoundingBoxRight,l=n-i.actualBoundingBoxAscent,c=n+i.actualBoundingBoxDescent,u=o.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=o.decorationWidth||2,e.moveTo(s,u),e.lineTo(a,u),e.stroke()}}function xne(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Tc(e,t,n,r,o,i={}){const s=kn(t)?t:[t],a=i.strokeWidth>0&&i.strokeColor!=="";let l,c;for(e.save(),e.font=o.string,yne(e,i),l=0;l<s.length;++l)c=s[l],i.backdrop&&xne(e,i.backdrop),a&&(i.strokeColor&&(e.strokeStyle=i.strokeColor),yt(i.strokeWidth)||(e.lineWidth=i.strokeWidth),e.strokeText(c,n,r,i.maxWidth)),e.fillText(c,n,r,i.maxWidth),vne(e,n,r,c,i),r+=Number(o.lineHeight);e.restore()}function jh(e,t){const{x:n,y:r,w:o,h:i,radius:s}=t;e.arc(n+s.topLeft,r+s.topLeft,s.topLeft,1.5*Mn,Mn,!0),e.lineTo(n,r+i-s.bottomLeft),e.arc(n+s.bottomLeft,r+i-s.bottomLeft,s.bottomLeft,Mn,qn,!0),e.lineTo(n+o-s.bottomRight,r+i),e.arc(n+o-s.bottomRight,r+i-s.bottomRight,s.bottomRight,qn,0,!0),e.lineTo(n+o,r+s.topRight),e.arc(n+o-s.topRight,r+s.topRight,s.topRight,0,-qn,!0),e.lineTo(n+s.topLeft,r)}const wne=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Sne=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function _ne(e,t){const n=(""+e).match(wne);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 Cne=e=>+e||0;function oE(e,t){const n={},r=Lt(t),o=r?Object.keys(t):t,i=Lt(e)?r?s=>ut(e[s],e[t[s]]):s=>e[s]:()=>e;for(const s of o)n[s]=Cne(i(s));return n}function ZF(e){return oE(e,{top:"y",right:"x",bottom:"y",left:"x"})}function uc(e){return oE(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Er(e){const t=ZF(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Zn(e,t){e=e||{},t=t||On.font;let n=ut(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=ut(e.style,t.style);r&&!(""+r).match(Sne)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const o={family:ut(e.family,t.family),lineHeight:_ne(ut(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:ut(e.weight,t.weight),string:""};return o.string=pne(o),o}function Rn(e,t,n,r){let o,i,s;for(o=0,i=e.length;o<i;++o)if(s=e[o],s!==void 0&&(t!==void 0&&typeof s=="function"&&(s=s(t)),n!==void 0&&kn(s)&&(s=s[n%s.length]),s!==void 0))return s}function Ene(e,t,n){const{min:r,max:o}=e,i=zF(t,(o-r)/2),s=(a,l)=>n&&a===0?0:a+l;return{min:s(r,-Math.abs(i)),max:s(o,i)}}function al(e,t){return Object.assign(Object.create(e),t)}function iE(e,t=[""],n,r,o=()=>e[0]){const i=n||e;typeof r>"u"&&(r=nL("_fallback",e));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:i,_fallback:r,_getTarget:o,override:a=>iE([a,...e],t,i,r)};return new Proxy(s,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return eL(a,l,()=>Dne(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return f2(a).includes(l)},ownKeys(a){return f2(a)},set(a,l,c){const u=a._storage||(a._storage=o());return a[l]=u[l]=c,delete a._keys,!0}})}function md(e,t,n,r){const o={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:JF(e,r),setContext:i=>md(e,i,n,r),override:i=>md(e.override(i),t,n,r)};return new Proxy(o,{deleteProperty(i,s){return delete i[s],delete e[s],!0},get(i,s,a){return eL(i,s,()=>Tne(i,s,a))},getOwnPropertyDescriptor(i,s){return i._descriptors.allKeys?Reflect.has(e,s)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,s)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(i,s){return Reflect.has(e,s)},ownKeys(){return Reflect.ownKeys(e)},set(i,s,a){return e[s]=a,delete i[s],!0}})}function JF(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:o=t.allKeys}=e;return{allKeys:o,scriptable:n,indexable:r,isScriptable:Ka(n)?n:()=>n,isIndexable:Ka(r)?r:()=>r}}const Rne=(e,t)=>e?e+JC(t):t,sE=(e,t)=>Lt(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function eL(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const r=n();return e[t]=r,r}function Tne(e,t,n){const{_proxy:r,_context:o,_subProxy:i,_descriptors:s}=e;let a=r[t];return Ka(a)&&s.isScriptable(t)&&(a=kne(t,a,e,n)),kn(a)&&a.length&&(a=Pne(t,a,e,s.isIndexable)),sE(t,a)&&(a=md(a,o,i&&i[t],s)),a}function kne(e,t,n,r){const{_proxy:o,_context:i,_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(i,s||r);return a.delete(e),sE(e,l)&&(l=aE(o._scopes,o,e,l)),l}function Pne(e,t,n,r){const{_proxy:o,_context:i,_subProxy:s,_descriptors:a}=n;if(typeof i.index<"u"&&r(e))return t[i.index%t.length];if(Lt(t[0])){const l=t,c=o._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=aE(c,o,e,u);t.push(md(d,i,s&&s[e],a))}}return t}function tL(e,t,n){return Ka(e)?e(t,n):e}const One=(e,t)=>e===!0?t:typeof e=="string"?Ya(t,e):void 0;function Mne(e,t,n,r,o){for(const i of t){const s=One(n,i);if(s){e.add(s);const a=tL(s._fallback,n,o);if(typeof a<"u"&&a!==n&&a!==r)return a}else if(s===!1&&typeof r<"u"&&n!==r)return null}return!1}function aE(e,t,n,r){const o=t._rootScopes,i=tL(t._fallback,n,r),s=[...e,...o],a=new Set;a.add(r);let l=d2(a,s,n,i||n,r);return l===null||typeof i<"u"&&i!==n&&(l=d2(a,s,i,l,r),l===null)?!1:iE(Array.from(a),[""],o,i,()=>Ane(t,n,r))}function d2(e,t,n,r,o){for(;n;)n=Mne(e,t,n,r,o);return n}function Ane(e,t,n){const r=e._getTarget();t in r||(r[t]={});const o=r[t];return kn(o)&&Lt(n)?n:o||{}}function Dne(e,t,n,r){let o;for(const i of t)if(o=nL(Rne(i,e),n),typeof o<"u")return sE(e,o)?aE(n,r,e,o):o}function nL(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function f2(e){let t=e._keys;return t||(t=e._keys=Ine(e._scopes)),t}function Ine(e){const t=new Set;for(const n of e)for(const r of Object.keys(n).filter(o=>!o.startsWith("_")))t.add(r);return Array.from(t)}function rL(e,t,n,r){const{iScale:o}=e,{key:i="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:o.parse(Ya(u,i),c)};return s}const Nne=Number.EPSILON||1e-14,bd=(e,t)=>t<e.length&&!e[t].skip&&e[t],oL=e=>e==="x"?"y":"x";function Fne(e,t,n,r){const o=e.skip?t:e,i=t,s=n.skip?t:n,a=iS(i,o),l=iS(s,i);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:i.x-d*(s.x-o.x),y:i.y-d*(s.y-o.y)},next:{x:i.x+p*(s.x-o.x),y:i.y+p*(s.y-o.y)}}}function Lne(e,t,n){const r=e.length;let o,i,s,a,l,c=bd(e,0);for(let u=0;u<r-1;++u)if(l=c,c=bd(e,u+1),!(!l||!c)){if(dh(t[u],0,Nne)){n[u]=n[u+1]=0;continue}o=n[u]/t[u],i=n[u+1]/t[u],a=Math.pow(o,2)+Math.pow(i,2),!(a<=9)&&(s=3/Math.sqrt(a),n[u]=o*s*t[u],n[u+1]=i*s*t[u])}}function $ne(e,t,n="x"){const r=oL(n),o=e.length;let i,s,a,l=bd(e,0);for(let c=0;c<o;++c){if(s=a,a=l,l=bd(e,c+1),!a)continue;const u=a[n],d=a[r];s&&(i=(u-s[n])/3,a[`cp1${n}`]=u-i,a[`cp1${r}`]=d-i*t[c]),l&&(i=(l[n]-u)/3,a[`cp2${n}`]=u+i,a[`cp2${r}`]=d+i*t[c])}}function jne(e,t="x"){const n=oL(t),r=e.length,o=Array(r).fill(0),i=Array(r);let s,a,l,c=bd(e,0);for(s=0;s<r;++s)if(a=l,l=c,c=bd(e,s+1),!!l){if(c){const u=c[t]-l[t];o[s]=u!==0?(c[n]-l[n])/u:0}i[s]=a?c?rs(o[s-1])!==rs(o[s])?0:(o[s-1]+o[s])/2:o[s-1]:o[s]}Lne(e,o,i),$ne(e,i,t)}function sm(e,t,n){return Math.max(Math.min(e,n),t)}function zne(e,t){let n,r,o,i,s,a=Ys(e[0],t);for(n=0,r=e.length;n<r;++n)s=i,i=a,a=n<r-1&&Ys(e[n+1],t),i&&(o=e[n],s&&(o.cp1x=sm(o.cp1x,t.left,t.right),o.cp1y=sm(o.cp1y,t.top,t.bottom)),a&&(o.cp2x=sm(o.cp2x,t.left,t.right),o.cp2y=sm(o.cp2y,t.top,t.bottom)))}function Bne(e,t,n,r,o){let i,s,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")jne(e,o);else{let c=r?e[e.length-1]:e[0];for(i=0,s=e.length;i<s;++i)a=e[i],l=Fne(c,a,e[Math.min(i+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&&zne(e,n)}function lE(){return typeof window<"u"&&typeof document<"u"}function cE(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Nb(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 t0=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function Hne(e,t){return t0(e).getPropertyValue(t)}const Wne=["top","right","bottom","left"];function dc(e,t,n){const r={};n=n?"-"+n:"";for(let o=0;o<4;o++){const i=Wne[o];r[i]=parseFloat(e[t+"-"+i+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const Vne=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function Une(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:o,offsetY:i}=r;let s=!1,a,l;if(Vne(o,i,e.target))a=o,l=i;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 Dl(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,o=t0(n),i=o.boxSizing==="border-box",s=dc(o,"padding"),a=dc(o,"border","width"),{x:l,y:c,box:u}=Une(e,n),d=s.left+(u&&a.left),p=s.top+(u&&a.top);let{width:h,height:m}=t;return i&&(h-=s.width+a.width,m-=s.height+a.height),{x:Math.round((l-d)/h*n.width/r),y:Math.round((c-p)/m*n.height/r)}}function Gne(e,t,n){let r,o;if(t===void 0||n===void 0){const i=e&&cE(e);if(!i)t=e.clientWidth,n=e.clientHeight;else{const s=i.getBoundingClientRect(),a=t0(i),l=dc(a,"border","width"),c=dc(a,"padding");t=s.width-c.width-l.width,n=s.height-c.height-l.height,r=Nb(a.maxWidth,i,"clientWidth"),o=Nb(a.maxHeight,i,"clientHeight")}}return{width:t,height:n,maxWidth:r||Ab,maxHeight:o||Ab}}const am=e=>Math.round(e*10)/10;function qne(e,t,n,r){const o=t0(e),i=dc(o,"margin"),s=Nb(o.maxWidth,e,"clientWidth")||Ab,a=Nb(o.maxHeight,e,"clientHeight")||Ab,l=Gne(e,t,n);let{width:c,height:u}=l;if(o.boxSizing==="content-box"){const p=dc(o,"border","width"),h=dc(o,"padding");c-=h.width+p.width,u-=h.height+p.height}return c=Math.max(0,c-i.width),u=Math.max(0,r?c/r:u-i.height),c=am(Math.min(c,s,l.maxWidth)),u=am(Math.min(u,a,l.maxHeight)),c&&!u&&(u=am(c/2)),(t!==void 0||n!==void 0)&&r&&l.height&&u>l.height&&(u=l.height,c=am(Math.floor(u*r))),{width:c,height:u}}function h2(e,t,n){const r=t||1,o=Math.floor(e.height*r),i=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!==o||s.width!==i?(e.currentDevicePixelRatio=r,s.height=o,s.width=i,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}const Yne=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};lE()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function p2(e,t){const n=Hne(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function Il(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function Kne(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 Xne(e,t,n,r){const o={x:e.cp2x,y:e.cp2y},i={x:t.cp1x,y:t.cp1y},s=Il(e,o,n),a=Il(o,i,n),l=Il(i,t,n),c=Il(s,a,n),u=Il(a,l,n);return Il(c,u,n)}const Qne=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}}},Zne=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function $u(e,t,n){return e?Qne(t,n):Zne()}function iL(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 sL(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function aL(e){return e==="angle"?{between:$h,compare:Jte,normalize:Fo}:{between:Gs,compare:(t,n)=>t-n,normalize:t=>t}}function g2({start:e,end:t,count:n,loop:r,style:o}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n===0,style:o}}function Jne(e,t,n){const{property:r,start:o,end:i}=n,{between:s,normalize:a}=aL(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]),o,i);++p)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:d,style:e.style}}function lL(e,t,n){if(!n)return[e];const{property:r,start:o,end:i}=n,s=t.length,{compare:a,between:l,normalize:c}=aL(r),{start:u,end:d,loop:p,style:h}=Jne(e,t,n),m=[];let b=!1,y=null,v,w,_;const R=()=>l(o,_,v)&&a(o,_)!==0,C=()=>a(i,v)===0||l(i,_,v),E=()=>b||R(),P=()=>!b||C();for(let A=u,I=u;A<=d;++A)w=t[A%s],!w.skip&&(v=c(w[r]),v!==_&&(b=l(v,o,i),y===null&&E()&&(y=a(v,o)===0?A:I),y!==null&&P()&&(m.push(g2({start:y,end:A,loop:p,count:s,style:h})),y=null),I=A,_=v));return y!==null&&m.push(g2({start:y,end:d,loop:p,count:s,style:h})),m}function cL(e,t){const n=[],r=e.segments;for(let o=0;o<r.length;o++){const i=lL(r[o],e.points,t);i.length&&n.push(...i)}return n}function ere(e,t,n,r){let o=0,i=t-1;if(n&&!r)for(;o<t&&!e[o].skip;)o++;for(;o<t&&e[o].skip;)o++;for(o%=t,n&&(i+=o);i>o&&e[i%t].skip;)i--;return i%=t,{start:o,end:i}}function tre(e,t,n,r){const o=e.length,i=[];let s=t,a=e[t],l;for(l=t+1;l<=n;++l){const c=e[l%o];c.skip||c.stop?a.skip||(r=!1,i.push({start:t%o,end:(l-1)%o,loop:r}),t=s=c.stop?l:null):(s=l,a.skip&&(t=l)),a=c}return s!==null&&i.push({start:t%o,end:s%o,loop:r}),i}function nre(e,t){const n=e.points,r=e.options.spanGaps,o=n.length;if(!o)return[];const i=!!e._loop,{start:s,end:a}=ere(n,o,i,r);if(r===!0)return m2(e,[{start:s,end:a,loop:i}],n,t);const l=a<s?a+o:a,c=!!e._fullLoop&&s===0&&a===o-1;return m2(e,tre(n,s,l,c),n,t)}function m2(e,t,n,r){return!r||!r.setContext||!n?t:rre(e,t,n,r)}function rre(e,t,n,r){const o=e._chart.getContext(),i=b2(e.options),{_datasetIndex:s,options:{spanGaps:a}}=e,l=n.length,c=[];let u=i,d=t[0].start,p=d;function h(m,b,y,v){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:y,style:v}),u=v,d=b%l)}}for(const m of t){d=a?d:m.start;let b=n[d%l],y;for(p=d+1;p<=m.end;p++){const v=n[p%l];y=b2(r.setContext(al(o,{type:"segment",p0:b,p1:v,p0DataIndex:(p-1)%l,p1DataIndex:p%l,datasetIndex:s}))),ore(y,u)&&h(d,p-1,m.loop,u),b=v,u=y}d<p-1&&h(d,p-1,m.loop,u)}return c}function b2(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function ore(e,t){if(!t)return!1;const n=[],r=function(o,i){return rE(i)?(n.includes(i)||n.push(i),n.indexOf(i)):i};return JSON.stringify(e,r)!==JSON.stringify(t,r)}/*!
309
+ * Chart.js v4.4.8
310
+ * https://www.chartjs.org
311
+ * (c) 2025 Chart.js Contributors
312
+ * Released under the MIT License
313
+ */class ire{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,o){const i=n.listeners[o],s=n.duration;i.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=GF.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,o)=>{if(!r.running||!r.items.length)return;const i=r.items;let s=i.length-1,a=!1,l;for(;s>=0;--s)l=i[s],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),a=!0):(i[s]=i[i.length-1],i.pop());a&&(o.draw(),this._notify(o,r,t,"progress")),i.length||(r.running=!1,this._notify(o,r,t,"complete"),r.initial=!1),n+=i.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,o)=>Math.max(r,o._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 o=r.length-1;for(;o>=0;--o)r[o].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Ns=new ire;const y2="transparent",sre={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=l2(e||y2),o=r.valid&&l2(t||y2);return o&&o.valid?o.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class are{constructor(t,n,r,o){const i=n[r];o=Rn([t.to,o,i,t.from]);const s=Rn([t.from,i,o]);this._active=!0,this._fn=t.fn||sre[t.type||typeof s],this._easing=fh[t.easing]||fh.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=o,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const o=this._target[this._prop],i=r-this._start,s=this._duration-i;this._start=r,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=i,this._loop=!!t.loop,this._to=Rn([t.to,n,o,t.from]),this._from=Rn([t.from,o,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,o=this._prop,i=this._from,s=this._loop,a=this._to;let l;if(this._active=i!==a&&(s||n<r),!this._active){this._target[o]=a,this._notify(!0);return}if(n<0){this._target[o]=i;return}l=n/r%2,l=s&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[o]=this._fn(i,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 o=0;o<r.length;o++)r[o][n]()}}class uL{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Lt(t))return;const n=Object.keys(On.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(o=>{const i=t[o];if(!Lt(i))return;const s={};for(const a of n)s[a]=i[a];(kn(i.properties)&&i.properties||[o]).forEach(a=>{(a===o||!r.has(a))&&r.set(a,s)})})}_animateOptions(t,n){const r=n.options,o=cre(t,r);if(!o)return[];const i=this._createAnimations(o,r);return r.$shared&&lre(t.options.$animations,r).then(()=>{t.options=r},()=>{}),i}_createAnimations(t,n){const r=this._properties,o=[],i=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"){o.push(...this._animateOptions(t,n));continue}const u=n[c];let d=i[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}i[c]=d=new are(p,t,c,u),o.push(d)}return o}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return Ns.add(this._chart,r),!0}}function lre(e,t){const n=[],r=Object.keys(t);for(let o=0;o<r.length;o++){const i=e[r[o]];i&&i.active()&&n.push(i.wait())}return Promise.all(n)}function cre(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 v2(e,t){const n=e&&e.options||{},r=n.reverse,o=n.min===void 0?t:0,i=n.max===void 0?t:0;return{start:r?i:o,end:r?o:i}}function ure(e,t,n){if(n===!1)return!1;const r=v2(e,n),o=v2(t,n);return{top:o.end,right:r.end,bottom:o.start,left:r.start}}function dre(e){let t,n,r,o;return Lt(e)?(t=e.top,n=e.right,r=e.bottom,o=e.left):t=n=r=o=e,{top:t,right:n,bottom:r,left:o,disabled:e===!1}}function dL(e,t){const n=[],r=e._getSortedDatasetMetas(t);let o,i;for(o=0,i=r.length;o<i;++o)n.push(r[o].index);return n}function x2(e,t,n,r={}){const o=e.keys,i=r.mode==="single";let s,a,l,c;if(t===null)return;let u=!1;for(s=0,a=o.length;s<a;++s){if(l=+o[s],l===n){if(u=!0,r.all)continue;break}c=e.values[l],Wn(c)&&(i||t===0||rs(t)===rs(c))&&(t+=c)}return!u&&!r.all?0:t}function fre(e,t){const{iScale:n,vScale:r}=t,o=n.axis==="x"?"x":"y",i=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]={[o]:u,[i]:e[u]};return a}function Vx(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function hre(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function pre(e){const{min:t,max:n,minDefined:r,maxDefined:o}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:o?n:Number.POSITIVE_INFINITY}}function gre(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function w2(e,t,n,r){for(const o of t.getMatchingVisibleMetas(r).reverse()){const i=e[o.index];if(n&&i>0||!n&&i<0)return o.index}return null}function S2(e,t){const{chart:n,_cachedMeta:r}=e,o=n._stacks||(n._stacks={}),{iScale:i,vScale:s,index:a}=r,l=i.axis,c=s.axis,u=hre(i,s,r),d=t.length;let p;for(let h=0;h<d;++h){const m=t[h],{[l]:b,[c]:y}=m,v=m._stacks||(m._stacks={});p=v[c]=gre(o,u,b),p[a]=y,p._top=w2(p,s,!0,r.type),p._bottom=w2(p,s,!1,r.type);const w=p._visualValues||(p._visualValues={});w[a]=y}}function Ux(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function mre(e,t){return al(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function bre(e,t,n){return al(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function Sf(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const o of t){const i=o._stacks;if(!i||i[r]===void 0||i[r][n]===void 0)return;delete i[r][n],i[r]._visualValues!==void 0&&i[r]._visualValues[n]!==void 0&&delete i[r]._visualValues[n]}}}const Gx=e=>e==="reset"||e==="none",_2=(e,t)=>t?e:Object.assign({},e),yre=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:dL(n,!0),values:null};class ui{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=Vx(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&&Sf(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),o=(d,p,h,m)=>d==="x"?p:d==="r"?m:h,i=n.xAxisID=ut(r.xAxisID,Ux(t,"x")),s=n.yAxisID=ut(r.yAxisID,Ux(t,"y")),a=n.rAxisID=ut(r.rAxisID,Ux(t,"r")),l=n.indexAxis,c=n.iAxisID=o(l,i,s,a),u=n.vAxisID=o(l,s,i,a);n.xScale=this.getScaleForId(i),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&&i2(this._data,this),t._stacked&&Sf(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(Lt(n)){const o=this._cachedMeta;this._data=fre(n,o)}else if(r!==n){if(r){i2(r,this);const o=this._cachedMeta;Sf(o),o._parsed=[]}n&&Object.isExtensible(n)&&rne(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 o=!1;this._dataCheck();const i=n._stacked;n._stacked=Vx(n.vScale,n),n.stack!==r.stack&&(o=!0,Sf(n),n.stack=r.stack),this._resyncElements(t),(o||i!==n._stacked)&&(S2(this,n._parsed),n._stacked=Vx(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:o}=this,{iScale:i,_stacked:s}=r,a=i.axis;let l=t===0&&n===o.length?!0:r._sorted,c=t>0&&r._parsed[t-1],u,d,p;if(this._parsing===!1)r._parsed=o,r._sorted=!0,p=o;else{kn(o[t])?p=this.parseArrayData(r,o,t,n):Lt(o[t])?p=this.parseObjectData(r,o,t,n):p=this.parsePrimitiveData(r,o,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&&S2(this,p)}parsePrimitiveData(t,n,r,o){const{iScale:i,vScale:s}=t,a=i.axis,l=s.axis,c=i.getLabels(),u=i===s,d=new Array(o);let p,h,m;for(p=0,h=o;p<h;++p)m=p+r,d[p]={[a]:u||i.parse(c[m],m),[l]:s.parse(n[m],m)};return d}parseArrayData(t,n,r,o){const{xScale:i,yScale:s}=t,a=new Array(o);let l,c,u,d;for(l=0,c=o;l<c;++l)u=l+r,d=n[u],a[l]={x:i.parse(d[0],u),y:s.parse(d[1],u)};return a}parseObjectData(t,n,r,o){const{xScale:i,yScale:s}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(o);let u,d,p,h;for(u=0,d=o;u<d;++u)p=u+r,h=n[p],c[u]={x:i.parse(Ya(h,a),p),y:s.parse(Ya(h,l),p)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const o=this.chart,i=this._cachedMeta,s=n[t.axis],a={keys:dL(o,!0),values:n._stacks[t.axis]._visualValues};return x2(a,s,i.index,{mode:r})}updateRangeFromParsed(t,n,r,o){const i=r[n.axis];let s=i===null?NaN:i;const a=o&&r._stacks[n.axis];o&&a&&(o.values=a,s=x2(o,i,this._cachedMeta.index)),t.min=Math.min(t.min,s),t.max=Math.max(t.max,s)}getMinMax(t,n){const r=this._cachedMeta,o=r._parsed,i=r._sorted&&t===r.iScale,s=o.length,a=this._getOtherScale(t),l=yre(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=pre(a);let p,h;function m(){h=o[p];const b=h[a.axis];return!Wn(h[t.axis])||u>b||d<b}for(p=0;p<s&&!(!m()&&(this.updateRangeFromParsed(c,t,h,l),i));++p);if(i){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 o,i,s;for(o=0,i=n.length;o<i;++o)s=n[o][t.axis],Wn(s)&&r.push(s);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,o=n.vScale,i=this.getParsed(t);return{label:r?""+r.getLabelForValue(i[r.axis]):"",value:o?""+o.getLabelForValue(i[o.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=dre(ut(this.options.clip,ure(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,o=r.data||[],i=n.chartArea,s=[],a=this._drawStart||0,l=this._drawCount||o.length-a,c=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(t,i,a,l),u=a;u<a+l;++u){const d=o[u];d.hidden||(d.active&&c?s.push(d):d.draw(t,i))}for(u=0;u<s.length;++u)s[u].draw(t,i)}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 o=this.getDataset();let i;if(t>=0&&t<this._cachedMeta.data.length){const s=this._cachedMeta.data[t];i=s.$context||(s.$context=bre(this.getContext(),t,s)),i.parsed=this.getParsed(t),i.raw=o.data[t],i.index=i.dataIndex=t}else i=this.$context||(this.$context=mre(this.chart.getContext(),this.index)),i.dataset=o,i.index=i.datasetIndex=this.index;return i.active=!!n,i.mode=r,i}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 o=n==="active",i=this._cachedDataOpts,s=t+"-"+n,a=i[s],l=this.enableOptionSharing&&Lh(r);if(a)return _2(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=o?[`${t}Hover`,"hover",t,""]:[t,""],p=c.getOptionScopes(this.getDataset(),u),h=Object.keys(On.elements[t]),m=()=>this.getContext(r,o,n),b=c.resolveNamedOptions(p,h,m,d);return b.$shared&&(b.$shared=l,i[s]=Object.freeze(_2(b,l))),b}_resolveAnimations(t,n,r){const o=this.chart,i=this._cachedDataOpts,s=`animation-${n}`,a=i[s];if(a)return a;let l;if(o.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 uL(o,l&&l.animations);return l&&l._cacheable&&(i[s]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||Gx(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),o=this._sharedOptions,i=this.getSharedOptions(r),s=this.includeOptions(n,i)||i!==o;return this.updateSharedOptions(i,n,r),{sharedOptions:i,includeOptions:s}}updateElement(t,n,r,o){Gx(o)?Object.assign(t,r):this._resolveAnimations(n,o).update(t,r)}updateSharedOptions(t,n,r){t&&!Gx(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,o){t.active=o;const i=this.getStyle(n,o);this._resolveAnimations(n,r,o).update(t,{options:!o&&this.getSharedOptions(i)||i})}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 o=r.length,i=n.length,s=Math.min(i,o);s&&this.parse(0,s),i>o?this._insertElements(o,i-o,t):i<o&&this._removeElements(i,o-i)}_insertElements(t,n,r=!0){const o=this._cachedMeta,i=o.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(i),a=t;a<s;++a)i[a]=new this.dataElementType;this._parsing&&l(o._parsed),this.parse(t,n),r&&this.updateElements(i,t,n,"reset")}updateElements(t,n,r,o){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const o=r._parsed.splice(t,n);r._stacked&&Sf(r,o)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,o]=t;this[n](r,o)}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(ui,"defaults",{}),Me(ui,"datasetElementType",null),Me(ui,"dataElementType",null);function vre(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let o=0,i=n.length;o<i;o++)r=r.concat(n[o].controller.getAllParsedValues(e));e._cache.$bar=UF(r.sort((o,i)=>o-i))}return e._cache.$bar}function xre(e){const t=e.iScale,n=vre(t,e.type);let r=t._length,o,i,s,a;const l=()=>{s===32767||s===-32768||(Lh(a)&&(r=Math.min(r,Math.abs(s-a)||r)),a=s)};for(o=0,i=n.length;o<i;++o)s=t.getPixelForValue(n[o]),l();for(a=void 0,o=0,i=t.ticks.length;o<i;++o)s=t.getPixelForTick(o),l();return r}function wre(e,t,n,r){const o=n.barThickness;let i,s;return yt(o)?(i=t.min*n.categoryPercentage,s=n.barPercentage):(i=o*r,s=1),{chunk:i/r,ratio:s,start:t.pixels[e]-i/2}}function Sre(e,t,n,r){const o=t.pixels,i=o[e];let s=e>0?o[e-1]:null,a=e<o.length-1?o[e+1]:null;const l=n.categoryPercentage;s===null&&(s=i-(a===null?t.end-t.start:a-i)),a===null&&(a=i+i-s);const c=i-(i-Math.min(s,a))/2*l;return{chunk:Math.abs(a-s)/2*l/r,ratio:n.barPercentage,start:c}}function _re(e,t,n,r){const o=n.parse(e[0],r),i=n.parse(e[1],r),s=Math.min(o,i),a=Math.max(o,i);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:o,end:i,min:s,max:a}}function fL(e,t,n,r){return kn(e)?_re(e,t,n,r):t[n.axis]=n.parse(e,r),t}function C2(e,t,n,r){const o=e.iScale,i=e.vScale,s=o.getLabels(),a=o===i,l=[];let c,u,d,p;for(c=n,u=n+r;c<u;++c)p=t[c],d={},d[o.axis]=a||o.parse(s[c],c),l.push(fL(p,d,i,c));return l}function qx(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function Cre(e,t,n){return e!==0?rs(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function Ere(e){let t,n,r,o,i;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(o="end",i="start"):(o="start",i="end"),{start:n,end:r,reverse:t,top:o,bottom:i}}function Rre(e,t,n,r){let o=t.borderSkipped;const i={};if(!o){e.borderSkipped=i;return}if(o===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:s,end:a,reverse:l,top:c,bottom:u}=Ere(e);o==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?o=c:(n._bottom||0)===r?o=u:(i[E2(u,s,a,l)]=!0,o=c)),i[E2(o,s,a,l)]=!0,e.borderSkipped=i}function E2(e,t,n,r){return r?(e=Tre(e,t,n),e=R2(e,n,t)):e=R2(e,t,n),e}function Tre(e,t,n){return e===t?n:e===n?t:e}function R2(e,t,n){return e==="start"?t:e==="end"?n:e}function kre(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class nb extends ui{parsePrimitiveData(t,n,r,o){return C2(t,n,r,o)}parseArrayData(t,n,r,o){return C2(t,n,r,o)}parseObjectData(t,n,r,o){const{iScale:i,vScale:s}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=i.axis==="x"?a:l,u=s.axis==="x"?a:l,d=[];let p,h,m,b;for(p=r,h=r+o;p<h;++p)b=n[p],m={},m[i.axis]=i.parse(Ya(b,c),p),d.push(fL(Ya(b,u),m,s,p));return d}updateRangeFromParsed(t,n,r,o){super.updateRangeFromParsed(t,n,r,o);const i=r._custom;i&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,i.min),t.max=Math.max(t.max,i.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:r,vScale:o}=n,i=this.getParsed(t),s=i._custom,a=qx(s)?"["+s.start+", "+s.end+"]":""+o.getLabelForValue(i[o.axis]);return{label:""+r.getLabelForValue(i[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,o){const i=o==="reset",{index:s,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:p}=this._getSharedOptions(n,o);for(let h=n;h<n+r;h++){const m=this.getParsed(h),b=i||yt(m[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(h),y=this._calculateBarIndexPixels(h,u),v=(m._stacks||{})[a.axis],w={horizontal:c,base:b.base,enableBorderRadius:!v||qx(m._custom)||s===v._top||s===v._bottom,x:c?b.head:y.center,y:c?y.center:b.head,height:c?y.size:Math.abs(b.size),width:c?Math.abs(b.size):y.size};p&&(w.options=d||this.resolveDataElementOptions(h,t[h].active?"active":o));const _=w.options||t[h].options;Rre(w,_,v,s),kre(w,_,u.ratio),this.updateElement(t[h],h,w,o)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,o=r.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),i=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(yt(p)||isNaN(p))return!0};for(const u of o)if(!(n!==void 0&&c(u))&&((i===!1||s.indexOf(u.stack)===-1||i===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 o=this._getStacks(t,r),i=n!==void 0?o.indexOf(n):-1;return i===-1?o.length-1:i}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,o=[];let i,s;for(i=0,s=n.data.length;i<s;++i)o.push(r.getPixelForValue(this.getParsed(i)[r.axis],i));const a=t.barThickness;return{min:a||xre(n),pixels:o,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:o},options:{base:i,minBarLength:s}}=this,a=i||0,l=this.getParsed(t),c=l._custom,u=qx(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&&rs(d)!==rs(c.barEnd)&&(p=0),p+=d);const y=!yt(i)&&!u?i:p;let v=n.getPixelForValue(y);if(this.chart.getDataVisibility(t)?m=n.getPixelForValue(p+h):m=v,b=m-v,Math.abs(b)<s){b=Cre(b,n,a)*s,d===a&&(v-=b/2);const w=n.getPixelForDecimal(0),_=n.getPixelForDecimal(1),R=Math.min(w,_),C=Math.max(w,_);v=Math.max(Math.min(v,C),R),m=v+b,r&&!u&&(l._stacks[n.axis]._visualValues[o]=n.getValueForPixel(m)-n.getValueForPixel(v))}if(v===n.getPixelForValue(a)){const w=rs(b)*n.getLineWidthForValue(a)/2;v+=w,b-=w}return{size:b,base:v,head:m,center:m+b/2}}_calculateBarIndexPixels(t,n){const r=n.scale,o=this.options,i=o.skipNull,s=ut(o.maxBarThickness,1/0);let a,l;if(n.grouped){const c=i?this._getStackCount(t):n.stackCount,u=o.barThickness==="flex"?Sre(t,n,o,c):wre(t,n,o,c),d=this._getStackIndex(this.index,this._cachedMeta.stack,i?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,o=r.length;let i=0;for(;i<o;++i)this.getParsed(i)[n.axis]!==null&&!r[i].hidden&&r[i].draw(this._ctx)}}Me(nb,"id","bar"),Me(nb,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),Me(nb,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class rb extends ui{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,r,o){const i=super.parsePrimitiveData(t,n,r,o);for(let s=0;s<i.length;s++)i[s]._custom=this.resolveDataElementOptions(s+r).radius;return i}parseArrayData(t,n,r,o){const i=super.parseArrayData(t,n,r,o);for(let s=0;s<i.length;s++){const a=n[r+s];i[s]._custom=ut(a[2],this.resolveDataElementOptions(s+r).radius)}return i}parseObjectData(t,n,r,o){const i=super.parseObjectData(t,n,r,o);for(let s=0;s<i.length;s++){const a=n[r+s];i[s]._custom=ut(a&&a.r&&+a.r,this.resolveDataElementOptions(s+r).radius)}return i}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:o,yScale:i}=n,s=this.getParsed(t),a=o.getLabelForValue(s.x),l=i.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,o){const i=o==="reset",{iScale:s,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,o),u=s.axis,d=a.axis;for(let p=n;p<n+r;p++){const h=t[p],m=!i&&this.getParsed(p),b={},y=b[u]=i?s.getPixelForDecimal(.5):s.getPixelForValue(m[u]),v=b[d]=i?a.getBasePixel():a.getPixelForValue(m[d]);b.skip=isNaN(y)||isNaN(v),c&&(b.options=l||this.resolveDataElementOptions(p,h.active?"active":o),i&&(b.options.radius=0)),this.updateElement(h,p,b,o)}}resolveDataElementOptions(t,n){const r=this.getParsed(t);let o=super.resolveDataElementOptions(t,n);o.$shared&&(o=Object.assign({},o,{$shared:!1}));const i=o.radius;return n!=="active"&&(o.radius=0),o.radius+=ut(r&&r._custom,i),o}}Me(rb,"id","bubble"),Me(rb,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),Me(rb,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Pre(e,t,n){let r=1,o=1,i=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)=>$h(_,a,l,!0)?1:Math.max(R,R*n,C,C*n),m=(_,R,C)=>$h(_,a,l,!0)?-1:Math.min(R,R*n,C,C*n),b=h(0,c,d),y=h(qn,u,p),v=m(Mn,c,d),w=m(Mn+qn,u,p);r=(b-v)/2,o=(y-w)/2,i=-(b+v)/2,s=-(y+w)/2}return{ratioX:r,ratioY:o,offsetX:i,offsetY:s}}class Ul extends ui{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,o=this._cachedMeta;if(this._parsing===!1)o._parsed=r;else{let i=l=>+r[l];if(Lt(r[t])){const{key:l="value"}=this._parsing;i=c=>+Ya(r[c],l)}let s,a;for(s=t,a=t+n;s<a;++s)o._parsed[s]=i(s)}}_getRotation(){return Pi(this.options.rotation-90)}_getCircumference(){return Pi(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 o=this.chart.getDatasetMeta(r).controller,i=o._getRotation(),s=o._getCircumference();t=Math.min(t,i),n=Math.max(n,i+s)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:r}=n,o=this._cachedMeta,i=o.data,s=this.getMaxBorderWidth()+this.getMaxOffset(i)+this.options.spacing,a=Math.max((Math.min(r.width,r.height)-s)/2,0),l=Math.min(Hte(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:p,ratioY:h,offsetX:m,offsetY:b}=Pre(d,u,l),y=(r.width-s)/p,v=(r.height-s)/h,w=Math.max(Math.min(y,v)/2,0),_=zF(this.options.radius,w),R=Math.max(_*l,0),C=(_-R)/this._getVisibleDatasetWeightTotal();this.offsetX=m*_,this.offsetY=b*_,o.total=this.calculateTotal(),this.outerRadius=_-C*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-C*c,0),this.updateElements(i,0,i.length,t)}_circumference(t,n){const r=this.options,o=this._cachedMeta,i=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||o._parsed[t]===null||o.data[t].hidden?0:this.calculateCircumference(o._parsed[t]*i/Pn)}updateElements(t,n,r,o){const i=o==="reset",s=this.chart,a=s.chartArea,c=s.options.animation,u=(a.left+a.right)/2,d=(a.top+a.bottom)/2,p=i&&c.animateScale,h=p?0:this.innerRadius,m=p?0:this.outerRadius,{sharedOptions:b,includeOptions:y}=this._getSharedOptions(n,o);let v=this._getRotation(),w;for(w=0;w<n;++w)v+=this._circumference(w,i);for(w=n;w<n+r;++w){const _=this._circumference(w,i),R=t[w],C={x:u+this.offsetX,y:d+this.offsetY,startAngle:v,endAngle:v+_,circumference:_,outerRadius:m,innerRadius:h};y&&(C.options=b||this.resolveDataElementOptions(w,R.active?"active":o)),v+=_,this.updateElement(R,w,C,o)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let r=0,o;for(o=0;o<n.length;o++){const i=t._parsed[o];i!==null&&!isNaN(i)&&this.chart.getDataVisibility(o)&&!n[o].hidden&&(r+=Math.abs(i))}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,o=r.data.labels||[],i=Pp(n._parsed[t],r.options.locale);return{label:o[t]||"",value:i}}getMaxBorderWidth(t){let n=0;const r=this.chart;let o,i,s,a,l;if(!t){for(o=0,i=r.data.datasets.length;o<i;++o)if(r.isDatasetVisible(o)){s=r.getDatasetMeta(o),t=s.data,a=s.controller;break}}if(!t)return 0;for(o=0,i=t.length;o<i;++o)l=a.resolveDataElementOptions(o),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let r=0,o=t.length;r<o;++r){const i=this.resolveDataElementOptions(r);n=Math.max(n,i.offset||0,i.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(ut(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Me(Ul,"id","doughnut"),Me(Ul,"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(Ul,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),Me(Ul,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:o}}=t.legend.options;return n.labels.map((i,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:o,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 ob extends ui{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:r,data:o=[],_dataset:i}=n,s=this.chart._animationsDisabled;let{start:a,count:l}=YF(n,o,s);this._drawStart=a,this._drawCount=l,KF(n)&&(a=0,l=o.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!i._decimated,r.points=o;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(o,a,l,t)}updateElements(t,n,r,o){const i=o==="reset",{iScale:s,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,o),p=s.axis,h=a.axis,{spanGaps:m,segment:b}=this.options,y=gd(m)?m:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||i||o==="none",w=n+r,_=t.length;let R=n>0&&this.getParsed(n-1);for(let C=0;C<_;++C){const E=t[C],P=v?E:{};if(C<n||C>=w){P.skip=!0;continue}const A=this.getParsed(C),I=yt(A[h]),F=P[p]=s.getPixelForValue(A[p],C),L=P[h]=i||I?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,A,l):A[h],C);P.skip=isNaN(F)||isNaN(L)||I,P.stop=C>0&&Math.abs(A[p]-R[p])>y,b&&(P.parsed=A,P.raw=c.data[C]),d&&(P.options=u||this.resolveDataElementOptions(C,E.active?"active":o)),v||this.updateElement(E,C,P,o),R=A}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,o=t.data||[];if(!o.length)return r;const i=o[0].size(this.resolveDataElementOptions(0)),s=o[o.length-1].size(this.resolveDataElementOptions(o.length-1));return Math.max(r,i,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Me(ob,"id","line"),Me(ob,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Me(ob,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class ph extends ui{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,o=r.data.labels||[],i=Pp(n._parsed[t].r,r.options.locale);return{label:o[t]||"",value:i}}parseObjectData(t,n,r,o){return rL.bind(this)(t,n,r,o)}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,o)=>{const i=this.getParsed(o).r;!isNaN(i)&&this.chart.getDataVisibility(o)&&(i<n.min&&(n.min=i),i>n.max&&(n.max=i))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,r=t.options,o=Math.min(n.right-n.left,n.bottom-n.top),i=Math.max(o/2,0),s=Math.max(r.cutoutPercentage?i/100*r.cutoutPercentage:1,0),a=(i-s)/t.getVisibleDatasetCount();this.outerRadius=i-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,r,o){const i=o==="reset",s=this.chart,l=s.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,p=c.getIndexAngle(0)-.5*Mn;let h=p,m;const b=360/this.countVisibleElements();for(m=0;m<n;++m)h+=this._computeAngle(m,o,b);for(m=n;m<n+r;m++){const y=t[m];let v=h,w=h+this._computeAngle(m,o,b),_=s.getDataVisibility(m)?c.getDistanceFromCenterForValue(this.getParsed(m).r):0;h=w,i&&(l.animateScale&&(_=0),l.animateRotate&&(v=w=p));const R={x:u,y:d,innerRadius:0,outerRadius:_,startAngle:v,endAngle:w,options:this.resolveDataElementOptions(m,y.active?"active":o)};this.updateElement(y,m,R,o)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((r,o)=>{!isNaN(this.getParsed(o).r)&&this.chart.getDataVisibility(o)&&n++}),n}_computeAngle(t,n,r){return this.chart.getDataVisibility(t)?Pi(this.resolveDataElementOptions(t,n).angle||r):0}}Me(ph,"id","polarArea"),Me(ph,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),Me(ph,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:o}}=t.legend.options;return n.labels.map((i,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:o,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 aS extends Ul{}Me(aS,"id","pie"),Me(aS,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class ib extends ui{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,o){return rL.bind(this)(t,n,r,o)}update(t){const n=this._cachedMeta,r=n.dataset,o=n.data||[],i=n.iScale.getLabels();if(r.points=o,t!=="resize"){const s=this.resolveDatasetElementOptions(t);this.options.showLine||(s.borderWidth=0);const a={_loop:!0,_fullLoop:i.length===o.length,options:s};this.updateElement(r,void 0,a,t)}this.updateElements(o,0,o.length,t)}updateElements(t,n,r,o){const i=this._cachedMeta.rScale,s=o==="reset";for(let a=n;a<n+r;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":o),u=i.getPointPositionForValue(a,this.getParsed(a).r),d=s?i.xCenter:u.x,p=s?i.yCenter:u.y,h={x:d,y:p,angle:u.angle,skip:isNaN(d)||isNaN(p),options:c};this.updateElement(l,a,h,o)}}}Me(ib,"id","radar"),Me(ib,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),Me(ib,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class sb extends ui{getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:o,yScale:i}=n,s=this.getParsed(t),a=o.getLabelForValue(s.x),l=i.getLabelForValue(s.y);return{label:r[t]||"",value:"("+a+", "+l+")"}}update(t){const n=this._cachedMeta,{data:r=[]}=n,o=this.chart._animationsDisabled;let{start:i,count:s}=YF(n,r,o);if(this._drawStart=i,this._drawCount=s,KF(n)&&(i=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:!o,options:c},t)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(r,i,s,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,r,o){const i=o==="reset",{iScale:s,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(n,o),d=this.getSharedOptions(u),p=this.includeOptions(o,d),h=s.axis,m=a.axis,{spanGaps:b,segment:y}=this.options,v=gd(b)?b:Number.POSITIVE_INFINITY,w=this.chart._animationsDisabled||i||o==="none";let _=n>0&&this.getParsed(n-1);for(let R=n;R<n+r;++R){const C=t[R],E=this.getParsed(R),P=w?C:{},A=yt(E[m]),I=P[h]=s.getPixelForValue(E[h],R),F=P[m]=i||A?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,E,l):E[m],R);P.skip=isNaN(I)||isNaN(F)||A,P.stop=R>0&&Math.abs(E[h]-_[h])>v,y&&(P.parsed=E,P.raw=c.data[R]),p&&(P.options=d||this.resolveDataElementOptions(R,C.active?"active":o)),w||this.updateElement(C,R,P,o),_=E}this.updateSharedOptions(d,o,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,o=r.options&&r.options.borderWidth||0;if(!n.length)return o;const i=n[0].size(this.resolveDataElementOptions(0)),s=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(o,i,s)/2}}Me(sb,"id","scatter"),Me(sb,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),Me(sb,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Ore=Object.freeze({__proto__:null,BarController:nb,BubbleController:rb,DoughnutController:Ul,LineController:ob,PieController:aS,PolarAreaController:ph,RadarController:ib,ScatterController:sb});function kl(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class uE{constructor(t){Me(this,"options");this.options=t||{}}static override(t){Object.assign(uE.prototype,t)}init(){}formats(){return kl()}parse(){return kl()}format(){return kl()}add(){return kl()}diff(){return kl()}startOf(){return kl()}endOf(){return kl()}}var Mre={_date:uE};function Are(e,t,n,r){const{controller:o,data:i,_sorted:s}=e,a=o._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&s&&i.length){const c=a._reversePixels?tne:qs;if(r){if(o._sharedOptions){const u=i[0],d=typeof u.getRange=="function"&&u.getRange(t);if(d){const p=c(i,t,n-d),h=c(i,t,n+d);return{lo:p.lo,hi:h.hi}}}}else{const u=c(i,t,n);if(l){const{vScale:d}=o._cachedMeta,{_parsed:p}=e,h=p.slice(0,u.lo+1).reverse().findIndex(b=>!yt(b[d.axis]));u.lo-=Math.max(0,h);const m=p.slice(u.hi).findIndex(b=>!yt(b[d.axis]));u.hi+=Math.max(0,m)}return u}}return{lo:0,hi:i.length-1}}function n0(e,t,n,r,o){const i=e.getSortedVisibleDatasetMetas(),s=n[t];for(let a=0,l=i.length;a<l;++a){const{index:c,data:u}=i[a],{lo:d,hi:p}=Are(i[a],t,s,o);for(let h=d;h<=p;++h){const m=u[h];m.skip||r(m,c,h)}}}function Dre(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,o){const i=t?Math.abs(r.x-o.x):0,s=n?Math.abs(r.y-o.y):0;return Math.sqrt(Math.pow(i,2)+Math.pow(s,2))}}function Yx(e,t,n,r,o){const i=[];return!o&&!e.isPointInArea(t)||n0(e,n,t,function(a,l,c){!o&&!Ys(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&i.push({element:a,datasetIndex:l,index:c})},!0),i}function Ire(e,t,n,r){let o=[];function i(s,a,l){const{startAngle:c,endAngle:u}=s.getProps(["startAngle","endAngle"],r),{angle:d}=WF(s,{x:t.x,y:t.y});$h(d,c,u)&&o.push({element:s,datasetIndex:a,index:l})}return n0(e,n,t,i),o}function Nre(e,t,n,r,o,i){let s=[];const a=Dre(n);let l=Number.POSITIVE_INFINITY;function c(u,d,p){const h=u.inRange(t.x,t.y,o);if(r&&!h)return;const m=u.getCenterPoint(o);if(!(!!i||e.isPointInArea(m))&&!h)return;const y=a(t,m);y<l?(s=[{element:u,datasetIndex:d,index:p}],l=y):y===l&&s.push({element:u,datasetIndex:d,index:p})}return n0(e,n,t,c),s}function Kx(e,t,n,r,o,i){return!i&&!e.isPointInArea(t)?[]:n==="r"&&!r?Ire(e,t,n,o):Nre(e,t,n,r,o,i)}function T2(e,t,n,r,o){const i=[],s=n==="x"?"inXRange":"inYRange";let a=!1;return n0(e,n,t,(l,c,u)=>{l[s]&&l[s](t[n],o)&&(i.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,o))}),r&&!a?[]:i}var Fre={modes:{index(e,t,n,r){const o=Dl(t,e),i=n.axis||"x",s=n.includeInvisible||!1,a=n.intersect?Yx(e,o,i,r,s):Kx(e,o,i,!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 o=Dl(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;let a=n.intersect?Yx(e,o,i,r,s):Kx(e,o,i,!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 o=Dl(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;return Yx(e,o,i,r,s)},nearest(e,t,n,r){const o=Dl(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;return Kx(e,o,i,n.intersect,r,s)},x(e,t,n,r){const o=Dl(t,e);return T2(e,o,"x",n.intersect,r)},y(e,t,n,r){const o=Dl(t,e);return T2(e,o,"y",n.intersect,r)}}};const hL=["left","top","right","bottom"];function _f(e,t){return e.filter(n=>n.pos===t)}function k2(e,t){return e.filter(n=>hL.indexOf(n.pos)===-1&&n.box.axis===t)}function Cf(e,t){return e.sort((n,r)=>{const o=t?r:n,i=t?n:r;return o.weight===i.weight?o.index-i.index:o.weight-i.weight})}function Lre(e){const t=[];let n,r,o,i,s,a;for(n=0,r=(e||[]).length;n<r;++n)o=e[n],{position:i,options:{stack:s,stackWeight:a=1}}=o,t.push({index:n,box:o,pos:i,horizontal:o.isHorizontal(),weight:o.weight,stack:s&&i+s,stackWeight:a});return t}function $re(e){const t={};for(const n of e){const{stack:r,pos:o,stackWeight:i}=n;if(!r||!hL.includes(o))continue;const s=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=i}return t}function jre(e,t){const n=$re(e),{vBoxMaxWidth:r,hBoxMaxHeight:o}=t;let i,s,a;for(i=0,s=e.length;i<s;++i){a=e[i];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=o):(a.width=r,a.height=u?u*o:l&&t.availableHeight)}return n}function zre(e){const t=Lre(e),n=Cf(t.filter(c=>c.box.fullSize),!0),r=Cf(_f(t,"left"),!0),o=Cf(_f(t,"right")),i=Cf(_f(t,"top"),!0),s=Cf(_f(t,"bottom")),a=k2(t,"x"),l=k2(t,"y");return{fullSize:n,leftAndTop:r.concat(i),rightAndBottom:o.concat(l).concat(s).concat(a),chartArea:_f(t,"chartArea"),vertical:r.concat(o).concat(l),horizontal:i.concat(s).concat(a)}}function P2(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function pL(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 Bre(e,t,n,r){const{pos:o,box:i}=n,s=e.maxPadding;if(!Lt(o)){n.size&&(e[o]-=n.size);const d=r[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?i.height:i.width),n.size=d.size/d.count,e[o]+=n.size}i.getPadding&&pL(s,i.getPadding());const a=Math.max(0,t.outerWidth-P2(s,e,"left","right")),l=Math.max(0,t.outerHeight-P2(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 Hre(e){const t=e.maxPadding;function n(r){const o=Math.max(t[r]-e[r],0);return e[r]+=o,o}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function Wre(e,t){const n=t.maxPadding;function r(o){const i={left:0,top:0,right:0,bottom:0};return o.forEach(s=>{i[s]=Math.max(t[s],n[s])}),i}return r(e?["left","right"]:["top","bottom"])}function Xf(e,t,n,r){const o=[];let i,s,a,l,c,u;for(i=0,s=e.length,c=0;i<s;++i){a=e[i],l=a.box,l.update(a.width||t.w,a.height||t.h,Wre(a.horizontal,t));const{same:d,other:p}=Bre(t,n,a,r);c|=d&&o.length,u=u||p,l.fullSize||o.push(a)}return c&&Xf(o,t,n,r)||u}function lm(e,t,n,r,o){e.top=n,e.left=t,e.right=t+r,e.bottom=n+o,e.width=r,e.height=o}function O2(e,t,n,r){const o=n.padding;let{x:i,y:s}=t;for(const a of e){const l=a.box,c=r[a.stack]||{placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const d=t.w*u,p=c.size||l.height;Lh(c.start)&&(s=c.start),l.fullSize?lm(l,o.left,s,n.outerWidth-o.right-o.left,p):lm(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;Lh(c.start)&&(i=c.start),l.fullSize?lm(l,i,o.top,p,n.outerHeight-o.bottom-o.top):lm(l,i,t.top+c.placed,p,d),c.start=i,c.placed+=d,i=l.right}}t.x=i,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 o=Er(e.options.layout.padding),i=Math.max(t-o.width,0),s=Math.max(n-o.height,0),a=zre(e.boxes),l=a.vertical,c=a.horizontal;sn(e.boxes,b=>{typeof b.beforeLayout=="function"&&b.beforeLayout()});const u=l.reduce((b,y)=>y.box.options&&y.box.options.display===!1?b:b+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:o,availableWidth:i,availableHeight:s,vBoxMaxWidth:i/2/u,hBoxMaxHeight:s/2}),p=Object.assign({},o);pL(p,Er(r));const h=Object.assign({maxPadding:p,w:i,h:s,x:o.left,y:o.top},o),m=jre(l.concat(c),d);Xf(a.fullSize,h,d,m),Xf(l,h,d,m),Xf(c,h,d,m)&&Xf(l,h,d,m),Hre(h),O2(a.leftAndTop,h,d,m),h.x+=h.w,h.y+=h.h,O2(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},sn(a.chartArea,b=>{const y=b.box;Object.assign(y,e.chartArea),y.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class gL{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,o){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,o?Math.floor(n/o):r)}}isAttached(t){return!0}updateConfig(t){}}class Vre extends gL{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const ab="$chartjs",Ure={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},M2=e=>e===null||e==="";function Gre(e,t){const n=e.style,r=e.getAttribute("height"),o=e.getAttribute("width");if(e[ab]={initial:{height:r,width:o,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",M2(o)){const i=p2(e,"width");i!==void 0&&(e.width=i)}if(M2(r))if(e.style.height==="")e.height=e.width/(t||2);else{const i=p2(e,"height");i!==void 0&&(e.height=i)}return e}const mL=Yne?{passive:!0}:!1;function qre(e,t,n){e&&e.addEventListener(t,n,mL)}function Yre(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,mL)}function Kre(e,t){const n=Ure[e.type]||e.type,{x:r,y:o}=Dl(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:o!==void 0?o:null}}function Fb(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function Xre(e,t,n){const r=e.canvas,o=new MutationObserver(i=>{let s=!1;for(const a of i)s=s||Fb(a.addedNodes,r),s=s&&!Fb(a.removedNodes,r);s&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}function Qre(e,t,n){const r=e.canvas,o=new MutationObserver(i=>{let s=!1;for(const a of i)s=s||Fb(a.removedNodes,r),s=s&&!Fb(a.addedNodes,r);s&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}const zh=new Map;let A2=0;function bL(){const e=window.devicePixelRatio;e!==A2&&(A2=e,zh.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function Zre(e,t){zh.size||window.addEventListener("resize",bL),zh.set(e,t)}function Jre(e){zh.delete(e),zh.size||window.removeEventListener("resize",bL)}function eoe(e,t,n){const r=e.canvas,o=r&&cE(r);if(!o)return;const i=qF((a,l)=>{const c=o.clientWidth;n(a,l),c<o.clientWidth&&n()},window),s=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||i(c,u)});return s.observe(o),Zre(e,i),s}function Xx(e,t,n){n&&n.disconnect(),t==="resize"&&Jre(e)}function toe(e,t,n){const r=e.canvas,o=qF(i=>{e.ctx!==null&&n(Kre(i,e))},e);return qre(r,t,o),o}class noe extends gL{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(Gre(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[ab])return!1;const r=n[ab].initial;["height","width"].forEach(i=>{const s=r[i];yt(s)?n.removeAttribute(i):n.setAttribute(i,s)});const o=r.style||{};return Object.keys(o).forEach(i=>{n.style[i]=o[i]}),n.width=n.width,delete n[ab],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const o=t.$proxies||(t.$proxies={}),s={attach:Xre,detach:Qre,resize:eoe}[n]||toe;o[n]=s(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),o=r[n];if(!o)return;({attach:Xx,detach:Xx,resize:Xx}[n]||Yre)(t,n,o),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,o){return qne(t,n,r,o)}isAttached(t){const n=t&&cE(t);return!!(n&&n.isConnected)}}function roe(e){return!lE()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?Vre:noe}var tb;let bs=(tb=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 gd(this.x)&&gd(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const o={};return t.forEach(i=>{o[i]=r[i]&&r[i].active()?r[i]._to:this[i]}),o}},Me(tb,"defaults",{}),Me(tb,"defaultRoutes"),tb);function ooe(e,t){const n=e.options.ticks,r=ioe(e),o=Math.min(n.maxTicksLimit||r,r),i=n.major.enabled?aoe(t):[],s=i.length,a=i[0],l=i[s-1],c=[];if(s>o)return loe(t,c,i,s/o),c;const u=soe(i,t,o);if(s>0){let d,p;const h=s>1?Math.round((l-a)/(s-1)):null;for(cm(t,c,u,yt(h)?0:a-h,a),d=0,p=s-1;d<p;d++)cm(t,c,u,i[d],i[d+1]);return cm(t,c,u,l,yt(h)?t.length:l+h),c}return cm(t,c,u),c}function ioe(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),o=e._maxLength/n;return Math.floor(Math.min(r,o))}function soe(e,t,n){const r=coe(e),o=t.length/n;if(!r)return Math.max(o,1);const i=Xte(r);for(let s=0,a=i.length-1;s<a;s++){const l=i[s];if(l>o)return l}return Math.max(o,1)}function aoe(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function loe(e,t,n,r){let o=0,i=n[0],s;for(r=Math.ceil(r),s=0;s<e.length;s++)s===i&&(t.push(e[s]),o++,i=n[o*r])}function cm(e,t,n,r,o){const i=ut(r,0),s=Math.min(ut(o,e.length),e.length);let a=0,l,c,u;for(n=Math.ceil(n),o&&(l=o-r,n=l/Math.floor(l/n)),u=i;u<0;)a++,u=Math.round(i+a*n);for(c=Math.max(i,0);c<s;c++)c===u&&(t.push(e[c]),a++,u=Math.round(i+a*n))}function coe(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 uoe=e=>e==="left"?"right":e==="right"?"left":e,D2=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,I2=(e,t)=>Math.min(t||e,e);function N2(e,t){const n=[],r=e.length/t,o=e.length;let i=0;for(;i<o;i+=r)n.push(e[Math.floor(i)]);return n}function doe(e,t,n){const r=e.ticks.length,o=Math.min(t,r-1),i=e._startPixel,s=e._endPixel,a=1e-6;let l=e.getPixelForTick(o),c;if(!(n&&(r===1?c=Math.max(l-i,s-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(o-1))/2,l+=o<t?c:-c,l<i-a||l>s+a)))return l}function foe(e,t){sn(e,n=>{const r=n.gc,o=r.length/2;let i;if(o>t){for(i=0;i<o;++i)delete n.data[r[i]];r.splice(0,o)}})}function Ef(e){return e.drawTicks?e.tickLength:0}function F2(e,t){if(!e.display)return 0;const n=Zn(e.font,t),r=Er(e.padding);return(kn(e.text)?e.text.length:1)*n.lineHeight+r.height}function hoe(e,t){return al(e,{scale:t,type:"scale"})}function poe(e,t,n){return al(e,{tick:n,index:t,type:"tick"})}function goe(e,t,n){let r=nE(e);return(n&&t!=="right"||!n&&t==="right")&&(r=uoe(r)),r}function moe(e,t,n,r){const{top:o,left:i,bottom:s,right:a,chart:l}=e,{chartArea:c,scales:u}=l;let d=0,p,h,m;const b=s-o,y=a-i;if(e.isHorizontal()){if(h=Ar(r,i,a),Lt(n)){const v=Object.keys(n)[0],w=n[v];m=u[v].getPixelForValue(w)+b-t}else n==="center"?m=(c.bottom+c.top)/2+b-t:m=D2(e,n,t);p=a-i}else{if(Lt(n)){const v=Object.keys(n)[0],w=n[v];h=u[v].getPixelForValue(w)-y+t}else n==="center"?h=(c.left+c.right)/2-y+t:h=D2(e,n,t);m=Ar(r,s,o),d=n==="left"?-qn:qn}return{titleX:h,titleY:m,maxWidth:p,rotation:d}}class ll extends bs{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:o}=this;return t=Io(t,Number.POSITIVE_INFINITY),n=Io(n,Number.NEGATIVE_INFINITY),r=Io(r,Number.POSITIVE_INFINITY),o=Io(o,Number.NEGATIVE_INFINITY),{min:Io(t,r),max:Io(n,o),minDefined:Wn(t),maxDefined:Wn(n)}}getMinMax(t){let{min:n,max:r,minDefined:o,maxDefined:i}=this.getUserBounds(),s;if(o&&i)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),o||(n=Math.min(n,s.min)),i||(r=Math.max(r,s.max));return n=i&&n>r?r:n,r=o&&n>r?n:r,{min:Io(n,Io(r,n)),max:Io(r,Io(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(){hn(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:o,grace:i,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=Ene(this,i,o),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?N2(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=ooe(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(){hn(this.options.afterUpdate,[this])}beforeSetDimensions(){hn(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(){hn(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),hn(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){hn(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,o,i;for(r=0,o=t.length;r<o;r++)i=t[r],i.label=hn(n.callback,[i.value,r,t],this)}afterTickToLabelConversion(){hn(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){hn(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=I2(this.ticks.length,t.ticks.maxTicksLimit),o=n.minRotation||0,i=n.maxRotation;let s=o,a,l,c;if(!this._isVisible()||!n.display||o>=i||r<=1||!this.isHorizontal()){this.labelRotation=o;return}const u=this._getLabelSizes(),d=u.widest.width,p=u.highest.height,h=gr(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-Ef(t.grid)-n.padding-F2(t.title,this.chart.options.font),c=Math.sqrt(d*d+p*p),s=eE(Math.min(Math.asin(gr((u.highest.height+6)/a,-1,1)),Math.asin(gr(l/c,-1,1))-Math.asin(gr(p/c,-1,1)))),s=Math.max(o,Math.min(i,s))),this.labelRotation=s}afterCalculateLabelRotation(){hn(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){hn(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:o,grid:i}}=this,s=this._isVisible(),a=this.isHorizontal();if(s){const l=F2(o,n.options.font);if(a?(t.width=this.maxWidth,t.height=Ef(i)+l):(t.height=this.maxHeight,t.width=Ef(i)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:p}=this._getLabelSizes(),h=r.padding*2,m=Pi(this.labelRotation),b=Math.cos(m),y=Math.sin(m);if(a){const v=r.mirror?0:y*d.width+b*p.height;t.height=Math.min(this.maxHeight,t.height+v+h)}else{const v=r.mirror?0:b*d.width+y*p.height;t.width=Math.min(this.maxWidth,t.width+v+h)}this._calculatePadding(c,u,y,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,o){const{ticks:{align:i,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=o*t.width,h=r*n.height):(p=r*t.height,h=o*n.width):i==="start"?h=n.width:i==="end"?p=t.width:i!=="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;i==="start"?(u=0,d=t.height):i==="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(){hn(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++)yt(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=N2(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:o,_longestTextCache:i}=this,s=[],a=[],l=Math.floor(n/I2(n,r));let c=0,u=0,d,p,h,m,b,y,v,w,_,R,C;for(d=0;d<n;d+=l){if(m=t[d].label,b=this._resolveTickFontOptions(d),o.font=y=b.string,v=i[y]=i[y]||{data:{},gc:[]},w=b.lineHeight,_=R=0,!yt(m)&&!kn(m))_=Db(o,v.data,v.gc,_,m),R=w;else if(kn(m))for(p=0,h=m.length;p<h;++p)C=m[p],!yt(C)&&!kn(C)&&(_=Db(o,v.data,v.gc,_,C),R+=w);s.push(_),a.push(R),c=Math.max(_,c),u=Math.max(R,u)}foe(i,n);const E=s.indexOf(c),P=a.indexOf(u),A=I=>({width:s[I]||0,height:a[I]||0});return{first:A(0),last:A(n-1),widest:A(E),highest:A(P),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 ene(this._alignToPixels?Tl(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=poe(this.getContext(),t,r))}return this.$context||(this.$context=hoe(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Pi(this.labelRotation),r=Math.abs(Math.cos(n)),o=Math.abs(Math.sin(n)),i=this._getLabelSizes(),s=t.autoSkipPadding||0,a=i?i.widest.width+s:0,l=i?i.highest.height+s:0;return this.isHorizontal()?l*r>a*o?a/r:l/o:l*o<a*r?l/r:a/o}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,o=this.options,{grid:i,position:s,border:a}=o,l=i.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),p=Ef(i),h=[],m=a.setContext(this.getContext()),b=m.display?m.width:0,y=b/2,v=function(B){return Tl(r,B,b)};let w,_,R,C,E,P,A,I,F,L,j,X;if(s==="top")w=v(this.bottom),P=this.bottom-p,I=w-y,L=v(t.top)+y,X=t.bottom;else if(s==="bottom")w=v(this.top),L=t.top,X=v(t.bottom)-y,P=w+y,I=this.top+p;else if(s==="left")w=v(this.right),E=this.right-p,A=w-y,F=v(t.left)+y,j=t.right;else if(s==="right")w=v(this.left),F=t.left,j=v(t.right)-y,E=w+y,A=this.left+p;else if(n==="x"){if(s==="center")w=v((t.top+t.bottom)/2+.5);else if(Lt(s)){const B=Object.keys(s)[0],W=s[B];w=v(this.chart.scales[B].getPixelForValue(W))}L=t.top,X=t.bottom,P=w+y,I=P+p}else if(n==="y"){if(s==="center")w=v((t.left+t.right)/2);else if(Lt(s)){const B=Object.keys(s)[0],W=s[B];w=v(this.chart.scales[B].getPixelForValue(W))}E=w-y,A=E-p,F=t.left,j=t.right}const U=ut(o.ticks.maxTicksLimit,d),$=Math.max(1,Math.ceil(d/U));for(_=0;_<d;_+=$){const B=this.getContext(_),W=i.setContext(B),q=a.setContext(B),Q=W.lineWidth,D=W.color,G=q.dash||[],V=q.dashOffset,M=W.tickWidth,ee=W.tickColor,K=W.tickBorderDash||[],re=W.tickBorderDashOffset;R=doe(this,_,l),R!==void 0&&(C=Tl(r,R,Q),c?E=A=F=j=C:P=I=L=X=C,h.push({tx1:E,ty1:P,tx2:A,ty2:I,x1:F,y1:L,x2:j,y2:X,width:Q,color:D,borderDash:G,borderDashOffset:V,tickWidth:M,tickColor:ee,tickBorderDash:K,tickBorderDashOffset:re}))}return this._ticksLength=d,this._borderValue=w,h}_computeLabelItems(t){const n=this.axis,r=this.options,{position:o,ticks:i}=r,s=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=i,p=Ef(r.grid),h=p+u,m=d?-u:h,b=-Pi(this.labelRotation),y=[];let v,w,_,R,C,E,P,A,I,F,L,j,X="middle";if(o==="top")E=this.bottom-m,P=this._getXAxisLabelAlignment();else if(o==="bottom")E=this.top+m,P=this._getXAxisLabelAlignment();else if(o==="left"){const $=this._getYAxisLabelAlignment(p);P=$.textAlign,C=$.x}else if(o==="right"){const $=this._getYAxisLabelAlignment(p);P=$.textAlign,C=$.x}else if(n==="x"){if(o==="center")E=(t.top+t.bottom)/2+h;else if(Lt(o)){const $=Object.keys(o)[0],B=o[$];E=this.chart.scales[$].getPixelForValue(B)+h}P=this._getXAxisLabelAlignment()}else if(n==="y"){if(o==="center")C=(t.left+t.right)/2-h;else if(Lt(o)){const $=Object.keys(o)[0],B=o[$];C=this.chart.scales[$].getPixelForValue(B)}P=this._getYAxisLabelAlignment(p).textAlign}n==="y"&&(l==="start"?X="top":l==="end"&&(X="bottom"));const U=this._getLabelSizes();for(v=0,w=a.length;v<w;++v){_=a[v],R=_.label;const $=i.setContext(this.getContext(v));A=this.getPixelForTick(v)+i.labelOffset,I=this._resolveTickFontOptions(v),F=I.lineHeight,L=kn(R)?R.length:1;const B=L/2,W=$.color,q=$.textStrokeColor,Q=$.textStrokeWidth;let D=P;s?(C=A,P==="inner"&&(v===w-1?D=this.options.reverse?"left":"right":v===0?D=this.options.reverse?"right":"left":D="center"),o==="top"?c==="near"||b!==0?j=-L*F+F/2:c==="center"?j=-U.highest.height/2-B*F+F:j=-U.highest.height+F/2:c==="near"||b!==0?j=F/2:c==="center"?j=U.highest.height/2-B*F:j=U.highest.height-L*F,d&&(j*=-1),b!==0&&!$.showLabelBackdrop&&(C+=F/2*Math.sin(b))):(E=A,j=(1-L)*F/2);let G;if($.showLabelBackdrop){const V=Er($.backdropPadding),M=U.heights[v],ee=U.widths[v];let K=j-V.top,re=0-V.left;switch(X){case"middle":K-=M/2;break;case"bottom":K-=M;break}switch(P){case"center":re-=ee/2;break;case"right":re-=ee;break;case"inner":v===w-1?re-=ee:v>0&&(re-=ee/2);break}G={left:re,top:K,width:ee+V.width,height:M+V.height,color:$.backdropColor}}y.push({label:R,font:I,textOffset:j,options:{rotation:b,color:W,strokeColor:q,strokeWidth:Q,textAlign:D,textBaseline:X,translation:[C,E],backdrop:G}})}return y}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Pi(this.labelRotation))return t==="top"?"left":"right";let o="center";return n.align==="start"?o="left":n.align==="end"?o="right":n.align==="inner"&&(o="inner"),o}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:o,padding:i}}=this.options,s=this._getLabelSizes(),a=t+i,l=s.widest.width;let c,u;return n==="left"?o?(u=this.right+i,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"?o?(u=this.left+i,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:o,width:i,height:s}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,o,i,s),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const o=this.ticks.findIndex(i=>i.value===t);return o>=0?n.setContext(this.getContext(o)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,o=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let i,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(i=0,s=o.length;i<s;++i){const l=o[i];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:o}}=this,i=r.setContext(this.getContext()),s=r.display?i.width:0;if(!s)return;const a=o.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,p;this.isHorizontal()?(c=Tl(t,this.left,s)-s/2,u=Tl(t,this.right,a)+a/2,d=p=l):(d=Tl(t,this.top,s)-s/2,p=Tl(t,this.bottom,a)+a/2,c=u=l),n.save(),n.lineWidth=i.width,n.strokeStyle=i.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,o=this._computeLabelArea();o&&lc(r,o);const i=this.getLabelItems(t);for(const s of i){const a=s.options,l=s.font,c=s.label,u=s.textOffset;Tc(r,c,0,u,l,a)}o&&cc(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:o}}=this;if(!r.display)return;const i=Zn(r.font),s=Er(r.padding),a=r.align;let l=i.lineHeight/2;n==="bottom"||n==="center"||Lt(n)?(l+=s.bottom,kn(r.text)&&(l+=i.lineHeight*(r.text.length-1))):l+=s.top;const{titleX:c,titleY:u,maxWidth:d,rotation:p}=moe(this,l,n,a);Tc(t,r.text,0,0,i,{color:r.color,maxWidth:d,rotation:p,textAlign:goe(a,n,o),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=ut(t.grid&&t.grid.z,-1),o=ut(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==ll.prototype.draw?[{z:n,draw:i=>{this.draw(i)}}]:[{z:r,draw:i=>{this.drawBackground(),this.drawGrid(i),this.drawTitle()}},{z:o,draw:()=>{this.drawBorder()}},{z:n,draw:i=>{this.drawLabels(i)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",o=[];let i,s;for(i=0,s=n.length;i<s;++i){const a=n[i];a[r]===this.id&&(!t||a.type===t)&&o.push(a)}return o}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return Zn(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class um{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;voe(n)&&(r=this.register(n));const o=this.items,i=t.id,s=this.scope+"."+i;if(!i)throw new Error("class does not have id: "+t);return i in o||(o[i]=t,boe(t,s,r),this.override&&On.override(t.id,t.overrides)),s}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,o=this.scope;r in n&&delete n[r],o&&r in On[o]&&(delete On[o][r],this.override&&delete Rc[r])}}function boe(e,t,n){const r=mr(Object.create(null),[n?On.get(n):{},On.get(t),e.defaults]);On.set(t,r),e.defaultRoutes&&yoe(t,e.defaultRoutes),e.descriptors&&On.describe(t,e.descriptors)}function yoe(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),o=r.pop(),i=[e].concat(r).join("."),s=t[n].split("."),a=s.pop(),l=s.join(".");On.route(i,o,l,a)})}function voe(e){return"id"in e&&"defaults"in e}class xoe{constructor(){this.controllers=new um(ui,"datasets",!0),this.elements=new um(bs,"elements"),this.plugins=new um(Object,"plugins"),this.scales=new um(ll,"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(o=>{const i=r||this._getRegistryForType(o);r||i.isForType(o)||i===this.plugins&&o.id?this._exec(t,i,o):sn(o,s=>{const a=r||this._getRegistryForType(s);this._exec(t,a,s)})})}_exec(t,n,r){const o=JC(t);hn(r["before"+o],[],r),n[t](r),hn(r["after"+o],[],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 o=n.get(t);if(o===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return o}}var Xr=new xoe;class woe{constructor(){this._init=[]}notify(t,n,r,o){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const i=o?this._descriptors(t).filter(o):this._descriptors(t),s=this._notify(i,t,n,r);return n==="afterDestroy"&&(this._notify(i,t,"stop"),this._notify(this._init,t,"uninstall")),s}_notify(t,n,r,o){o=o||{};for(const i of t){const s=i.plugin,a=s[r],l=[n,o,i.options];if(hn(a,l,s)===!1&&o.cancelable)return!1}return!0}invalidate(){yt(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,o=ut(r.options&&r.options.plugins,{}),i=Soe(r);return o===!1&&!n?[]:Coe(t,i,o,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,o=(i,s)=>i.filter(a=>!s.some(l=>a.plugin.id===l.plugin.id));this._notify(o(n,r),t,"stop"),this._notify(o(r,n),t,"start")}}function Soe(e){const t={},n=[],r=Object.keys(Xr.plugins.items);for(let i=0;i<r.length;i++)n.push(Xr.getPlugin(r[i]));const o=e.plugins||[];for(let i=0;i<o.length;i++){const s=o[i];n.indexOf(s)===-1&&(n.push(s),t[s.id]=!0)}return{plugins:n,localIds:t}}function _oe(e,t){return!t&&e===!1?null:e===!0?{}:e}function Coe(e,{plugins:t,localIds:n},r,o){const i=[],s=e.getContext();for(const a of t){const l=a.id,c=_oe(r[l],o);c!==null&&i.push({plugin:a,options:Eoe(e.config,{plugin:a,local:n[l]},c,s)})}return i}function Eoe(e,{plugin:t,local:n},r,o){const i=e.pluginScopeKeys(t),s=e.getOptionScopes(r,i);return n&&t.defaults&&s.push(t.defaults),e.createResolver(s,o,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function lS(e,t){const n=On.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function Roe(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function Toe(e,t){return e===t?"_index_":"_value_"}function L2(e){if(e==="x"||e==="y"||e==="r")return e}function koe(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function cS(e,...t){if(L2(e))return e;for(const n of t){const r=n.axis||koe(n.position)||e.length>1&&L2(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function $2(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function Poe(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 $2(e,"x",n[0])||$2(e,"y",n[0])}return{}}function Ooe(e,t){const n=Rc[e.type]||{scales:{}},r=t.scales||{},o=lS(e.type,t),i=Object.create(null);return Object.keys(r).forEach(s=>{const a=r[s];if(!Lt(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=cS(s,a,Poe(s,e),On.scales[a.type]),c=Toe(l,o),u=n.scales||{};i[s]=uh(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(s=>{const a=s.type||e.type,l=s.indexAxis||lS(a,t),u=(Rc[a]||{}).scales||{};Object.keys(u).forEach(d=>{const p=Roe(d,l),h=s[p+"AxisID"]||p;i[h]=i[h]||Object.create(null),uh(i[h],[{axis:p},r[h],u[d]])})}),Object.keys(i).forEach(s=>{const a=i[s];uh(a,[On.scales[a.type],On.scale])}),i}function yL(e){const t=e.options||(e.options={});t.plugins=ut(t.plugins,{}),t.scales=Ooe(e,t)}function vL(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function Moe(e){return e=e||{},e.data=vL(e.data),yL(e),e}const j2=new Map,xL=new Set;function dm(e,t){let n=j2.get(e);return n||(n=t(),j2.set(e,n),xL.add(n)),n}const Rf=(e,t,n)=>{const r=Ya(t,n);r!==void 0&&e.add(r)};class Aoe{constructor(t){this._config=Moe(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=vL(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(),yL(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return dm(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return dm(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return dm(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return dm(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let o=r.get(t);return(!o||n)&&(o=new Map,r.set(t,o)),o}getOptionScopes(t,n,r){const{options:o,type:i}=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=>Rf(l,t,d))),u.forEach(d=>Rf(l,o,d)),u.forEach(d=>Rf(l,Rc[i]||{},d)),u.forEach(d=>Rf(l,On,d)),u.forEach(d=>Rf(l,sS,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),xL.has(n)&&s.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Rc[n]||{},On.datasets[n]||{},{type:n},On,sS]}resolveNamedOptions(t,n,r,o=[""]){const i={$shared:!0},{resolver:s,subPrefixes:a}=z2(this._resolverCache,t,o);let l=s;if(Ioe(s,n)){i.$shared=!1,r=Ka(r)?r():r;const c=this.createResolver(t,r,a);l=md(s,r,c)}for(const c of n)i[c]=l[c];return i}createResolver(t,n,r=[""],o){const{resolver:i}=z2(this._resolverCache,t,r);return Lt(n)?md(i,n,void 0,o):i}}function z2(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const o=n.join();let i=r.get(o);return i||(i={resolver:iE(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(o,i)),i}const Doe=e=>Lt(e)&&Object.getOwnPropertyNames(e).some(t=>Ka(e[t]));function Ioe(e,t){const{isScriptable:n,isIndexable:r}=JF(e);for(const o of t){const i=n(o),s=r(o),a=(s||i)&&e[o];if(i&&(Ka(a)||Doe(a))||s&&kn(a))return!0}return!1}var Noe="4.4.8";const Foe=["top","bottom","left","right","chartArea"];function B2(e,t){return e==="top"||e==="bottom"||Foe.indexOf(e)===-1&&t==="x"}function H2(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function W2(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),hn(n&&n.onComplete,[e],t)}function Loe(e){const t=e.chart,n=t.options.animation;hn(n&&n.onProgress,[e],t)}function wL(e){return lE()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const lb={},V2=e=>{const t=wL(e);return Object.values(lb).filter(n=>n.canvas===t).pop()};function $oe(e,t,n){const r=Object.keys(e);for(const o of r){const i=+o;if(i>=t){const s=e[o];delete e[o],(n>0||i>t)&&(e[i+n]=s)}}}function joe(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}function fm(e,t,n){return e.options.clip?e[n]:t[n]}function zoe(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:fm(n,t,"left"),right:fm(n,t,"right"),top:fm(r,t,"top"),bottom:fm(r,t,"bottom")}:t}class Ln{static register(...t){Xr.add(...t),U2()}static unregister(...t){Xr.remove(...t),U2()}constructor(t,n){const r=this.config=new Aoe(n),o=wL(t),i=V2(o);if(i)throw new Error("Canvas is already in use. Chart with ID '"+i.id+"' must be destroyed before the canvas with ID '"+i.canvas.id+"' can be reused.");const s=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||roe(o)),this.platform.updateConfig(r);const a=this.platform.acquireContext(o,s.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=Bte(),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 woe,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=one(d=>this.update(d),s.resizeDelay||0),this._dataChanges=[],lb[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Ns.listen(this,"complete",W2),Ns.listen(this,"progress",Loe),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:o,_aspectRatio:i}=this;return yt(t)?n&&i?i:o?r/o: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 Xr}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():h2(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return u2(this.canvas,this.ctx),this}stop(){return Ns.stop(this),this}resize(t,n){Ns.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,o=this.canvas,i=r.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(o,t,n,i),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,h2(this,a,!0)&&(this.notifyPlugins("resize",{size:s}),hn(r.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};sn(n,(r,o)=>{r.id=o})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,o=Object.keys(r).reduce((s,a)=>(s[a]=!1,s),{});let i=[];n&&(i=i.concat(Object.keys(n).map(s=>{const a=n[s],l=cS(s,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),sn(i,s=>{const a=s.options,l=a.id,c=cS(l,a),u=ut(a.type,s.dtype);(a.position===void 0||B2(a.position,c)!==B2(s.dposition))&&(a.position=s.dposition),o[l]=!0;let d=null;if(l in r&&r[l].type===u)d=r[l];else{const p=Xr.getScale(u);d=new p({id:l,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(a,t)}),sn(o,(s,a)=>{s||delete r[a]}),sn(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((o,i)=>o.index-i.index),r>n){for(let o=n;o<r;++o)this._destroyDatasetMeta(o);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(H2("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,o)=>{n.filter(i=>i===r._dataset).length===0&&this._destroyDatasetMeta(o)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,o;for(this._removeUnreferencedMetasets(),r=0,o=n.length;r<o;r++){const i=n[r];let s=this.getDatasetMeta(r);const a=i.type||this.config.type;if(s.type&&s.type!==a&&(this._destroyDatasetMeta(r),s=this.getDatasetMeta(r)),s.type=a,s.indexAxis=i.indexAxis||lS(a,this.options),s.order=i.order||0,s.index=r,s.label=""+i.label,s.visible=this.isDatasetVisible(r),s.controller)s.controller.updateIndex(r),s.controller.linkScales();else{const l=Xr.getController(a),{datasetElementType:c,dataElementType:u}=On.datasets[a];Object.assign(l,{dataElementType:Xr.getElement(u),datasetElementType:c&&Xr.getElement(c)}),s.controller=new l(this,r),t.push(s.controller)}}return this._updateMetasets(),t}_resetElements(){sn(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()),o=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const i=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=!o&&i.indexOf(d)===-1;d.buildOrUpdateElements(p),s=Math.max(+d.getMaxOverflow(),s)}s=this._minPadding=r.layout.autoPadding?s:0,this._updateLayout(s),o||sn(i,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(H2("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){sn(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);(!t2(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:o,count:i}of n){const s=r==="_removeElements"?-i:i;$oe(t,o,s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=i=>new Set(t.filter(s=>s[0]===i).map((s,a)=>a+","+s.splice(1).join(","))),o=r(0);for(let i=1;i<n;i++)if(!t2(o,r(i)))return;return Array.from(o).map(i=>i.split(",")).map(i=>({method:i[1],start:+i[2],count:+i[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=[],sn(this.boxes,o=>{r&&o.position==="chartArea"||(o.configure&&o.configure(),this._layers.push(...o._layers()))},this),this._layers.forEach((o,i)=>{o._idx=i}),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,Ka(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),o={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",o)!==!1&&(r.controller._update(n),o.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",o))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Ns.has(this)?this.attached&&!Ns.running(this)&&Ns.start(this):(this.draw(),W2({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:o}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,o)}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 o,i;for(o=0,i=n.length;o<i;++o){const s=n[o];(!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,o=!r.disabled,i=zoe(t,this.chartArea),s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(o&&lc(n,{left:r.left===!1?0:i.left-r.left,right:r.right===!1?this.width:i.right+r.right,top:r.top===!1?0:i.top-r.top,bottom:r.bottom===!1?this.height:i.bottom+r.bottom}),t.controller.draw(),o&&cc(n),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return Ys(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,o){const i=Fre.modes[n];return typeof i=="function"?i(this,t,r,o):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let o=r.filter(i=>i&&i._dataset===n).pop();return o||(o={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(o)),o}getContext(){return this.$context||(this.$context=al(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 o=r?"show":"hide",i=this.getDatasetMeta(t),s=i.controller._resolveAnimations(void 0,o);Lh(n)?(i.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),s.update(i,{visible:r}),this.update(a=>a.datasetIndex===t?o:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),Ns.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),u2(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete lb[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=(i,s)=>{n.addEventListener(this,i,s),t[i]=s},o=(i,s,a)=>{i.offsetX=s,i.offsetY=a,this._eventHandler(i)};sn(this.options.events,i=>r(i,o))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},o=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},i=(l,c)=>{this.canvas&&this.resize(l,c)};let s;const a=()=>{o("attach",a),this.attached=!0,this.resize(),r("resize",i),r("detach",s)};s=()=>{this.attached=!1,o("resize",i),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():s()}unbindEvents(){sn(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},sn(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const o=r?"set":"remove";let i,s,a,l;for(n==="dataset"&&(i=this.getDatasetMeta(t[0].datasetIndex),i.controller["_"+o+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){s=t[a];const c=s&&this.getDatasetMeta(s.datasetIndex).controller;c&&c[o+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:i,index:s})=>{const a=this.getDatasetMeta(i);if(!a)throw new Error("No dataset found at index "+i);return{datasetIndex:i,element:a.data[s],index:s}});!Ob(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 o=this.options.hover,i=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),s=i(n,t),a=r?t:i(t,n);s.length&&this.updateHoverStyle(s,o.mode,!1),a.length&&o.mode&&this.updateHoverStyle(a,o.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},o=s=>(s.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,o)===!1)return;const i=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,o),(i||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:o=[],options:i}=this,s=n,a=this._getActiveElements(t,o,r,s),l=qte(t),c=joe(t,this._lastEvent,r,l);r&&(this._lastEvent=null,hn(i.onHover,[t,a,this],this),l&&hn(i.onClick,[t,a,this],this));const u=!Ob(a,o);return(u||n)&&(this._active=a,this._updateHoverStyles(a,o,n)),this._lastEvent=c,u}_getActiveElements(t,n,r,o){if(t.type==="mouseout")return[];if(!r)return n;const i=this.options.hover;return this.getElementsAtEventForMode(t,i.mode,i,o)}}Me(Ln,"defaults",On),Me(Ln,"instances",lb),Me(Ln,"overrides",Rc),Me(Ln,"registry",Xr),Me(Ln,"version",Noe),Me(Ln,"getChart",V2);function U2(){return sn(Ln.instances,e=>e._plugins.invalidate())}function Boe(e,t,n){const{startAngle:r,pixelMargin:o,x:i,y:s,outerRadius:a,innerRadius:l}=t;let c=o/a;e.beginPath(),e.arc(i,s,a,r-c,n+c),l>o?(c=o/l,e.arc(i,s,l,n+c,r-c,!0)):e.arc(i,s,o,n+qn,r-qn),e.closePath(),e.clip()}function Hoe(e){return oE(e,["outerStart","outerEnd","innerStart","innerEnd"])}function Woe(e,t,n,r){const o=Hoe(e.options.borderRadius),i=(n-t)/2,s=Math.min(i,r*t/2),a=l=>{const c=(n-Math.min(i,l))*r/2;return gr(l,0,Math.min(i,c))};return{outerStart:a(o.outerStart),outerEnd:a(o.outerEnd),innerStart:gr(o.innerStart,0,s),innerEnd:gr(o.innerEnd,0,s)}}function hu(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function Lb(e,t,n,r,o,i){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=o-l;if(r){const $=u>0?u-r:0,B=d>0?d-r:0,W=($+B)/2,q=W!==0?m*W/(W+r):m;h=(m-q)/2}const b=Math.max(.001,m*d-n/Mn)/d,y=(m-b)/2,v=l+y+h,w=o-y-h,{outerStart:_,outerEnd:R,innerStart:C,innerEnd:E}=Woe(t,p,d,w-v),P=d-_,A=d-R,I=v+_/P,F=w-R/A,L=p+C,j=p+E,X=v+C/L,U=w-E/j;if(e.beginPath(),i){const $=(I+F)/2;if(e.arc(s,a,d,I,$),e.arc(s,a,d,$,F),R>0){const Q=hu(A,F,s,a);e.arc(Q.x,Q.y,R,F,w+qn)}const B=hu(j,w,s,a);if(e.lineTo(B.x,B.y),E>0){const Q=hu(j,U,s,a);e.arc(Q.x,Q.y,E,w+qn,U+Math.PI)}const W=(w-E/p+(v+C/p))/2;if(e.arc(s,a,p,w-E/p,W,!0),e.arc(s,a,p,W,v+C/p,!0),C>0){const Q=hu(L,X,s,a);e.arc(Q.x,Q.y,C,X+Math.PI,v-qn)}const q=hu(P,v,s,a);if(e.lineTo(q.x,q.y),_>0){const Q=hu(P,I,s,a);e.arc(Q.x,Q.y,_,v-qn,I)}}else{e.moveTo(s,a);const $=Math.cos(I)*d+s,B=Math.sin(I)*d+a;e.lineTo($,B);const W=Math.cos(F)*d+s,q=Math.sin(F)*d+a;e.lineTo(W,q)}e.closePath()}function Voe(e,t,n,r,o){const{fullCircles:i,startAngle:s,circumference:a}=t;let l=t.endAngle;if(i){Lb(e,t,n,r,l,o);for(let c=0;c<i;++c)e.fill();isNaN(a)||(l=s+(a%Pn||Pn))}return Lb(e,t,n,r,l,o),e.fill(),l}function Uoe(e,t,n,r,o){const{fullCircles:i,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(i){Lb(e,t,n,r,m,o);for(let b=0;b<i;++b)e.stroke();isNaN(a)||(m=s+(a%Pn||Pn))}h&&Boe(e,t,m),i||(Lb(e,t,n,r,m,o),e.stroke())}class Tu extends bs{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,o){const i=this.getProps(["x","y"],o),{angle:s,distance:a}=WF(i,{x:n,y:r}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:d,circumference:p}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],o),h=(this.options.spacing+this.options.borderWidth)/2,m=ut(p,c-l),b=$h(s,l,c)&&l!==c,y=m>=Pn||b,v=Gs(a,u+h,d+h);return y&&v}getCenterPoint(n){const{x:r,y:o,startAngle:i,endAngle:s,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:u}=this.options,d=(i+s)/2,p=(a+l+u+c)/2;return{x:r+Math.cos(d)*p,y:o+Math.sin(d)*p}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:r,circumference:o}=this,i=(r.offset||0)/4,s=(r.spacing||0)/2,a=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=o>Pn?Math.floor(o/Pn):0,o===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*i,Math.sin(l)*i);const c=1-Math.sin(Math.min(Mn,o||0)),u=i*c;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,Voe(n,this,u,s,a),Uoe(n,this,u,s,a),n.restore()}}Me(Tu,"id","arc"),Me(Tu,"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(Tu,"defaultRoutes",{backgroundColor:"backgroundColor"}),Me(Tu,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function SL(e,t,n=t){e.lineCap=ut(n.borderCapStyle,t.borderCapStyle),e.setLineDash(ut(n.borderDash,t.borderDash)),e.lineDashOffset=ut(n.borderDashOffset,t.borderDashOffset),e.lineJoin=ut(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=ut(n.borderWidth,t.borderWidth),e.strokeStyle=ut(n.borderColor,t.borderColor)}function Goe(e,t,n){e.lineTo(n.x,n.y)}function qoe(e){return e.stepped?mne:e.tension||e.cubicInterpolationMode==="monotone"?bne:Goe}function _L(e,t,n={}){const r=e.length,{start:o=0,end:i=r-1}=n,{start:s,end:a}=t,l=Math.max(o,s),c=Math.min(i,a),u=o<s&&i<s||o>a&&i>a;return{count:r,start:l,loop:t.loop,ilen:c<l&&!u?r+c-l:c-l}}function Yoe(e,t,n,r){const{points:o,options:i}=t,{count:s,start:a,loop:l,ilen:c}=_L(o,n,r),u=qoe(i);let{move:d=!0,reverse:p}=r||{},h,m,b;for(h=0;h<=c;++h)m=o[(a+(p?c-h:h))%s],!m.skip&&(d?(e.moveTo(m.x,m.y),d=!1):u(e,b,m,p,i.stepped),b=m);return l&&(m=o[(a+(p?c:0))%s],u(e,b,m,p,i.stepped)),!!l}function Koe(e,t,n,r){const o=t.points,{count:i,start:s,ilen:a}=_L(o,n,r),{move:l=!0,reverse:c}=r||{};let u=0,d=0,p,h,m,b,y,v;const w=R=>(s+(c?a-R:R))%i,_=()=>{b!==y&&(e.lineTo(u,y),e.lineTo(u,b),e.lineTo(u,v))};for(l&&(h=o[w(0)],e.moveTo(h.x,h.y)),p=0;p<=a;++p){if(h=o[w(p)],h.skip)continue;const R=h.x,C=h.y,E=R|0;E===m?(C<b?b=C:C>y&&(y=C),u=(d*u+R)/++d):(_(),e.lineTo(R,C),m=E,d=0,b=y=C),v=C}_()}function uS(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?Koe:Yoe}function Xoe(e){return e.stepped?Kne:e.tension||e.cubicInterpolationMode==="monotone"?Xne:Il}function Qoe(e,t,n,r){let o=t._path;o||(o=t._path=new Path2D,t.path(o,n,r)&&o.closePath()),SL(e,t.options),e.stroke(o)}function Zoe(e,t,n,r){const{segments:o,options:i}=t,s=uS(t);for(const a of o)SL(e,i,a.style),e.beginPath(),s(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const Joe=typeof Path2D=="function";function eie(e,t,n,r){Joe&&!t.options.segment?Qoe(e,t,n,r):Zoe(e,t,n,r)}class $a extends bs{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 o=r.spanGaps?this._loop:this._fullLoop;Bne(this._points,r,t,o,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=nre(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,o=t[n],i=this.points,s=cL(this,{property:n,start:o,end:o});if(!s.length)return;const a=[],l=Xoe(r);let c,u;for(c=0,u=s.length;c<u;++c){const{start:d,end:p}=s[c],h=i[d],m=i[p];if(h===m){a.push(h);continue}const b=Math.abs((o-h[n])/(m[n]-h[n])),y=l(h,m,b,r.stepped);y[n]=t[n],a.push(y)}return a.length===1?a[0]:a}pathSegment(t,n,r){return uS(this)(t,this,n,r)}path(t,n,r){const o=this.segments,i=uS(this);let s=this._loop;n=n||0,r=r||this.points.length-n;for(const a of o)s&=i(t,this,a,{start:n,end:n+r-1});return!!s}draw(t,n,r,o){const i=this.options||{};(this.points||[]).length&&i.borderWidth&&(t.save(),eie(t,this,r,o),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}Me($a,"id","line"),Me($a,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),Me($a,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),Me($a,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function G2(e,t,n,r){const o=e.options,{[n]:i}=e.getProps([n],r);return Math.abs(t-i)<o.radius+o.hitRadius}class fc extends bs{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,o){const i=this.options,{x:s,y:a}=this.getProps(["x","y"],o);return Math.pow(n-s,2)+Math.pow(r-a,2)<Math.pow(i.hitRadius+i.radius,2)}inXRange(n,r){return G2(this,n,"x",r)}inYRange(n,r){return G2(this,n,"y",r)}getCenterPoint(n){const{x:r,y:o}=this.getProps(["x","y"],n);return{x:r,y:o}}size(n){n=n||this.options||{};let r=n.radius||0;r=Math.max(r,r&&n.hoverRadius||0);const o=r&&n.borderWidth||0;return(r+o)*2}draw(n,r){const o=this.options;this.skip||o.radius<.1||!Ys(this,r,this.size(o)/2)||(n.strokeStyle=o.borderColor,n.lineWidth=o.borderWidth,n.fillStyle=o.backgroundColor,Ib(n,o,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}Me(fc,"id","point"),Me(fc,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),Me(fc,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function CL(e,t){const{x:n,y:r,base:o,width:i,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,o),l=Math.max(n,o),c=r-d,u=r+d):(d=i/2,a=n-d,l=n+d,c=Math.min(r,o),u=Math.max(r,o)),{left:a,top:c,right:l,bottom:u}}function ja(e,t,n,r){return e?0:gr(t,n,r)}function tie(e,t,n){const r=e.options.borderWidth,o=e.borderSkipped,i=ZF(r);return{t:ja(o.top,i.top,0,n),r:ja(o.right,i.right,0,t),b:ja(o.bottom,i.bottom,0,n),l:ja(o.left,i.left,0,t)}}function nie(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),o=e.options.borderRadius,i=uc(o),s=Math.min(t,n),a=e.borderSkipped,l=r||Lt(o);return{topLeft:ja(!l||a.top||a.left,i.topLeft,0,s),topRight:ja(!l||a.top||a.right,i.topRight,0,s),bottomLeft:ja(!l||a.bottom||a.left,i.bottomLeft,0,s),bottomRight:ja(!l||a.bottom||a.right,i.bottomRight,0,s)}}function rie(e){const t=CL(e),n=t.right-t.left,r=t.bottom-t.top,o=tie(e,n/2,r/2),i=nie(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:i},inner:{x:t.left+o.l,y:t.top+o.t,w:n-o.l-o.r,h:r-o.t-o.b,radius:{topLeft:Math.max(0,i.topLeft-Math.max(o.t,o.l)),topRight:Math.max(0,i.topRight-Math.max(o.t,o.r)),bottomLeft:Math.max(0,i.bottomLeft-Math.max(o.b,o.l)),bottomRight:Math.max(0,i.bottomRight-Math.max(o.b,o.r))}}}}function Qx(e,t,n,r){const o=t===null,i=n===null,a=e&&!(o&&i)&&CL(e,r);return a&&(o||Gs(t,a.left,a.right))&&(i||Gs(n,a.top,a.bottom))}function oie(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function iie(e,t){e.rect(t.x,t.y,t.w,t.h)}function Zx(e,t,n={}){const r=e.x!==n.x?-t:0,o=e.y!==n.y?-t:0,i=(e.x+e.w!==n.x+n.w?t:0)-r,s=(e.y+e.h!==n.y+n.h?t:0)-o;return{x:e.x+r,y:e.y+o,w:e.w+i,h:e.h+s,radius:e.radius}}class hc extends bs{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:o}}=this,{inner:i,outer:s}=rie(this),a=oie(s.radius)?jh:iie;t.save(),(s.w!==i.w||s.h!==i.h)&&(t.beginPath(),a(t,Zx(s,n,i)),t.clip(),a(t,Zx(i,-n,s)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),a(t,Zx(i,n)),t.fillStyle=o,t.fill(),t.restore()}inRange(t,n,r){return Qx(this,t,n,r)}inXRange(t,n){return Qx(this,t,null,n)}inYRange(t,n){return Qx(this,null,t,n)}getCenterPoint(t){const{x:n,y:r,base:o,horizontal:i}=this.getProps(["x","y","base","horizontal"],t);return{x:i?(n+o)/2:n,y:i?r:(r+o)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}Me(hc,"id","bar"),Me(hc,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),Me(hc,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var sie=Object.freeze({__proto__:null,ArcElement:Tu,BarElement:hc,LineElement:$a,PointElement:fc});const dS=["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)"],q2=dS.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function EL(e){return dS[e%dS.length]}function RL(e){return q2[e%q2.length]}function aie(e,t){return e.borderColor=EL(t),e.backgroundColor=RL(t),++t}function lie(e,t){return e.backgroundColor=e.data.map(()=>EL(t++)),t}function cie(e,t){return e.backgroundColor=e.data.map(()=>RL(t++)),t}function uie(e){let t=0;return(n,r)=>{const o=e.getDatasetMeta(r).controller;o instanceof Ul?t=lie(n,t):o instanceof ph?t=cie(n,t):o&&(t=aie(n,t))}}function Y2(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function die(e){return e&&(e.borderColor||e.backgroundColor)}function fie(){return On.borderColor!=="rgba(0,0,0,0.1)"||On.backgroundColor!=="rgba(0,0,0,0.1)"}var hie={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:r},options:o}=e.config,{elements:i}=o,s=Y2(r)||die(o)||i&&Y2(i)||fie();if(!n.forceOverride&&s)return;const a=uie(e);r.forEach(a)}};function pie(e,t,n,r,o){const i=o.samples||r;if(i>=n)return e.slice(t,t+n);const s=[],a=(n-2)/(i-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<i-2;d++){let y=0,v=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++)y+=e[w].x,v+=e[w].y;y/=C,v/=C;const E=Math.floor(d*a)+1+t,P=Math.min(Math.floor((d+1)*a)+1,n)+t,{x:A,y:I}=e[u];for(h=m=-1,w=E;w<P;w++)m=.5*Math.abs((A-y)*(e[w].y-I)-(A-e[w].x)*(v-I)),m>h&&(h=m,p=e[w],b=w);s[l++]=p,u=b}return s[l++]=e[c],s}function gie(e,t,n,r){let o=0,i=0,s,a,l,c,u,d,p,h,m,b;const y=[],v=t+n-1,w=e[t].x,R=e[v].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),o=(i*o+a.x)/++i;else{const E=s-1;if(!yt(d)&&!yt(p)){const P=Math.min(d,p),A=Math.max(d,p);P!==h&&P!==E&&y.push({...e[P],x:o}),A!==h&&A!==E&&y.push({...e[A],x:o})}s>0&&E!==h&&y.push(e[E]),y.push(a),u=C,i=0,m=b=c,d=p=h=s}}return y}function TL(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 K2(e){e.data.datasets.forEach(t=>{TL(t)})}function mie(e,t){const n=t.length;let r=0,o;const{iScale:i}=e,{min:s,max:a,minDefined:l,maxDefined:c}=i.getUserBounds();return l&&(r=gr(qs(t,i.axis,s).lo,0,n-1)),c?o=gr(qs(t,i.axis,a).hi+1,r,n)-r:o=n-r,{start:r,count:o}}var bie={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){K2(e);return}const r=e.width;e.data.datasets.forEach((o,i)=>{const{_data:s,indexAxis:a}=o,l=e.getDatasetMeta(i),c=s||o.data;if(Rn([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}=mie(l,c);const h=n.threshold||4*r;if(p<=h){TL(o);return}yt(s)&&(o._data=c,delete o.data,Object.defineProperty(o,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(b){this._data=b}}));let m;switch(n.algorithm){case"lttb":m=pie(c,d,p,r,n);break;case"min-max":m=gie(c,d,p,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}o._decimated=m})},destroy(e){K2(e)}};function yie(e,t,n){const r=e.segments,o=e.points,i=t.points,s=[];for(const a of r){let{start:l,end:c}=a;c=dE(l,c,o);const u=fS(n,o[l],o[c],a.loop);if(!t.segments){s.push({source:a,target:u,start:o[l],end:o[c]});continue}const d=cL(t,u);for(const p of d){const h=fS(n,i[p.start],i[p.end],p.loop),m=lL(a,o,h);for(const b of m)s.push({source:b,target:p,start:{[n]:X2(u,h,"start",Math.max)},end:{[n]:X2(u,h,"end",Math.min)}})}}return s}function fS(e,t,n,r){if(r)return;let o=t[e],i=n[e];return e==="angle"&&(o=Fo(o),i=Fo(i)),{property:e,start:o,end:i}}function vie(e,t){const{x:n=null,y:r=null}=e||{},o=t.points,i=[];return t.segments.forEach(({start:s,end:a})=>{a=dE(s,a,o);const l=o[s],c=o[a];r!==null?(i.push({x:l.x,y:r}),i.push({x:c.x,y:r})):n!==null&&(i.push({x:n,y:l.y}),i.push({x:n,y:c.y}))}),i}function dE(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function X2(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function kL(e,t){let n=[],r=!1;return kn(e)?(r=!0,n=e):n=vie(e,t),n.length?new $a({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function Q2(e){return e&&e.fill!==!1}function xie(e,t,n){let o=e[t].fill;const i=[t];let s;if(!n)return o;for(;o!==!1&&i.indexOf(o)===-1;){if(!Wn(o))return o;if(s=e[o],!s)return!1;if(s.visible)return o;i.push(o),o=s.fill}return!1}function wie(e,t,n){const r=Eie(e);if(Lt(r))return isNaN(r.value)?!1:r;let o=parseFloat(r);return Wn(o)&&Math.floor(o)===o?Sie(r[0],t,o,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function Sie(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function _ie(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:Lt(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function Cie(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:Lt(e)?r=e.value:r=t.getBaseValue(),r}function Eie(e){const t=e.options,n=t.fill;let r=ut(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function Rie(e){const{scale:t,index:n,line:r}=e,o=[],i=r.segments,s=r.points,a=Tie(t,n);a.push(kL({x:null,y:t.bottom},r));for(let l=0;l<i.length;l++){const c=i[l];for(let u=c.start;u<=c.end;u++)kie(o,s[u],a)}return new $a({points:o,options:{}})}function Tie(e,t){const n=[],r=e.getMatchingVisibleMetas("line");for(let o=0;o<r.length;o++){const i=r[o];if(i.index===t)break;i.hidden||n.unshift(i.dataset)}return n}function kie(e,t,n){const r=[];for(let o=0;o<n.length;o++){const i=n[o],{first:s,last:a,point:l}=Pie(i,t,"x");if(!(!l||s&&a)){if(s)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function Pie(e,t,n){const r=e.interpolate(t,n);if(!r)return{};const o=r[n],i=e.segments,s=e.points;let a=!1,l=!1;for(let c=0;c<i.length;c++){const u=i[c],d=s[u.start][n],p=s[u.end][n];if(Gs(o,d,p)){a=o===d,l=o===p;break}}return{first:a,last:l,point:r}}class PL{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,r){const{x:o,y:i,radius:s}=this;return n=n||{start:0,end:Pn},t.arc(o,i,s,n.end,n.start,!0),!r.bounds}interpolate(t){const{x:n,y:r,radius:o}=this,i=t.angle;return{x:n+Math.cos(i)*o,y:r+Math.sin(i)*o,angle:i}}}function Oie(e){const{chart:t,fill:n,line:r}=e;if(Wn(n))return Mie(t,n);if(n==="stack")return Rie(e);if(n==="shape")return!0;const o=Aie(e);return o instanceof PL?o:kL(o,r)}function Mie(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function Aie(e){return(e.scale||{}).getPointPositionForValue?Iie(e):Die(e)}function Die(e){const{scale:t={},fill:n}=e,r=_ie(n,t);if(Wn(r)){const o=t.isHorizontal();return{x:o?r:null,y:o?null:r}}return null}function Iie(e){const{scale:t,fill:n}=e,r=t.options,o=t.getLabels().length,i=r.reverse?t.max:t.min,s=Cie(n,t,i),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,i);return new PL({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(s)})}for(let l=0;l<o;++l)a.push(t.getPointPositionForValue(l,s));return a}function Jx(e,t,n){const r=Oie(t),{line:o,scale:i,axis:s}=t,a=o.options,l=a.fill,c=a.backgroundColor,{above:u=c,below:d=c}=l||{};r&&o.points.length&&(lc(e,n),Nie(e,{line:o,target:r,above:u,below:d,area:n,scale:i,axis:s}),cc(e))}function Nie(e,t){const{line:n,target:r,above:o,below:i,area:s,scale:a}=t,l=n._loop?"angle":t.axis;e.save(),l==="x"&&i!==o&&(Z2(e,r,s.top),J2(e,{line:n,target:r,color:o,scale:a,property:l}),e.restore(),e.save(),Z2(e,r,s.bottom)),J2(e,{line:n,target:r,color:i,scale:a,property:l}),e.restore()}function Z2(e,t,n){const{segments:r,points:o}=t;let i=!0,s=!1;e.beginPath();for(const a of r){const{start:l,end:c}=a,u=o[l],d=o[dE(l,c,o)];i?(e.moveTo(u.x,u.y),i=!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 J2(e,t){const{line:n,target:r,property:o,color:i,scale:s}=t,a=yie(n,r,o);for(const{source:l,target:c,start:u,end:d}of a){const{style:{backgroundColor:p=i}={}}=l,h=r!==!0;e.save(),e.fillStyle=p,Fie(e,s,h&&fS(o,u,d)),e.beginPath();const m=!!n.pathSegment(e,l);let b;if(h){m?e.closePath():eM(e,r,d,o);const y=!!r.pathSegment(e,c,{move:m,reverse:!0});b=m&&y,b||eM(e,r,u,o)}e.closePath(),e.fill(b?"evenodd":"nonzero"),e.restore()}}function Fie(e,t,n){const{top:r,bottom:o}=t.chart.chartArea,{property:i,start:s,end:a}=n||{};i==="x"&&(e.beginPath(),e.rect(s,r,a-s,o-r),e.clip())}function eM(e,t,n,r){const o=t.interpolate(n,r);o&&e.lineTo(o.x,o.y)}var Lie={id:"filler",afterDatasetsUpdate(e,t,n){const r=(e.data.datasets||[]).length,o=[];let i,s,a,l;for(s=0;s<r;++s)i=e.getDatasetMeta(s),a=i.dataset,l=null,a&&a.options&&a instanceof $a&&(l={visible:e.isDatasetVisible(s),index:s,fill:wie(a,s,r),chart:e,axis:i.controller.options.indexAxis,scale:i.vScale,line:a}),i.$filler=l,o.push(l);for(s=0;s<r;++s)l=o[s],!(!l||l.fill===!1)&&(l.fill=xie(o,s,n.propagate))},beforeDraw(e,t,n){const r=n.drawTime==="beforeDraw",o=e.getSortedVisibleDatasetMetas(),i=e.chartArea;for(let s=o.length-1;s>=0;--s){const a=o[s].$filler;a&&(a.line.updateControlPoints(i,a.axis),r&&a.fill&&Jx(e.ctx,a,i))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=e.getSortedVisibleDatasetMetas();for(let o=r.length-1;o>=0;--o){const i=r[o].$filler;Q2(i)&&Jx(e.ctx,i,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!Q2(r)||n.drawTime!=="beforeDatasetDraw"||Jx(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const tM=(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)}},$ie=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class nM extends bs{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=hn(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,o)=>t.sort(r,o,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,o=Zn(r.font),i=o.size,s=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=tM(r,i);let c,u;n.font=o.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(s,i,a,l)+10):(u=this.maxHeight,c=this._fitCols(s,o,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,o){const{ctx:i,maxWidth:s,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=o+a;let d=t;i.textAlign="left",i.textBaseline="middle";let p=-1,h=-u;return this.legendItems.forEach((m,b)=>{const y=r+n/2+i.measureText(m.text).width;(b===0||c[c.length-1]+y+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:y,height:o},c[c.length-1]+=y+a}),d}_fitCols(t,n,r,o){const{ctx:i,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((y,v)=>{const{itemWidth:w,itemHeight:_}=jie(r,n,i,y,o);v>0&&h+_+2*a>u&&(d+=p+a,c.push({width:p,height:h}),m+=p+a,b++,p=h=0),l[v]={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:o},rtl:i}}=this,s=$u(i,this.left,this.width);if(this.isHorizontal()){let a=0,l=Ar(r,this.left+o,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=Ar(r,this.left+o,this.right-this.lineWidths[a])),c.top+=this.top+t+o,c.left=s.leftForLtr(s.x(l),c.width),l+=c.width+o}else{let a=0,l=Ar(r,this.top+t+o,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=Ar(r,this.top+t+o,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+o,c.left=s.leftForLtr(s.x(c.left),c.width),l+=c.height+o}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;lc(t,this),this._draw(),cc(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:o}=this,{align:i,labels:s}=t,a=On.color,l=$u(t.rtl,this.left,this.width),c=Zn(s.font),{padding:u}=s,d=c.size,p=d/2;let h;this.drawTitle(),o.textAlign=l.textAlign("left"),o.textBaseline="middle",o.lineWidth=.5,o.font=c.string;const{boxWidth:m,boxHeight:b,itemHeight:y}=tM(s,d),v=function(E,P,A){if(isNaN(m)||m<=0||isNaN(b)||b<0)return;o.save();const I=ut(A.lineWidth,1);if(o.fillStyle=ut(A.fillStyle,a),o.lineCap=ut(A.lineCap,"butt"),o.lineDashOffset=ut(A.lineDashOffset,0),o.lineJoin=ut(A.lineJoin,"miter"),o.lineWidth=I,o.strokeStyle=ut(A.strokeStyle,a),o.setLineDash(ut(A.lineDash,[])),s.usePointStyle){const F={radius:b*Math.SQRT2/2,pointStyle:A.pointStyle,rotation:A.rotation,borderWidth:I},L=l.xPlus(E,m/2),j=P+p;QF(o,F,L,j,s.pointStyleWidth&&m)}else{const F=P+Math.max((d-b)/2,0),L=l.leftForLtr(E,m),j=uc(A.borderRadius);o.beginPath(),Object.values(j).some(X=>X!==0)?jh(o,{x:L,y:F,w:m,h:b,radius:j}):o.rect(L,F,m,b),o.fill(),I!==0&&o.stroke()}o.restore()},w=function(E,P,A){Tc(o,A.text,E,P+y/2,c,{strikethrough:A.hidden,textAlign:l.textAlign(A.textAlign)})},_=this.isHorizontal(),R=this._computeTitleHeight();_?h={x:Ar(i,this.left+u,this.right-r[0]),y:this.top+u+R,line:0}:h={x:this.left+u,y:Ar(i,this.top+R+u,this.bottom-n[0].height),line:0},iL(this.ctx,t.textDirection);const C=y+u;this.legendItems.forEach((E,P)=>{o.strokeStyle=E.fontColor,o.fillStyle=E.fontColor;const A=o.measureText(E.text).width,I=l.textAlign(E.textAlign||(E.textAlign=s.textAlign)),F=m+p+A;let L=h.x,j=h.y;l.setWidth(this.width),_?P>0&&L+F+u>this.right&&(j=h.y+=C,h.line++,L=h.x=Ar(i,this.left+u,this.right-r[h.line])):P>0&&j+C>this.bottom&&(L=h.x=L+n[h.line].width+u,h.line++,j=h.y=Ar(i,this.top+R+u,this.bottom-n[h.line].height));const X=l.x(L);if(v(X,j,E),L=ine(I,L+m+p,_?L+F:this.right,t.rtl),w(l.x(L),j,E),_)h.x+=F+u;else if(typeof E.text!="string"){const U=c.lineHeight;h.y+=OL(E,U)+u}else h.y+=C}),sL(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=Zn(n.font),o=Er(n.padding);if(!n.display)return;const i=$u(t.rtl,this.left,this.width),s=this.ctx,a=n.position,l=r.size/2,c=o.top+l;let u,d=this.left,p=this.width;if(this.isHorizontal())p=Math.max(...this.lineWidths),u=this.top+c,d=Ar(t.align,d,this.right-p);else{const m=this.columnSizes.reduce((b,y)=>Math.max(b,y.height),0);u=c+Ar(t.align,this.top,this.bottom-m-t.labels.padding-this._computeTitleHeight())}const h=Ar(a,d,d+p);s.textAlign=i.textAlign(nE(a)),s.textBaseline="middle",s.strokeStyle=n.color,s.fillStyle=n.color,s.font=r.string,Tc(s,n.text,h,u,r)}_computeTitleHeight(){const t=this.options.title,n=Zn(t.font),r=Er(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,o,i;if(Gs(t,this.left,this.right)&&Gs(n,this.top,this.bottom)){for(i=this.legendHitBoxes,r=0;r<i.length;++r)if(o=i[r],Gs(t,o.left,o.left+o.width)&&Gs(n,o.top,o.top+o.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!Hie(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const o=this._hoveredItem,i=$ie(o,r);o&&!i&&hn(n.onLeave,[t,o,this],this),this._hoveredItem=r,r&&!i&&hn(n.onHover,[t,r,this],this)}else r&&hn(n.onClick,[t,r,this],this)}}function jie(e,t,n,r,o){const i=zie(r,e,t,n),s=Bie(o,r,t.lineHeight);return{itemWidth:i,itemHeight:s}}function zie(e,t,n,r){let o=e.text;return o&&typeof o!="string"&&(o=o.reduce((i,s)=>i.length>s.length?i:s)),t+n.size/2+r.measureText(o).width}function Bie(e,t,n){let r=e;return typeof t.text!="string"&&(r=OL(t,n)),r}function OL(e,t){const n=e.text?e.text.length:0;return t*n}function Hie(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var Wie={id:"legend",_element:nM,start(e,t,n){const r=e.legend=new nM({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,o=n.chart;o.isDatasetVisible(r)?(o.hide(r),t.hidden=!0):(o.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:o,color:i,useBorderRadius:s,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=Er(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:i,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:o||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 fE=class extends bs{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 o=kn(r.text)?r.text.length:1;this._padding=Er(r.padding);const i=o*Zn(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=i:this.width=i}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:o,right:i,options:s}=this,a=s.align;let l=0,c,u,d;return this.isHorizontal()?(u=Ar(a,r,i),d=n+t,c=i-r):(s.position==="left"?(u=r+t,d=Ar(a,o,n),l=Mn*-.5):(u=i-t,d=Ar(a,n,o),l=Mn*.5),c=o-n),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=Zn(n.font),i=r.lineHeight/2+this._padding.top,{titleX:s,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(i);Tc(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:nE(n.align),textBaseline:"middle",translation:[s,a]})}};function Vie(e,t){const n=new fE({ctx:e.ctx,options:t,chart:e});Nr.configure(e,n,t),Nr.addBox(e,n),e.titleBlock=n}var Uie={id:"title",_element:fE,start(e,t,n){Vie(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 hm=new WeakMap;var Gie={id:"subtitle",start(e,t,n){const r=new fE({ctx:e.ctx,options:n,chart:e});Nr.configure(e,r,n),Nr.addBox(e,r),hm.set(e,r)},stop(e){Nr.removeBox(e,hm.get(e)),hm.delete(e)},beforeUpdate(e,t,n){const r=hm.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 Qf={average(e){if(!e.length)return!1;let t,n,r=new Set,o=0,i=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),o+=l.y,++i}}return i===0||r.size===0?!1:{x:[...r].reduce((a,l)=>a+l)/r.size,y:o/i}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,o=Number.POSITIVE_INFINITY,i,s,a;for(i=0,s=e.length;i<s;++i){const l=e[i].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=iS(t,c);u<o&&(o=u,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function Bi(e,t){return t&&(kn(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Fs(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
314
+ `)>-1?e.split(`
315
+ `):e}function qie(e,t){const{element:n,datasetIndex:r,index:o}=t,i=e.getDatasetMeta(r).controller,{label:s,value:a}=i.getLabelAndValue(o);return{chart:e,label:s,parsed:i.getParsed(o),raw:e.data.datasets[r].data[o],formattedValue:a,dataset:i.getDataset(),dataIndex:o,datasetIndex:r,element:n}}function rM(e,t){const n=e.chart.ctx,{body:r,footer:o,title:i}=e,{boxWidth:s,boxHeight:a}=t,l=Zn(t.bodyFont),c=Zn(t.titleFont),u=Zn(t.footerFont),d=i.length,p=o.length,h=r.length,m=Er(t.padding);let b=m.height,y=0,v=r.reduce((R,C)=>R+C.before.length+C.lines.length+C.after.length,0);if(v+=e.beforeBody.length+e.afterBody.length,d&&(b+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),v){const R=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;b+=h*R+(v-h)*l.lineHeight+(v-1)*t.bodySpacing}p&&(b+=t.footerMarginTop+p*u.lineHeight+(p-1)*t.footerSpacing);let w=0;const _=function(R){y=Math.max(y,n.measureText(R).width+w)};return n.save(),n.font=c.string,sn(e.title,_),n.font=l.string,sn(e.beforeBody.concat(e.afterBody),_),w=t.displayColors?s+2+t.boxPadding:0,sn(r,R=>{sn(R.before,_),sn(R.lines,_),sn(R.after,_)}),w=0,n.font=u.string,sn(e.footer,_),n.restore(),y+=m.width,{width:y,height:b}}function Yie(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function Kie(e,t,n,r){const{x:o,width:i}=r,s=n.caretSize+n.caretPadding;if(e==="left"&&o+i+s>t.width||e==="right"&&o-i-s<0)return!0}function Xie(e,t,n,r){const{x:o,width:i}=n,{width:s,chartArea:{left:a,right:l}}=e;let c="center";return r==="center"?c=o<=(a+l)/2?"left":"right":o<=i/2?c="left":o>=s-i/2&&(c="right"),Kie(c,e,t,n)&&(c="center"),c}function oM(e,t,n){const r=n.yAlign||t.yAlign||Yie(e,n);return{xAlign:n.xAlign||t.xAlign||Xie(e,t,n,r),yAlign:r}}function Qie(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function Zie(e,t,n){let{y:r,height:o}=e;return t==="top"?r+=n:t==="bottom"?r-=o+n:r-=o/2,r}function iM(e,t,n,r){const{caretSize:o,caretPadding:i,cornerRadius:s}=e,{xAlign:a,yAlign:l}=n,c=o+i,{topLeft:u,topRight:d,bottomLeft:p,bottomRight:h}=uc(s);let m=Qie(t,a);const b=Zie(t,l,c);return l==="center"?a==="left"?m+=c:a==="right"&&(m-=c):a==="left"?m-=Math.max(u,p)+o:a==="right"&&(m+=Math.max(d,h)+o),{x:gr(m,0,r.width-t.width),y:gr(b,0,r.height-t.height)}}function pm(e,t,n){const r=Er(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function sM(e){return Bi([],Fs(e))}function Jie(e,t,n){return al(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function aM(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const ML={beforeTitle:As,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:As,beforeBody:As,beforeLabel:As,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 yt(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:As,afterBody:As,beforeFooter:As,footer:As,afterFooter:As};function co(e,t,n,r){const o=e[t].call(n,r);return typeof o>"u"?ML[t].call(n,r):o}var p1;let lM=(p1=class extends bs{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()),o=r.enabled&&n.options.animation&&r.animations,i=new uL(this.chart,o);return o._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||(this.$context=Jie(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,o=co(r,"beforeTitle",this,t),i=co(r,"title",this,t),s=co(r,"afterTitle",this,t);let a=[];return a=Bi(a,Fs(o)),a=Bi(a,Fs(i)),a=Bi(a,Fs(s)),a}getBeforeBody(t,n){return sM(co(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,o=[];return sn(t,i=>{const s={before:[],lines:[],after:[]},a=aM(r,i);Bi(s.before,Fs(co(a,"beforeLabel",this,i))),Bi(s.lines,co(a,"label",this,i)),Bi(s.after,Fs(co(a,"afterLabel",this,i))),o.push(s)}),o}getAfterBody(t,n){return sM(co(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,o=co(r,"beforeFooter",this,t),i=co(r,"footer",this,t),s=co(r,"afterFooter",this,t);let a=[];return a=Bi(a,Fs(o)),a=Bi(a,Fs(i)),a=Bi(a,Fs(s)),a}_createItems(t){const n=this._active,r=this.chart.data,o=[],i=[],s=[];let a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push(qie(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))),sn(a,u=>{const d=aM(t.callbacks,u);o.push(co(d,"labelColor",this,u)),i.push(co(d,"labelPointStyle",this,u)),s.push(co(d,"labelTextColor",this,u))}),this.labelColors=o,this.labelPointStyles=i,this.labelTextColors=s,this.dataPoints=a,a}update(t,n){const r=this.options.setContext(this.getContext()),o=this._active;let i,s=[];if(!o.length)this.opacity!==0&&(i={opacity:0});else{const a=Qf[r.position].call(this,o,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=rM(this,r),c=Object.assign({},a,l),u=oM(this.chart,r,c),d=iM(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,i={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,i&&this._resolveAnimations().update(this,i),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,o){const i=this.getCaretPosition(t,r,o);n.lineTo(i.x1,i.y1),n.lineTo(i.x2,i.y2),n.lineTo(i.x3,i.y3)}getCaretPosition(t,n,r){const{xAlign:o,yAlign:i}=this,{caretSize:s,cornerRadius:a}=r,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=uc(a),{x:p,y:h}=t,{width:m,height:b}=n;let y,v,w,_,R,C;return i==="center"?(R=h+b/2,o==="left"?(y=p,v=y-s,_=R+s,C=R-s):(y=p+m,v=y+s,_=R-s,C=R+s),w=y):(o==="left"?v=p+Math.max(l,u)+s:o==="right"?v=p+m-Math.max(c,d)-s:v=this.caretX,i==="top"?(_=h,R=_-s,y=v-s,w=v+s):(_=h+b,R=_+s,y=v+s,w=v-s),C=_),{x1:y,x2:v,x3:w,y1:_,y2:R,y3:C}}drawTitle(t,n,r){const o=this.title,i=o.length;let s,a,l;if(i){const c=$u(r.rtl,this.x,this.width);for(t.x=pm(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",s=Zn(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=s.string,l=0;l<i;++l)n.fillText(o[l],c.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+a,l+1===i&&(t.y+=r.titleMarginBottom-a)}}_drawColorBox(t,n,r,o,i){const s=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=i,u=Zn(i.bodyFont),d=pm(this,"left",i),p=o.x(d),h=l<u.lineHeight?(u.lineHeight-l)/2:0,m=n.y+h;if(i.usePointStyle){const b={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},y=o.leftForLtr(p,c)+c/2,v=m+l/2;t.strokeStyle=i.multiKeyBackground,t.fillStyle=i.multiKeyBackground,Ib(t,b,y,v),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,Ib(t,b,y,v)}else{t.lineWidth=Lt(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=o.leftForLtr(p,c),y=o.leftForLtr(o.xPlus(p,1),c-2),v=uc(s.borderRadius);Object.values(v).some(w=>w!==0)?(t.beginPath(),t.fillStyle=i.multiKeyBackground,jh(t,{x:b,y:m,w:c,h:l,radius:v}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),jh(t,{x:y,y:m+1,w:c-2,h:l-2,radius:v}),t.fill()):(t.fillStyle=i.multiKeyBackground,t.fillRect(b,m,c,l),t.strokeRect(b,m,c,l),t.fillStyle=s.backgroundColor,t.fillRect(y,m+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:o}=this,{bodySpacing:i,bodyAlign:s,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=r,d=Zn(r.bodyFont);let p=d.lineHeight,h=0;const m=$u(r.rtl,this.x,this.width),b=function(A){n.fillText(A,m.x(t.x+h),t.y+p/2),t.y+=p+i},y=m.textAlign(s);let v,w,_,R,C,E,P;for(n.textAlign=s,n.textBaseline="middle",n.font=d.string,t.x=pm(this,y,r),n.fillStyle=r.bodyColor,sn(this.beforeBody,b),h=a&&y!=="right"?s==="center"?c/2+u:c+2+u:0,R=0,E=o.length;R<E;++R){for(v=o[R],w=this.labelTextColors[R],n.fillStyle=w,sn(v.before,b),_=v.lines,a&&_.length&&(this._drawColorBox(n,t,R,m,r),p=Math.max(d.lineHeight,l)),C=0,P=_.length;C<P;++C)b(_[C]),p=d.lineHeight;sn(v.after,b)}h=0,p=d.lineHeight,sn(this.afterBody,b),t.y-=i}drawFooter(t,n,r){const o=this.footer,i=o.length;let s,a;if(i){const l=$u(r.rtl,this.x,this.width);for(t.x=pm(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",s=Zn(r.footerFont),n.fillStyle=r.footerColor,n.font=s.string,a=0;a<i;++a)n.fillText(o[a],l.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+r.footerSpacing}}drawBackground(t,n,r,o){const{xAlign:i,yAlign:s}=this,{x:a,y:l}=t,{width:c,height:u}=r,{topLeft:d,topRight:p,bottomLeft:h,bottomRight:m}=uc(o.cornerRadius);n.fillStyle=o.backgroundColor,n.strokeStyle=o.borderColor,n.lineWidth=o.borderWidth,n.beginPath(),n.moveTo(a+d,l),s==="top"&&this.drawCaret(t,n,r,o),n.lineTo(a+c-p,l),n.quadraticCurveTo(a+c,l,a+c,l+p),s==="center"&&i==="right"&&this.drawCaret(t,n,r,o),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,o),n.lineTo(a+h,l+u),n.quadraticCurveTo(a,l+u,a,l+u-h),s==="center"&&i==="left"&&this.drawCaret(t,n,r,o),n.lineTo(a,l+d),n.quadraticCurveTo(a,l,a+d,l),n.closePath(),n.fill(),o.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,o=r&&r.x,i=r&&r.y;if(o||i){const s=Qf[t.position].call(this,this._active,this._eventPosition);if(!s)return;const a=this._size=rM(this,t),l=Object.assign({},s,this._size),c=oM(n,t,l),u=iM(t,l,c,n);(o._to!==u.x||i._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 o={width:this.width,height:this.height},i={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const s=Er(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(i,t,o,n),iL(t,n.textDirection),i.y+=s.top,this.drawTitle(i,t,n),this.drawBody(i,t,n),this.drawFooter(i,t,n),sL(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,o=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}}),i=!Ob(r,o),s=this._positionChanged(o,n);(i||s)&&(this._active=o,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const o=this.options,i=this._active||[],s=this._getActiveElements(t,i,n,r),a=this._positionChanged(s,t),l=n||!Ob(s,i)||a;return l&&(this._active=s,(o.enabled||o.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,o){const i=this.options;if(t.type==="mouseout")return[];if(!o)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,i.mode,i,r);return i.reverse&&s.reverse(),s}_positionChanged(t,n){const{caretX:r,caretY:o,options:i}=this,s=Qf[i.position].call(this,t,n);return s!==!1&&(r!==s.x||o!==s.y)}},Me(p1,"positioners",Qf),p1);var AL={id:"tooltip",_element:lM,positioners:Qf,afterInit(e,t,n){n&&(e.tooltip=new lM({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:ML},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"]},ese=Object.freeze({__proto__:null,Colors:hie,Decimation:bie,Filler:Lie,Legend:Wie,SubTitle:Gie,Title:Uie,Tooltip:AL});const tse=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function nse(e,t,n,r){const o=e.indexOf(t);if(o===-1)return tse(e,t,n,r);const i=e.lastIndexOf(t);return o!==i?n:o}const rse=(e,t)=>e===null?null:gr(Math.round(e),0,t);function cM(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class $b extends ll{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:o,label:i}of n)r[o]===i&&r.splice(o,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(yt(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:nse(r,t,ut(n,t),this._addedLabels),rse(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:o}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(o=this.getLabels().length-1)),this.min=r,this.max=o}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,o=[];let i=this.getLabels();i=t===0&&n===i.length-1?i:i.slice(t,n+1),this._valueRange=Math.max(i.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let s=t;s<=n;s++)o.push({value:s});return o}getLabelForValue(t){return cM.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($b,"id","category"),Me($b,"defaults",{ticks:{callback:cM}});function ose(e,t){const n=[],{bounds:o,step:i,min:s,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:p}=e,h=i||1,m=u-1,{min:b,max:y}=t,v=!yt(s),w=!yt(a),_=!yt(c),R=(y-b)/(d+1);let C=r2((y-b)/m/h)*h,E,P,A,I;if(C<1e-14&&!v&&!w)return[{value:b},{value:y}];I=Math.ceil(y/C)-Math.floor(b/C),I>m&&(C=r2(I*C/m/h)*h),yt(l)||(E=Math.pow(10,l),C=Math.ceil(C*E)/E),o==="ticks"?(P=Math.floor(b/C)*C,A=Math.ceil(y/C)*C):(P=b,A=y),v&&w&&i&&Zte((a-s)/i,C/1e3)?(I=Math.round(Math.min((a-s)/C,u)),C=(a-s)/I,P=s,A=a):_?(P=v?s:P,A=w?a:A,I=c-1,C=(A-P)/I):(I=(A-P)/C,dh(I,Math.round(I),C/1e3)?I=Math.round(I):I=Math.ceil(I));const F=Math.max(o2(C),o2(P));E=Math.pow(10,yt(l)?F:l),P=Math.round(P*E)/E,A=Math.round(A*E)/E;let L=0;for(v&&(p&&P!==s?(n.push({value:s}),P<s&&L++,dh(Math.round((P+L*C)*E)/E,s,uM(s,R,e))&&L++):P<s&&L++);L<I;++L){const j=Math.round((P+L*C)*E)/E;if(w&&j>a)break;n.push({value:j})}return w&&p&&A!==a?n.length&&dh(n[n.length-1].value,a,uM(a,R,e))?n[n.length-1].value=a:n.push({value:a}):(!w||A===a)&&n.push({value:A}),n}function uM(e,t,{horizontal:n,minRotation:r}){const o=Pi(r),i=(n?Math.sin(o):Math.cos(o))||.001,s=.75*t*(""+e).length;return Math.min(t/i,s)}class jb extends ll{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 yt(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:o,max:i}=this;const s=l=>o=n?o:l,a=l=>i=r?i:l;if(t){const l=rs(o),c=rs(i);l<0&&c<0?a(0):l>0&&c>0&&s(0)}if(o===i){let l=i===0?1:Math.abs(i*.05);a(i+l),t||s(o-l)}this.min=o,this.max=i}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,o;return r?(o=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,o>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${o} ticks. Limiting to 1000.`),o=1e3)):(o=this.computeTickLimit(),n=n||11),n&&(o=Math.min(n,o)),o}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const o={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},i=this._range||this,s=ose(o,i);return t.bounds==="ticks"&&HF(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 o=(r-n)/Math.max(t.length-1,1)/2;n-=o,r+=o}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return Pp(t,this.chart.options.locale,this.options.ticks.format)}}class yd extends jb{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Wn(t)?t:0,this.max=Wn(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Pi(this.options.ticks.minRotation),o=(t?Math.sin(r):Math.cos(r))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,i.lineHeight/o))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}Me(yd,"id","linear"),Me(yd,"defaults",{ticks:{callback:e0.formatters.numeric}});const Bh=e=>Math.floor(La(e)),Pl=(e,t)=>Math.pow(10,Bh(e)+t);function dM(e){return e/Math.pow(10,Bh(e))===1}function fM(e,t,n){const r=Math.pow(10,n),o=Math.floor(e/r);return Math.ceil(t/r)-o}function ise(e,t){const n=t-e;let r=Bh(n);for(;fM(e,t,r)>10;)r++;for(;fM(e,t,r)<10;)r--;return Math.min(r,Bh(e))}function sse(e,{min:t,max:n}){t=Io(e.min,t);const r=[],o=Bh(t);let i=ise(t,n),s=i<0?Math.pow(10,Math.abs(i)):1;const a=Math.pow(10,i),l=o>i?Math.pow(10,o):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,i)),p=Io(e.min,Math.round((l+u+d*Math.pow(10,i))*s)/s);for(;p<n;)r.push({value:p,major:dM(p),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(i++,d=2,s=i>=0?1:s),p=Math.round((l+u+d*Math.pow(10,i))*s)/s;const h=Io(e.max,p);return r.push({value:h,major:dM(h),significand:d}),r}class vd extends ll{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=jb.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return Wn(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Wn(t)?Math.max(0,t):null,this.max=Wn(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Wn(this._userMin)&&(this.min=t===Pl(this.min,0)?Pl(this.min,-1):Pl(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let r=this.min,o=this.max;const i=a=>r=t?r:a,s=a=>o=n?o:a;r===o&&(r<=0?(i(1),s(10)):(i(Pl(r,-1)),s(Pl(o,1)))),r<=0&&i(Pl(o,-1)),o<=0&&s(Pl(r,1)),this.min=r,this.max=o}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=sse(n,this);return t.bounds==="ticks"&&HF(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":Pp(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=La(t),this._valueRange=La(this.max)-La(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(La(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}Me(vd,"id","logarithmic"),Me(vd,"defaults",{ticks:{callback:e0.formatters.logarithmic,major:{enabled:!0}}});function hS(e){const t=e.ticks;if(t.display&&e.display){const n=Er(t.backdropPadding);return ut(t.font&&t.font.size,On.font.size)+n.height}return 0}function ase(e,t,n){return n=kn(n)?n:[n],{w:gne(e,t.string,n),h:n.length*t.lineHeight}}function hM(e,t,n,r,o){return e===r||e===o?{start:t-n/2,end:t+n/2}:e<r||e>o?{start:t-n,end:t}:{start:t,end:t+n}}function lse(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=[],o=[],i=e._pointLabels.length,s=e.options.pointLabels,a=s.centerPointLabels?Mn/i:0;for(let l=0;l<i;l++){const c=s.setContext(e.getPointLabelContext(l));o[l]=c.padding;const u=e.getPointPosition(l,e.drawingArea+o[l],a),d=Zn(c.font),p=ase(e.ctx,d,e._pointLabels[l]);r[l]=p;const h=Fo(e.getIndexAngle(l)+a),m=Math.round(eE(h)),b=hM(m,u.x,p.w,0,180),y=hM(m,u.y,p.h,90,270);cse(n,t,h,b,y)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=fse(e,r,o)}function cse(e,t,n,r,o){const i=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)/i,e.l=Math.min(e.l,t.l-a)):r.end>t.r&&(a=(r.end-t.r)/i,e.r=Math.max(e.r,t.r+a)),o.start<t.t?(l=(t.t-o.start)/s,e.t=Math.min(e.t,t.t-l)):o.end>t.b&&(l=(o.end-t.b)/s,e.b=Math.max(e.b,t.b+l))}function use(e,t,n){const r=e.drawingArea,{extra:o,additionalAngle:i,padding:s,size:a}=n,l=e.getPointPosition(t,r+o+s,i),c=Math.round(eE(Fo(l.angle+qn))),u=gse(l.y,a.h,c),d=hse(c),p=pse(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 dse(e,t){if(!t)return!0;const{left:n,top:r,right:o,bottom:i}=e;return!(Ys({x:n,y:r},t)||Ys({x:n,y:i},t)||Ys({x:o,y:r},t)||Ys({x:o,y:i},t))}function fse(e,t,n){const r=[],o=e._pointLabels.length,i=e.options,{centerPointLabels:s,display:a}=i.pointLabels,l={extra:hS(i)/2,additionalAngle:s?Mn/o:0};let c;for(let u=0;u<o;u++){l.padding=n[u],l.size=t[u];const d=use(e,u,l);r.push(d),a==="auto"&&(d.visible=dse(d,c),d.visible&&(c=d))}return r}function hse(e){return e===0||e===180?"center":e<180?"left":"right"}function pse(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function gse(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function mse(e,t,n){const{left:r,top:o,right:i,bottom:s}=n,{backdropColor:a}=t;if(!yt(a)){const l=uc(t.borderRadius),c=Er(t.backdropPadding);e.fillStyle=a;const u=r-c.left,d=o-c.top,p=i-r+c.width,h=s-o+c.height;Object.values(l).some(m=>m!==0)?(e.beginPath(),jh(e,{x:u,y:d,w:p,h,radius:l}),e.fill()):e.fillRect(u,d,p,h)}}function bse(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let o=t-1;o>=0;o--){const i=e._pointLabelItems[o];if(!i.visible)continue;const s=r.setContext(e.getPointLabelContext(o));mse(n,s,i);const a=Zn(s.font),{x:l,y:c,textAlign:u}=i;Tc(n,e._pointLabels[o],l,c+a.lineHeight/2,a,{color:s.color,textAlign:u,textBaseline:"middle"})}}function DL(e,t,n,r){const{ctx:o}=e;if(n)o.arc(e.xCenter,e.yCenter,t,0,Pn);else{let i=e.getPointPosition(0,t);o.moveTo(i.x,i.y);for(let s=1;s<r;s++)i=e.getPointPosition(s,t),o.lineTo(i.x,i.y)}}function yse(e,t,n,r,o){const i=e.ctx,s=t.circular,{color:a,lineWidth:l}=t;!s&&!r||!a||!l||n<0||(i.save(),i.strokeStyle=a,i.lineWidth=l,i.setLineDash(o.dash||[]),i.lineDashOffset=o.dashOffset,i.beginPath(),DL(e,n,s,r),i.closePath(),i.stroke(),i.restore())}function vse(e,t,n){return al(e,{label:n,index:t,type:"pointLabel"})}class Zf extends jb{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=Er(hS(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=Wn(t)&&!isNaN(t)?t:0,this.max=Wn(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/hS(this.options))}generateTickLabels(t){jb.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const o=hn(this.options.pointLabels.callback,[n,r],this);return o||o===0?o:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?lse(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,o){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-o)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,o))}getIndexAngle(t){const n=Pn/(this._pointLabels.length||1),r=this.options.startAngle||0;return Fo(t*n+Pi(r))}getDistanceFromCenterForValue(t){if(yt(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(yt(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 vse(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const o=this.getIndexAngle(t)-qn+r;return{x:Math.cos(o)*n+this.xCenter,y:Math.sin(o)*n+this.yCenter,angle:o}}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:o,bottom:i}=this._pointLabelItems[t];return{left:n,top:r,right:o,bottom:i}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),DL(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:o,border:i}=n,s=this._pointLabels.length;let a,l,c;if(n.pointLabels.display&&bse(this,s),o.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=o.setContext(p),m=i.setContext(p);yse(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 o=this.getIndexAngle(0);let i,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(o),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=Zn(c.font);if(i=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,s=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=Er(c.backdropPadding);t.fillRect(-s/2-d.left,-i-u.size/2-d.top,s+d.width,u.size+d.height)}Tc(t,a.label,0,-i,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}Me(Zf,"id","radialLinear"),Me(Zf,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:e0.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),Me(Zf,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),Me(Zf,"descriptors",{angleLines:{_fallback:"grid"}});const r0={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},xo=Object.keys(r0);function pM(e,t){return e-t}function gM(e,t){if(yt(t))return null;const n=e._adapter,{parser:r,round:o,isoWeekday:i}=e._parseOpts;let s=t;return typeof r=="function"&&(s=r(s)),Wn(s)||(s=typeof r=="string"?n.parse(s,r):n.parse(s)),s===null?null:(o&&(s=o==="week"&&(gd(i)||i===!0)?n.startOf(s,"isoWeek",i):n.startOf(s,o)),+s)}function mM(e,t,n,r){const o=xo.length;for(let i=xo.indexOf(e);i<o-1;++i){const s=r0[xo[i]],a=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((n-t)/(a*s.size))<=r)return xo[i]}return xo[o-1]}function xse(e,t,n,r,o){for(let i=xo.length-1;i>=xo.indexOf(n);i--){const s=xo[i];if(r0[s].common&&e._adapter.diff(o,r,s)>=t-1)return s}return xo[n?xo.indexOf(n):0]}function wse(e){for(let t=xo.indexOf(e)+1,n=xo.length;t<n;++t)if(r0[xo[t]].common)return xo[t]}function bM(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:o}=tE(n,t),i=n[r]>=t?n[r]:n[o];e[i]=!0}}function Sse(e,t,n,r){const o=e._adapter,i=+o.startOf(t[0].value,r),s=t[t.length-1].value;let a,l;for(a=i;a<=s;a=+o.add(a,1,r))l=n[a],l>=0&&(t[l].major=!0);return t}function yM(e,t,n){const r=[],o={},i=t.length;let s,a;for(s=0;s<i;++s)a=t[s],o[a]=s,r.push({value:a,major:!1});return i===0||!n?r:Sse(e,r,o,n)}class Hh extends ll{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={}),o=this._adapter=new Mre._date(t.adapters.date);o.init(n),uh(r.displayFormats,o.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:gM(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:o,max:i,minDefined:s,maxDefined:a}=this.getUserBounds();function l(c){!s&&!isNaN(c.min)&&(o=Math.min(o,c.min)),!a&&!isNaN(c.max)&&(i=Math.max(i,c.max))}(!s||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),o=Wn(o)&&!isNaN(o)?o:+n.startOf(Date.now(),r),i=Wn(i)&&!isNaN(i)?i:+n.endOf(Date.now(),r)+1,this.min=Math.min(o,i-1),this.max=Math.max(o+1,i)}_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,o=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&o.length&&(this.min=this._userMin||o[0],this.max=this._userMax||o[o.length-1]);const i=this.min,s=this.max,a=nne(o,i,s);return this._unit=n.unit||(r.autoSkip?mM(n.minUnit,this.min,this.max,this._getLabelCapacity(i)):xse(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:wse(this._unit),this.initOffsets(o),t.reverse&&a.reverse(),yM(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,o,i;this.options.offset&&t.length&&(o=this.getDecimalForValue(t[0]),t.length===1?n=1-o:n=(this.getDecimalForValue(t[1])-o)/2,i=this.getDecimalForValue(t[t.length-1]),t.length===1?r=i:r=(i-this.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;n=gr(n,0,s),r=gr(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,o=this.options,i=o.time,s=i.unit||mM(i.minUnit,n,r,this._getLabelCapacity(n)),a=ut(o.ticks.stepSize,1),l=s==="week"?i.isoWeekday:!1,c=gd(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=o.ticks.source==="data"&&this.getDataTimestamps();for(p=d,h=0;p<r;p=+t.add(p,a,s),h++)bM(u,p,m);return(p===r||o.bounds==="ticks"||h===1)&&bM(u,p,m),Object.keys(u).sort(pM).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 o=this.options.time.displayFormats,i=this._unit,s=n||o[i];return this._adapter.format(t,s)}_tickFormatFunction(t,n,r,o){const i=this.options,s=i.ticks.callback;if(s)return hn(s,[t,n,r],this);const a=i.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,o||(h?d:u))}generateTickLabels(t){let n,r,o;for(n=0,r=t.length;n<r;++n)o=t[n],o.label=this._tickFormatFunction(o.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,o=Pi(this.isHorizontal()?n.maxRotation:n.minRotation),i=Math.cos(o),s=Math.sin(o),a=this._resolveTickFontOptions(0).size;return{w:r*i+a*s,h:r*s+a*i}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,o=r[n.unit]||r.millisecond,i=this._tickFormatFunction(t,0,yM(this,[t],this._majorUnit),o),s=this._getLabelSize(i),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 o=this.getMatchingVisibleMetas();if(this._normalized&&o.length)return this._cache.data=o[0].controller.getAllParsedValues(this);for(n=0,r=o.length;n<r;++n)t=t.concat(o[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 o=this.getLabels();for(n=0,r=o.length;n<r;++n)t.push(gM(this,o[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return UF(t.sort(pM))}}Me(Hh,"id","time"),Me(Hh,"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 gm(e,t,n){let r=0,o=e.length-1,i,s,a,l;n?(t>=e[r].pos&&t<=e[o].pos&&({lo:r,hi:o}=qs(e,"pos",t)),{pos:i,time:a}=e[r],{pos:s,time:l}=e[o]):(t>=e[r].time&&t<=e[o].time&&({lo:r,hi:o}=qs(e,"time",t)),{time:i,pos:a}=e[r],{time:s,pos:l}=e[o]);const c=s-i;return c?a+(l-a)*(t-i)/c:a}class pS extends Hh{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=gm(n,this.min),this._tableRange=gm(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,o=[],i=[];let s,a,l,c,u;for(s=0,a=t.length;s<a;++s)c=t[s],c>=n&&c<=r&&o.push(c);if(o.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(s=0,a=o.length;s<a;++s)u=o[s+1],l=o[s-1],c=o[s],Math.round((u+l)/2)!==c&&i.push({time:c,pos:s/(a-1)});return i}_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((o,i)=>o-i)}_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(gm(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return gm(this._table,r*this._tableRange+this._minPos,!0)}}Me(pS,"id","timeseries"),Me(pS,"defaults",Hh.defaults);var _se=Object.freeze({__proto__:null,CategoryScale:$b,LinearScale:yd,LogarithmicScale:vd,RadialLinearScale:Zf,TimeScale:Hh,TimeSeriesScale:pS});const Cse=[Ore,sie,ese,_se];class Xa{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let r=0;for(let o=0;o<this._n&&o<32;o++){const i=n[o],s=t+i,a=Math.abs(t)<Math.abs(i)?t-(s-i):i-(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,o,i,s=0;if(n>0){for(s=t[--n];n>0&&(r=s,o=t[--n],s=r+o,i=o-(s-r),!i););n>0&&(i<0&&t[n-1]<0||i>0&&t[n-1]>0)&&(o=i*2,r=s+o,o==r-s&&(s=r))}return s}}function*Ese(e){for(const t of e)yield*t}function IL(e){return Array.from(Ese(e))}function ku(e,t,n){e=+e,t=+t,n=(o=arguments.length)<2?(t=e,e=0,1):o<3?1:+n;for(var r=-1,o=Math.max(0,Math.ceil((t-e)/n))|0,i=new Array(o);++r<o;)i[r]=e+r*n;return i}var nt=1e-6,NL=1e-12,At=Math.PI,Hn=At/2,vM=At/4,Wo=At*2,Yr=180/At,pn=At/180,Kt=Math.abs,Ld=Math.atan,ls=Math.atan2,bt=Math.cos,mm=Math.ceil,FL=Math.exp,zb=Math.log,ew=Math.pow,ft=Math.sin,ci=Math.sign||function(e){return e>0?1:e<0?-1:0},Zr=Math.sqrt,hE=Math.tan;function LL(e){return e>1?0:e<-1?At:Math.acos(e)}function fi(e){return e>1?Hn:e<-1?-Hn:Math.asin(e)}function pr(){}function Bb(e,t){e&&wM.hasOwnProperty(e.type)&&wM[e.type](e,t)}var xM={Feature:function(e,t){Bb(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,o=n.length;++r<o;)Bb(n[r].geometry,t)}},wM={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,o=n.length;++r<o;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){gS(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)gS(n[r],t,0)},Polygon:function(e,t){SM(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)SM(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,o=n.length;++r<o;)Bb(n[r],t)}};function gS(e,t,n){var r=-1,o=e.length-n,i;for(t.lineStart();++r<o;)i=e[r],t.point(i[0],i[1],i[2]);t.lineEnd()}function SM(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)gS(e[n],t,1);t.polygonEnd()}function $l(e,t){e&&xM.hasOwnProperty(e.type)?xM[e.type](e,t):Bb(e,t)}function mS(e){return[ls(e[1],e[0]),fi(e[2])]}function xd(e){var t=e[0],n=e[1],r=bt(n);return[r*bt(t),r*ft(t),ft(n)]}function bm(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Hb(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 tw(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function ym(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function bS(e){var t=Zr(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function yS(e,t){function n(r,o){return r=e(r,o),t(r[0],r[1])}return e.invert&&t.invert&&(n.invert=function(r,o){return r=t.invert(r,o),r&&e.invert(r[0],r[1])}),n}function vS(e,t){return Kt(e)>At&&(e-=Math.round(e/Wo)*Wo),[e,t]}vS.invert=vS;function $L(e,t,n){return(e%=Wo)?t||n?yS(CM(e),EM(t,n)):CM(e):t||n?EM(t,n):vS}function _M(e){return function(t,n){return t+=e,Kt(t)>At&&(t-=Math.round(t/Wo)*Wo),[t,n]}}function CM(e){var t=_M(e);return t.invert=_M(-e),t}function EM(e,t){var n=bt(e),r=ft(e),o=bt(t),i=ft(t);function s(a,l){var c=bt(l),u=bt(a)*c,d=ft(a)*c,p=ft(l),h=p*n+u*r;return[ls(d*o-h*i,u*n-p*r),fi(h*o+d*i)]}return s.invert=function(a,l){var c=bt(l),u=bt(a)*c,d=ft(a)*c,p=ft(l),h=p*o-d*i;return[ls(d*o+p*i,u*n+h*r),fi(h*n-u*r)]},s}function Rse(e){e=$L(e[0]*pn,e[1]*pn,e.length>2?e[2]*pn:0);function t(n){return n=e(n[0]*pn,n[1]*pn),n[0]*=Yr,n[1]*=Yr,n}return t.invert=function(n){return n=e.invert(n[0]*pn,n[1]*pn),n[0]*=Yr,n[1]*=Yr,n},t}function Tse(e,t,n,r,o,i){if(n){var s=bt(t),a=ft(t),l=r*n;o==null?(o=t+r*Wo,i=t-l/2):(o=RM(s,o),i=RM(s,i),(r>0?o<i:o>i)&&(o+=r*Wo));for(var c,u=o;r>0?u>i:u<i;u-=l)c=mS([s,-a*bt(u),-a*ft(u)]),e.point(c[0],c[1])}}function RM(e,t){t=xd(t),t[0]-=e,bS(t);var n=LL(-t[1]);return((-t[2]<0?-n:n)+Wo-nt)%Wo}function jL(){var e=[],t;return{point:function(n,r,o){t.push([n,r,o])},lineStart:function(){e.push(t=[])},lineEnd:pr,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function cb(e,t){return Kt(e[0]-t[0])<nt&&Kt(e[1]-t[1])<nt}function vm(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 zL(e,t,n,r,o){var i=[],s=[],a,l;if(e.forEach(function(m){if(!((b=m.length-1)<=0)){var b,y=m[0],v=m[b],w;if(cb(y,v)){if(!y[2]&&!v[2]){for(o.lineStart(),a=0;a<b;++a)o.point((y=m[a])[0],y[1]);o.lineEnd();return}v[0]+=2*nt}i.push(w=new vm(y,m,null,!0)),s.push(w.o=new vm(y,null,w,!1)),i.push(w=new vm(v,m,null,!1)),s.push(w.o=new vm(v,null,w,!0))}}),!!i.length){for(s.sort(t),TM(i),TM(s),a=0,l=s.length;a<l;++a)s[a].e=n=!n;for(var c=i[0],u,d;;){for(var p=c,h=!0;p.v;)if((p=p.n)===c)return;u=p.z,o.lineStart();do{if(p.v=p.o.v=!0,p.e){if(h)for(a=0,l=u.length;a<l;++a)o.point((d=u[a])[0],d[1]);else r(p.x,p.n.x,1,o);p=p.n}else{if(h)for(u=p.p.z,a=u.length-1;a>=0;--a)o.point((d=u[a])[0],d[1]);else r(p.x,p.p.x,-1,o);p=p.p}p=p.o,u=p.z,h=!h}while(!p.v);o.lineEnd()}}}function TM(e){if(t=e.length){for(var t,n=0,r=e[0],o;++n<t;)r.n=o=e[n],o.p=r,r=o;r.n=o=e[0],o.p=r}}function nw(e){return Kt(e[0])<=At?e[0]:ci(e[0])*((Kt(e[0])+At)%Wo-At)}function BL(e,t){var n=nw(t),r=t[1],o=ft(r),i=[ft(n),-bt(n),0],s=0,a=0,l=new Xa;o===1?r=Hn+nt:o===-1&&(r=-Hn-nt);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=nw(h),b=h[1]/2+vM,y=ft(b),v=bt(b),w=0;w<p;++w,m=R,y=E,v=P,h=_){var _=d[w],R=nw(_),C=_[1]/2+vM,E=ft(C),P=bt(C),A=R-m,I=A>=0?1:-1,F=I*A,L=F>At,j=y*E;if(l.add(ls(j*I*ft(F),v*P+j*bt(F))),s+=L?A+I*Wo:A,L^m>=n^R>=n){var X=Hb(xd(h),xd(_));bS(X);var U=Hb(i,X);bS(U);var $=(L^A>=0?-1:1)*fi(U[2]);(r>$||r===$&&(X[0]||X[1]))&&(a+=L^A>=0?1:-1)}}return(s<-1e-6||s<nt&&l<-1e-12)^a&1}function HL(e,t,n,r){return function(o){var i=t(o),s=jL(),a=t(s),l=!1,c,u,d,p={point:h,lineStart:b,lineEnd:y,polygonStart:function(){p.point=v,p.lineStart=w,p.lineEnd=_,u=[],c=[]},polygonEnd:function(){p.point=h,p.lineStart=b,p.lineEnd=y,u=IL(u);var R=BL(c,r);u.length?(l||(o.polygonStart(),l=!0),zL(u,Pse,R,n,o)):R&&(l||(o.polygonStart(),l=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),l&&(o.polygonEnd(),l=!1),u=c=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function h(R,C){e(R,C)&&o.point(R,C)}function m(R,C){i.point(R,C)}function b(){p.point=m,i.lineStart()}function y(){p.point=h,i.lineEnd()}function v(R,C){d.push([R,C]),a.point(R,C)}function w(){a.lineStart(),d=[]}function _(){v(d[0][0],d[0][1]),a.lineEnd();var R=a.clean(),C=s.result(),E,P=C.length,A,I,F;if(d.pop(),c.push(d),d=null,!!P){if(R&1){if(I=C[0],(A=I.length-1)>0){for(l||(o.polygonStart(),l=!0),o.lineStart(),E=0;E<A;++E)o.point((F=I[E])[0],F[1]);o.lineEnd()}return}P>1&&R&2&&C.push(C.pop().concat(C.shift())),u.push(C.filter(kse))}}return p}}function kse(e){return e.length>1}function Pse(e,t){return((e=e.x)[0]<0?e[1]-Hn-nt:Hn-e[1])-((t=t.x)[0]<0?t[1]-Hn-nt:Hn-t[1])}const kM=HL(function(){return!0},Ose,Ase,[-At,-Hn]);function Ose(e){var t=NaN,n=NaN,r=NaN,o;return{lineStart:function(){e.lineStart(),o=1},point:function(i,s){var a=i>0?At:-At,l=Kt(i-t);Kt(l-At)<nt?(e.point(t,n=(n+s)/2>0?Hn:-Hn),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(a,n),e.point(i,n),o=0):r!==a&&l>=At&&(Kt(t-r)<nt&&(t-=r*nt),Kt(i-a)<nt&&(i-=a*nt),n=Mse(t,n,i,s),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(a,n),o=0),e.point(t=i,n=s),r=a},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-o}}}function Mse(e,t,n,r){var o,i,s=ft(e-n);return Kt(s)>nt?Ld((ft(t)*(i=bt(r))*ft(n)-ft(r)*(o=bt(t))*ft(e))/(o*i*s)):(t+r)/2}function Ase(e,t,n,r){var o;if(e==null)o=n*Hn,r.point(-At,o),r.point(0,o),r.point(At,o),r.point(At,0),r.point(At,-o),r.point(0,-o),r.point(-At,-o),r.point(-At,0),r.point(-At,o);else if(Kt(e[0]-t[0])>nt){var i=e[0]<t[0]?At:-At;o=n*i/2,r.point(-i,o),r.point(0,o),r.point(i,o)}else r.point(t[0],t[1])}function Dse(e){var t=bt(e),n=2*pn,r=t>0,o=Kt(t)>nt;function i(u,d,p,h){Tse(h,e,n,p,u,d)}function s(u,d){return bt(u)*bt(d)>t}function a(u){var d,p,h,m,b;return{lineStart:function(){m=h=!1,b=1},point:function(y,v){var w=[y,v],_,R=s(y,v),C=r?R?0:c(y,v):R?c(y+(y<0?At:-At),v):0;if(!d&&(m=h=R)&&u.lineStart(),R!==h&&(_=l(d,w),(!_||cb(d,_)||cb(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(o&&d&&r^R){var E;!(C&p)&&(E=l(w,d,!0))&&(b=0,r?(u.lineStart(),u.point(E[0][0],E[0][1]),u.point(E[1][0],E[1][1]),u.lineEnd()):(u.point(E[1][0],E[1][1]),u.lineEnd(),u.lineStart(),u.point(E[0][0],E[0][1],3)))}R&&(!d||!cb(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=xd(u),m=xd(d),b=[1,0,0],y=Hb(h,m),v=bm(y,y),w=y[0],_=v-w*w;if(!_)return!p&&u;var R=t*v/_,C=-t*w/_,E=Hb(b,y),P=ym(b,R),A=ym(y,C);tw(P,A);var I=E,F=bm(P,I),L=bm(I,I),j=F*F-L*(bm(P,P)-1);if(!(j<0)){var X=Zr(j),U=ym(I,(-F-X)/L);if(tw(U,P),U=mS(U),!p)return U;var $=u[0],B=d[0],W=u[1],q=d[1],Q;B<$&&(Q=$,$=B,B=Q);var D=B-$,G=Kt(D-At)<nt,V=G||D<nt;if(!G&&q<W&&(Q=W,W=q,q=Q),V?G?W+q>0^U[1]<(Kt(U[0]-$)<nt?W:q):W<=U[1]&&U[1]<=q:D>At^($<=U[0]&&U[0]<=B)){var M=ym(I,(-F+X)/L);return tw(M,P),[U,mS(M)]}}}function c(u,d){var p=r?e:At-e,h=0;return u<-p?h|=1:u>p&&(h|=2),d<-p?h|=4:d>p&&(h|=8),h}return HL(s,a,i,r?[0,-e]:[-At,e-At])}function Ise(e,t,n,r,o,i){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=o-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=i-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 xm=1e9,wm=-1e9;function Nse(e,t,n,r){function o(c,u){return e<=c&&c<=n&&t<=u&&u<=r}function i(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 Kt(c[0]-e)<nt?u>0?0:3:Kt(c[0]-n)<nt?u>0?2:1:Kt(c[1]-t)<nt?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=jL(),p,h,m,b,y,v,w,_,R,C,E,P={point:A,lineStart:j,lineEnd:X,polygonStart:F,polygonEnd:L};function A($,B){o($,B)&&u.point($,B)}function I(){for(var $=0,B=0,W=h.length;B<W;++B)for(var q=h[B],Q=1,D=q.length,G=q[0],V,M,ee=G[0],K=G[1];Q<D;++Q)V=ee,M=K,G=q[Q],ee=G[0],K=G[1],M<=r?K>r&&(ee-V)*(r-M)>(K-M)*(e-V)&&++$:K<=r&&(ee-V)*(r-M)<(K-M)*(e-V)&&--$;return $}function F(){u=d,p=[],h=[],E=!0}function L(){var $=I(),B=E&&$,W=(p=IL(p)).length;(B||W)&&(c.polygonStart(),B&&(c.lineStart(),i(null,null,1,c),c.lineEnd()),W&&zL(p,a,$,i,c),c.polygonEnd()),u=c,p=h=m=null}function j(){P.point=U,h&&h.push(m=[]),C=!0,R=!1,w=_=NaN}function X(){p&&(U(b,y),v&&R&&d.rejoin(),p.push(d.result())),P.point=A,R&&u.lineEnd()}function U($,B){var W=o($,B);if(h&&m.push([$,B]),C)b=$,y=B,v=W,C=!1,W&&(u.lineStart(),u.point($,B));else if(W&&R)u.point($,B);else{var q=[w=Math.max(wm,Math.min(xm,w)),_=Math.max(wm,Math.min(xm,_))],Q=[$=Math.max(wm,Math.min(xm,$)),B=Math.max(wm,Math.min(xm,B))];Ise(q,Q,e,t,n,r)?(R||(u.lineStart(),u.point(q[0],q[1])),u.point(Q[0],Q[1]),W||u.lineEnd(),E=!1):W&&(u.lineStart(),u.point($,B),E=!1)}w=$,_=B,R=W}return P}}var xS,wS,ub,db,wd={sphere:pr,point:pr,lineStart:Fse,lineEnd:pr,polygonStart:pr,polygonEnd:pr};function Fse(){wd.point=$se,wd.lineEnd=Lse}function Lse(){wd.point=wd.lineEnd=pr}function $se(e,t){e*=pn,t*=pn,wS=e,ub=ft(t),db=bt(t),wd.point=jse}function jse(e,t){e*=pn,t*=pn;var n=ft(t),r=bt(t),o=Kt(e-wS),i=bt(o),s=ft(o),a=r*s,l=db*n-ub*r*i,c=ub*n+db*r*i;xS.add(ls(Zr(a*a+l*l),c)),wS=e,ub=n,db=r}function zse(e){return xS=new Xa,$l(e,wd),+xS}var SS=[null,null],Bse={type:"LineString",coordinates:SS};function _S(e,t){return SS[0]=e,SS[1]=t,zse(Bse)}var PM={Feature:function(e,t){return Wb(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,o=n.length;++r<o;)if(Wb(n[r].geometry,t))return!0;return!1}},OM={Sphere:function(){return!0},Point:function(e,t){return MM(e.coordinates,t)},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)if(MM(n[r],t))return!0;return!1},LineString:function(e,t){return AM(e.coordinates,t)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)if(AM(n[r],t))return!0;return!1},Polygon:function(e,t){return DM(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)if(DM(n[r],t))return!0;return!1},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,o=n.length;++r<o;)if(Wb(n[r],t))return!0;return!1}};function Wb(e,t){return e&&OM.hasOwnProperty(e.type)?OM[e.type](e,t):!1}function MM(e,t){return _S(e,t)===0}function AM(e,t){for(var n,r,o,i=0,s=e.length;i<s;i++){if(r=_S(e[i],t),r===0||i>0&&(o=_S(e[i],e[i-1]),o>0&&n<=o&&r<=o&&(n+r-o)*(1-Math.pow((n-r)/o,2))<NL*o))return!0;n=r}return!1}function DM(e,t){return!!BL(e.map(Hse),WL(t))}function Hse(e){return e=e.map(WL),e.pop(),e}function WL(e){return[e[0]*pn,e[1]*pn]}function Wse(e,t){return(e&&PM.hasOwnProperty(e.type)?PM[e.type]:Wb)(e,t)}function IM(e,t,n){var r=ku(e,t-nt,n).concat(t);return function(o){return r.map(function(i){return[o,i]})}}function NM(e,t,n){var r=ku(e,t-nt,n).concat(t);return function(o){return r.map(function(i){return[i,o]})}}function VL(){var e,t,n,r,o,i,s,a,l=10,c=l,u=90,d=360,p,h,m,b,y=2.5;function v(){return{type:"MultiLineString",coordinates:w()}}function w(){return ku(mm(r/u)*u,n,u).map(m).concat(ku(mm(a/d)*d,s,d).map(b)).concat(ku(mm(t/l)*l,e,l).filter(function(_){return Kt(_%u)>nt}).map(p)).concat(ku(mm(i/c)*c,o,c).filter(function(_){return Kt(_%d)>nt}).map(h))}return v.lines=function(){return w().map(function(_){return{type:"LineString",coordinates:_}})},v.outline=function(){return{type:"Polygon",coordinates:[m(r).concat(b(s).slice(1),m(n).reverse().slice(1),b(a).reverse().slice(1))]}},v.extent=function(_){return arguments.length?v.extentMajor(_).extentMinor(_):v.extentMinor()},v.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=_),v.precision(y)):[[r,a],[n,s]]},v.extentMinor=function(_){return arguments.length?(t=+_[0][0],e=+_[1][0],i=+_[0][1],o=+_[1][1],t>e&&(_=t,t=e,e=_),i>o&&(_=i,i=o,o=_),v.precision(y)):[[t,i],[e,o]]},v.step=function(_){return arguments.length?v.stepMajor(_).stepMinor(_):v.stepMinor()},v.stepMajor=function(_){return arguments.length?(u=+_[0],d=+_[1],v):[u,d]},v.stepMinor=function(_){return arguments.length?(l=+_[0],c=+_[1],v):[l,c]},v.precision=function(_){return arguments.length?(y=+_,p=IM(i,o,90),h=NM(t,e,y),m=IM(a,s,90),b=NM(r,n,y),v):y},v.extentMajor([[-180,-90+nt],[180,90-nt]]).extentMinor([[-180,-80-nt],[180,80+nt]])}function Vse(){return VL()()}const CS=e=>e;var rw=new Xa,ES=new Xa,UL,GL,RS,TS,Hs={point:pr,lineStart:pr,lineEnd:pr,polygonStart:function(){Hs.lineStart=Use,Hs.lineEnd=qse},polygonEnd:function(){Hs.lineStart=Hs.lineEnd=Hs.point=pr,rw.add(Kt(ES)),ES=new Xa},result:function(){var e=rw/2;return rw=new Xa,e}};function Use(){Hs.point=Gse}function Gse(e,t){Hs.point=qL,UL=RS=e,GL=TS=t}function qL(e,t){ES.add(TS*e-RS*t),RS=e,TS=t}function qse(){qL(UL,GL)}var Sd=1/0,Vb=Sd,Wh=-Sd,Ub=Wh,Gb={point:Yse,lineStart:pr,lineEnd:pr,polygonStart:pr,polygonEnd:pr,result:function(){var e=[[Sd,Vb],[Wh,Ub]];return Wh=Ub=-(Vb=Sd=1/0),e}};function Yse(e,t){e<Sd&&(Sd=e),e>Wh&&(Wh=e),t<Vb&&(Vb=t),t>Ub&&(Ub=t)}var kS=0,PS=0,Jf=0,qb=0,Yb=0,Pu=0,OS=0,MS=0,eh=0,YL,KL,Qi,Zi,ai={point:kc,lineStart:FM,lineEnd:LM,polygonStart:function(){ai.lineStart=Qse,ai.lineEnd=Zse},polygonEnd:function(){ai.point=kc,ai.lineStart=FM,ai.lineEnd=LM},result:function(){var e=eh?[OS/eh,MS/eh]:Pu?[qb/Pu,Yb/Pu]:Jf?[kS/Jf,PS/Jf]:[NaN,NaN];return kS=PS=Jf=qb=Yb=Pu=OS=MS=eh=0,e}};function kc(e,t){kS+=e,PS+=t,++Jf}function FM(){ai.point=Kse}function Kse(e,t){ai.point=Xse,kc(Qi=e,Zi=t)}function Xse(e,t){var n=e-Qi,r=t-Zi,o=Zr(n*n+r*r);qb+=o*(Qi+e)/2,Yb+=o*(Zi+t)/2,Pu+=o,kc(Qi=e,Zi=t)}function LM(){ai.point=kc}function Qse(){ai.point=Jse}function Zse(){XL(YL,KL)}function Jse(e,t){ai.point=XL,kc(YL=Qi=e,KL=Zi=t)}function XL(e,t){var n=e-Qi,r=t-Zi,o=Zr(n*n+r*r);qb+=o*(Qi+e)/2,Yb+=o*(Zi+t)/2,Pu+=o,o=Zi*e-Qi*t,OS+=o*(Qi+e),MS+=o*(Zi+t),eh+=o*3,kc(Qi=e,Zi=t)}function QL(e){this._context=e}QL.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,Wo);break}}},result:pr};var AS=new Xa,ow,ZL,JL,th,nh,Vh={point:pr,lineStart:function(){Vh.point=eae},lineEnd:function(){ow&&e4(ZL,JL),Vh.point=pr},polygonStart:function(){ow=!0},polygonEnd:function(){ow=null},result:function(){var e=+AS;return AS=new Xa,e}};function eae(e,t){Vh.point=e4,ZL=th=e,JL=nh=t}function e4(e,t){th-=e,nh-=t,AS.add(Zr(th*th+nh*nh)),th=e,nh=t}let $M,Kb,jM,zM;class BM{constructor(t){this._append=t==null?t4:tae(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!==jM||this._append!==Kb){const r=this._radius,o=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`,jM=r,Kb=this._append,zM=this._,this._=o}this._+=zM;break}}}result(){const t=this._;return this._="",t.length?t:null}}function t4(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function tae(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return t4;if(t!==$M){const n=10**t;$M=t,Kb=function(o){let i=1;this._+=o[0];for(const s=o.length;i<s;++i)this._+=Math.round(arguments[i]*n)/n+o[i]}}return Kb}function HM(e,t){let n=3,r=4.5,o,i;function s(a){return a&&(typeof r=="function"&&i.pointRadius(+r.apply(this,arguments)),$l(a,o(i))),i.result()}return s.area=function(a){return $l(a,o(Hs)),Hs.result()},s.measure=function(a){return $l(a,o(Vh)),Vh.result()},s.bounds=function(a){return $l(a,o(Gb)),Gb.result()},s.centroid=function(a){return $l(a,o(ai)),ai.result()},s.projection=function(a){return arguments.length?(o=a==null?(e=null,CS):(e=a).stream,s):e},s.context=function(a){return arguments.length?(i=a==null?(t=null,new BM(n)):new QL(t=a),typeof r!="function"&&i.pointRadius(r),s):t},s.pointRadius=function(a){return arguments.length?(r=typeof a=="function"?a:(i.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&&(i=new BM(n)),s},s.projection(e).digits(n).context(t)}function pE(e){return function(t){var n=new DS;for(var r in e)n[r]=e[r];return n.stream=t,n}}function DS(){}DS.prototype={constructor:DS,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 gE(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),$l(n,e.stream(Gb)),t(Gb.result()),r!=null&&e.clipExtent(r),e}function mE(e,t,n){return gE(e,function(r){var o=t[1][0]-t[0][0],i=t[1][1]-t[0][1],s=Math.min(o/(r[1][0]-r[0][0]),i/(r[1][1]-r[0][1])),a=+t[0][0]+(o-s*(r[1][0]+r[0][0]))/2,l=+t[0][1]+(i-s*(r[1][1]+r[0][1]))/2;e.scale(150*s).translate([a,l])},n)}function n4(e,t,n){return mE(e,[[0,0],t],n)}function r4(e,t,n){return gE(e,function(r){var o=+t,i=o/(r[1][0]-r[0][0]),s=(o-i*(r[1][0]+r[0][0]))/2,a=-i*r[0][1];e.scale(150*i).translate([s,a])},n)}function o4(e,t,n){return gE(e,function(r){var o=+t,i=o/(r[1][1]-r[0][1]),s=-i*r[0][0],a=(o-i*(r[1][1]+r[0][1]))/2;e.scale(150*i).translate([s,a])},n)}var WM=16,nae=bt(30*pn);function VM(e,t){return+t?oae(e,t):rae(e)}function rae(e){return pE({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function oae(e,t){function n(r,o,i,s,a,l,c,u,d,p,h,m,b,y){var v=c-r,w=u-o,_=v*v+w*w;if(_>4*t&&b--){var R=s+p,C=a+h,E=l+m,P=Zr(R*R+C*C+E*E),A=fi(E/=P),I=Kt(Kt(E)-1)<nt||Kt(i-d)<nt?(i+d)/2:ls(C,R),F=e(I,A),L=F[0],j=F[1],X=L-r,U=j-o,$=w*X-v*U;($*$/_>t||Kt((v*X+w*U)/_-.5)>.3||s*p+a*h+l*m<nae)&&(n(r,o,i,s,a,l,L,j,I,R/=P,C/=P,E,b,y),y.point(L,j),n(L,j,I,R,C,E,c,u,d,p,h,m,b,y))}}return function(r){var o,i,s,a,l,c,u,d,p,h,m,b,y={point:v,lineStart:w,lineEnd:R,polygonStart:function(){r.polygonStart(),y.lineStart=C},polygonEnd:function(){r.polygonEnd(),y.lineStart=w}};function v(A,I){A=e(A,I),r.point(A[0],A[1])}function w(){d=NaN,y.point=_,r.lineStart()}function _(A,I){var F=xd([A,I]),L=e(A,I);n(d,p,u,h,m,b,d=L[0],p=L[1],u=A,h=F[0],m=F[1],b=F[2],WM,r),r.point(d,p)}function R(){y.point=v,r.lineEnd()}function C(){w(),y.point=E,y.lineEnd=P}function E(A,I){_(o=A,I),i=d,s=p,a=h,l=m,c=b,y.point=_}function P(){n(d,p,u,h,m,b,i,s,o,a,l,c,WM,r),y.lineEnd=R,R()}return y}}var iae=pE({point:function(e,t){this.stream.point(e*pn,t*pn)}});function sae(e){return pE({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function aae(e,t,n,r,o){function i(s,a){return s*=r,a*=o,[t+e*s,n-e*a]}return i.invert=function(s,a){return[(s-t)/e*r,(n-a)/e*o]},i}function UM(e,t,n,r,o,i){if(!i)return aae(e,t,n,r,o);var s=bt(i),a=ft(i),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,y){return b*=r,y*=o,[l*b-c*y+t,n-c*b-l*y]}return m.invert=function(b,y){return[r*(u*b-d*y+p),o*(h-d*b-u*y)]},m}function ra(e){return i4(function(){return e})()}function i4(e){var t,n=150,r=480,o=250,i=0,s=0,a=0,l=0,c=0,u,d=0,p=1,h=1,m=null,b=kM,y=null,v,w,_,R=CS,C=.5,E,P,A,I,F;function L($){return A($[0]*pn,$[1]*pn)}function j($){return $=A.invert($[0],$[1]),$&&[$[0]*Yr,$[1]*Yr]}L.stream=function($){return I&&F===$?I:I=iae(sae(u)(b(E(R(F=$)))))},L.preclip=function($){return arguments.length?(b=$,m=void 0,U()):b},L.postclip=function($){return arguments.length?(R=$,y=v=w=_=null,U()):R},L.clipAngle=function($){return arguments.length?(b=+$?Dse(m=$*pn):(m=null,kM),U()):m*Yr},L.clipExtent=function($){return arguments.length?(R=$==null?(y=v=w=_=null,CS):Nse(y=+$[0][0],v=+$[0][1],w=+$[1][0],_=+$[1][1]),U()):y==null?null:[[y,v],[w,_]]},L.scale=function($){return arguments.length?(n=+$,X()):n},L.translate=function($){return arguments.length?(r=+$[0],o=+$[1],X()):[r,o]},L.center=function($){return arguments.length?(i=$[0]%360*pn,s=$[1]%360*pn,X()):[i*Yr,s*Yr]},L.rotate=function($){return arguments.length?(a=$[0]%360*pn,l=$[1]%360*pn,c=$.length>2?$[2]%360*pn:0,X()):[a*Yr,l*Yr,c*Yr]},L.angle=function($){return arguments.length?(d=$%360*pn,X()):d*Yr},L.reflectX=function($){return arguments.length?(p=$?-1:1,X()):p<0},L.reflectY=function($){return arguments.length?(h=$?-1:1,X()):h<0},L.precision=function($){return arguments.length?(E=VM(P,C=$*$),U()):Zr(C)},L.fitExtent=function($,B){return mE(L,$,B)},L.fitSize=function($,B){return n4(L,$,B)},L.fitWidth=function($,B){return r4(L,$,B)},L.fitHeight=function($,B){return o4(L,$,B)};function X(){var $=UM(n,0,0,p,h,d).apply(null,t(i,s)),B=UM(n,r-$[0],o-$[1],p,h,d);return u=$L(a,l,c),P=yS(t,B),A=yS(u,P),E=VM(P,C),U()}function U(){return I=F=null,L}return function(){return t=e.apply(this,arguments),L.invert=t.invert&&j,X()}}function bE(e){var t=0,n=At/3,r=i4(e),o=r(t,n);return o.parallels=function(i){return arguments.length?r(t=i[0]*pn,n=i[1]*pn):[t*Yr,n*Yr]},o}function lae(e){var t=bt(e);function n(r,o){return[r*t,ft(o)/t]}return n.invert=function(r,o){return[r/t,fi(o*t)]},n}function cae(e,t){var n=ft(e),r=(n+ft(t))/2;if(Kt(r)<nt)return lae(e);var o=1+n*(2*r-n),i=Zr(o)/r;function s(a,l){var c=Zr(o-2*r*ft(l))/r;return[c*ft(a*=r),i-c*bt(a)]}return s.invert=function(a,l){var c=i-l,u=ls(a,Kt(c))*ci(c);return c*r<0&&(u-=At*ci(a)*ci(c)),[u/r,fi((o-(a*a+c*c)*r*r)/(2*r))]},s}function Xb(){return bE(cae).scale(155.424).center([0,33.6442])}function s4(){return Xb().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function uae(e){var t=e.length;return{point:function(n,r){for(var o=-1;++o<t;)e[o].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 dae(){var e,t,n=s4(),r,o=Xb().rotate([154,0]).center([-2,58.5]).parallels([55,65]),i,s=Xb().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||(i.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,y=(p[1]-m[1])/h;return(y>=.12&&y<.234&&b>=-.425&&b<-.214?o:y>=.166&&y<.234&&b>=-.214&&b<-.115?s:n).invert(p)},u.stream=function(p){return e&&t===p?e:e=uae([n.stream(t=p),o.stream(p),s.stream(p)])},u.precision=function(p){return arguments.length?(n.precision(p),o.precision(p),s.precision(p),d()):n.precision()},u.scale=function(p){return arguments.length?(n.scale(p),o.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),i=o.translate([m-.307*h,b+.201*h]).clipExtent([[m-.425*h+nt,b+.12*h+nt],[m-.214*h-nt,b+.234*h-nt]]).stream(c),a=s.translate([m-.205*h,b+.212*h]).clipExtent([[m-.214*h+nt,b+.166*h+nt],[m-.115*h-nt,b+.234*h-nt]]).stream(c),d()},u.fitExtent=function(p,h){return mE(u,p,h)},u.fitSize=function(p,h){return n4(u,p,h)},u.fitWidth=function(p,h){return r4(u,p,h)},u.fitHeight=function(p,h){return o4(u,p,h)};function d(){return e=t=null,u}return u.scale(1070)}function a4(e){return function(t,n){var r=bt(t),o=bt(n),i=e(r*o);return i===1/0?[2,0]:[i*o*ft(t),i*ft(n)]}}function Op(e){return function(t,n){var r=Zr(t*t+n*n),o=e(r),i=ft(o),s=bt(o);return[ls(t*i,r*s),fi(r&&n*i/r)]}}var l4=a4(function(e){return Zr(2/(1+e))});l4.invert=Op(function(e){return 2*fi(e/2)});function fae(){return ra(l4).scale(124.75).clipAngle(180-.001)}var c4=a4(function(e){return(e=LL(e))&&e/ft(e)});c4.invert=Op(function(e){return e});function hae(){return ra(c4).scale(79.4188).clipAngle(180-.001)}function o0(e,t){return[e,zb(hE((Hn+t)/2))]}o0.invert=function(e,t){return[e,2*Ld(FL(t))-Hn]};function pae(){return u4(o0).scale(961/Wo)}function u4(e){var t=ra(e),n=t.center,r=t.scale,o=t.translate,i=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?(o(d),u()):o()},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=At*r(),p=t(Rse(t.rotate()).invert([0,0]));return i(s==null?[[p[0]-d,p[1]-d],[p[0]+d,p[1]+d]]:e===o0?[[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 Sm(e){return hE((Hn+e)/2)}function gae(e,t){var n=bt(e),r=e===t?ft(e):zb(n/bt(t))/zb(Sm(t)/Sm(e)),o=n*ew(Sm(e),r)/r;if(!r)return o0;function i(s,a){o>0?a<-Hn+nt&&(a=-Hn+nt):a>Hn-nt&&(a=Hn-nt);var l=o/ew(Sm(a),r);return[l*ft(r*s),o-l*bt(r*s)]}return i.invert=function(s,a){var l=o-a,c=ci(r)*Zr(s*s+l*l),u=ls(s,Kt(l))*ci(l);return l*r<0&&(u-=At*ci(s)*ci(l)),[u/r,2*Ld(ew(o/c,1/r))-Hn]},i}function mae(){return bE(gae).scale(109.5).parallels([30,30])}function Qb(e,t){return[e,t]}Qb.invert=Qb;function bae(){return ra(Qb).scale(152.63)}function yae(e,t){var n=bt(e),r=e===t?ft(e):(n-bt(t))/(t-e),o=n/r+e;if(Kt(r)<nt)return Qb;function i(s,a){var l=o-a,c=r*s;return[l*ft(c),o-l*bt(c)]}return i.invert=function(s,a){var l=o-a,c=ls(s,Kt(l))*ci(l);return l*r<0&&(c-=At*ci(s)*ci(l)),[c/r,o-ci(r)*Zr(s*s+l*l)]},i}function vae(){return bE(yae).scale(131.154).center([0,13.9389])}var gh=1.340264,mh=-.081106,bh=893e-6,yh=.003796,Zb=Zr(3)/2,xae=12;function d4(e,t){var n=fi(Zb*ft(t)),r=n*n,o=r*r*r;return[e*bt(n)/(Zb*(gh+3*mh*r+o*(7*bh+9*yh*r))),n*(gh+mh*r+o*(bh+yh*r))]}d4.invert=function(e,t){for(var n=t,r=n*n,o=r*r*r,i=0,s,a,l;i<xae&&(a=n*(gh+mh*r+o*(bh+yh*r))-t,l=gh+3*mh*r+o*(7*bh+9*yh*r),n-=s=a/l,r=n*n,o=r*r*r,!(Kt(s)<NL));++i);return[Zb*e*(gh+3*mh*r+o*(7*bh+9*yh*r))/bt(n),fi(ft(n)/Zb)]};function wae(){return ra(d4).scale(177.158)}function f4(e,t){var n=bt(t),r=bt(e)*n;return[n*ft(e)/r,ft(t)/r]}f4.invert=Op(Ld);function Sae(){return ra(f4).scale(144.049).clipAngle(60)}function h4(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)))]}h4.invert=function(e,t){var n=t,r=25,o;do{var i=n*n,s=i*i;n-=o=(n*(1.007226+i*(.015085+s*(-.044475+.028874*i-.005916*s)))-t)/(1.007226+i*(.015085*3+s*(-.044475*7+.028874*9*i-.005916*11*s)))}while(Kt(o)>nt&&--r>0);return[e/(.8707+(i=n*n)*(-.131979+i*(-.013791+i*i*i*(.003971-.001529*i)))),n]};function _ae(){return ra(h4).scale(175.295)}function p4(e,t){return[bt(t)*ft(e),ft(t)]}p4.invert=Op(fi);function Cae(){return ra(p4).scale(249.5).clipAngle(90+nt)}function g4(e,t){var n=bt(t),r=1+bt(e)*n;return[n*ft(e)/r,ft(t)/r]}g4.invert=Op(function(e){return 2*Ld(e)});function Eae(){return ra(g4).scale(250).clipAngle(142)}function m4(e,t){return[zb(hE((Hn+t)/2)),-e]}m4.invert=function(e,t){return[-t,2*Ld(FL(e))-Hn]};function Rae(){var e=u4(m4),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 en(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 i0(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function yE(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function $d(){}var Pc=.7,_d=1/Pc,ju="\\s*([+-]?\\d+)\\s*",Uh="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",os="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Tae=/^#([0-9a-f]{3,8})$/,kae=new RegExp(`^rgb\\(${ju},${ju},${ju}\\)$`),Pae=new RegExp(`^rgb\\(${os},${os},${os}\\)$`),Oae=new RegExp(`^rgba\\(${ju},${ju},${ju},${Uh}\\)$`),Mae=new RegExp(`^rgba\\(${os},${os},${os},${Uh}\\)$`),Aae=new RegExp(`^hsl\\(${Uh},${os},${os}\\)$`),Dae=new RegExp(`^hsla\\(${Uh},${os},${os},${Uh}\\)$`),GM={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};i0($d,vE,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:qM,formatHex:qM,formatHex8:Iae,formatHsl:Nae,formatRgb:YM,toString:YM});function qM(){return this.rgb().formatHex()}function Iae(){return this.rgb().formatHex8()}function Nae(){return y4(this).formatHsl()}function YM(){return this.rgb().formatRgb()}function vE(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Tae.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?KM(t):n===3?new Fr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?_m(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?_m(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=kae.exec(e))?new Fr(t[1],t[2],t[3],1):(t=Pae.exec(e))?new Fr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Oae.exec(e))?_m(t[1],t[2],t[3],t[4]):(t=Mae.exec(e))?_m(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Aae.exec(e))?ZM(t[1],t[2]/100,t[3]/100,1):(t=Dae.exec(e))?ZM(t[1],t[2]/100,t[3]/100,t[4]):GM.hasOwnProperty(e)?KM(GM[e]):e==="transparent"?new Fr(NaN,NaN,NaN,0):null}function KM(e){return new Fr(e>>16&255,e>>8&255,e&255,1)}function _m(e,t,n,r){return r<=0&&(e=t=n=NaN),new Fr(e,t,n,r)}function b4(e){return e instanceof $d||(e=vE(e)),e?(e=e.rgb(),new Fr(e.r,e.g,e.b,e.opacity)):new Fr}function Gh(e,t,n,r){return arguments.length===1?b4(e):new Fr(e,t,n,r??1)}function Fr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}i0(Fr,Gh,yE($d,{brighter(e){return e=e==null?_d:Math.pow(_d,e),new Fr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Pc:Math.pow(Pc,e),new Fr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Fr(pc(this.r),pc(this.g),pc(this.b),Jb(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:XM,formatHex:XM,formatHex8:Fae,formatRgb:QM,toString:QM}));function XM(){return`#${Gl(this.r)}${Gl(this.g)}${Gl(this.b)}`}function Fae(){return`#${Gl(this.r)}${Gl(this.g)}${Gl(this.b)}${Gl((isNaN(this.opacity)?1:this.opacity)*255)}`}function QM(){const e=Jb(this.opacity);return`${e===1?"rgb(":"rgba("}${pc(this.r)}, ${pc(this.g)}, ${pc(this.b)}${e===1?")":`, ${e})`}`}function Jb(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function pc(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Gl(e){return e=pc(e),(e<16?"0":"")+e.toString(16)}function ZM(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ki(e,t,n,r)}function y4(e){if(e instanceof ki)return new ki(e.h,e.s,e.l,e.opacity);if(e instanceof $d||(e=vE(e)),!e)return new ki;if(e instanceof ki)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),s=NaN,a=i-o,l=(i+o)/2;return a?(t===i?s=(n-r)/a+(n<r)*6:n===i?s=(r-t)/a+2:s=(t-n)/a+4,a/=l<.5?i+o:2-i-o,s*=60):a=l>0&&l<1?0:s,new ki(s,a,l,e.opacity)}function Lae(e,t,n,r){return arguments.length===1?y4(e):new ki(e,t,n,r??1)}function ki(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}i0(ki,Lae,yE($d,{brighter(e){return e=e==null?_d:Math.pow(_d,e),new ki(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Pc:Math.pow(Pc,e),new ki(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,o=2*n-r;return new Fr(iw(e>=240?e-240:e+120,o,r),iw(e,o,r),iw(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new ki(JM(this.h),Cm(this.s),Cm(this.l),Jb(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Jb(this.opacity);return`${e===1?"hsl(":"hsla("}${JM(this.h)}, ${Cm(this.s)*100}%, ${Cm(this.l)*100}%${e===1?")":`, ${e})`}`}}));function JM(e){return e=(e||0)%360,e<0?e+360:e}function Cm(e){return Math.max(0,Math.min(1,e||0))}function iw(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 $ae=Math.PI/180,jae=180/Math.PI;var v4=-.14861,xE=1.78277,wE=-.29227,s0=-.90649,qh=1.97294,eA=qh*s0,tA=qh*xE,nA=xE*wE-s0*v4;function zae(e){if(e instanceof gc)return new gc(e.h,e.s,e.l,e.opacity);e instanceof Fr||(e=b4(e));var t=e.r/255,n=e.g/255,r=e.b/255,o=(nA*r+eA*t-tA*n)/(nA+eA-tA),i=r-o,s=(qh*(n-o)-wE*i)/s0,a=Math.sqrt(s*s+i*i)/(qh*o*(1-o)),l=a?Math.atan2(s,i)*jae-120:NaN;return new gc(l<0?l+360:l,a,o,e.opacity)}function cs(e,t,n,r){return arguments.length===1?zae(e):new gc(e,t,n,r??1)}function gc(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}i0(gc,cs,yE($d,{brighter(e){return e=e==null?_d:Math.pow(_d,e),new gc(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Pc:Math.pow(Pc,e),new gc(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*$ae,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),o=Math.sin(e);return new Fr(255*(t+n*(v4*r+xE*o)),255*(t+n*(wE*r+s0*o)),255*(t+n*(qh*r)),this.opacity)}}));function Bae(e,t,n,r,o){var i=e*e,s=i*e;return((1-3*e+3*i-s)*t+(4-6*i+3*s)*n+(1+3*e+3*i-3*s)*r+s*o)/6}function Hae(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),o=e[r],i=e[r+1],s=r>0?e[r-1]:2*o-i,a=r<t-1?e[r+2]:2*i-o;return Bae((n-r/t)*t,s,o,i,a)}}const SE=e=>()=>e;function x4(e,t){return function(n){return e+n*t}}function Wae(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 Vae(e,t){var n=t-e;return n?x4(e,n>180||n<-180?n-360*Math.round(n/360):n):SE(isNaN(e)?t:e)}function Uae(e){return(e=+e)==1?zu:function(t,n){return n-t?Wae(t,n,e):SE(isNaN(t)?n:t)}}function zu(e,t){var n=t-e;return n?x4(e,n):SE(isNaN(e)?t:e)}(function e(t){var n=Uae(t);function r(o,i){var s=n((o=Gh(o)).r,(i=Gh(i)).r),a=n(o.g,i.g),l=n(o.b,i.b),c=zu(o.opacity,i.opacity);return function(u){return o.r=s(u),o.g=a(u),o.b=l(u),o.opacity=c(u),o+""}}return r.gamma=e,r})(1);function Gae(e){return function(t){var n=t.length,r=new Array(n),o=new Array(n),i=new Array(n),s,a;for(s=0;s<n;++s)a=Gh(t[s]),r[s]=a.r||0,o[s]=a.g||0,i[s]=a.b||0;return r=e(r),o=e(o),i=e(i),a.opacity=1,function(l){return a.r=r(l),a.g=o(l),a.b=i(l),a+""}}}var qae=Gae(Hae);function w4(e){return function t(n){n=+n;function r(o,i){var s=e((o=cs(o)).h,(i=cs(i)).h),a=zu(o.s,i.s),l=zu(o.l,i.l),c=zu(o.opacity,i.opacity);return function(u){return o.h=s(u),o.s=a(u),o.l=l(Math.pow(u,n)),o.opacity=c(u),o+""}}return r.gamma=t,r}(1)}w4(Vae);var _E=w4(zu);const bn=e=>qae(e[e.length-1]);var Yae=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(en);const Kae=bn(Yae);var Xae=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(en);const Qae=bn(Xae);var Zae=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(en);const Jae=bn(Zae);var ele=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(en);const tle=bn(ele);var nle=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(en);const rle=bn(nle);var ole=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(en);const ile=bn(ole);var sle=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(en);const ale=bn(sle);var lle=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(en);const cle=bn(lle);var ule=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(en);const dle=bn(ule);var fle=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(en);const hle=bn(fle);var ple=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(en);const gle=bn(ple);var mle=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(en);const ble=bn(mle);var yle=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(en);const vle=bn(yle);var xle=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(en);const wle=bn(xle);var Sle=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(en);const _le=bn(Sle);var Cle=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(en);const Ele=bn(Cle);var Rle=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(en);const Tle=bn(Rle);var kle=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(en);const Ple=bn(kle);var Ole=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(en);const Mle=bn(Ole);var Ale=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(en);const Dle=bn(Ale);var Ile=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(en);const Nle=bn(Ile);var Fle=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(en);const Lle=bn(Fle);var $le=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(en);const jle=bn($le);var zle=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(en);const Ble=bn(zle);var Hle=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(en);const Wle=bn(Hle);var Vle=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(en);const Ule=bn(Vle);var Gle=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(en);const qle=bn(Gle);function Yle(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 Kle=_E(cs(300,.5,0),cs(-240,.5,1));var Xle=_E(cs(-100,.75,.35),cs(80,1.5,.8)),Qle=_E(cs(260,.75,.35),cs(80,1.5,.8)),Em=cs();function Zle(e){(e<0||e>1)&&(e-=Math.floor(e));var t=Math.abs(e-.5);return Em.h=360*e-100,Em.s=1.5-1.5*t,Em.l=.8-.9*t,Em+""}var Rm=Gh(),Jle=Math.PI/3,ece=Math.PI*2/3;function tce(e){var t;return e=(.5-e)*Math.PI,Rm.r=255*(t=Math.sin(e))*t,Rm.g=255*(t=Math.sin(e+Jle))*t,Rm.b=255*(t=Math.sin(e+ece))*t,Rm+""}function nce(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+e*(1172.33-e*(10793.56-e*(33300.12-e*(38394.49-e*14825.05)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+e*(557.33+e*(1225.33-e*(3574.96-e*(1073.77+e*707.56)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+e*(3211.1-e*(15327.97-e*(27814-e*(22569.18-e*6838.66)))))))+")"}function a0(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}const rce=a0(en("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var oce=a0(en("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),ice=a0(en("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),sce=a0(en("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function ace(e){return e}function lce(e){if(e==null)return ace;var t,n,r=e.scale[0],o=e.scale[1],i=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+i,d[1]=(n+=a[1])*o+s;c<u;)d[c]=a[c],++c;return d}}function cce(e,t){for(var n,r=e.length,o=r-t;o<--r;)n=e[o],e[o++]=e[r],e[r]=n}function uce(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return rA(e,n)})}:rA(e,t)}function rA(e,t){var n=t.id,r=t.bbox,o=t.properties==null?{}:t.properties,i=dce(e,t);return n==null&&r==null?{type:"Feature",properties:o,geometry:i}:r==null?{type:"Feature",id:n,properties:o,geometry:i}:{type:"Feature",id:n,bbox:r,properties:o,geometry:i}}function dce(e,t){var n=lce(e.transform),r=e.arcs;function o(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&&cce(d,m)}function i(u){return n(u)}function s(u){for(var d=[],p=0,h=u.length;p<h;++p)o(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=i(u.coordinates);break;case"MultiPoint":p=u.coordinates.map(i);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 vh={geoAzimuthalEqualArea:fae,geoAzimuthalEquidistant:hae,geoGnomonic:Sae,geoOrthographic:Cae,geoStereographic:Eae,geoEqualEarth:wae,geoAlbers:s4,geoAlbersUsa:dae,geoConicConformal:mae,geoConicEqualArea:Xb,geoConicEquidistant:vae,geoEquirectangular:bae,geoMercator:pae,geoTransverseMercator:Rae,geoNaturalEarth1:_ae};Object.keys(vh).forEach(e=>{vh[`${e.charAt(3).toLowerCase()}${e.slice(4)}`]=vh[e]});class Hc extends ll{constructor(t){super(t),this.outlineBounds=null,this.oldChartBounds=null,this.geoPath=HM()}init(t){t.position="chartArea",super.init(t),typeof t.projection=="function"?this.projection=t.projection:this.projection=(vh[t.projection]||vh.albersUsa)(),this.geoPath.projection(this.projection),this.outlineBounds=null,this.oldChartBounds=null}computeBounds(t){const n=HM(this.projection.fitWidth(1e3,t)).bounds(t),r=Math.ceil(n[1][1]-n[0][1]),o=Math.ceil(n[1][0]-n[0][0]),i=this.projection.translate();this.outlineBounds={width:o,height:r,aspectRatio:o/r,refScale:this.projection.scale(),refX:i[0],refY:i[1]}}updateBounds(){const t=this.chart.chartArea,n=this.outlineBounds;if(!n)return!1;const r=this.options.padding,o=typeof r=="number"?r:r.top,i=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-i-a,c=t.bottom-t.top-o-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+i,b=(c-h)*.5+t.top+o,y=this.options;return this.projection.scale(n.refScale*d*y.projectionScale).translate([d*n.refX+m+y.projectionOffset[0],d*n.refY+b+y.projectionOffset[1]]),!u||u.chartWidth!==this.oldChartBounds.chartWidth||u.chartHeight!==this.oldChartBounds.chartHeight}}Hc.id="projection";Hc.defaults={projection:"albersUsa",projectionScale:1,projectionOffset:[0,0],padding:0};Hc.descriptors={_scriptable:e=>e!=="projection",_indexable:e=>e!=="projectionOffset"};const l0={position:"chartArea",property:"value",grid:{z:1,drawOnChartArea:!1},ticks:{z:1},legend:{align:"right",position:"bottom-right",length:100,width:50,margin:8,indicatorWidth:10}};function fce(e){const{indicatorWidth:t,align:n,margin:r}=e,o=(typeof r=="number"?r:r.left)+(n==="right"?t:0),i=(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:o,top:i,right:s,bottom:a}}function hce(e,t,n,r,o){const{indicatorWidth:i,align:s,position:a}=t,l=s==="top"||s==="bottom",c=(s==="left"?o.w:n)+(l?i:0),u=(s==="top"?o.h:r)+(l?0:i),d=fce(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 Ou extends yd{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 o=Math.min(n,this.bottom==null?Number.POSITIVE_INFINITY:this.bottom),i=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(i,l(a?s.length:s.width,i))-(a?0:s.indicatorWidth),u=Math.min(o,l(a?s.width:s.length,o))-(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=hce(t,this.options.legend,this.width,this.height,this.legendSize),{ctx:r}=this;r.save(),r.translate(n[0],n[1]);const o=this.options.position;this.options.position=this.options.legend.align,super.draw({...t,bottom:this.height+10,right:this.width}),this.options.position=o;const{indicatorWidth:i}=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,-i);break;default:r.translate(-i,0);break}this._drawIndicator(),r.restore()}_drawIndicator(){}}class S4 extends vd{constructor(){super(...arguments),this.legendSize={w:0,h:0}}init(t){Ou.prototype.init.call(this,t)}parse(t,n){return Ou.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 Ou.prototype.update.call(this,t,n,r)}_computeLabelArea(){}draw(t){return Ou.prototype.draw.call(this,t)}_drawIndicator(){}}const Ws={interpolateBlues:Lle,interpolateBrBG:Kae,interpolateBuGn:hle,interpolateBuPu:gle,interpolateCividis:Yle,interpolateCool:Qle,interpolateCubehelixDefault:Kle,interpolateGnBu:ble,interpolateGreens:jle,interpolateGreys:Ble,interpolateInferno:ice,interpolateMagma:oce,interpolateOrRd:vle,interpolateOranges:qle,interpolatePRGn:Qae,interpolatePiYG:Jae,interpolatePlasma:sce,interpolatePuBu:_le,interpolatePuBuGn:wle,interpolatePuOr:tle,interpolatePuRd:Ele,interpolatePurples:Wle,interpolateRainbow:Zle,interpolateRdBu:rle,interpolateRdGy:ile,interpolateRdPu:Tle,interpolateRdYlBu:ale,interpolateRdYlGn:cle,interpolateReds:Ule,interpolateSinebow:tce,interpolateSpectral:dle,interpolateTurbo:nce,interpolateViridis:rce,interpolateWarm:Xle,interpolateYlGn:Mle,interpolateYlGnBu:Ple,interpolateYlOrBr:Dle,interpolateYlOrRd:Nle};Object.keys(Ws).forEach(e=>{Ws[`${e.charAt(11).toLowerCase()}${e.slice(12)}`]=Ws[e],Ws[e.slice(11)]=Ws[e]});function _4(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 C4={interpolate:"blues",missing:"transparent",quantize:0};class Qa extends Ou{get interpolate(){const t=this.options;return t?typeof t.interpolate=="function"?t.interpolate:Ws[t.interpolate]||Ws.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=_4(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 o=r/this.options.quantize,i=n?s=>r-o-s:s=>s;for(let s=0;s<r;s+=o){const a=(s+o/2)/r;this.ctx.fillStyle=this.getColor(a),this.ctx.fillRect(i(s),0,o,t)}}else{const o=n?i=>r-1-i:i=>i;for(let i=0;i<r;i+=1)this.ctx.fillStyle=this.getColor((i+.5)/r),this.ctx.fillRect(o(i),0,1,t)}}else{const r=this.height;if(this.options.quantize>0){const o=r/this.options.quantize,i=n?s=>r-o-s:s=>s;for(let s=0;s<r;s+=o){const a=(s+o/2)/r;this.ctx.fillStyle=this.getColor(a),this.ctx.fillRect(0,i(s),t,o)}}else{const o=n?i=>r-1-i:i=>i;for(let i=0;i<r;i+=1)this.ctx.fillStyle=this.getColor((i+.5)/r),this.ctx.fillRect(0,o(i),t,1)}}}}Qa.id="color";Qa.defaults=mr({},[yd.defaults,l0,C4]);Qa.descriptors={_scriptable:e=>e!=="interpolate",_indexable:!1};class CE extends S4{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=Ws[t.interpolate]||Ws.blues}getColorForValue(t){return Qa.prototype.getColorForValue.call(this,t)}getColor(t){let n=t;return this.options.quantize>0&&(n=_4(n,this.options.quantize)),this.interpolate(n)}_drawIndicator(){return Qa.prototype._drawIndicator.call(this)}}CE.id="colorLogarithmic";CE.defaults=mr({},[vd.defaults,l0,C4]);CE.descriptors={_scriptable:e=>e!=="interpolate",_indexable:!1};const E4={missing:1,mode:"area",range:[2,20],legend:{align:"bottom",length:90,width:70,indicatorWidth:42}};class Za extends Ou{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 i=r*r*Math.PI,s=n*n*Math.PI,a=i-s,l=t*a+s;return Math.sqrt(l/Math.PI)}const o=r-n;return t*o+n}_drawIndicator(){const{ctx:t}=this,n=this.options.legend.indicatorWidth/2,r=this.isHorizontal(),o=this.ticks,i=this.getLabelItems(),s=i?i.map(a=>({[r?"x":"y"]:a.options.translation[r?0:1]})):o.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";o.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};Ib(t,h,d,p)})}}Za.id="size";Za.defaults=mr({},[yd.defaults,l0,E4]);Za.descriptors={_scriptable:!0,_indexable:e=>e!=="range"};class R4 extends S4{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 Za.prototype.getSizeImpl.call(this,t)}_drawIndicator(){Za.prototype._drawIndicator.call(this)}}R4.id="sizeLogarithmic";R4.defaults=mr({},[vd.defaults,l0,E4]);function pce(e,t){return[[e[0][0]-t,e[0][1]-t],[e[1][0]+t,e[1][1]+t]]}class ea extends bs{constructor(){super(...arguments),this.cache=void 0}inRange(t,n){const r=this.getBounds(),o=(Number.isNaN(t)||t>=r.x&&t<=r.x2)&&(Number.isNaN(n)||n>=r.y&&n<=r.y2),i=this.projectionScale.geoPath.projection();if(o&&!Number.isNaN(t)&&!Number.isNaN(n)&&typeof i.invert=="function"){const s=i.invert([t,n]);return s!=null&&Wse(this.feature,s)}return o}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=pce(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"),o=Math.floor(n.x),i=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-o,1)*l),u=Math.ceil(Math.max(a-i,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(-o,-i),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 o=Math.floor(r.x),i=Math.floor(r.y),s=Math.ceil(r.x+r.width),a=Math.ceil(r.y+r.height),l=s-o,c=a-i;l>0&&c>0&&t.drawImage(this.cache.canvas,o,i,s-o,a-i)}else Number.isFinite(r.x)&&(t.save(),this._drawImpl(t),t.restore())}}ea.id="geoFeature";ea.defaults={...hc.defaults,outlineBackgroundColor:null,outlineBorderWidth:0,graticuleBorderColor:"#CCCCCC",graticuleBorderWidth:0};ea.defaultRoutes={outlineBorderColor:"borderColor",...hc.defaultRoutes||{}};const T4={showOutline:!1,showGraticule:!1,clipMap:!0},k4={scales:{projection:{axis:"x",type:Hc.id,position:"chartArea",display:!1}}};function oA(e){const t={...e};return Object.keys(e).forEach(n=>{let r=n;if(n.startsWith("outline")){const o=n.slice(7);r=o[0].toLowerCase()+o.slice(1)}else if(n.startsWith("hoverOutline"))r=`hover${n.slice(12)}`;else return;delete t[n],t[r]=e[n]}),t}class P4 extends ui{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 ut(this.getGeoDataset().showOutline,this.getGeoOptions().showOutline)}clipMap(){return ut(this.getGeoDataset().clipMap,this.getGeoOptions().clipMap)}getGraticule(){return ut(this.getGeoDataset().showGraticule,this.getGeoOptions().showGraticule)}update(t){super.update(t);const n=this.getMeta(),r=this.getProjectionScale(),o=r.updateBounds();if(this.showOutline()){const i=n.dataset;if(o&&delete i.cache,i.projectionScale=r,i.pixelRatio=this.chart.currentDevicePixelRatio,t!=="resize"){const s=oA(this.resolveDatasetElementOptions(t)),a={feature:this.resolveOutline(),options:s};this.updateElement(i,void 0,a,t),this.getGraticule()&&(n.graticule=s)}}else this.getGraticule()&&t!=="resize"&&(n.graticule=oA(this.resolveDatasetElementOptions(t)));this.updateElements(n.data,0,n.data.length,t),o&&n.data.forEach(i=>delete i.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,i=this.getProjectionScale().geoPath.context(r);if(r.save(),r.beginPath(),typeof t=="boolean")t&&i(Vse());else{const s=VL();t.stepMajor&&s.stepMajor(t.stepMajor),t.stepMinor&&s.stepMinor(t.stepMinor),i(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,lc(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||lc(t.ctx,t.chartArea):r&&(r=!1,cc(t.ctx)),this.showGraticule(),n===!0||n==="items"?r||lc(t.ctx,t.chartArea):r&&(r=!1,cc(t.ctx)),this.getMeta().data.forEach(o=>o.draw.call(o,t.ctx,t.chartArea)),r&&(r=!1,cc(t.ctx))}}function O4(e,t,n,r=[],o=[]){Xr.addControllers(n),Array.isArray(r)?Xr.addElements(...r):Xr.addElements(r),Array.isArray(o)?Xr.addScales(...o):Xr.addScales(o);const i=t;return i.type=e,i}class jd extends P4{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:o}=this.getDataset(),i=this._cachedMeta;for(let s=t;s<t+n;s+=1)i._parsed[s]={[r.axis]:r.parse(o[s],s)}}updateElements(t,n,r,o){const i=this.resolveDataElementOptions(n,o),s=this.getSharedOptions(i),a=this.includeOptions(o,s),l=this.getProjectionScale();this.updateSharedOptions(s,o,i);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,o)),this.updateElement(u,c,p,o)}}indexToColor(t){const n=this.getMeta().rScale;return n.getColorForValue(this.getParsed(t)[n.axis])}}jd.id="choropleth";jd.defaults=mr({},[T4,{datasetElementType:ea.id,dataElementType:ea.id}]);jd.overrides=mr({},[k4,{plugins:{tooltip:{callbacks:{title(){return""},label(e){var t,n,r,o;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]:`${(o=(r=e.chart.data)===null||r===void 0?void 0:r.labels)===null||o===void 0?void 0:o[e.dataIndex]}: ${e.formattedValue}`}}},colors:{enabled:!1}},scales:{color:{type:Qa.id,axis:"x"}},elements:{geoFeature:{backgroundColor(e){return e.dataIndex==null?null:e.chart.getDatasetMeta(e.datasetIndex).controller.indexToColor(e.dataIndex)}}}}]);class gce extends Ln{constructor(t,n){super(t,O4("choropleth",n,jd,ea,[Qa,Hc]))}}gce.id=jd.id;class zd extends P4{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,o=this.getDataset().data,i=this._cachedMeta;for(let s=t;s<t+n;s+=1){const a=o[s];i._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,o){const i=o==="reset",s=this.resolveDataElementOptions(n,o),a=this.getSharedOptions(s),l=this.includeOptions(o,a),c=this.getProjectionScale();this.getMeta().rScale._model=s,this.updateSharedOptions(a,o,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,o),i&&(m.options.radius=0)),this.updateElement(d,u,m,o)}}indexToRadius(t){const n=this.getMeta().rScale;return n.getSizeForValue(this.getParsed(t)[n.axis])}}zd.id="bubbleMap";zd.defaults=mr({},[T4,{dataElementType:fc.id,datasetElementType:ea.id,showOutline:!0,clipMap:"outline+graticule"}]);zd.overrides=mr({},[k4,{plugins:{tooltip:{callbacks:{title(){return""},label(e){var t,n,r,o;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]:`${(o=(r=e.chart.data)===null||r===void 0?void 0:r.labels)===null||o===void 0?void 0:o[e.dataIndex]}: ${e.formattedValue}`}}}},scales:{size:{axis:"x",type:Za.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 mce extends Ln{constructor(t,n){super(t,O4("bubbleMap",n,zd,ea,[Za,Hc]))}}mce.id=zd.id;function bce(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 yce(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 vce(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 xce(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 wce(e,t){var r,o,i,s,a;return{...e,type:t==="stackedBar"?"bar":"line",options:{...e==null?void 0:e.options,scales:{x:{...(o=(r=e==null?void 0:e.options)==null?void 0:r.scales)==null?void 0:o.x,display:!0,stacked:!0},y:{...(s=(i=e==null?void 0:e.options)==null?void 0:i.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 Sce(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 _ce(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 Cce(e){var r,o;const t=ye.getState().theme;let n={...e,type:"radar",options:{...e==null?void 0:e.options,scales:{x:{display:!1},y:{display:!1},r:{grid:{display:!0},angleLines:{},ticks:{}}},plugins:{...(r=e==null?void 0:e.options)==null?void 0:r.plugins,legend:{position:"bottom",align:"center"}}}};return t==="dark"&&(n={...n,options:{...n.options,scales:{...(o=n==null?void 0:n.options)==null?void 0:o.scales,r:{grid:{color:Ut.slate[800]},angleLines:{color:Ut.slate[800]},ticks:{color:Ut.slate[800],showLabelBackdrop:!1}}}}}),n}function EE({data:e,cardType:t="bar",cfg:n,customCfg:r,provider:o="chartjs",userSettings:i,preferences:s,topoJson:a}){var l,c,u,d,p,h,m,b,y,v;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 _=uce(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}=hr(e),E=_.map(j=>{var B;const X=C==null?void 0:C[0],U=C==null?void 0:C[1],$=(B=e.find(W=>(W==null?void 0:W[X])===j.properties.NAME||(W==null?void 0:W[X])===j.properties.name))==null?void 0:B[U];return{feature:j,value:$}}),A=Yf([{label:w,data:E,borderColor:"lightgray"}],r),I={type:"choropleth",data:{labels:_.map(j=>j.properties.NAME||j.properties.name),datasets:A},options:R},{options:F}=NF({cfg:I,preferences:s,customCfg:r});return{...I,options:F}}if(t==="bar"){const w=vce(n);return El({data:e,cfg:w,customCfg:r,cardType:t,preferences:s})}if(t==="horizontalBar"){const w=bce(n);return El({data:e,cfg:w,customCfg:r,cardType:t,preferences:s})}if(t==="pyramid"){const w=yce(n),{dimensionKeys:_,metricKeys:R}=hr(e),C=Pb({dataArray:e,groupKey:_[0],pivotKey:_[1],valueKey:R[0]}),E=El({data:C,cfg:w,customCfg:r,cardType:t,preferences:s}),P="x2";return{...E,data:{...E.data,datasets:E.data.datasets.map((I,F)=>F===1?{...I,xAxisID:P}:I)},options:{...E.options,scales:{...(m=E==null?void 0:E.options)==null?void 0:m.scales,[P]:{beginAtZero:!0,stack:1}}}}}if(t==="stackedBar"||t==="stackedLine"){const w=wce(n,t),{dimensionKeys:_,metricKeys:R}=hr(e),C=Pb({dataArray:e,groupKey:_[0],pivotKey:_[1],valueKey:R[0],sortChart:s==null?void 0:s.sortChart});return El({data:C,cfg:w,customCfg:r,cardType:t,preferences:s})}if(t==="line"){const w=Sce(n);return El({data:e,cfg:w,customCfg:r,cardType:t,preferences:s})}if(t==="range"){const w=xce(n),_=Qee(e),R=Yf(_,r),{plugins:C,options:E}=nS((s==null?void 0:s.customVisualCode)||""),P=go((w==null?void 0:w.options)||{},(n==null?void 0:n.options)||{}),A=go(P,(s==null?void 0:s.chartOptions)||{}),I=go(A,(r==null?void 0:r.options)||{}),F=go(I,E),L=IF(n,s),j=go(F,L),X={...j,plugins:{...j==null?void 0:j.plugins,datalabels:{...(b=j==null?void 0:j.plugins)==null?void 0:b.datalabels,formatter:(q,Q)=>q.map(G=>{var V,M,ee,K;return li({number:Number(G),decimalPlaces:((V=s==null?void 0:s.numberAxisFormat)==null?void 0:V.decimalPlaces)||0,useSuffix:!!((M=s==null?void 0:s.numberAxisFormat)!=null&&M.suffix),customSuffix:"",locale:((ee=s==null?void 0:s.numberAxisFormat)==null?void 0:ee.locale)||"",currency:((K=s==null?void 0:s.numberAxisFormat)==null?void 0:K.currency)||""})}).slice(0,2).join(" - ")}}},{dimensionKeys:U}=hr(e),$=U[0];return{type:"bar",data:{labels:[...new Set(tS(e,$))],datasets:R},options:X,plugins:[...C]}}if(t==="pie"||t==="doughnut"||t==="polarArea"){const w=_ce(t,n),{dimensionKeys:_,metricKeys:R}=hr(e),C=Zee(R,e),E=Yf(C,r),{plugins:P,options:A}=nS((s==null?void 0:s.customVisualCode)||""),I=_[0],F=tS(e,I),L=go((w==null?void 0:w.options)||{},(r==null?void 0:r.options)||{}),j=go(L,(s==null?void 0:s.chartOptions)||{}),X={...j,plugins:{...j.plugins,datalabels:{...(y=j.plugins)==null?void 0:y.datalabels,formatter:(q,Q)=>{var D,G,V,M;return li({number:Number(q),decimalPlaces:((D=s==null?void 0:s.numberAxisFormat)==null?void 0:D.decimalPlaces)||0,useSuffix:!!((G=s==null?void 0:s.numberAxisFormat)!=null&&G.suffix),customSuffix:"",locale:((V=s==null?void 0:s.numberAxisFormat)==null?void 0:V.locale)||"",currency:((M=s==null?void 0:s.numberAxisFormat)==null?void 0:M.currency)||""})}},tooltip:{...(v=j.plugins)==null?void 0:v.tooltip,callbacks:{label:function(q){var ee,K,re,Y;q.dataset.label;const D=q.dataset.data.reduce((J,ie)=>J+ie,0),G=q.parsed,V=li({number:Number(G),decimalPlaces:((ee=s==null?void 0:s.numberAxisFormat)==null?void 0:ee.decimalPlaces)||0,useSuffix:!!((K=s==null?void 0:s.numberAxisFormat)!=null&&K.suffix),customSuffix:"",locale:((re=s==null?void 0:s.numberAxisFormat)==null?void 0:re.locale)||"",currency:((Y=s==null?void 0:s.numberAxisFormat)==null?void 0:Y.currency)||""}),M=(G/D*100).toFixed(2);return V+` (${M}%)`}}}}},U=go(j,X),$=go(U,A);return{type:t,data:{labels:F,datasets:E},options:$,plugins:[t==="doughnut"?{id:"doughnutLabel",beforeDatasetsDraw:function(q,Q,D){var ie,de,he,se;const{ctx:G,data:V}=q;G.save();const M=q.getDatasetMeta(0).data[0].x,ee=q.getDatasetMeta(0).data[0].y,K=ud(Ih()),re=window.getComputedStyle(G.canvas).fontFamily;G.font=`1em ${re}`,G.fontWeight="bolder",G.fillStyle=K,G.textAlign="center",G.textBaseline="middle";const Y=V.datasets[0].data.reduce((ge,ue)=>ge+ue,0),J=li({number:Number(Y),decimalPlaces:((ie=s==null?void 0:s.numberAxisFormat)==null?void 0:ie.decimalPlaces)||0,useSuffix:!!((de=s==null?void 0:s.numberAxisFormat)!=null&&de.suffix),customSuffix:"",locale:((he=s==null?void 0:s.numberAxisFormat)==null?void 0:he.locale)||"",currency:((se=s==null?void 0:s.numberAxisFormat)==null?void 0:se.currency)||""});G.fillText(J,M,ee)}}:"",...P]}}if(t==="radar"){const w=Cce(n);return El({data:e,cfg:w,customCfg:r,cardType:t,preferences:s})}if(t==="bubble"||t==="scatter"){const{metricKeys:w}=hr(e);if(w.length<3){console.log("Bubble charts require 3 numeric columns");return}const _=Xee(e),R=Yf(_,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}}}},E=go(C,(r==null?void 0:r.options)||{});return{type:t,data:{datasets:R},options:E}}return El({data:e,cfg:n,customCfg:r,cardType:t,preferences:s})}function Ece({chart:e,elementIndex:t,datasetIndex:n,cardType:r,cfg:o,apply:i}){const s=ye.getState().theme;if(!o)return;const a=s==="dark"?"rgb(238,238,238,0.2)":"rgb(238,238,238,0.8)";["bar","line","horizontalBar","bubble","scatter"].includes(r)&&Tce(e,t,o,i,a),["pie","doughnut","polarArea"].includes(r)&&kce(e,t,o,i,a),["stackedBar","pyramid"].includes(r)&&Rce({chart:e,elementIndex:t,datasetIndex:n,cfg:o,apply:i,blurColor:a})}function Rce(e){var a,l,c,u;const{chart:t,elementIndex:n,datasetIndex:r,cfg:o,apply:i,blurColor:s}=e;i?(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,y)=>y===n&&p===r?b:s),d.borderColor=(m=d==null?void 0:d.borderColor)==null?void 0:m.map((b,y)=>y===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,y,v,w;d.backgroundColor=new Array(d.data.length).fill((b=(m=(h=o==null?void 0:o.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=(v=(y=o==null?void 0:o.data)==null?void 0:y.datasets)==null?void 0:v[p])==null?void 0:w.borderColor)}),t==null||t.update()}function Tce(e,t,n,r,o){var i,s,a,l;r?(s=(i=e==null?void 0:e.data)==null?void 0:i.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:o),c.borderColor=(d=c==null?void 0:c.borderColor)==null?void 0:d.map((p,h)=>h===t?p:o)}):(l=(a=e==null?void 0:e.data)==null?void 0:a.datasets)==null||l.forEach((c,u)=>{var d,p,h,m,b,y;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((y=(b=(m=n==null?void 0:n.data)==null?void 0:m.datasets)==null?void 0:b[u])==null?void 0:y.borderColor)}),e==null||e.update()}function kce(e,t,n,r,o){var i,s,a,l;r?(s=(i=e==null?void 0:e.data)==null?void 0:i.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:o),c.borderColor=(d=c==null?void 0:c.borderColor)==null?void 0:d.map((p,h)=>h===t?p:o)}):(l=(a=e==null?void 0:e.data)==null?void 0:a.datasets)==null||l.forEach((c,u)=>{var d,p,h,m,b,y,v,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=(y=(b=(m=n==null?void 0:n.data)==null?void 0:m.datasets)==null?void 0:b[u])==null?void 0:y.borderColor),c.backgroundColor=(v=c==null?void 0:c.backgroundColor)==null?void 0:v.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 Pce({card:e,data:t,datasetIndex:n,clickIndex:r,value:o}){var i,s,a,l,c,u;try{if(!t)return;const{keys:d,dimensionKeys:p,metricKeys:h}=hr(t);if(e.type==="map"){const m=d[0],b=((s=(i=o==null?void 0:o.feature)==null?void 0:i.properties)==null?void 0:s.name)||((l=(a=o==null?void 0:o.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:o}]}if(["stackedBar","pyramid"].includes(e.type)){const m=Pb({dataArray:t,groupKey:p[0],pivotKey:p[1],valueKey:h[0]}),b=p[0],y=(u=m[r])==null?void 0:u[b],v=p[1],{metricKeys:w}=hr(m),_=w[n];return[{columnName:b,columnValue:y,metric:h[0],value:o},{columnName:v,columnValue:_,metric:h[0],value:o}]}if(e.type==="bubble"||e.type==="scatter"){const m=p[0],b=o.label;return[{columnName:m,columnValue:b,metric1:h[0],value1:o.x,metric2:h[1],value2:o.y,metric3:h==null?void 0:h[2],value3:o==null?void 0:o.r}]}}catch(d){console.error("Error in getAdhocFilter",d)}}function Oce(e,t){var r,o;if((((r=e.data.datasets)==null?void 0:r.filter(i=>!!i.fill))||[]).length>0){const i=(o=e==null?void 0:e.data.datasets)==null?void 0:o.map(a=>({...a,backgroundColor:[a.backgroundColor].map(l=>{const c=t.createLinearGradient(0,0,0,400);return c.addColorStop(0,l),c.addColorStop(.7,yte("--semaphor-background")),c})}));return{...e,data:{...e.data,datasets:i}}}return e}function M4(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:o,isFetching:i,isError:s}=Sp({queryKey:["topojson",t],queryFn:()=>fetch(t).then(h=>h.json()),enabled:n,staleTime:1/0});return{data:r,isLoading:o,isFetching:i,isError:s}}function Mce(e){var s,a;const[t]=k.useState({id:"",title:"",type:"bar"}),{getCard:n}=Yn(),r=n(e),o=A4(r||t),i={...r,data:((s=o==null?void 0:o.data)==null?void 0:s.records)||[]};return{...o,data:((a=o==null?void 0:o.data)==null?void 0:a.records)||[],card:i}}function A4(e){var X,U,$,B;const{onChartElementClicked:t}=Uo(),[n,r]=k.useState(0);((X=e==null?void 0:e.preferences)==null?void 0:X.filterOnClickColumnIndex)===void 0||(U=e.preferences)==null||U.filterOnClickColumnIndex;const o=ye(W=>W.isVisualEditing),i=ye(W=>W.filteringCards),s=ye(W=>W.selectedSheetId),a=ye(W=>W.selectedLensId);ye(W=>W.selectedCardId),ye(W=>W.dashboard),ye(W=>W.isDashboardEditing),ye(W=>W.themeStyle);const l=ye(W=>W.filterValues),c=k.useRef(l),u=($=e==null?void 0:e.preferences)==null?void 0:$.onClickFilter,{addFilteringCard:d,getCardFrame:p,addOrUpdateFilterValues:h,removeFilterValues:m,removeFilteringCard:b}=Yn(),{data:y,isLoading:v,isFetching:w,isError:_,queryKey:R}=qa(e),{data:C}=M4(e),E=i==null?void 0:i.find(W=>W.id===e.id),P=p(e.id),A=(P==null?void 0:P.cards)||[],I=(A==null?void 0:A.length)==1;let F;y&&y.records&&((B=y.records)==null?void 0:B.length)>0&&e.type!=="custom"&&(F=EE({data:y==null?void 0:y.records,cardType:e.type,cfg:e.cfg,customCfg:e.customCfg,preferences:e.preferences,topoJson:C}));const L=k.useRef({filteringCards:i});k.useEffect(()=>{!(y!=null&&y.records)||v||w||E&&I||o||r(W=>W+1)},[y==null?void 0:y.records,v,w,E,I,o]),k.useEffect(()=>{e.connectionId&&!E&&(c.current=l)},[l,a,e.connectionId,E]),k.useEffect(()=>{var q;E&&(L.current.filteringCards=[...i||[]]),!E&&((q=L.current.filteringCards)==null?void 0:q.find(Q=>Q.id===e.id))&&I&&r(Q=>Q+1)},[E,I,e.id,i]);function j(W,q,Q,D){var M;let G=!1;if(!(y!=null&&y.records))return;const V=Pce({card:e,data:y==null?void 0:y.records,datasetIndex:q,clickIndex:Q,value:D});if(console.log("fieldValues",V),t==null||t(e,V),!!(((M=e==null?void 0:e.preferences)==null?void 0:M.onClickFilter)??[]).length){if(E){const ee=e.id;m(ee),b(e)}else{if(G=!0,!V)return;const ee=[];V.forEach((K,re)=>{const Y=u==null?void 0:u.find(ie=>ie.columnIndex===re);if(!Y)return;const J={filterId:e.id+"-"+K.columnName+"-"+s,connectionId:e==null?void 0:e.connectionId,tableName:e.lastSelectedTable,name:K.columnName,expression:Y.expression,valueType:My(V[Y.columnIndex].columnValue),operation:"=",values:[V[Y.columnIndex].columnValue]};ee.push(J)}),h(ee),d(e)}Ece({chart:W,elementIndex:Q,datasetIndex:q,cardType:e.type,cfg:F,apply:G})}}return{isError:_,isLoading:v,isFetching:w,data:y,visualKey:n,handleDatapointClick:j,cfg:F,queryKey:R}}function is({children:e,containerClassName:t,className:n,text:r,onSave:o,type:i="input"}){const[s,a]=k.useState(!1),[l,c]=k.useState(r),u=ye(h=>h.isDashboardEditing),d=h=>{h.stopPropagation(),u&&a(!0)};function p(){return i==="textarea"?x.jsx("textarea",{className:me("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),o(l))}}):x.jsx("input",{onMouseDown:h=>h.stopPropagation(),type:"text",className:me("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),o(l))}})}return x.jsx("div",{className:me("flex",t),role:"editable",onDoubleClick:d,children:s?p():e})}function D4(e){const{authToken:t}=Uo(),n=OX(t==null?void 0:t.accessToken);function r(){var i,s,a,l,c,u;if((s=(i=e.preferences)==null?void 0:i.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 o(){var i,s,a,l,c,u;if((s=(i=e.preferences)==null?void 0:i.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:o}}function ey({card:e,data:t}){var w,_,R,C,E,P,A,I,F,L,j,X,U,$,B,W;const n=ye(q=>q.actions.setCardTitle),r=ye(q=>q.actions.setCardDescription),o=ye(q=>q.isVisualEditing),i=bo(q=>q.card),s=bo(q=>q.actions.setCard);bo(q=>q.actions.setNumberFormat);const{getCurrency:a,getLocale:l}=D4(e),c=ye(q=>q.selectedSheetId),u=(_=(w=e.preferences)==null?void 0:w.formatNumber)==null?void 0:_.colorRanges,{metricKeys:d}=hr(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(q){o?s({...i,title:q}):n(c,e.id,q)}function y(q){o?s({...i,description:q}):r(c,e.id,q)}const v=h&&h-p!==0?(p-h)/h:null;return x.jsxs("div",{className:"kpi-card flex grow flex-col overflow-auto",children:[x.jsxs(Dy,{className:"grow pb-3",children:[x.jsx(is,{text:o?i.title:e.title,onSave:b,children:x.jsx("div",{className:"flex items-center gap-2",children:x.jsx(Id,{className:"text-base font-medium text-muted-foreground",children:e.title})})}),m&&x.jsxs("div",{className:"flex flex-wrap items-end gap-3 text-foreground",children:[x.jsx("p",{style:{color:YC(p,u)},className:"text-3xl font-semibold",children:li({number:p,decimalPlaces:((P=(E=e.preferences)==null?void 0:E.formatNumber)==null?void 0:P.decimalPlaces)||0,useSuffix:!!((I=(A=e.preferences)==null?void 0:A.formatNumber)!=null&&I.suffix),customSuffix:((L=(F=e.preferences)==null?void 0:F.formatNumber)==null?void 0:L.suffix)||"",locale:l()||"",currency:a()||""})}),h&&x.jsxs("span",{className:"min-w-fit text-base font-normal text-muted-foreground",children:["from  ",li({number:h,decimalPlaces:((X=(j=e.preferences)==null?void 0:j.formatNumber)==null?void 0:X.decimalPlaces)||0,useSuffix:!!(($=(U=e.preferences)==null?void 0:U.formatNumber)!=null&&$.suffix),customSuffix:((W=(B=e.preferences)==null?void 0:B.formatNumber)==null?void 0:W.suffix)||"",locale:l()||"",currency:a()||""})]})]})]}),v&&x.jsxs(Iy,{className:"grow items-start gap-1 pb-4 text-sm",children:[x.jsx(I4,{children:v}),x.jsxs("div",{className:"flex gap-1 text-muted-foreground",children:[v>0?"up ":"down ",x.jsx(is,{text:e.description||"",onSave:y,children:e.description})]})]})]})}function I4({children:e,className:t}){var i,s;const n=ye(a=>a.themeStyle),r=e>0?x.jsx("span",{children:"+"}):x.jsx("span",{children:"-"}),o=`${Math.abs(e*100).toFixed(0)}%`;return x.jsxs("div",{style:{borderRadius:(s=(i=n==null?void 0:n.chart)==null?void 0:i.options)==null?void 0:s.borderRadius},className:me("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,x.jsx("span",{className:"ml-[1px]",children:o})]})}const Ace=["top","right","bottom","left"],ta=Math.min,Dr=Math.max,Yh=Math.round,Tm=Math.floor,ss=e=>({x:e,y:e}),Dce={left:"right",right:"left",bottom:"top",top:"bottom"},Ice={start:"end",end:"start"};function IS(e,t,n){return Dr(e,ta(t,n))}function us(e,t){return typeof e=="function"?e(t):e}function na(e){return e.split("-")[0]}function Bd(e){return e.split("-")[1]}function RE(e){return e==="x"?"y":"x"}function TE(e){return e==="y"?"height":"width"}function Ja(e){return["top","bottom"].includes(na(e))?"y":"x"}function kE(e){return RE(Ja(e))}function Nce(e,t,n){n===void 0&&(n=!1);const r=Bd(e),o=kE(e),i=TE(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=ty(s)),[s,ty(s)]}function Fce(e){const t=ty(e);return[NS(e),t,NS(t)]}function NS(e){return e.replace(/start|end/g,t=>Ice[t])}function Lce(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function $ce(e,t,n,r){const o=Bd(e);let i=Lce(na(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(NS)))),i}function ty(e){return e.replace(/left|right|bottom|top/g,t=>Dce[t])}function jce(e){return{top:0,right:0,bottom:0,left:0,...e}}function N4(e){return typeof e!="number"?jce(e):{top:e,right:e,bottom:e,left:e}}function ny(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function iA(e,t,n){let{reference:r,floating:o}=e;const i=Ja(t),s=kE(t),a=TE(s),l=na(t),c=i==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let h;switch(l){case"top":h={x:u,y:r.y-o.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-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(Bd(t)){case"start":h[s]-=p*(n&&c?-1:1);break;case"end":h[s]+=p*(n&&c?-1:1);break}return h}const zce=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=iA(c,r,l),p=r,h={},m=0;for(let b=0;b<a.length;b++){const{name:y,fn:v}=a[b],{x:w,y:_,data:R,reset:C}=await v({x:u,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:h,rects:c,platform:s,elements:{reference:e,floating:t}});u=w??u,d=_??d,h={...h,[y]:{...h[y],...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:o}):C.rects),{x:u,y:d}=iA(c,p,l)),b=-1)}return{x:u,y:d,placement:p,strategy:o,middlewareData:h}};async function Cd(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:h=0}=us(t,e),m=N4(h),y=a[p?d==="floating"?"reference":"floating":d],v=ny(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),w=d==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),R=await(i.isElement==null?void 0:i.isElement(_))?await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1}:{x:1,y:1},C=ny(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:_,strategy:l}):w);return{top:(v.top-C.top+m.top)/R.y,bottom:(C.bottom-v.bottom+m.bottom)/R.y,left:(v.left-C.left+m.left)/R.x,right:(C.right-v.right+m.right)/R.x}}const Bce=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=us(e,t)||{};if(c==null)return{};const d=N4(u),p={x:n,y:r},h=kE(o),m=TE(h),b=await s.getDimensions(c),y=h==="y",v=y?"top":"left",w=y?"bottom":"right",_=y?"clientHeight":"clientWidth",R=i.reference[m]+i.reference[h]-p[h]-i.floating[m],C=p[h]-i.reference[h],E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let P=E?E[_]:0;(!P||!await(s.isElement==null?void 0:s.isElement(E)))&&(P=a.floating[_]||i.floating[m]);const A=R/2-C/2,I=P/2-b[m]/2-1,F=ta(d[v],I),L=ta(d[w],I),j=F,X=P-b[m]-L,U=P/2-b[m]/2+A,$=IS(j,U,X),B=!l.arrow&&Bd(o)!=null&&U!==$&&i.reference[m]/2-(U<j?F:L)-b[m]/2<0,W=B?U<j?U-j:U-X:0;return{[h]:p[h]+W,data:{[h]:$,centerOffset:U-$-W,...B&&{alignmentOffset:W}},reset:B}}}),Hce=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,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,...y}=us(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=na(o),w=Ja(a),_=na(a)===a,R=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=p||(_||!b?[ty(a)]:Fce(a)),E=m!=="none";!p&&E&&C.push(...$ce(a,b,m,R));const P=[a,...C],A=await Cd(t,y),I=[];let F=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&I.push(A[v]),d){const U=Nce(o,s,R);I.push(A[U[0]],A[U[1]])}if(F=[...F,{placement:o,overflows:I}],!I.every(U=>U<=0)){var L,j;const U=(((L=i.flip)==null?void 0:L.index)||0)+1,$=P[U];if($)return{data:{index:U,overflows:F},reset:{placement:$}};let B=(j=F.filter(W=>W.overflows[0]<=0).sort((W,q)=>W.overflows[1]-q.overflows[1])[0])==null?void 0:j.placement;if(!B)switch(h){case"bestFit":{var X;const W=(X=F.filter(q=>{if(E){const Q=Ja(q.placement);return Q===w||Q==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(Q=>Q>0).reduce((Q,D)=>Q+D,0)]).sort((q,Q)=>q[1]-Q[1])[0])==null?void 0:X[0];W&&(B=W);break}case"initialPlacement":B=a;break}if(o!==B)return{reset:{placement:B}}}return{}}}};function sA(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function aA(e){return Ace.some(t=>e[t]>=0)}const Wce=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=us(e,t);switch(r){case"referenceHidden":{const i=await Cd(t,{...o,elementContext:"reference"}),s=sA(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:aA(s)}}}case"escaped":{const i=await Cd(t,{...o,altBoundary:!0}),s=sA(i,n.floating);return{data:{escapedOffsets:s,escaped:aA(s)}}}default:return{}}}}};async function Vce(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=na(n),a=Bd(n),l=Ja(n)==="y",c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=us(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 Uce=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await Vce(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},Gce=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:y=>{let{x:v,y:w}=y;return{x:v,y:w}}},...l}=us(e,t),c={x:n,y:r},u=await Cd(t,l),d=Ja(na(o)),p=RE(d);let h=c[p],m=c[d];if(i){const y=p==="y"?"top":"left",v=p==="y"?"bottom":"right",w=h+u[y],_=h-u[v];h=IS(w,h,_)}if(s){const y=d==="y"?"top":"left",v=d==="y"?"bottom":"right",w=m+u[y],_=m-u[v];m=IS(w,m,_)}const b=a.fn({...t,[p]:h,[d]:m});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[p]:i,[d]:s}}}}}},qce=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=us(e,t),u={x:n,y:r},d=Ja(o),p=RE(d);let h=u[p],m=u[d];const b=us(a,t),y=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(l){const _=p==="y"?"height":"width",R=i.reference[p]-i.floating[_]+y.mainAxis,C=i.reference[p]+i.reference[_]-y.mainAxis;h<R?h=R:h>C&&(h=C)}if(c){var v,w;const _=p==="y"?"width":"height",R=["top","left"].includes(na(o)),C=i.reference[d]-i.floating[_]+(R&&((v=s.offset)==null?void 0:v[d])||0)+(R?0:y.crossAxis),E=i.reference[d]+i.reference[_]+(R?0:((w=s.offset)==null?void 0:w[d])||0)-(R?y.crossAxis:0);m<C?m=C:m>E&&(m=E)}return{[p]:h,[d]:m}}}},Yce=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=us(e,t),u=await Cd(t,c),d=na(o),p=Bd(o),h=Ja(o)==="y",{width:m,height:b}=i.floating;let y,v;d==="top"||d==="bottom"?(y=d,v=p===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(v=d,y=p==="end"?"top":"bottom");const w=b-u.top-u.bottom,_=m-u.left-u.right,R=ta(b-u[y],w),C=ta(m-u[v],_),E=!t.middlewareData.shift;let P=R,A=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=_),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(P=w),E&&!p){const F=Dr(u.left,0),L=Dr(u.right,0),j=Dr(u.top,0),X=Dr(u.bottom,0);h?A=m-2*(F!==0||L!==0?F+L:Dr(u.left,u.right)):P=b-2*(j!==0||X!==0?j+X:Dr(u.top,u.bottom))}await l({...t,availableWidth:A,availableHeight:P});const I=await s.getDimensions(a.floating);return m!==I.width||b!==I.height?{reset:{rects:!0}}:{}}}};function c0(){return typeof window<"u"}function Hd(e){return F4(e)?(e.nodeName||"").toLowerCase():"#document"}function zo(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ys(e){var t;return(t=(F4(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function F4(e){return c0()?e instanceof Node||e instanceof zo(e).Node:!1}function Lr(e){return c0()?e instanceof Element||e instanceof zo(e).Element:!1}function ds(e){return c0()?e instanceof HTMLElement||e instanceof zo(e).HTMLElement:!1}function lA(e){return!c0()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof zo(e).ShadowRoot}function Mp(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ni(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Kce(e){return["table","td","th"].includes(Hd(e))}function u0(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function PE(e){const t=OE(),n=Lr(e)?Ni(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 Xce(e){let t=el(e);for(;ds(t)&&!Ed(t);){if(PE(t))return t;if(u0(t))return null;t=el(t)}return null}function OE(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ed(e){return["html","body","#document"].includes(Hd(e))}function Ni(e){return zo(e).getComputedStyle(e)}function d0(e){return Lr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function el(e){if(Hd(e)==="html")return e;const t=e.assignedSlot||e.parentNode||lA(e)&&e.host||ys(e);return lA(t)?t.host:t}function L4(e){const t=el(e);return Ed(t)?e.ownerDocument?e.ownerDocument.body:e.body:ds(t)&&Mp(t)?t:L4(t)}function Kh(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=L4(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=zo(o);if(i){const a=FS(s);return t.concat(s,s.visualViewport||[],Mp(o)?o:[],a&&n?Kh(a):[])}return t.concat(o,Kh(o,[],n))}function FS(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function $4(e){const t=Ni(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ds(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Yh(n)!==i||Yh(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function ME(e){return Lr(e)?e:e.contextElement}function Bu(e){const t=ME(e);if(!ds(t))return ss(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=$4(t);let s=(i?Yh(n.width):n.width)/r,a=(i?Yh(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Qce=ss(0);function j4(e){const t=zo(e);return!OE()||!t.visualViewport?Qce:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Zce(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==zo(e)?!1:t}function Oc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=ME(e);let s=ss(1);t&&(r?Lr(r)&&(s=Bu(r)):s=Bu(e));const a=Zce(i,n,r)?j4(i):ss(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const p=zo(i),h=r&&Lr(r)?zo(r):r;let m=p,b=FS(m);for(;b&&r&&h!==m;){const y=Bu(b),v=b.getBoundingClientRect(),w=Ni(b),_=v.left+(b.clientLeft+parseFloat(w.paddingLeft))*y.x,R=v.top+(b.clientTop+parseFloat(w.paddingTop))*y.y;l*=y.x,c*=y.y,u*=y.x,d*=y.y,l+=_,c+=R,m=zo(b),b=FS(m)}}return ny({width:u,height:d,x:l,y:c})}function AE(e,t){const n=d0(e).scrollLeft;return t?t.left+n:Oc(ys(e)).left+n}function z4(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:AE(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function Jce(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=ys(r),a=t?u0(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=ss(1);const u=ss(0),d=ds(r);if((d||!d&&!i)&&((Hd(r)!=="body"||Mp(s))&&(l=d0(r)),ds(r))){const h=Oc(r);c=Bu(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const p=s&&!d&&!i?z4(s,l,!0):ss(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 eue(e){return Array.from(e.getClientRects())}function tue(e){const t=ys(e),n=d0(e),r=e.ownerDocument.body,o=Dr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Dr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+AE(e);const a=-n.scrollTop;return Ni(r).direction==="rtl"&&(s+=Dr(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function nue(e,t){const n=zo(e),r=ys(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const c=OE();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function rue(e,t){const n=Oc(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=ds(e)?Bu(e):ss(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function cA(e,t,n){let r;if(t==="viewport")r=nue(e,n);else if(t==="document")r=tue(ys(e));else if(Lr(t))r=rue(t,n);else{const o=j4(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ny(r)}function B4(e,t){const n=el(e);return n===t||!Lr(n)||Ed(n)?!1:Ni(n).position==="fixed"||B4(n,t)}function oue(e,t){const n=t.get(e);if(n)return n;let r=Kh(e,[],!1).filter(a=>Lr(a)&&Hd(a)!=="body"),o=null;const i=Ni(e).position==="fixed";let s=i?el(e):e;for(;Lr(s)&&!Ed(s);){const a=Ni(s),l=PE(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Mp(s)&&!l&&B4(e,s))?r=r.filter(u=>u!==s):o=a,s=el(s)}return t.set(e,r),r}function iue(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?u0(t)?[]:oue(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const d=cA(t,u,o);return c.top=Dr(d.top,c.top),c.right=ta(d.right,c.right),c.bottom=ta(d.bottom,c.bottom),c.left=Dr(d.left,c.left),c},cA(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function sue(e){const{width:t,height:n}=$4(e);return{width:t,height:n}}function aue(e,t,n){const r=ds(t),o=ys(t),i=n==="fixed",s=Oc(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=ss(0);if(r||!r&&!i)if((Hd(t)!=="body"||Mp(o))&&(a=d0(t)),r){const p=Oc(t,!0,i,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else o&&(l.x=AE(o));const c=o&&!r&&!i?z4(o,a):ss(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 sw(e){return Ni(e).position==="static"}function uA(e,t){if(!ds(e)||Ni(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ys(e)===n&&(n=n.ownerDocument.body),n}function H4(e,t){const n=zo(e);if(u0(e))return n;if(!ds(e)){let o=el(e);for(;o&&!Ed(o);){if(Lr(o)&&!sw(o))return o;o=el(o)}return n}let r=uA(e,t);for(;r&&Kce(r)&&sw(r);)r=uA(r,t);return r&&Ed(r)&&sw(r)&&!PE(r)?n:r||Xce(e)||n}const lue=async function(e){const t=this.getOffsetParent||H4,n=this.getDimensions,r=await n(e.floating);return{reference:aue(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function cue(e){return Ni(e).direction==="rtl"}const uue={convertOffsetParentRelativeRectToViewportRelativeRect:Jce,getDocumentElement:ys,getClippingRect:iue,getOffsetParent:H4,getElementRects:lue,getClientRects:eue,getDimensions:sue,getScale:Bu,isElement:Lr,isRTL:cue};function W4(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function due(e,t){let n=null,r;const o=ys(e);function i(){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),i();const c=e.getBoundingClientRect(),{left:u,top:d,width:p,height:h}=c;if(a||t(),!p||!h)return;const m=Tm(d),b=Tm(o.clientWidth-(u+p)),y=Tm(o.clientHeight-(d+h)),v=Tm(u),_={rootMargin:-m+"px "+-b+"px "+-y+"px "+-v+"px",threshold:Dr(0,ta(1,l))||1};let R=!0;function C(E){const P=E[0].intersectionRatio;if(P!==l){if(!R)return s();P?s(!1,P):r=setTimeout(()=>{s(!1,1e-7)},1e3)}P===1&&!W4(c,e.getBoundingClientRect())&&s(),R=!1}try{n=new IntersectionObserver(C,{..._,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,_)}n.observe(e)}return s(!0),i}function V4(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=ME(e),u=o||i?[...c?Kh(c):[],...Kh(t)]:[];u.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const d=c&&a?due(c,n):null;let p=-1,h=null;s&&(h=new ResizeObserver(v=>{let[w]=v;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?Oc(e):null;l&&y();function y(){const v=Oc(e);b&&!W4(b,v)&&n(),b=v,m=requestAnimationFrame(y)}return n(),()=>{var v;u.forEach(w=>{o&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),d==null||d(),(v=h)==null||v.disconnect(),h=null,l&&cancelAnimationFrame(m)}}const aw=Cd,fue=Uce,hue=Gce,pue=Hce,gue=Yce,mue=Wce,dA=Bce,bue=qce,yue=(e,t,n)=>{const r=new Map,o={platform:uue,...n},i={...o.platform,_c:r};return zce(e,t,{...o,platform:i})};var fb=typeof document<"u"?k.useLayoutEffect:k.useEffect;function ry(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,o;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(!ry(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!ry(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function U4(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function fA(e,t){const n=U4(e);return Math.round(t*n)/n}function lw(e){const t=T.useRef(e);return fb(()=>{t.current=e}),t}function G4(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,d]=T.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=T.useState(r);ry(p,r)||h(r);const[m,b]=T.useState(null),[y,v]=T.useState(null),w=T.useCallback(q=>{q!==E.current&&(E.current=q,b(q))},[]),_=T.useCallback(q=>{q!==P.current&&(P.current=q,v(q))},[]),R=i||m,C=s||y,E=T.useRef(null),P=T.useRef(null),A=T.useRef(u),I=l!=null,F=lw(l),L=lw(o),j=lw(c),X=T.useCallback(()=>{if(!E.current||!P.current)return;const q={placement:t,strategy:n,middleware:p};L.current&&(q.platform=L.current),yue(E.current,P.current,q).then(Q=>{const D={...Q,isPositioned:j.current!==!1};U.current&&!ry(A.current,D)&&(A.current=D,wc.flushSync(()=>{d(D)}))})},[p,t,n,L,j]);fb(()=>{c===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,d(q=>({...q,isPositioned:!1})))},[c]);const U=T.useRef(!1);fb(()=>(U.current=!0,()=>{U.current=!1}),[]),fb(()=>{if(R&&(E.current=R),C&&(P.current=C),R&&C){if(F.current)return F.current(R,C,X);X()}},[R,C,X,F,I]);const $=T.useMemo(()=>({reference:E,floating:P,setReference:w,setFloating:_}),[w,_]),B=T.useMemo(()=>({reference:R,floating:C}),[R,C]),W=T.useMemo(()=>{const q={position:n,left:0,top:0};if(!B.floating)return q;const Q=fA(B.floating,u.x),D=fA(B.floating,u.y);return a?{...q,transform:"translate("+Q+"px, "+D+"px)",...U4(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Q,top:D}},[n,a,B.floating,u.x,u.y]);return T.useMemo(()=>({...u,update:X,refs:$,elements:B,floatingStyles:W}),[u,X,$,B,W])}const vue=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?dA({element:r.current,padding:o}).fn(n):{}:r?dA({element:r,padding:o}).fn(n):{}}}},DE=(e,t)=>({...fue(e),options:[e,t]}),q4=(e,t)=>({...hue(e),options:[e,t]}),xue=(e,t)=>({...bue(e),options:[e,t]}),Y4=(e,t)=>({...pue(e),options:[e,t]}),K4=(e,t)=>({...gue(e),options:[e,t]}),wue=(e,t)=>({...mue(e),options:[e,t]}),Sue=(e,t)=>({...vue(e),options:[e,t]});var _ue="Arrow",X4=T.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return x.jsx(je.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:x.jsx("polygon",{points:"0,0 30,0 15,10"})})});X4.displayName=_ue;var Cue=X4;function f0(e){const[t,n]=T.useState(void 0);return Cr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.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 IE="Popper",[Q4,vs]=lr(IE),[Eue,Z4]=Q4(IE),J4=e=>{const{__scopePopper:t,children:n}=e,[r,o]=T.useState(null);return x.jsx(Eue,{scope:t,anchor:r,onAnchorChange:o,children:n})};J4.displayName=IE;var e3="PopperAnchor",t3=T.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=Z4(e3,n),s=T.useRef(null),a=dt(t,s);return T.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:x.jsx(je.div,{...o,ref:a})});t3.displayName=e3;var NE="PopperContent",[Rue,Tue]=Q4(NE),n3=T.forwardRef((e,t)=>{var Y,J,ie,de,he,se;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="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,y=Z4(NE,n),[v,w]=T.useState(null),_=dt(t,ge=>w(ge)),[R,C]=T.useState(null),E=f0(R),P=(E==null?void 0:E.width)??0,A=(E==null?void 0:E.height)??0,I=r+(i!=="center"?"-"+i:""),F=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},L=Array.isArray(c)?c:[c],j=L.length>0,X={padding:F,boundary:L.filter(Pue),altBoundary:j},{refs:U,floatingStyles:$,placement:B,isPositioned:W,middlewareData:q}=G4({strategy:"fixed",placement:I,whileElementsMounted:(...ge)=>V4(...ge,{animationFrame:h==="always"}),elements:{reference:y.anchor},middleware:[DE({mainAxis:o+A,alignmentAxis:s}),l&&q4({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?xue():void 0,...X}),l&&Y4({...X}),K4({...X,apply:({elements:ge,rects:ue,availableWidth:Ce,availableHeight:ke})=>{const{width:Ne,height:Oe}=ue.reference,Le=ge.floating.style;Le.setProperty("--radix-popper-available-width",`${Ce}px`),Le.setProperty("--radix-popper-available-height",`${ke}px`),Le.setProperty("--radix-popper-anchor-width",`${Ne}px`),Le.setProperty("--radix-popper-anchor-height",`${Oe}px`)}}),R&&Sue({element:R,padding:a}),Oue({arrowWidth:P,arrowHeight:A}),p&&wue({strategy:"referenceHidden",...X})]}),[Q,D]=i3(B),G=ir(m);Cr(()=>{W&&(G==null||G())},[W,G]);const V=(Y=q.arrow)==null?void 0:Y.x,M=(J=q.arrow)==null?void 0:J.y,ee=((ie=q.arrow)==null?void 0:ie.centerOffset)!==0,[K,re]=T.useState();return Cr(()=>{v&&re(window.getComputedStyle(v).zIndex)},[v]),x.jsx("div",{ref:U.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:W?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[(de=q.transformOrigin)==null?void 0:de.x,(he=q.transformOrigin)==null?void 0:he.y].join(" "),...((se=q.hide)==null?void 0:se.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:x.jsx(Rue,{scope:n,placedSide:Q,onArrowChange:C,arrowX:V,arrowY:M,shouldHideArrow:ee,children:x.jsx(je.div,{"data-side":Q,"data-align":D,...b,ref:_,style:{...b.style,animation:W?void 0:"none"}})})})});n3.displayName=NE;var r3="PopperArrow",kue={top:"bottom",right:"left",bottom:"top",left:"right"},o3=T.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=Tue(r3,r),s=kue[i.placedSide];return x.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:x.jsx(Cue,{...o,ref:n,style:{...o.style,display:"block"}})})});o3.displayName=r3;function Pue(e){return e!==null}var Oue=e=>({name:"transformOrigin",options:e,fn(t){var y,v,w;const{placement:n,rects:r,middlewareData:o}=t,s=((y=o.arrow)==null?void 0:y.centerOffset)!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[c,u]=i3(n),d={start:"0%",center:"50%",end:"100%"}[u],p=(((v=o.arrow)==null?void 0:v.x)??0)+a/2,h=(((w=o.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 i3(e){const[t,n="center"]=e.split("-");return[t,n]}var Ap=J4,Wd=t3,Dp=n3,Ip=o3,Mue="Portal",Np=T.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,i]=T.useState(!1);Cr(()=>i(!0),[]);const s=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?Ir.createPortal(x.jsx(je.div,{...r,ref:t}),s):null});Np.displayName=Mue;function Aue(e,t=globalThis==null?void 0:globalThis.document){const n=ir(e);T.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Due="DismissableLayer",LS="dismissableLayer.update",Iue="dismissableLayer.pointerDownOutside",Nue="dismissableLayer.focusOutside",hA,s3=T.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Wc=T.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,c=T.useContext(s3),[u,d]=T.useState(null),p=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=T.useState({}),m=dt(t,P=>d(P)),b=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),v=b.indexOf(y),w=u?b.indexOf(u):-1,_=c.layersWithOutsidePointerEventsDisabled.size>0,R=w>=v,C=$ue(P=>{const A=P.target,I=[...c.branches].some(F=>F.contains(A));!R||I||(o==null||o(P),s==null||s(P),P.defaultPrevented||a==null||a())},p),E=jue(P=>{const A=P.target;[...c.branches].some(F=>F.contains(A))||(i==null||i(P),s==null||s(P),P.defaultPrevented||a==null||a())},p);return Aue(P=>{w===c.layers.size-1&&(r==null||r(P),!P.defaultPrevented&&a&&(P.preventDefault(),a()))},p),T.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(hA=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),pA(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=hA)}},[u,p,n,c]),T.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),pA())},[u,c]),T.useEffect(()=>{const P=()=>h({});return document.addEventListener(LS,P),()=>document.removeEventListener(LS,P)},[]),x.jsx(je.div,{...l,ref:m,style:{pointerEvents:_?R?"auto":"none":void 0,...e.style},onFocusCapture:Te(e.onFocusCapture,E.onFocusCapture),onBlurCapture:Te(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Te(e.onPointerDownCapture,C.onPointerDownCapture)})});Wc.displayName=Due;var Fue="DismissableLayerBranch",Lue=T.forwardRef((e,t)=>{const n=T.useContext(s3),r=T.useRef(null),o=dt(t,r);return T.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),x.jsx(je.div,{...e,ref:o})});Lue.displayName=Fue;function $ue(e,t=globalThis==null?void 0:globalThis.document){const n=ir(e),r=T.useRef(!1),o=T.useRef(()=>{});return T.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){a3(Iue,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function jue(e,t=globalThis==null?void 0:globalThis.document){const n=ir(e),r=T.useRef(!1);return T.useEffect(()=>{const o=i=>{i.target&&!r.current&&a3(Nue,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function pA(){const e=new CustomEvent(LS);document.dispatchEvent(e)}function a3(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?KN(o,i):o.dispatchEvent(i)}var cw,FE="HoverCard",[l3,jAe]=lr(FE,[vs]),h0=vs(),[zue,LE]=l3(FE),c3=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:o,onOpenChange:i,openDelay:s=700,closeDelay:a=300}=e,l=h0(t),c=T.useRef(0),u=T.useRef(0),d=T.useRef(!1),p=T.useRef(!1),[h=!1,m]=$r({prop:r,defaultProp:o,onChange:i}),b=T.useCallback(()=>{clearTimeout(u.current),c.current=window.setTimeout(()=>m(!0),s)},[s,m]),y=T.useCallback(()=>{clearTimeout(c.current),!d.current&&!p.current&&(u.current=window.setTimeout(()=>m(!1),a))},[a,m]),v=T.useCallback(()=>m(!1),[m]);return T.useEffect(()=>()=>{clearTimeout(c.current),clearTimeout(u.current)},[]),x.jsx(zue,{scope:t,open:h,onOpenChange:m,onOpen:b,onClose:y,onDismiss:v,hasSelectionRef:d,isPointerDownOnContentRef:p,children:x.jsx(Ap,{...l,children:n})})};c3.displayName=FE;var u3="HoverCardTrigger",d3=T.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=LE(u3,n),i=h0(n);return x.jsx(Wd,{asChild:!0,...i,children:x.jsx(je.a,{"data-state":o.open?"open":"closed",...r,ref:t,onPointerEnter:Te(e.onPointerEnter,iy(o.onOpen)),onPointerLeave:Te(e.onPointerLeave,iy(o.onClose)),onFocus:Te(e.onFocus,o.onOpen),onBlur:Te(e.onBlur,o.onClose),onTouchStart:Te(e.onTouchStart,s=>s.preventDefault())})})});d3.displayName=u3;var Bue="HoverCardPortal",[zAe,Hue]=l3(Bue,{forceMount:void 0}),oy="HoverCardContent",f3=T.forwardRef((e,t)=>{const n=Hue(oy,e.__scopeHoverCard),{forceMount:r=n.forceMount,...o}=e,i=LE(oy,e.__scopeHoverCard);return x.jsx(er,{present:r||i.open,children:x.jsx(Wue,{"data-state":i.open?"open":"closed",...o,onPointerEnter:Te(e.onPointerEnter,iy(i.onOpen)),onPointerLeave:Te(e.onPointerLeave,iy(i.onClose)),ref:t})})});f3.displayName=oy;var Wue=T.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,...a}=e,l=LE(oy,n),c=h0(n),u=T.useRef(null),d=dt(t,u),[p,h]=T.useState(!1);return T.useEffect(()=>{if(p){const m=document.body;return cw=m.style.userSelect||m.style.webkitUserSelect,m.style.userSelect="none",m.style.webkitUserSelect="none",()=>{m.style.userSelect=cw,m.style.webkitUserSelect=cw}}},[p]),T.useEffect(()=>{if(u.current){const m=()=>{h(!1),l.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var y;((y=document.getSelection())==null?void 0:y.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]),T.useEffect(()=>{u.current&&Gue(u.current).forEach(b=>b.setAttribute("tabindex","-1"))}),x.jsx(Wc,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:s,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:Te(i,m=>{m.preventDefault()}),onDismiss:l.onDismiss,children:x.jsx(Dp,{...c,...a,onPointerDown:Te(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)"}})})}),Vue="HoverCardArrow",Uue=T.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=h0(n);return x.jsx(Ip,{...o,...r,ref:t})});Uue.displayName=Vue;function iy(e){return t=>t.pointerType==="touch"?void 0:e()}function Gue(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}var que=c3,Yue=d3,h3=f3;const Fp=que,Lp=Yue,Vd=T.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>x.jsx(h3,{ref:o,align:t,sideOffset:n,className:me("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}));Vd.displayName=h3.displayName;function p3({card:e}){const{setCardInfo:t}=Yn();return x.jsxs(Fp,{openDelay:0,children:[x.jsx(Lp,{children:x.jsx(gF,{className:"size-4 text-muted-foreground/40"})}),x.jsx(Vd,{align:"start",className:"w-[300px]",onMouseDown:n=>n.stopPropagation(),children:x.jsx(is,{type:"textarea",text:e.info||"",onSave:n=>t(e.id,n),children:x.jsx("p",{className:"text-sm text-muted-foreground",children:e.info||"Double-click to add info"})})})]})}function Kue({card:e,renderFilterInfo:t}){var m,b,y,v,w,_,R,C,E,P,A,I,F,L,j,X;ye(U=>U.themeStyle);const{data:n,isLoading:r}=qa(e),o=(n==null?void 0:n.records)||[],i=ye(U=>U.isDashboardEditing),{getCurrency:s,getLocale:a}=D4(e),l=(b=(m=e.preferences)==null?void 0:m.formatNumber)==null?void 0:b.colorRanges,{metricKeys:c}=hr(o||[]),u=(y=o==null?void 0:o[0])==null?void 0:y[c==null?void 0:c[0]],d=(v=o==null?void 0:o[0])==null?void 0:v[c==null?void 0:c[1]],p=(o==null?void 0:o.length)>0,h=d&&d-u!==0?(u-d)/d:null;return x.jsx("div",{className:"flex min-w-fit grow flex-col overflow-auto",children:x.jsxs("div",{className:"grow",children:[p?x.jsx("div",{className:"",children:x.jsxs("div",{className:me("flex items-end gap-1.5",{"animate-pulse":r}),children:[x.jsx("p",{style:{color:YC(u,l)},className:"text-3xl font-semibold",children:li({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:((P=(E=e.preferences)==null?void 0:E.formatNumber)==null?void 0:P.suffix)||"",locale:a()||"",currency:s()||""})}),h&&x.jsxs("div",{className:"flex items-end gap-1",children:[x.jsx(I4,{className:"",children:h}),d&&x.jsx("div",{className:"ml-0.5 mr-1 min-w-fit text-sm font-normal text-muted-foreground",children:`from ${li({number:d,decimalPlaces:((I=(A=e.preferences)==null?void 0:A.formatNumber)==null?void 0:I.decimalPlaces)||0,useSuffix:!!((L=(F=e.preferences)==null?void 0:F.formatNumber)!=null&&L.suffix),customSuffix:((X=(j=e.preferences)==null?void 0:j.formatNumber)==null?void 0:X.suffix)||"",locale:a()||"",currency:s()||""})}`})]})]})}):x.jsx("div",{className:"flex h-9 items-center justify-center"}),x.jsxs("div",{className:"flex items-center gap-3",children:[x.jsxs(Id,{className:"flex items-center gap-2 text-base font-medium text-muted-foreground",children:[e.title,(i||e.info)&&x.jsx(p3,{card:e})]}),t==null?void 0:t()]})]})})}var Xue="VisuallyHidden",$E=T.forwardRef((e,t)=>x.jsx(je.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}}));$E.displayName=Xue;var Que=$E,[p0,BAe]=lr("Tooltip",[vs]),g0=vs(),g3="TooltipProvider",Zue=700,$S="tooltip.open",[Jue,jE]=p0(g3),m3=e=>{const{__scopeTooltip:t,delayDuration:n=Zue,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,[s,a]=T.useState(!0),l=T.useRef(!1),c=T.useRef(0);return T.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),x.jsx(Jue,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:T.useCallback(()=>{window.clearTimeout(c.current),a(!1)},[]),onClose:T.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:T.useCallback(u=>{l.current=u},[]),disableHoverableContent:o,children:i})};m3.displayName=g3;var m0="Tooltip",[ede,b0]=p0(m0),b3=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=jE(m0,e.__scopeTooltip),c=g0(t),[u,d]=T.useState(null),p=Jn(),h=T.useRef(0),m=s??l.disableHoverableContent,b=a??l.delayDuration,y=T.useRef(!1),[v=!1,w]=$r({prop:r,defaultProp:o,onChange:P=>{P?(l.onOpen(),document.dispatchEvent(new CustomEvent($S))):l.onClose(),i==null||i(P)}}),_=T.useMemo(()=>v?y.current?"delayed-open":"instant-open":"closed",[v]),R=T.useCallback(()=>{window.clearTimeout(h.current),h.current=0,y.current=!1,w(!0)},[w]),C=T.useCallback(()=>{window.clearTimeout(h.current),h.current=0,w(!1)},[w]),E=T.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{y.current=!0,w(!0),h.current=0},b)},[b,w]);return T.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),x.jsx(Ap,{...c,children:x.jsx(ede,{scope:t,contentId:p,open:v,stateAttribute:_,trigger:u,onTriggerChange:d,onTriggerEnter:T.useCallback(()=>{l.isOpenDelayed?E():R()},[l.isOpenDelayed,E,R]),onTriggerLeave:T.useCallback(()=>{m?C():(window.clearTimeout(h.current),h.current=0)},[C,m]),onOpen:R,onClose:C,disableHoverableContent:m,children:n})})};b3.displayName=m0;var jS="TooltipTrigger",zE=T.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=b0(jS,n),i=jE(jS,n),s=g0(n),a=T.useRef(null),l=dt(t,a,o.onTriggerChange),c=T.useRef(!1),u=T.useRef(!1),d=T.useCallback(()=>c.current=!1,[]);return T.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),x.jsx(Wd,{asChild:!0,...s,children:x.jsx(je.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:Te(e.onPointerMove,p=>{p.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:Te(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:Te(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Te(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:Te(e.onBlur,o.onClose),onClick:Te(e.onClick,o.onClose)})})});zE.displayName=jS;var tde="TooltipPortal",[HAe,nde]=p0(tde,{forceMount:void 0}),Rd="TooltipContent",y3=T.forwardRef((e,t)=>{const n=nde(Rd,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=b0(Rd,e.__scopeTooltip);return x.jsx(er,{present:r||s.open,children:s.disableHoverableContent?x.jsx(v3,{side:o,...i,ref:t}):x.jsx(rde,{side:o,...i,ref:t})})}),rde=T.forwardRef((e,t)=>{const n=b0(Rd,e.__scopeTooltip),r=jE(Rd,e.__scopeTooltip),o=T.useRef(null),i=dt(t,o),[s,a]=T.useState(null),{trigger:l,onClose:c}=n,u=o.current,{onPointerInTransitChange:d}=r,p=T.useCallback(()=>{a(null),d(!1)},[d]),h=T.useCallback((m,b)=>{const y=m.currentTarget,v={x:m.clientX,y:m.clientY},w=ade(v,y.getBoundingClientRect()),_=lde(v,w),R=cde(b.getBoundingClientRect()),C=dde([..._,...R]);a(C),d(!0)},[d]);return T.useEffect(()=>()=>p(),[p]),T.useEffect(()=>{if(l&&u){const m=y=>h(y,u),b=y=>h(y,l);return l.addEventListener("pointerleave",m),u.addEventListener("pointerleave",b),()=>{l.removeEventListener("pointerleave",m),u.removeEventListener("pointerleave",b)}}},[l,u,h,p]),T.useEffect(()=>{if(s){const m=b=>{const y=b.target,v={x:b.clientX,y:b.clientY},w=(l==null?void 0:l.contains(y))||(u==null?void 0:u.contains(y)),_=!ude(v,s);w?p():_&&(p(),c())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[l,u,s,c,p]),x.jsx(v3,{...e,ref:i})}),[ode,ide]=p0(m0,{isInside:!1}),v3=T.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=b0(Rd,n),c=g0(n),{onClose:u}=l;return T.useEffect(()=>(document.addEventListener($S,u),()=>document.removeEventListener($S,u)),[u]),T.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]),x.jsx(Wc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:x.jsxs(Dp,{"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:[x.jsx(dC,{children:r}),x.jsx(ode,{scope:n,isInside:!0,children:x.jsx(Que,{id:l.contentId,role:"tooltip",children:o||r})})]})})});y3.displayName=Rd;var x3="TooltipArrow",sde=T.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=g0(n);return ide(x3,n).isInside?null:x.jsx(Ip,{...o,...r,ref:t})});sde.displayName=x3;function ade(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function lde(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 cde(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function ude(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i].x,l=t[i].y,c=t[s].x,u=t[s].y;l>r!=u>r&&n<(c-a)*(r-l)/(u-l)+a&&(o=!o)}return o}function dde(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),fde(t)}function fde(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}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 hde=m3,pde=b3,gde=zE,w3=y3;const mde=hde,S3=pde,_3=gde,BE=T.forwardRef(({className:e,sideOffset:t=4,...n},r)=>x.jsx(w3,{ref:r,sideOffset:t,className:me("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}));BE.displayName=w3.displayName;/*! @license DOMPurify 3.2.4 | (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.4/LICENSE */const{entries:C3,setPrototypeOf:gA,isFrozen:bde,getPrototypeOf:yde,getOwnPropertyDescriptor:vde}=Object;let{freeze:Jr,seal:hi,create:E3}=Object,{apply:zS,construct:BS}=typeof Reflect<"u"&&Reflect;Jr||(Jr=function(t){return t});hi||(hi=function(t){return t});zS||(zS=function(t,n,r){return t.apply(n,r)});BS||(BS=function(t,n){return new t(...n)});const km=eo(Array.prototype.forEach),xde=eo(Array.prototype.lastIndexOf),mA=eo(Array.prototype.pop),Tf=eo(Array.prototype.push),wde=eo(Array.prototype.splice),hb=eo(String.prototype.toLowerCase),uw=eo(String.prototype.toString),bA=eo(String.prototype.match),kf=eo(String.prototype.replace),Sde=eo(String.prototype.indexOf),_de=eo(String.prototype.trim),_i=eo(Object.prototype.hasOwnProperty),Vr=eo(RegExp.prototype.test),Pf=Cde(TypeError);function eo(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return zS(e,t,r)}}function Cde(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return BS(e,n)}}function Ft(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:hb;gA&&gA(e,null);let r=t.length;for(;r--;){let o=t[r];if(typeof o=="string"){const i=n(o);i!==o&&(bde(t)||(t[r]=i),o=i)}e[o]=!0}return e}function Ede(e){for(let t=0;t<e.length;t++)_i(e,t)||(e[t]=null);return e}function Nl(e){const t=E3(null);for(const[n,r]of C3(e))_i(e,n)&&(Array.isArray(r)?t[n]=Ede(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=Nl(r):t[n]=r);return t}function Of(e,t){for(;e!==null;){const r=vde(e,t);if(r){if(r.get)return eo(r.get);if(typeof r.value=="function")return eo(r.value)}e=yde(e)}function n(){return null}return n}const yA=Jr(["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"]),dw=Jr(["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"]),fw=Jr(["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"]),Rde=Jr(["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"]),hw=Jr(["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"]),Tde=Jr(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),vA=Jr(["#text"]),xA=Jr(["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"]),pw=Jr(["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"]),wA=Jr(["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"]),Pm=Jr(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),kde=hi(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Pde=hi(/<%[\w\W]*|[\w\W]*%>/gm),Ode=hi(/\$\{[\w\W]*/gm),Mde=hi(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ade=hi(/^aria-[\-\w]+$/),R3=hi(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Dde=hi(/^(?:\w+script|data):/i),Ide=hi(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),T3=hi(/^html$/i),Nde=hi(/^[a-z][.\w]*(-[.\w]+)+$/i);var SA=Object.freeze({__proto__:null,ARIA_ATTR:Ade,ATTR_WHITESPACE:Ide,CUSTOM_ELEMENT:Nde,DATA_ATTR:Mde,DOCTYPE_NAME:T3,ERB_EXPR:Pde,IS_ALLOWED_URI:R3,IS_SCRIPT_OR_DATA:Dde,MUSTACHE_EXPR:kde,TMPLIT_EXPR:Ode});const Mf={element:1,text:3,progressingInstruction:7,comment:8,document:9},Fde=function(){return typeof window>"u"?null:window},Lde=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const o="data-tt-policy-suffix";n&&n.hasAttribute(o)&&(r=n.getAttribute(o));const i="dompurify"+(r?"#"+r:"");try{return t.createPolicy(i,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},_A=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function k3(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Fde();const t=Fe=>k3(Fe);if(t.version="3.2.4",t.removed=[],!e||!e.document||e.document.nodeType!==Mf.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const r=n,o=r.currentScript,{DocumentFragment:i,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=Of(m,"cloneNode"),y=Of(m,"remove"),v=Of(m,"nextSibling"),w=Of(m,"childNodes"),_=Of(m,"parentNode");if(typeof s=="function"){const Fe=n.createElement("template");Fe.content&&Fe.content.ownerDocument&&(n=Fe.content.ownerDocument)}let R,C="";const{implementation:E,createNodeIterator:P,createDocumentFragment:A,getElementsByTagName:I}=n,{importNode:F}=r;let L=_A();t.isSupported=typeof C3=="function"&&typeof _=="function"&&E&&E.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:j,ERB_EXPR:X,TMPLIT_EXPR:U,DATA_ATTR:$,ARIA_ATTR:B,IS_SCRIPT_OR_DATA:W,ATTR_WHITESPACE:q,CUSTOM_ELEMENT:Q}=SA;let{IS_ALLOWED_URI:D}=SA,G=null;const V=Ft({},[...yA,...dw,...fw,...hw,...vA]);let M=null;const ee=Ft({},[...xA,...pw,...wA,...Pm]);let K=Object.seal(E3(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}})),re=null,Y=null,J=!0,ie=!0,de=!1,he=!0,se=!1,ge=!0,ue=!1,Ce=!1,ke=!1,Ne=!1,Oe=!1,Le=!1,Je=!0,it=!1;const ln="user-content-";let vt=!0,$n=!1,Ct={},fe=null;const _e=Ft({},["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 Ve=Ft({},["audio","video","img","source","image","track"]);let rt=null;const An=Ft({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ue="http://www.w3.org/1998/Math/MathML",lt="http://www.w3.org/2000/svg",Ge="http://www.w3.org/1999/xhtml";let tn=Ge,gt=!1,In=null;const $t=Ft({},[Ue,lt,Ge],uw);let Nn=Ft({},["mi","mo","mn","ms","mtext"]),st=Ft({},["annotation-xml"]);const qo=Ft({},["title","style","font","a","script"]);let cr=null;const br=["application/xhtml+xml","text/html"],mi="text/html";let $e=null,Pt=null;const Xt=n.createElement("form"),tr=function(ne){return ne instanceof RegExp||ne instanceof Function},nr=function(){let ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Pt&&Pt===ne)){if((!ne||typeof ne!="object")&&(ne={}),ne=Nl(ne),cr=br.indexOf(ne.PARSER_MEDIA_TYPE)===-1?mi:ne.PARSER_MEDIA_TYPE,$e=cr==="application/xhtml+xml"?uw:hb,G=_i(ne,"ALLOWED_TAGS")?Ft({},ne.ALLOWED_TAGS,$e):V,M=_i(ne,"ALLOWED_ATTR")?Ft({},ne.ALLOWED_ATTR,$e):ee,In=_i(ne,"ALLOWED_NAMESPACES")?Ft({},ne.ALLOWED_NAMESPACES,uw):$t,rt=_i(ne,"ADD_URI_SAFE_ATTR")?Ft(Nl(An),ne.ADD_URI_SAFE_ATTR,$e):An,He=_i(ne,"ADD_DATA_URI_TAGS")?Ft(Nl(Ve),ne.ADD_DATA_URI_TAGS,$e):Ve,fe=_i(ne,"FORBID_CONTENTS")?Ft({},ne.FORBID_CONTENTS,$e):_e,re=_i(ne,"FORBID_TAGS")?Ft({},ne.FORBID_TAGS,$e):{},Y=_i(ne,"FORBID_ATTR")?Ft({},ne.FORBID_ATTR,$e):{},Ct=_i(ne,"USE_PROFILES")?ne.USE_PROFILES:!1,J=ne.ALLOW_ARIA_ATTR!==!1,ie=ne.ALLOW_DATA_ATTR!==!1,de=ne.ALLOW_UNKNOWN_PROTOCOLS||!1,he=ne.ALLOW_SELF_CLOSE_IN_ATTR!==!1,se=ne.SAFE_FOR_TEMPLATES||!1,ge=ne.SAFE_FOR_XML!==!1,ue=ne.WHOLE_DOCUMENT||!1,Ne=ne.RETURN_DOM||!1,Oe=ne.RETURN_DOM_FRAGMENT||!1,Le=ne.RETURN_TRUSTED_TYPE||!1,ke=ne.FORCE_BODY||!1,Je=ne.SANITIZE_DOM!==!1,it=ne.SANITIZE_NAMED_PROPS||!1,vt=ne.KEEP_CONTENT!==!1,$n=ne.IN_PLACE||!1,D=ne.ALLOWED_URI_REGEXP||R3,tn=ne.NAMESPACE||Ge,Nn=ne.MATHML_TEXT_INTEGRATION_POINTS||Nn,st=ne.HTML_INTEGRATION_POINTS||st,K=ne.CUSTOM_ELEMENT_HANDLING||{},ne.CUSTOM_ELEMENT_HANDLING&&tr(ne.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(K.tagNameCheck=ne.CUSTOM_ELEMENT_HANDLING.tagNameCheck),ne.CUSTOM_ELEMENT_HANDLING&&tr(ne.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(K.attributeNameCheck=ne.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),ne.CUSTOM_ELEMENT_HANDLING&&typeof ne.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(K.allowCustomizedBuiltInElements=ne.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),se&&(ie=!1),Oe&&(Ne=!0),Ct&&(G=Ft({},vA),M=[],Ct.html===!0&&(Ft(G,yA),Ft(M,xA)),Ct.svg===!0&&(Ft(G,dw),Ft(M,pw),Ft(M,Pm)),Ct.svgFilters===!0&&(Ft(G,fw),Ft(M,pw),Ft(M,Pm)),Ct.mathMl===!0&&(Ft(G,hw),Ft(M,wA),Ft(M,Pm))),ne.ADD_TAGS&&(G===V&&(G=Nl(G)),Ft(G,ne.ADD_TAGS,$e)),ne.ADD_ATTR&&(M===ee&&(M=Nl(M)),Ft(M,ne.ADD_ATTR,$e)),ne.ADD_URI_SAFE_ATTR&&Ft(rt,ne.ADD_URI_SAFE_ATTR,$e),ne.FORBID_CONTENTS&&(fe===_e&&(fe=Nl(fe)),Ft(fe,ne.FORBID_CONTENTS,$e)),vt&&(G["#text"]=!0),ue&&Ft(G,["html","head","body"]),G.table&&(Ft(G,["tbody"]),delete re.tbody),ne.TRUSTED_TYPES_POLICY){if(typeof ne.TRUSTED_TYPES_POLICY.createHTML!="function")throw Pf('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof ne.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Pf('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');R=ne.TRUSTED_TYPES_POLICY,C=R.createHTML("")}else R===void 0&&(R=Lde(h,o)),R!==null&&typeof C=="string"&&(C=R.createHTML(""));Jr&&Jr(ne),Pt=ne}},zr=Ft({},[...dw,...fw,...Rde]),yr=Ft({},[...hw,...Tde]),ur=function(ne){let Se=_(ne);(!Se||!Se.tagName)&&(Se={namespaceURI:tn,tagName:"template"});const De=hb(ne.tagName),jt=hb(Se.tagName);return In[ne.namespaceURI]?ne.namespaceURI===lt?Se.namespaceURI===Ge?De==="svg":Se.namespaceURI===Ue?De==="svg"&&(jt==="annotation-xml"||Nn[jt]):!!zr[De]:ne.namespaceURI===Ue?Se.namespaceURI===Ge?De==="math":Se.namespaceURI===lt?De==="math"&&st[jt]:!!yr[De]:ne.namespaceURI===Ge?Se.namespaceURI===lt&&!st[jt]||Se.namespaceURI===Ue&&!Nn[jt]?!1:!yr[De]&&(qo[De]||!zr[De]):!!(cr==="application/xhtml+xml"&&In[ne.namespaceURI]):!1},_n=function(ne){Tf(t.removed,{element:ne});try{_(ne).removeChild(ne)}catch{y(ne)}},la=function(ne,Se){try{Tf(t.removed,{attribute:Se.getAttributeNode(ne),from:Se})}catch{Tf(t.removed,{attribute:null,from:Se})}if(Se.removeAttribute(ne),ne==="is")if(Ne||Oe)try{_n(Se)}catch{}else try{Se.setAttribute(ne,"")}catch{}},qc=function(ne){let Se=null,De=null;if(ke)ne="<remove></remove>"+ne;else{const It=bA(ne,/^[\r\n\t ]+/);De=It&&It[0]}cr==="application/xhtml+xml"&&tn===Ge&&(ne='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+ne+"</body></html>");const jt=R?R.createHTML(ne):ne;if(tn===Ge)try{Se=new p().parseFromString(jt,cr)}catch{}if(!Se||!Se.documentElement){Se=E.createDocument(tn,"template",null);try{Se.documentElement.innerHTML=gt?C:jt}catch{}}const yn=Se.body||Se.documentElement;return ne&&De&&yn.insertBefore(n.createTextNode(De),yn.childNodes[0]||null),tn===Ge?I.call(Se,ue?"html":"body")[0]:ue?Se.documentElement:yn},Yc=function(ne){return P.call(ne.ownerDocument||ne,ne,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},te=function(ne){return ne instanceof d&&(typeof ne.nodeName!="string"||typeof ne.textContent!="string"||typeof ne.removeChild!="function"||!(ne.attributes instanceof u)||typeof ne.removeAttribute!="function"||typeof ne.setAttribute!="function"||typeof ne.namespaceURI!="string"||typeof ne.insertBefore!="function"||typeof ne.hasChildNodes!="function")},Re=function(ne){return typeof a=="function"&&ne instanceof a};function Ae(Fe,ne,Se){km(Fe,De=>{De.call(t,ne,Se,Pt)})}const qe=function(ne){let Se=null;if(Ae(L.beforeSanitizeElements,ne,null),te(ne))return _n(ne),!0;const De=$e(ne.nodeName);if(Ae(L.uponSanitizeElement,ne,{tagName:De,allowedTags:G}),ne.hasChildNodes()&&!Re(ne.firstElementChild)&&Vr(/<[/\w]/g,ne.innerHTML)&&Vr(/<[/\w]/g,ne.textContent)||ne.nodeType===Mf.progressingInstruction||ge&&ne.nodeType===Mf.comment&&Vr(/<[/\w]/g,ne.data))return _n(ne),!0;if(!G[De]||re[De]){if(!re[De]&&qt(De)&&(K.tagNameCheck instanceof RegExp&&Vr(K.tagNameCheck,De)||K.tagNameCheck instanceof Function&&K.tagNameCheck(De)))return!1;if(vt&&!fe[De]){const jt=_(ne)||ne.parentNode,yn=w(ne)||ne.childNodes;if(yn&&jt){const It=yn.length;for(let Kn=It-1;Kn>=0;--Kn){const no=b(yn[Kn],!0);no.__removalCount=(ne.__removalCount||0)+1,jt.insertBefore(no,v(ne))}}}return _n(ne),!0}return ne instanceof l&&!ur(ne)||(De==="noscript"||De==="noembed"||De==="noframes")&&Vr(/<\/no(script|embed|frames)/i,ne.innerHTML)?(_n(ne),!0):(se&&ne.nodeType===Mf.text&&(Se=ne.textContent,km([j,X,U],jt=>{Se=kf(Se,jt," ")}),ne.textContent!==Se&&(Tf(t.removed,{element:ne.cloneNode()}),ne.textContent=Se)),Ae(L.afterSanitizeElements,ne,null),!1)},Bt=function(ne,Se,De){if(Je&&(Se==="id"||Se==="name")&&(De in n||De in Xt))return!1;if(!(ie&&!Y[Se]&&Vr($,Se))){if(!(J&&Vr(B,Se))){if(!M[Se]||Y[Se]){if(!(qt(ne)&&(K.tagNameCheck instanceof RegExp&&Vr(K.tagNameCheck,ne)||K.tagNameCheck instanceof Function&&K.tagNameCheck(ne))&&(K.attributeNameCheck instanceof RegExp&&Vr(K.attributeNameCheck,Se)||K.attributeNameCheck instanceof Function&&K.attributeNameCheck(Se))||Se==="is"&&K.allowCustomizedBuiltInElements&&(K.tagNameCheck instanceof RegExp&&Vr(K.tagNameCheck,De)||K.tagNameCheck instanceof Function&&K.tagNameCheck(De))))return!1}else if(!rt[Se]){if(!Vr(D,kf(De,q,""))){if(!((Se==="src"||Se==="xlink:href"||Se==="href")&&ne!=="script"&&Sde(De,"data:")===0&&He[ne])){if(!(de&&!Vr(W,kf(De,q,"")))){if(De)return!1}}}}}}return!0},qt=function(ne){return ne!=="annotation-xml"&&bA(ne,Q)},Ot=function(ne){Ae(L.beforeSanitizeAttributes,ne,null);const{attributes:Se}=ne;if(!Se||te(ne))return;const De={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:M,forceKeepAttr:void 0};let jt=Se.length;for(;jt--;){const yn=Se[jt],{name:It,namespaceURI:Kn,value:no}=yn,ws=$e(It);let dr=It==="value"?no:_de(no);if(De.attrName=ws,De.attrValue=dr,De.keepAttr=!0,De.forceKeepAttr=void 0,Ae(L.uponSanitizeAttribute,ne,De),dr=De.attrValue,it&&(ws==="id"||ws==="name")&&(la(It,ne),dr=ln+dr),ge&&Vr(/((--!?|])>)|<\/(style|title)/i,dr)){la(It,ne);continue}if(De.forceKeepAttr||(la(It,ne),!De.keepAttr))continue;if(!he&&Vr(/\/>/i,dr)){la(It,ne);continue}se&&km([j,X,U],Jd=>{dr=kf(dr,Jd," ")});const Zd=$e(ne.nodeName);if(Bt(Zd,ws,dr)){if(R&&typeof h=="object"&&typeof h.getAttributeType=="function"&&!Kn)switch(h.getAttributeType(Zd,ws)){case"TrustedHTML":{dr=R.createHTML(dr);break}case"TrustedScriptURL":{dr=R.createScriptURL(dr);break}}try{Kn?ne.setAttributeNS(Kn,It,dr):ne.setAttribute(It,dr),te(ne)?_n(ne):mA(t.removed)}catch{}}}Ae(L.afterSanitizeAttributes,ne,null)},Et=function Fe(ne){let Se=null;const De=Yc(ne);for(Ae(L.beforeSanitizeShadowDOM,ne,null);Se=De.nextNode();)Ae(L.uponSanitizeShadowNode,Se,null),qe(Se),Ot(Se),Se.content instanceof i&&Fe(Se.content);Ae(L.afterSanitizeShadowDOM,ne,null)};return t.sanitize=function(Fe){let ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Se=null,De=null,jt=null,yn=null;if(gt=!Fe,gt&&(Fe="<!-->"),typeof Fe!="string"&&!Re(Fe))if(typeof Fe.toString=="function"){if(Fe=Fe.toString(),typeof Fe!="string")throw Pf("dirty is not a string, aborting")}else throw Pf("toString is not a function");if(!t.isSupported)return Fe;if(Ce||nr(ne),t.removed=[],typeof Fe=="string"&&($n=!1),$n){if(Fe.nodeName){const no=$e(Fe.nodeName);if(!G[no]||re[no])throw Pf("root node is forbidden and cannot be sanitized in-place")}}else if(Fe instanceof a)Se=qc("<!---->"),De=Se.ownerDocument.importNode(Fe,!0),De.nodeType===Mf.element&&De.nodeName==="BODY"||De.nodeName==="HTML"?Se=De:Se.appendChild(De);else{if(!Ne&&!se&&!ue&&Fe.indexOf("<")===-1)return R&&Le?R.createHTML(Fe):Fe;if(Se=qc(Fe),!Se)return Ne?null:Le?C:""}Se&&ke&&_n(Se.firstChild);const It=Yc($n?Fe:Se);for(;jt=It.nextNode();)qe(jt),Ot(jt),jt.content instanceof i&&Et(jt.content);if($n)return Fe;if(Ne){if(Oe)for(yn=A.call(Se.ownerDocument);Se.firstChild;)yn.appendChild(Se.firstChild);else yn=Se;return(M.shadowroot||M.shadowrootmode)&&(yn=F.call(r,yn,!0)),yn}let Kn=ue?Se.outerHTML:Se.innerHTML;return ue&&G["!doctype"]&&Se.ownerDocument&&Se.ownerDocument.doctype&&Se.ownerDocument.doctype.name&&Vr(T3,Se.ownerDocument.doctype.name)&&(Kn="<!DOCTYPE "+Se.ownerDocument.doctype.name+`>
316
+ `+Kn),se&&km([j,X,U],no=>{Kn=kf(Kn,no," ")}),R&&Le?R.createHTML(Kn):Kn},t.setConfig=function(){let Fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};nr(Fe),Ce=!0},t.clearConfig=function(){Pt=null,Ce=!1},t.isValidAttribute=function(Fe,ne,Se){Pt||nr({});const De=$e(Fe),jt=$e(ne);return Bt(De,jt,Se)},t.addHook=function(Fe,ne){typeof ne=="function"&&Tf(L[Fe],ne)},t.removeHook=function(Fe,ne){if(ne!==void 0){const Se=xde(L[Fe],ne);return Se===-1?void 0:wde(L[Fe],Se,1)[0]}return mA(L[Fe])},t.removeHooks=function(Fe){L[Fe]=[]},t.removeAllHooks=function(){L=_A()},t}var HS=k3();function sy({card:e,isLoading:t,data:n}){var p,h;const r=n||[],{keys:o}=hr(r),i=ye(m=>m.selectedSheetId),s=ye(m=>m.isVisualEditing),a=(h=(p=e==null?void 0:e.preferences)==null?void 0:p.textVisualOptions)==null?void 0:h.isDynamicText,{setCardDescription:l}=Yn(),{setCard:c}=Rp();function u(){var v;if(t)return x.jsxs("div",{className:"space-y-2",children:[x.jsx(Fu,{className:"h-3 w-full animate-pulse bg-muted"}),x.jsx(Fu,{className:"h-3 w-3/4 animate-pulse bg-muted"}),x.jsx(Fu,{className:"h-3 w-1/2 animate-pulse bg-muted"})]});const m=(v=r==null?void 0:r[0])==null?void 0:v[o[0]],b=HS.sanitize(m),y=x.jsx("div",{dangerouslySetInnerHTML:{__html:b}});return x.jsx("div",{className:"text-sm text-foreground/80 hover:cursor-text",onMouseDown:w=>w.stopPropagation(),children:y})}function d(){return x.jsx("div",{onMouseDown:m=>m.stopPropagation(),children:x.jsx(is,{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(i,e.id,m),s===!0&&c({...e,description:m})},children:x.jsx("div",{className:"text-sm text-foreground/70 hover:cursor-text",dangerouslySetInnerHTML:{__html:HS.sanitize((e==null?void 0:e.description)||(s?"Edit Description":"")||"")}})})})}return x.jsxs(x.Fragment,{children:[!a&&d(),a===!0&&u()]})}const CA=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,EA=ad,HE=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return EA(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(c=>{const u=n==null?void 0:n[c],d=i==null?void 0:i[c];if(u===null)return null;const p=CA(u)||CA(d);return o[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,y]=m;return Array.isArray(y)?y.includes({...i,...a}[b]):{...i,...a}[b]===y})?[...c,d,p]:c},[]);return EA(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},Xh=HE("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"}}),sr=T.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const s=r?Js:"button";return x.jsx(s,{className:me(Xh({variant:t,size:n,className:e})),ref:i,...o})});sr.displayName="Button";var $de="Separator",RA="horizontal",jde=["horizontal","vertical"],P3=T.forwardRef((e,t)=>{const{decorative:n,orientation:r=RA,...o}=e,i=zde(r)?r:RA,a=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return x.jsx(je.div,{"data-orientation":i,...a,...o,ref:t})});P3.displayName=$de;function zde(e){return jde.includes(e)}var O3=P3;const y0=T.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>x.jsx(O3,{ref:o,decorative:n,orientation:t,className:me("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));y0.displayName=O3.displayName;function Bde(){var b,y;const e=ye(v=>v.themeStyle),t=ye(v=>v.filterValues),n=ye(v=>v.dashboard.filters),r=ye(v=>v.filteringCards),o=ye(v=>v.selectedSheetId),{removeFilterValues:i,removeFilteringCard:s,setFilterValues:a,setFilteringCards:l}=Yn(),c=n==null?void 0:n.filter(v=>v.sheetId===o||!v.sheetId),u=t==null?void 0:t.filter(v=>(c==null?void 0:c.some(w=>w.id===v.filterId))||v.filterId.endsWith(o));if(!u||u.length===0)return null;const d=u.map(v=>{const w=n==null?void 0:n.find(_=>_.id===v.filterId);return{filterId:v.filterId,name:(w==null?void 0:w.title)||v.name,values:v.values}});function p(v){return v instanceof Date?v.toLocaleDateString():v}function h(v){const w=r==null?void 0:r.find(_=>v.filterId.startsWith(_.id));w&&s(w),i(v.filterId)}function m(v){var w,_;return x.jsxs("div",{className:"space-y-2",children:[x.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:[x.jsx("span",{className:"break-words",children:v.name}),x.jsx(Bc,{onClick:()=>h(v),className:"size-3 text-muted hover:cursor-pointer hover:text-background"})]}),x.jsx("div",{className:"flex flex-wrap gap-1",children:v.values.map(R=>{var C,E;return x.jsx("span",{style:{borderRadius:(E=(C=e==null?void 0:e.chart)==null?void 0:C.options)==null?void 0:E.borderRadius},className:"inline-block",children:p(R)},R==null?void 0:R.toString())})})]})}return x.jsxs(Fp,{openDelay:100,children:[x.jsx(Lp,{children:x.jsx(fF,{className:"z-100 size-3.5 text-muted-foreground/40"})}),x.jsxs(Vd,{style:{borderRadius:(y=(b=e==null?void 0:e.chart)==null?void 0:b.options)==null?void 0:y.borderRadius},className:"relative flex min-h-fit w-[300px] flex-col px-0 text-xs",align:"start",children:[x.jsx(GC,{onClick:()=>{l([]),a([])},className:"absolute right-4 size-3.5 text-muted-foreground/40 hover:cursor-pointer"}),x.jsx("div",{className:"h-fit max-h-[150px] min-h-0 grow overflow-auto",children:d==null?void 0:d.map(v=>x.jsxs("div",{className:"px-5",children:[m(v),x.jsx(y0,{className:"my-2"})]},v.name))})]})]})}const Hde=T.forwardRef(({className:e,containerClassName:t,containerStyle:n,...r},o)=>x.jsx("div",{style:n,className:me("relative w-full overflow-auto",t),children:x.jsx("table",{ref:o,className:me("w-full caption-bottom text-sm",e),...r})}));Hde.displayName="Table";const WE=T.forwardRef(({className:e,...t},n)=>x.jsx("thead",{ref:n,className:me("[&_tr]:border-b",e),...t}));WE.displayName="TableHeader";const VE=T.forwardRef(({className:e,...t},n)=>x.jsx("tbody",{ref:n,className:me("[&_tr:last-child]:border-0",e),...t}));VE.displayName="TableBody";const Wde=T.forwardRef(({className:e,...t},n)=>x.jsx("tfoot",{ref:n,className:me("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));Wde.displayName="TableFooter";const xh=T.forwardRef(({className:e,...t},n)=>x.jsx("tr",{ref:n,className:me("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));xh.displayName="TableRow";const UE=T.forwardRef(({className:e,...t},n)=>x.jsx("th",{ref:n,className:me("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));UE.displayName="TableHead";const GE=T.forwardRef(({className:e,...t},n)=>x.jsx("td",{ref:n,className:me("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));GE.displayName="TableCell";const Vde=T.forwardRef(({className:e,...t},n)=>x.jsx("caption",{ref:n,className:me("mt-4 text-sm text-muted-foreground",e),...t}));Vde.displayName="TableCaption";/**
317
+ * table-core
318
+ *
319
+ * Copyright (c) TanStack
320
+ *
321
+ * This source code is licensed under the MIT license found in the
322
+ * LICENSE.md file in the root directory of this source tree.
323
+ *
324
+ * @license MIT
325
+ */function za(e,t){return typeof e=="function"?e(t):e}function Vo(e,t){return n=>{t.setState(r=>({...r,[e]:za(n,r[e])}))}}function v0(e){return e instanceof Function}function Ude(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Gde(e,t){const n=[],r=o=>{o.forEach(i=>{n.push(i);const s=t(i);s!=null&&s.length&&r(s)})};return r(e),n}function et(e,t,n){let r=[],o;return i=>{let s;n.key&&n.debug&&(s=Date.now());const a=e(i);if(!(a.length!==r.length||a.some((u,d)=>r[d]!==u)))return o;r=a;let c;if(n.key&&n.debug&&(c=Date.now()),o=t(...a),n==null||n.onChange==null||n.onChange(o),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`,`
326
+ font-size: .6rem;
327
+ font-weight: bold;
328
+ color: hsl(${Math.max(0,Math.min(120-120*p,120))}deg 100% 31%);`,n==null?void 0:n.key)}return o}}function tt(e,t,n,r){return{debug:()=>{var o;return(o=e==null?void 0:e.debugAll)!=null?o:e[t]},key:process.env.NODE_ENV==="development"&&n,onChange:r}}function qde(e,t,n,r){const o=()=>{var s;return(s=i.getValue())!=null?s:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:o,getContext:et(()=>[e,n,t,i],(s,a,l,c)=>({table:s,column:a,row:l,cell:c,getValue:c.getValue,renderValue:c.renderValue}),tt(e.options,"debugCells","cell.getContext"))};return e._features.forEach(s=>{s.createCell==null||s.createCell(i,n,t,e)},{}),i}function Yde(e,t,n,r){var o,i;const a={...e._getDefaultColumnDef(),...t},l=a.accessorKey;let c=(o=(i=a.id)!=null?i:l?typeof String.prototype.replaceAll=="function"?l.replaceAll(".","_"):l.replace(/\./g,"_"):void 0)!=null?o: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:et(()=>[!0],()=>{var p;return[d,...(p=d.columns)==null?void 0:p.flatMap(h=>h.getFlatColumns())]},tt(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:et(()=>[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]},tt(e.options,"debugColumns","column.getLeafColumns"))};for(const p of e._features)p.createColumn==null||p.createColumn(d,e);return d}const Pr="debugHeaders";function TA(e,t,n){var r;let i={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(i),s},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(s=>{s.createHeader==null||s.createHeader(i,e)}),i}const Kde={createTable:e=>{e.getHeaderGroups=et(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var i,s;const a=(i=r==null?void 0:r.map(d=>n.find(p=>p.id===d)).filter(Boolean))!=null?i:[],l=(s=o==null?void 0:o.map(d=>n.find(p=>p.id===d)).filter(Boolean))!=null?s:[],c=n.filter(d=>!(r!=null&&r.includes(d.id))&&!(o!=null&&o.includes(d.id)));return Om(t,[...a,...c,...l],e)},tt(e.options,Pr,"getHeaderGroups")),e.getCenterHeaderGroups=et(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(i=>!(r!=null&&r.includes(i.id))&&!(o!=null&&o.includes(i.id))),Om(t,n,e,"center")),tt(e.options,Pr,"getCenterHeaderGroups")),e.getLeftHeaderGroups=et(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const i=(o=r==null?void 0:r.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return Om(t,i,e,"left")},tt(e.options,Pr,"getLeftHeaderGroups")),e.getRightHeaderGroups=et(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const i=(o=r==null?void 0:r.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return Om(t,i,e,"right")},tt(e.options,Pr,"getRightHeaderGroups")),e.getFooterGroups=et(()=>[e.getHeaderGroups()],t=>[...t].reverse(),tt(e.options,Pr,"getFooterGroups")),e.getLeftFooterGroups=et(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),tt(e.options,Pr,"getLeftFooterGroups")),e.getCenterFooterGroups=et(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),tt(e.options,Pr,"getCenterFooterGroups")),e.getRightFooterGroups=et(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),tt(e.options,Pr,"getRightFooterGroups")),e.getFlatHeaders=et(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),tt(e.options,Pr,"getFlatHeaders")),e.getLeftFlatHeaders=et(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),tt(e.options,Pr,"getLeftFlatHeaders")),e.getCenterFlatHeaders=et(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),tt(e.options,Pr,"getCenterFlatHeaders")),e.getRightFlatHeaders=et(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),tt(e.options,Pr,"getRightFlatHeaders")),e.getCenterLeafHeaders=et(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),tt(e.options,Pr,"getCenterLeafHeaders")),e.getLeftLeafHeaders=et(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),tt(e.options,Pr,"getLeftLeafHeaders")),e.getRightLeafHeaders=et(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),tt(e.options,Pr,"getRightLeafHeaders")),e.getLeafHeaders=et(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,i,s,a,l,c;return[...(o=(i=t[0])==null?void 0:i.headers)!=null?o:[],...(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()},tt(e.options,Pr,"getLeafHeaders"))}};function Om(e,t,n,r){var o,i;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(y=>{const v=[...b].reverse()[0],w=y.column.depth===m.depth;let _,R=!1;if(w&&y.column.parent?_=y.column.parent:(_=y.column,R=!0),v&&(v==null?void 0:v.column)===_)v.subHeaders.push(y);else{const C=TA(n,_,{id:[r,h,_.id,y==null?void 0:y.id].filter(Boolean).join("_"),isPlaceholder:R,placeholderId:R?`${b.filter(E=>E.column===_).length}`:void 0,depth:h,index:b.length});C.subHeaders.push(y),b.push(C)}m.headers.push(y),y.headerGroup=m}),l.push(m),h>0&&c(b,h-1)},u=t.map((p,h)=>TA(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,y=0,v=[0];m.subHeaders&&m.subHeaders.length?(v=[],d(m.subHeaders).forEach(_=>{let{colSpan:R,rowSpan:C}=_;b+=R,v.push(C)})):b=1;const w=Math.min(...v);return y=y+w,m.colSpan=b,m.rowSpan=y,{colSpan:b,rowSpan:y}});return d((o=(i=l[0])==null?void 0:i.headers)!=null?o:[]),l}const Xde=(e,t,n,r,o,i,s)=>{let a={id:t,index:r,original:n,depth:o,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:()=>Gde(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:et(()=>[e.getAllLeafColumns()],l=>l.map(c=>qde(e,a,c,c.id)),tt(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:et(()=>[a.getAllCells()],l=>l.reduce((c,u)=>(c[u.column.id]=u,c),{}),tt(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},Qde={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()}}},M3=(e,t,n)=>{var r,o;const i=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(i))};M3.autoRemove=e=>Ai(e);const A3=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};A3.autoRemove=e=>Ai(e);const D3=(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())};D3.autoRemove=e=>Ai(e);const I3=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};I3.autoRemove=e=>Ai(e);const N3=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});N3.autoRemove=e=>Ai(e)||!(e!=null&&e.length);const F3=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});F3.autoRemove=e=>Ai(e)||!(e!=null&&e.length);const L3=(e,t,n)=>e.getValue(t)===n;L3.autoRemove=e=>Ai(e);const $3=(e,t,n)=>e.getValue(t)==n;$3.autoRemove=e=>Ai(e);const qE=(e,t,n)=>{let[r,o]=n;const i=e.getValue(t);return i>=r&&i<=o};qE.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,i=t===null||Number.isNaN(r)?-1/0:r,s=n===null||Number.isNaN(o)?1/0:o;if(i>s){const a=i;i=s,s=a}return[i,s]};qE.autoRemove=e=>Ai(e)||Ai(e[0])&&Ai(e[1]);const Ls={includesString:M3,includesStringSensitive:A3,equalsString:D3,arrIncludes:I3,arrIncludesAll:N3,arrIncludesSome:F3,equals:L3,weakEquals:$3,inNumberRange:qE};function Ai(e){return e==null||e===""}const Zde={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Vo("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"?Ls.includesString:typeof r=="number"?Ls.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Ls.equals:Array.isArray(r)?Ls.arrIncludes:Ls.weakEquals},e.getFilterFn=()=>{var n,r;return v0(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:Ls[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!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(o=>o.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),i=r==null?void 0:r.find(u=>u.id===e.id),s=za(n,i?i.value:void 0);if(kA(o,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(i){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=o=>{var i;return(i=za(t,o))==null?void 0:i.filter(s=>{const a=n.find(l=>l.id===s.id);if(a){const l=a.getFilterFn();if(kA(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 kA(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const Jde=(e,t,n)=>n.reduce((r,o)=>{const i=o.getValue(e);return r+(typeof i=="number"?i:0)},0),efe=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}),r},tfe=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r<i||r===void 0&&i>=i)&&(r=i)}),r},nfe=(e,t,n)=>{let r,o;return n.forEach(i=>{const s=i.getValue(e);s!=null&&(r===void 0?s>=s&&(r=o=s):(r>s&&(r=s),o<s&&(o=s)))}),[r,o]},rfe=(e,t)=>{let n=0,r=0;if(t.forEach(o=>{let i=o.getValue(e);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},ofe=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!Ude(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((i,s)=>i-s);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},ife=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),sfe=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,afe=(e,t)=>t.length,gw={sum:Jde,min:efe,max:tfe,extent:nfe,mean:rfe,median:ofe,unique:ife,uniqueCount:sfe,count:afe},lfe={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:Vo("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 gw.sum;if(Object.prototype.toString.call(r)==="[object Date]")return gw.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return v0(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:gw[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 o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function cfe(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(i=>!t.includes(i.id));return n==="remove"?r:[...t.map(i=>e.find(s=>s.id===i)).filter(Boolean),...r]}const ufe={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Vo("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=et(n=>[wh(t,n)],n=>n.findIndex(r=>r.id===e.id),tt(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var r;return((r=wh(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=wh(t,n);return((r=o[o.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=et(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>o=>{let i=[];if(!(t!=null&&t.length))i=o;else{const s=[...t],a=[...o];for(;a.length&&s.length;){const l=s.shift(),c=a.findIndex(u=>u.id===l);c>-1&&i.push(a.splice(c,1)[0])}i=[...i,...a]}return cfe(i,n,r)},tt(e.options,"debugTable","_getOrderColumnsFn"))}},mw=()=>({left:[],right:[]}),dfe={getInitialState:e=>({columnPinning:mw(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Vo("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var i,s;if(n==="right"){var a,l;return{left:((a=o==null?void 0:o.left)!=null?a:[]).filter(d=>!(r!=null&&r.includes(d))),right:[...((l=o==null?void 0:o.right)!=null?l:[]).filter(d=>!(r!=null&&r.includes(d))),...r]}}if(n==="left"){var c,u;return{left:[...((c=o==null?void 0:o.left)!=null?c:[]).filter(d=>!(r!=null&&r.includes(d))),...r],right:((u=o==null?void 0:o.right)!=null?u:[]).filter(d=>!(r!=null&&r.includes(d)))}}return{left:((i=o==null?void 0:o.left)!=null?i:[]).filter(d=>!(r!=null&&r.includes(d))),right:((s=o==null?void 0:o.right)!=null?s:[]).filter(d=>!(r!=null&&r.includes(d)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,i,s;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((i=(s=t.options.enableColumnPinning)!=null?s:t.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:o}=t.getState().columnPinning,i=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>o==null?void 0:o.includes(a));return i?"left":s?"right":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?(n=(r=t.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=et(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,o)=>{const i=[...r??[],...o??[]];return n.filter(s=>!i.includes(s.column.id))},tt(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=et(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),tt(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=et(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),tt(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?mw():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:mw())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var o,i;return!!((o=r.left)!=null&&o.length||(i=r.right)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=et(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),tt(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=et(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),tt(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=et(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(i=>!o.includes(i.id))},tt(e.options,"debugColumns","getCenterLeafColumns"))}},Mm={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},bw=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),ffe={getDefaultColumnDef:()=>Mm,getInitialState:e=>({columnSizing:{},columnSizingInfo:bw(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Vo("columnSizing",e),onColumnSizingInfoChange:Vo("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Mm.minSize,(r=i??e.columnDef.size)!=null?r:Mm.size),(o=e.columnDef.maxSize)!=null?o:Mm.maxSize)},e.getStart=et(n=>[n,wh(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,i)=>o+i.getSize(),0),tt(t.options,"debugColumns","getStart")),e.getAfter=et(n=>[n,wh(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,i)=>o+i.getSize(),0),tt(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...o}=n;return o})},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=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var i;n+=(i=o.column.getSize())!=null?i: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),o=r==null?void 0:r.getCanResize();return i=>{if(!r||!o||(i.persist==null||i.persist(),yw(i)&&i.touches&&i.touches.length>1))return;const s=e.getSize(),a=e?e.getLeafHeaders().map(v=>[v.column.id,v.column.getSize()]):[[r.id,r.getSize()]],l=yw(i)?Math.round(i.touches[0].clientX):i.clientX,c={},u=(v,w)=>{typeof w=="number"&&(t.setColumnSizingInfo(_=>{var R,C;const E=t.options.columnResizeDirection==="rtl"?-1:1,P=(w-((R=_==null?void 0:_.startOffset)!=null?R:0))*E,A=Math.max(P/((C=_==null?void 0:_.startSize)!=null?C:0),-.999999);return _.columnSizingStart.forEach(I=>{let[F,L]=I;c[F]=Math.round(Math.max(L+L*A,0)*100)/100}),{..._,deltaOffset:P,deltaPercentage:A}}),(t.options.columnResizeMode==="onChange"||v==="end")&&t.setColumnSizing(_=>({..._,...c})))},d=v=>u("move",v),p=v=>{u("end",v),t.setColumnSizingInfo(w=>({...w,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},h=n||typeof document<"u"?document:null,m={moveHandler:v=>d(v.clientX),upHandler:v=>{h==null||h.removeEventListener("mousemove",m.moveHandler),h==null||h.removeEventListener("mouseup",m.upHandler),p(v.clientX)}},b={moveHandler:v=>(v.cancelable&&(v.preventDefault(),v.stopPropagation()),d(v.touches[0].clientX),!1),upHandler:v=>{var w;h==null||h.removeEventListener("touchmove",b.moveHandler),h==null||h.removeEventListener("touchend",b.upHandler),v.cancelable&&(v.preventDefault(),v.stopPropagation()),p((w=v.touches[0])==null?void 0:w.clientX)}},y=hfe()?{passive:!1}:!1;yw(i)?(h==null||h.addEventListener("touchmove",b.moveHandler,y),h==null||h.addEventListener("touchend",b.upHandler,y)):(h==null||h.addEventListener("mousemove",m.moveHandler,y),h==null||h.addEventListener("mouseup",m.upHandler,y)),t.setColumnSizingInfo(v=>({...v,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?bw():(n=e.initialState.columnSizingInfo)!=null?n:bw())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0}}};let Am=null;function hfe(){if(typeof Am=="boolean")return Am;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 Am=e,Am}function yw(e){return e.type==="touchstart"}const pfe={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Vo("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 o=e.columns;return(n=o.length?o.some(i=>i.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=et(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),tt(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=et(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],tt(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(n,r)=>et(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),tt(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((o,i)=>({...o,[i.id]:n||!(i.getCanHide!=null&&i.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 wh(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const gfe={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()}}},mfe={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Vo("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,o,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Ls.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return v0(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Ls[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},bfe={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Vo("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o: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 o,i;e.setExpanded(r?{}:(o=(i=e.initialState)==null?void 0:i.expanded)!=null?o:{})},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(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const s=i.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 o;const i=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=(o=n)!=null?o:!i,!i&&n)return{...s,[e.id]:!0};if(i&&!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,o;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((o=e.subRows)!=null&&o.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()}}}},WS=0,VS=10,vw=()=>({pageIndex:WS,pageSize:VS}),yfe={getInitialState:e=>({...e,pagination:{...vw(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Vo("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const o=i=>za(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?vw():(o=e.initialState.pagination)!=null?o:vw())},e.setPageIndex=r=>{e.setPagination(o=>{let i=za(r,o.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,s)),{...o,pageIndex:i}})},e.resetPageIndex=r=>{var o,i;e.setPageIndex(r?WS:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?o:WS)},e.resetPageSize=r=>{var o,i;e.setPageSize(r?VS:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?o:VS)},e.setPageSize=r=>{e.setPagination(o=>{const i=Math.max(1,za(r,o.pageSize)),s=o.pageSize*o.pageIndex,a=Math.floor(s/i);return{...o,pageIndex:a,pageSize:i}})},e.setPageCount=r=>e.setPagination(o=>{var i;let s=za(r,(i=e.options.pageCount)!=null?i:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...o,pageCount:s}}),e.getPageOptions=et(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((i,s)=>s)),o},tt(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:r<o-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}}},xw=()=>({top:[],bottom:[]}),vfe={getInitialState:e=>({rowPinning:xw(),...e}),getDefaultOptions:e=>({onRowPinningChange:Vo("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,o)=>{const i=r?e.getLeafRows().map(l=>{let{id:c}=l;return c}):[],s=o?e.getParentRows().map(l=>{let{id:c}=l;return c}):[],a=new Set([...s,e.id,...i]);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:o}=t.options;return typeof r=="function"?r(e):(n=r??o)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,i=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>o==null?void 0:o.includes(a));return i?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const i=(n=o==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(s=>{let{id:a}=s;return a});return(r=i==null?void 0:i.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?xw():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:xw())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var o,i;return!!((o=r.top)!=null&&o.length||(i=r.bottom)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(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=et(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),tt(e.options,"debugRows","getTopRows")),e.getBottomRows=et(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),tt(e.options,"debugRows","getBottomRows")),e.getCenterRows=et(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const o=new Set([...n??[],...r??[]]);return t.filter(i=>!o.has(i.id))},tt(e.options,"debugRows","getCenterRows"))}},xfe={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Vo("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},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(i=>{i.getCanSelect()&&(r[i.id]=!0)}):o.forEach(i=>{delete r[i.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(i=>{US(o,i.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=et(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?ww(e,n):{rows:[],flatRows:[],rowsById:{}},tt(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=et(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?ww(e,n):{rows:[],flatRows:[],rowsById:{}},tt(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=et(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?ww(e,n):{rows:[],flatRows:[],rowsById:{}},tt(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(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(o=>!n[o.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 o=e.getIsSelected();t.setRowSelection(i=>{var s;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return i;const a={...i};return US(a,e.id,n,(s=r==null?void 0:r.selectChildren)!=null?s:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return YE(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return GS(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return GS(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 o;n&&e.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},US=(e,t,n,r,o)=>{var i;const s=o.getRow(t,!0);n?(s.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),s.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(i=s.subRows)!=null&&i.length&&s.getCanSelectSubRows()&&s.subRows.forEach(a=>US(e,a.id,n,r,o))};function ww(e,t){const n=e.getState().rowSelection,r=[],o={},i=function(s,a){return s.map(l=>{var c;const u=YE(l,n);if(u&&(r.push(l),o[l.id]=l),(c=l.subRows)!=null&&c.length&&(l={...l,subRows:i(l.subRows)}),u)return l}).filter(Boolean)};return{rows:i(t.rows),flatRows:r,rowsById:o}}function YE(e,t){var n;return(n=t[e.id])!=null?n:!1}function GS(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,i=!1;return e.subRows.forEach(s=>{if(!(i&&!o)&&(s.getCanSelect()&&(YE(s,t)?i=!0:o=!1),s.subRows&&s.subRows.length)){const a=GS(s,t);a==="all"?i=!0:(a==="some"&&(i=!0),o=!1)}}),o?"all":i?"some":!1}const qS=/([0-9]+)/gm,wfe=(e,t,n)=>j3(tl(e.getValue(n)).toLowerCase(),tl(t.getValue(n)).toLowerCase()),Sfe=(e,t,n)=>j3(tl(e.getValue(n)),tl(t.getValue(n))),_fe=(e,t,n)=>KE(tl(e.getValue(n)).toLowerCase(),tl(t.getValue(n)).toLowerCase()),Cfe=(e,t,n)=>KE(tl(e.getValue(n)),tl(t.getValue(n))),Efe=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},Rfe=(e,t,n)=>KE(e.getValue(n),t.getValue(n));function KE(e,t){return e===t?0:e>t?1:-1}function tl(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function j3(e,t){const n=e.split(qS).filter(Boolean),r=t.split(qS).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),i=r.shift(),s=parseInt(o,10),a=parseInt(i,10),l=[s,a].sort();if(isNaN(l[0])){if(o>i)return 1;if(i>o)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 Af={alphanumeric:wfe,alphanumericCaseSensitive:Sfe,text:_fe,textCaseSensitive:Cfe,datetime:Efe,basic:Rfe},Tfe={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Vo("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const i=o==null?void 0:o.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return Af.datetime;if(typeof i=="string"&&(r=!0,i.split(qS).length>1))return Af.alphanumeric}return r?Af.text:Af.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 v0(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:Af[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),i=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=i?n:o==="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"&&(i||o||(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,o;const i=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==i&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:s==="desc"?"asc":"desc":i},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(o=>o.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(o=>o.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())}},kfe=[Kde,pfe,ufe,dfe,Qde,Zde,gfe,mfe,Tfe,lfe,bfe,yfe,vfe,xfe,ffe];function Pfe(e){var t,n;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const r=[...kfe,...(t=e._features)!=null?t:[]];let o={_features:r};const i=o._features.reduce((p,h)=>Object.assign(p,h.getDefaultOptions==null?void 0:h.getDefaultOptions(o)),{}),s=p=>o.options.mergeOptions?o.options.mergeOptions(i,p):{...i,...p};let l={...{},...(n=e.initialState)!=null?n:{}};o._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:{...i,...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:()=>{o.setState(o.initialState)},setOptions:p=>{const h=za(p,o.options);o.options=s(h)},getState:()=>o.options.state,setState:p=>{o.options.onStateChange==null||o.options.onStateChange(p)},_getRowId:(p,h,m)=>{var b;return(b=o.options.getRowId==null?void 0:o.options.getRowId(p,h,m))!=null?b:`${m?[m.id,h].join("."):h}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(p,h)=>{let m=(h?o.getPrePaginationRowModel():o.getRowModel()).rowsById[p];if(!m&&(m=o.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:et(()=>[o.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,y;return(b=(y=m.renderValue())==null||y.toString==null?void 0:y.toString())!=null?b:null},...o._features.reduce((m,b)=>Object.assign(m,b.getDefaultColumnDef==null?void 0:b.getDefaultColumnDef()),{}),...p}},tt(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>o.options.columns,getAllColumns:et(()=>[o._getColumnDefs()],p=>{const h=function(m,b,y){return y===void 0&&(y=0),m.map(v=>{const w=Yde(o,v,y,b),_=v;return w.columns=_.columns?h(_.columns,w,y+1):[],w})};return h(p)},tt(e,"debugColumns","getAllColumns")),getAllFlatColumns:et(()=>[o.getAllColumns()],p=>p.flatMap(h=>h.getFlatColumns()),tt(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:et(()=>[o.getAllFlatColumns()],p=>p.reduce((h,m)=>(h[m.id]=m,h),{}),tt(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:et(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(p,h)=>{let m=p.flatMap(b=>b.getLeafColumns());return h(m)},tt(e,"debugColumns","getAllLeafColumns")),getColumn:p=>{const h=o._getAllFlatColumnsById()[p];return process.env.NODE_ENV!=="production"&&!h&&console.error(`[Table] Column with id '${p}' does not exist.`),h}};Object.assign(o,d);for(let p=0;p<o._features.length;p++){const h=o._features[p];h==null||h.createTable==null||h.createTable(o)}return o}function z3(){return e=>et(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,i,s){i===void 0&&(i=0);const a=[];for(let c=0;c<o.length;c++){const u=Xde(e,e._getRowId(o[c],c,s),o[c],c,i,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(o[c],c),(l=u.originalSubRows)!=null&&l.length&&(u.subRows=r(u.originalSubRows,i+1,u))}}return a};return n.rows=r(t),n},tt(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function Ofe(e){const t=[],n=r=>{var o;t.push(r),(o=r.subRows)!=null&&o.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function B3(e){return t=>et(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:o,pageIndex:i}=n;let{rows:s,flatRows:a,rowsById:l}=r;const c=o*i,u=c+o;s=s.slice(c,u);let d;t.options.paginateExpandedRows?d={rows:s,flatRows:a,rowsById:l}:d=Ofe({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},tt(t.options,"debugTable","getPaginationRowModel"))}function H3(){return e=>et(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,o=[],i=r.filter(l=>{var c;return(c=e.getColumn(l.id))==null?void 0:c.getCanSort()}),s={};i.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<i.length;h+=1){var p;const m=i[h],b=s[m.id],y=b.sortUndefined,v=(p=m==null?void 0:m.desc)!=null?p:!1;let w=0;if(y){const _=u.getValue(m.id),R=d.getValue(m.id),C=_===void 0,E=R===void 0;if(C||E){if(y==="first")return C?-1:1;if(y==="last")return C?1:-1;w=C&&E?0:C?y:-y}}if(w===0&&(w=b.sortingFn(u,d,m.id)),w!==0)return v&&(w*=-1),b.invertSorting&&(w*=-1),w}return u.index-d.index}),c.forEach(u=>{var d;o.push(u),(d=u.subRows)!=null&&d.length&&(u.subRows=a(u.subRows))}),c};return{rows:a(n.rows),flatRows:o,rowsById:n.rowsById}},tt(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
329
+ * react-table
330
+ *
331
+ * Copyright (c) TanStack
332
+ *
333
+ * This source code is licensed under the MIT license found in the
334
+ * LICENSE.md file in the root directory of this source tree.
335
+ *
336
+ * @license MIT
337
+ */function YS(e,t){return e?Mfe(e)?T.createElement(e,t):e:null}function Mfe(e){return Afe(e)||typeof e=="function"||Dfe(e)}function Afe(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function Dfe(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function W3(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=T.useState(()=>({current:Pfe(t)})),[r,o]=T.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...e,state:{...r,...e.state},onStateChange:s=>{o(s),e.onStateChange==null||e.onStateChange(s)}})),n.current}function KS(e,[t,n]){return Math.min(n,Math.max(t,e))}var Sw=0;function x0(){T.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??PA()),document.body.insertAdjacentElement("beforeend",e[1]??PA()),Sw++,()=>{Sw===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Sw--}},[])}function PA(){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 _w="focusScope.autoFocusOnMount",Cw="focusScope.autoFocusOnUnmount",OA={bubbles:!1,cancelable:!0},Ife="FocusScope",$p=T.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=T.useState(null),c=ir(o),u=ir(i),d=T.useRef(null),p=dt(t,b=>l(b)),h=T.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;T.useEffect(()=>{if(r){let b=function(_){if(h.paused||!a)return;const R=_.target;a.contains(R)?d.current=R:Ra(d.current,{select:!0})},y=function(_){if(h.paused||!a)return;const R=_.relatedTarget;R!==null&&(a.contains(R)||Ra(d.current,{select:!0}))},v=function(_){if(document.activeElement===document.body)for(const C of _)C.removedNodes.length>0&&Ra(a)};document.addEventListener("focusin",b),document.addEventListener("focusout",y);const w=new MutationObserver(v);return a&&w.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",y),w.disconnect()}}},[r,a,h.paused]),T.useEffect(()=>{if(a){AA.add(h);const b=document.activeElement;if(!a.contains(b)){const v=new CustomEvent(_w,OA);a.addEventListener(_w,c),a.dispatchEvent(v),v.defaultPrevented||(Nfe(zfe(V3(a)),{select:!0}),document.activeElement===b&&Ra(a))}return()=>{a.removeEventListener(_w,c),setTimeout(()=>{const v=new CustomEvent(Cw,OA);a.addEventListener(Cw,u),a.dispatchEvent(v),v.defaultPrevented||Ra(b??document.body,{select:!0}),a.removeEventListener(Cw,u),AA.remove(h)},0)}}},[a,c,u,h]);const m=T.useCallback(b=>{if(!n&&!r||h.paused)return;const y=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,v=document.activeElement;if(y&&v){const w=b.currentTarget,[_,R]=Ffe(w);_&&R?!b.shiftKey&&v===R?(b.preventDefault(),n&&Ra(_,{select:!0})):b.shiftKey&&v===_&&(b.preventDefault(),n&&Ra(R,{select:!0})):v===w&&b.preventDefault()}},[n,r,h.paused]);return x.jsx(je.div,{tabIndex:-1,...s,ref:p,onKeyDown:m})});$p.displayName=Ife;function Nfe(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ra(r,{select:t}),document.activeElement!==n)return}function Ffe(e){const t=V3(e),n=MA(t,e),r=MA(t.reverse(),e);return[n,r]}function V3(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function MA(e,t){for(const n of e)if(!Lfe(n,{upTo:t}))return n}function Lfe(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 $fe(e){return e instanceof HTMLInputElement&&"select"in e}function Ra(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&$fe(e)&&t&&e.select()}}var AA=jfe();function jfe(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=DA(e,t),e.unshift(t)},remove(t){var n;e=DA(e,t),(n=e[0])==null||n.resume()}}}function DA(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function zfe(e){return e.filter(t=>t.tagName!=="A")}function w0(e){const t=T.useRef({value:e,previous:e});return T.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Bfe=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},pu=new WeakMap,Dm=new WeakMap,Im={},Ew=0,U3=function(e){return e&&(e.host||U3(e.parentNode))},Hfe=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=U3(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})},Wfe=function(e,t,n,r){var o=Hfe(t,Array.isArray(e)?e:[e]);Im[n]||(Im[n]=new WeakMap);var i=Im[n],s=[],a=new Set,l=new Set(o),c=function(d){!d||a.has(d)||(a.add(d),c(d.parentNode))};o.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=(pu.get(p)||0)+1,y=(i.get(p)||0)+1;pu.set(p,b),i.set(p,y),s.push(p),b===1&&m&&Dm.set(p,!0),y===1&&p.setAttribute(n,"true"),m||p.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",p,v)}})};return u(t),a.clear(),Ew++,function(){s.forEach(function(d){var p=pu.get(d)-1,h=i.get(d)-1;pu.set(d,p),i.set(d,h),p||(Dm.has(d)||d.removeAttribute(r),Dm.delete(d)),h||d.removeAttribute(n)}),Ew--,Ew||(pu=new WeakMap,pu=new WeakMap,Dm=new WeakMap,Im={})}},S0=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Bfe(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),Wfe(r,o,n,"aria-hidden")):function(){return null}},Ji=function(){return Ji=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Ji.apply(this,arguments)};function G3(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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Vfe(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var pb="right-scroll-bar-position",gb="width-before-scroll-bar",Ufe="with-scroll-bars-hidden",Gfe="--removed-body-scroll-bar-size";function Rw(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function qfe(e,t){var n=k.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var Yfe=typeof window<"u"?T.useLayoutEffect:T.useEffect,IA=new WeakMap;function Kfe(e,t){var n=qfe(null,function(r){return e.forEach(function(o){return Rw(o,r)})});return Yfe(function(){var r=IA.get(n);if(r){var o=new Set(r),i=new Set(e),s=n.current;o.forEach(function(a){i.has(a)||Rw(a,null)}),i.forEach(function(a){o.has(a)||Rw(a,s)})}IA.set(n,e)},[e]),n}function Xfe(e){return e}function Qfe(e,t){t===void 0&&(t=Xfe);var n=[],r=!1,o={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(i){var s=t(i,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(i),s=n}var l=function(){var u=s;s=[],u.forEach(i)},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 o}function Zfe(e){e===void 0&&(e={});var t=Qfe(null);return t.options=Ji({async:!0,ssr:!1},e),t}var q3=function(e){var t=e.sideCar,n=G3(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 T.createElement(r,Ji({},n))};q3.isSideCarExport=!0;function Jfe(e,t){return e.useMedium(t),q3}var Y3=Zfe(),Tw=function(){},_0=T.forwardRef(function(e,t){var n=T.useRef(null),r=T.useState({onScrollCapture:Tw,onWheelCapture:Tw,onTouchMoveCapture:Tw}),o=r[0],i=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,y=e.as,v=y===void 0?"div":y,w=e.gapMode,_=G3(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=p,C=Kfe([n,t]),E=Ji(Ji({},_),o);return T.createElement(T.Fragment,null,u&&T.createElement(R,{sideCar:Y3,removeScrollBar:c,shards:d,noIsolation:h,inert:m,setCallbacks:i,allowPinchZoom:!!b,lockRef:n,gapMode:w}),s?T.cloneElement(T.Children.only(a),Ji(Ji({},E),{ref:C})):T.createElement(v,Ji({},E,{className:l,ref:C}),a))});_0.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};_0.classNames={fullWidth:gb,zeroRight:pb};var ehe=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function the(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ehe();return t&&e.setAttribute("nonce",t),e}function nhe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function rhe(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var ohe=function(){var e=0,t=null;return{add:function(n){e==0&&(t=the())&&(nhe(t,n),rhe(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ihe=function(){var e=ohe();return function(t,n){T.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},K3=function(){var e=ihe(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},she={left:0,top:0,right:0,gap:0},kw=function(e){return parseInt(e||"",10)||0},ahe=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[kw(n),kw(r),kw(o)]},lhe=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return she;var t=ahe(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])}},che=K3(),Hu="data-scroll-locked",uhe=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
338
+ .`.concat(Ufe,` {
339
+ overflow: hidden `).concat(r,`;
340
+ padding-right: `).concat(a,"px ").concat(r,`;
341
+ }
342
+ body[`).concat(Hu,`] {
343
+ overflow: hidden `).concat(r,`;
344
+ overscroll-behavior: contain;
345
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
346
+ padding-left: `.concat(o,`px;
347
+ padding-top: `).concat(i,`px;
348
+ padding-right: `).concat(s,`px;
349
+ margin-left:0;
350
+ margin-top:0;
351
+ margin-right: `).concat(a,"px ").concat(r,`;
352
+ `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
353
+ }
354
+
355
+ .`).concat(pb,` {
356
+ right: `).concat(a,"px ").concat(r,`;
357
+ }
358
+
359
+ .`).concat(gb,` {
360
+ margin-right: `).concat(a,"px ").concat(r,`;
361
+ }
362
+
363
+ .`).concat(pb," .").concat(pb,` {
364
+ right: 0 `).concat(r,`;
365
+ }
366
+
367
+ .`).concat(gb," .").concat(gb,` {
368
+ margin-right: 0 `).concat(r,`;
369
+ }
370
+
371
+ body[`).concat(Hu,`] {
372
+ `).concat(Gfe,": ").concat(a,`px;
373
+ }
374
+ `)},NA=function(){var e=parseInt(document.body.getAttribute(Hu)||"0",10);return isFinite(e)?e:0},dhe=function(){T.useEffect(function(){return document.body.setAttribute(Hu,(NA()+1).toString()),function(){var e=NA()-1;e<=0?document.body.removeAttribute(Hu):document.body.setAttribute(Hu,e.toString())}},[])},fhe=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;dhe();var i=T.useMemo(function(){return lhe(o)},[o]);return T.createElement(che,{styles:uhe(i,!t,o,n?"":"!important")})},XS=!1;if(typeof window<"u")try{var Nm=Object.defineProperty({},"passive",{get:function(){return XS=!0,!0}});window.addEventListener("test",Nm,Nm),window.removeEventListener("test",Nm,Nm)}catch{XS=!1}var gu=XS?{passive:!1}:!1,hhe=function(e){return e.tagName==="TEXTAREA"},X3=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!hhe(e)&&n[t]==="visible")},phe=function(e){return X3(e,"overflowY")},ghe=function(e){return X3(e,"overflowX")},FA=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Q3(e,r);if(o){var i=Z3(e,r),s=i[1],a=i[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},mhe=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},bhe=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Q3=function(e,t){return e==="v"?phe(t):ghe(t)},Z3=function(e,t){return e==="v"?mhe(t):bhe(t)},yhe=function(e,t){return e==="h"&&t==="rtl"?-1:1},vhe=function(e,t,n,r,o){var i=yhe(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),c=!1,u=s>0,d=0,p=0;do{var h=Z3(e,a),m=h[0],b=h[1],y=h[2],v=b-y-i*m;(m||v)&&Q3(e,a)&&(d+=v,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},Fm=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},LA=function(e){return[e.deltaX,e.deltaY]},$A=function(e){return e&&"current"in e?e.current:e},xhe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},whe=function(e){return`
375
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
376
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
377
+ `)},She=0,mu=[];function _he(e){var t=T.useRef([]),n=T.useRef([0,0]),r=T.useRef(),o=T.useState(She++)[0],i=T.useState(K3)[0],s=T.useRef(e);T.useEffect(function(){s.current=e},[e]),T.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var b=Vfe([e.lockRef.current],(e.shards||[]).map($A),!0).filter(Boolean);return b.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),b.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=T.useCallback(function(b,y){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!s.current.allowPinchZoom;var v=Fm(b),w=n.current,_="deltaX"in b?b.deltaX:w[0]-v[0],R="deltaY"in b?b.deltaY:w[1]-v[1],C,E=b.target,P=Math.abs(_)>Math.abs(R)?"h":"v";if("touches"in b&&P==="h"&&E.type==="range")return!1;var A=FA(P,E);if(!A)return!0;if(A?C=P:(C=P==="v"?"h":"v",A=FA(P,E)),!A)return!1;if(!r.current&&"changedTouches"in b&&(_||R)&&(r.current=C),!C)return!0;var I=r.current||C;return vhe(I,y,b,I==="h"?_:R)},[]),l=T.useCallback(function(b){var y=b;if(!(!mu.length||mu[mu.length-1]!==i)){var v="deltaY"in y?LA(y):Fm(y),w=t.current.filter(function(C){return C.name===y.type&&(C.target===y.target||y.target===C.shadowParent)&&xhe(C.delta,v)})[0];if(w&&w.should){y.cancelable&&y.preventDefault();return}if(!w){var _=(s.current.shards||[]).map($A).filter(Boolean).filter(function(C){return C.contains(y.target)}),R=_.length>0?a(y,_[0]):!s.current.noIsolation;R&&y.cancelable&&y.preventDefault()}}},[]),c=T.useCallback(function(b,y,v,w){var _={name:b,delta:y,target:v,should:w,shadowParent:Che(v)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(R){return R!==_})},1)},[]),u=T.useCallback(function(b){n.current=Fm(b),r.current=void 0},[]),d=T.useCallback(function(b){c(b.type,LA(b),b.target,a(b,e.lockRef.current))},[]),p=T.useCallback(function(b){c(b.type,Fm(b),b.target,a(b,e.lockRef.current))},[]);T.useEffect(function(){return mu.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",l,gu),document.addEventListener("touchmove",l,gu),document.addEventListener("touchstart",u,gu),function(){mu=mu.filter(function(b){return b!==i}),document.removeEventListener("wheel",l,gu),document.removeEventListener("touchmove",l,gu),document.removeEventListener("touchstart",u,gu)}},[]);var h=e.removeScrollBar,m=e.inert;return T.createElement(T.Fragment,null,m?T.createElement(i,{styles:whe(o)}):null,h?T.createElement(fhe,{gapMode:e.gapMode}):null)}function Che(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Ehe=Jfe(Y3,_he);var jp=T.forwardRef(function(e,t){return T.createElement(_0,Ji({},e,{ref:t,sideCar:Ehe}))});jp.classNames=_0.classNames;var Rhe=[" ","Enter","ArrowUp","ArrowDown"],The=[" ","Enter"],zp="Select",[C0,E0,khe]=Fy(zp),[Ud,WAe]=lr(zp,[khe,vs]),R0=vs(),[Phe,cl]=Ud(zp),[Ohe,Mhe]=Ud(zp),J3=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:c,name:u,autoComplete:d,disabled:p,required:h,form:m}=e,b=R0(t),[y,v]=T.useState(null),[w,_]=T.useState(null),[R,C]=T.useState(!1),E=$c(c),[P=!1,A]=$r({prop:r,defaultProp:o,onChange:i}),[I,F]=$r({prop:s,defaultProp:a,onChange:l}),L=T.useRef(null),j=y?m||!!y.closest("form"):!0,[X,U]=T.useState(new Set),$=Array.from(X).map(B=>B.props.value).join(";");return x.jsx(Ap,{...b,children:x.jsxs(Phe,{required:h,scope:t,trigger:y,onTriggerChange:v,valueNode:w,onValueNodeChange:_,valueNodeHasChildren:R,onValueNodeHasChildrenChange:C,contentId:Jn(),value:I,onValueChange:F,open:P,onOpenChange:A,dir:E,triggerPointerDownPosRef:L,disabled:p,children:[x.jsx(C0.Provider,{scope:t,children:x.jsx(Ohe,{scope:e.__scopeSelect,onNativeOptionAdd:T.useCallback(B=>{U(W=>new Set(W).add(B))},[]),onNativeOptionRemove:T.useCallback(B=>{U(W=>{const q=new Set(W);return q.delete(B),q})},[]),children:n})}),j?x.jsxs(E$,{"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:d,value:I,onChange:B=>F(B.target.value),disabled:p,form:m,children:[I===void 0?x.jsx("option",{value:""}):null,Array.from(X)]},$):null]})})};J3.displayName=zp;var e$="SelectTrigger",t$=T.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=R0(n),s=cl(e$,n),a=s.disabled||r,l=dt(t,s.onTriggerChange),c=E0(n),u=T.useRef("touch"),[d,p,h]=R$(b=>{const y=c().filter(_=>!_.disabled),v=y.find(_=>_.value===s.value),w=T$(y,b,v);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 x.jsx(Wd,{asChild:!0,...i,children:x.jsx(je.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":C$(s.value)?"":void 0,...o,ref:l,onClick:Te(o.onClick,b=>{b.currentTarget.focus(),u.current!=="mouse"&&m(b)}),onPointerDown:Te(o.onPointerDown,b=>{u.current=b.pointerType;const y=b.target;y.hasPointerCapture(b.pointerId)&&y.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(m(b),b.preventDefault())}),onKeyDown:Te(o.onKeyDown,b=>{const y=d.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&p(b.key),!(y&&b.key===" ")&&Rhe.includes(b.key)&&(m(),b.preventDefault())})})})});t$.displayName=e$;var n$="SelectValue",r$=T.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=e,l=cl(n$,n),{onValueNodeHasChildrenChange:c}=l,u=i!==void 0,d=dt(t,l.onValueNodeChange);return Cr(()=>{c(u)},[c,u]),x.jsx(je.span,{...a,ref:d,style:{pointerEvents:"none"},children:C$(l.value)?x.jsx(x.Fragment,{children:s}):i})});r$.displayName=n$;var Ahe="SelectIcon",o$=T.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return x.jsx(je.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});o$.displayName=Ahe;var Dhe="SelectPortal",i$=e=>x.jsx(Np,{asChild:!0,...e});i$.displayName=Dhe;var Mc="SelectContent",s$=T.forwardRef((e,t)=>{const n=cl(Mc,e.__scopeSelect),[r,o]=T.useState();if(Cr(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?wc.createPortal(x.jsx(a$,{scope:e.__scopeSelect,children:x.jsx(C0.Slot,{scope:e.__scopeSelect,children:x.jsx("div",{children:e.children})})}),i):null}return x.jsx(l$,{...e,ref:t})});s$.displayName=Mc;var Ci=10,[a$,ul]=Ud(Mc),Ihe="SelectContentImpl",l$=T.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:p,collisionPadding:h,sticky:m,hideWhenDetached:b,avoidCollisions:y,...v}=e,w=cl(Mc,n),[_,R]=T.useState(null),[C,E]=T.useState(null),P=dt(t,Y=>R(Y)),[A,I]=T.useState(null),[F,L]=T.useState(null),j=E0(n),[X,U]=T.useState(!1),$=T.useRef(!1);T.useEffect(()=>{if(_)return S0(_)},[_]),x0();const B=T.useCallback(Y=>{const[J,...ie]=j().map(se=>se.ref.current),[de]=ie.slice(-1),he=document.activeElement;for(const se of Y)if(se===he||(se==null||se.scrollIntoView({block:"nearest"}),se===J&&C&&(C.scrollTop=0),se===de&&C&&(C.scrollTop=C.scrollHeight),se==null||se.focus(),document.activeElement!==he))return},[j,C]),W=T.useCallback(()=>B([A,_]),[B,A,_]);T.useEffect(()=>{X&&W()},[X,W]);const{onOpenChange:q,triggerPointerDownPosRef:Q}=w;T.useEffect(()=>{if(_){let Y={x:0,y:0};const J=de=>{var he,se;Y={x:Math.abs(Math.round(de.pageX)-(((he=Q.current)==null?void 0:he.x)??0)),y:Math.abs(Math.round(de.pageY)-(((se=Q.current)==null?void 0:se.y)??0))}},ie=de=>{Y.x<=10&&Y.y<=10?de.preventDefault():_.contains(de.target)||q(!1),document.removeEventListener("pointermove",J),Q.current=null};return Q.current!==null&&(document.addEventListener("pointermove",J),document.addEventListener("pointerup",ie,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",J),document.removeEventListener("pointerup",ie,{capture:!0})}}},[_,q,Q]),T.useEffect(()=>{const Y=()=>q(!1);return window.addEventListener("blur",Y),window.addEventListener("resize",Y),()=>{window.removeEventListener("blur",Y),window.removeEventListener("resize",Y)}},[q]);const[D,G]=R$(Y=>{const J=j().filter(he=>!he.disabled),ie=J.find(he=>he.ref.current===document.activeElement),de=T$(J,Y,ie);de&&setTimeout(()=>de.ref.current.focus())}),V=T.useCallback((Y,J,ie)=>{const de=!$.current&&!ie;(w.value!==void 0&&w.value===J||de)&&(I(Y),de&&($.current=!0))},[w.value]),M=T.useCallback(()=>_==null?void 0:_.focus(),[_]),ee=T.useCallback((Y,J,ie)=>{const de=!$.current&&!ie;(w.value!==void 0&&w.value===J||de)&&L(Y)},[w.value]),K=r==="popper"?QS:c$,re=K===QS?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:p,collisionPadding:h,sticky:m,hideWhenDetached:b,avoidCollisions:y}:{};return x.jsx(a$,{scope:n,content:_,viewport:C,onViewportChange:E,itemRefCallback:V,selectedItem:A,onItemLeave:M,itemTextRefCallback:ee,focusSelectedItem:W,selectedItemText:F,position:r,isPositioned:X,searchRef:D,children:x.jsx(jp,{as:Js,allowPinchZoom:!0,children:x.jsx($p,{asChild:!0,trapped:w.open,onMountAutoFocus:Y=>{Y.preventDefault()},onUnmountAutoFocus:Te(o,Y=>{var J;(J=w.trigger)==null||J.focus({preventScroll:!0}),Y.preventDefault()}),children:x.jsx(Wc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:Y=>Y.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:x.jsx(K,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:Y=>Y.preventDefault(),...v,...re,onPlaced:()=>U(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:Te(v.onKeyDown,Y=>{const J=Y.ctrlKey||Y.altKey||Y.metaKey;if(Y.key==="Tab"&&Y.preventDefault(),!J&&Y.key.length===1&&G(Y.key),["ArrowUp","ArrowDown","Home","End"].includes(Y.key)){let de=j().filter(he=>!he.disabled).map(he=>he.ref.current);if(["ArrowUp","End"].includes(Y.key)&&(de=de.slice().reverse()),["ArrowUp","ArrowDown"].includes(Y.key)){const he=Y.target,se=de.indexOf(he);de=de.slice(se+1)}setTimeout(()=>B(de)),Y.preventDefault()}})})})})})})});l$.displayName=Ihe;var Nhe="SelectItemAlignedPosition",c$=T.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=cl(Mc,n),s=ul(Mc,n),[a,l]=T.useState(null),[c,u]=T.useState(null),d=dt(t,P=>u(P)),p=E0(n),h=T.useRef(!1),m=T.useRef(!0),{viewport:b,selectedItem:y,selectedItemText:v,focusSelectedItem:w}=s,_=T.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&b&&y&&v){const P=i.trigger.getBoundingClientRect(),A=c.getBoundingClientRect(),I=i.valueNode.getBoundingClientRect(),F=v.getBoundingClientRect();if(i.dir!=="rtl"){const he=F.left-A.left,se=I.left-he,ge=P.left-se,ue=P.width+ge,Ce=Math.max(ue,A.width),ke=window.innerWidth-Ci,Ne=KS(se,[Ci,Math.max(Ci,ke-Ce)]);a.style.minWidth=ue+"px",a.style.left=Ne+"px"}else{const he=A.right-F.right,se=window.innerWidth-I.right-he,ge=window.innerWidth-P.right-se,ue=P.width+ge,Ce=Math.max(ue,A.width),ke=window.innerWidth-Ci,Ne=KS(se,[Ci,Math.max(Ci,ke-Ce)]);a.style.minWidth=ue+"px",a.style.right=Ne+"px"}const L=p(),j=window.innerHeight-Ci*2,X=b.scrollHeight,U=window.getComputedStyle(c),$=parseInt(U.borderTopWidth,10),B=parseInt(U.paddingTop,10),W=parseInt(U.borderBottomWidth,10),q=parseInt(U.paddingBottom,10),Q=$+B+X+q+W,D=Math.min(y.offsetHeight*5,Q),G=window.getComputedStyle(b),V=parseInt(G.paddingTop,10),M=parseInt(G.paddingBottom,10),ee=P.top+P.height/2-Ci,K=j-ee,re=y.offsetHeight/2,Y=y.offsetTop+re,J=$+B+Y,ie=Q-J;if(J<=ee){const he=L.length>0&&y===L[L.length-1].ref.current;a.style.bottom="0px";const se=c.clientHeight-b.offsetTop-b.offsetHeight,ge=Math.max(K,re+(he?M:0)+se+W),ue=J+ge;a.style.height=ue+"px"}else{const he=L.length>0&&y===L[0].ref.current;a.style.top="0px";const ge=Math.max(ee,$+b.offsetTop+(he?V:0)+re)+ie;a.style.height=ge+"px",b.scrollTop=J-ee+b.offsetTop}a.style.margin=`${Ci}px 0`,a.style.minHeight=D+"px",a.style.maxHeight=j+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[p,i.trigger,i.valueNode,a,c,b,y,v,i.dir,r]);Cr(()=>_(),[_]);const[R,C]=T.useState();Cr(()=>{c&&C(window.getComputedStyle(c).zIndex)},[c]);const E=T.useCallback(P=>{P&&m.current===!0&&(_(),w==null||w(),m.current=!1)},[_,w]);return x.jsx(Lhe,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:E,children:x.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:R},children:x.jsx(je.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});c$.displayName=Nhe;var Fhe="SelectPopperPosition",QS=T.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Ci,...i}=e,s=R0(n);return x.jsx(Dp,{...s,...i,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.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)"}})});QS.displayName=Fhe;var[Lhe,XE]=Ud(Mc,{}),ZS="SelectViewport",u$=T.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=ul(ZS,n),s=XE(ZS,n),a=dt(t,i.onViewportChange),l=T.useRef(0);return x.jsxs(x.Fragment,{children:[x.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}),x.jsx(C0.Slot,{scope:n,children:x.jsx(je.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Te(o.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-Ci*2,b=parseFloat(d.style.minHeight),y=parseFloat(d.style.height),v=Math.max(b,y);if(v<m){const w=v+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})})})]})});u$.displayName=ZS;var d$="SelectGroup",[$he,jhe]=Ud(d$),f$=T.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Jn();return x.jsx($he,{scope:n,id:o,children:x.jsx(je.div,{role:"group","aria-labelledby":o,...r,ref:t})})});f$.displayName=d$;var h$="SelectLabel",p$=T.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=jhe(h$,n);return x.jsx(je.div,{id:o.id,...r,ref:t})});p$.displayName=h$;var ay="SelectItem",[zhe,g$]=Ud(ay),m$=T.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,a=cl(ay,n),l=ul(ay,n),c=a.value===r,[u,d]=T.useState(i??""),[p,h]=T.useState(!1),m=dt(t,w=>{var _;return(_=l.itemRefCallback)==null?void 0:_.call(l,w,r,o)}),b=Jn(),y=T.useRef("touch"),v=()=>{o||(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 x.jsx(zhe,{scope:n,value:r,disabled:o,textId:b,isSelected:c,onItemTextChange:T.useCallback(w=>{d(_=>_||((w==null?void 0:w.textContent)??"").trim())},[]),children:x.jsx(C0.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:x.jsx(je.div,{role:"option","aria-labelledby":b,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:m,onFocus:Te(s.onFocus,()=>h(!0)),onBlur:Te(s.onBlur,()=>h(!1)),onClick:Te(s.onClick,()=>{y.current!=="mouse"&&v()}),onPointerUp:Te(s.onPointerUp,()=>{y.current==="mouse"&&v()}),onPointerDown:Te(s.onPointerDown,w=>{y.current=w.pointerType}),onPointerMove:Te(s.onPointerMove,w=>{var _;y.current=w.pointerType,o?(_=l.onItemLeave)==null||_.call(l):y.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Te(s.onPointerLeave,w=>{var _;w.currentTarget===document.activeElement&&((_=l.onItemLeave)==null||_.call(l))}),onKeyDown:Te(s.onKeyDown,w=>{var R;((R=l.searchRef)==null?void 0:R.current)!==""&&w.key===" "||(The.includes(w.key)&&v(),w.key===" "&&w.preventDefault())})})})})});m$.displayName=ay;var rh="SelectItemText",b$=T.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=cl(rh,n),a=ul(rh,n),l=g$(rh,n),c=Mhe(rh,n),[u,d]=T.useState(null),p=dt(t,v=>d(v),l.onItemTextChange,v=>{var w;return(w=a.itemTextRefCallback)==null?void 0:w.call(a,v,l.value,l.disabled)}),h=u==null?void 0:u.textContent,m=T.useMemo(()=>x.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:b,onNativeOptionRemove:y}=c;return Cr(()=>(b(m),()=>y(m)),[b,y,m]),x.jsxs(x.Fragment,{children:[x.jsx(je.span,{id:l.textId,...i,ref:p}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?wc.createPortal(i.children,s.valueNode):null]})});b$.displayName=rh;var y$="SelectItemIndicator",v$=T.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return g$(y$,n).isSelected?x.jsx(je.span,{"aria-hidden":!0,...r,ref:t}):null});v$.displayName=y$;var JS="SelectScrollUpButton",x$=T.forwardRef((e,t)=>{const n=ul(JS,e.__scopeSelect),r=XE(JS,e.__scopeSelect),[o,i]=T.useState(!1),s=dt(t,r.onScrollButtonChange);return Cr(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollTop>0;i(c)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?x.jsx(S$,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});x$.displayName=JS;var e_="SelectScrollDownButton",w$=T.forwardRef((e,t)=>{const n=ul(e_,e.__scopeSelect),r=XE(e_,e.__scopeSelect),[o,i]=T.useState(!1),s=dt(t,r.onScrollButtonChange);return Cr(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<c;i(u)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?x.jsx(S$,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});w$.displayName=e_;var S$=T.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=ul("SelectScrollButton",n),s=T.useRef(null),a=E0(n),l=T.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return T.useEffect(()=>()=>l(),[l]),Cr(()=>{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]),x.jsx(je.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:Te(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:Te(o.onPointerMove,()=>{var c;(c=i.onItemLeave)==null||c.call(i),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:Te(o.onPointerLeave,()=>{l()})})}),Bhe="SelectSeparator",_$=T.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return x.jsx(je.div,{"aria-hidden":!0,...r,ref:t})});_$.displayName=Bhe;var t_="SelectArrow",Hhe=T.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=R0(n),i=cl(t_,n),s=ul(t_,n);return i.open&&s.position==="popper"?x.jsx(Ip,{...o,...r,ref:t}):null});Hhe.displayName=t_;function C$(e){return e===""||e===void 0}var E$=T.forwardRef((e,t)=>{const{value:n,...r}=e,o=T.useRef(null),i=dt(t,o),s=w0(n);return T.useEffect(()=>{const a=o.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]),x.jsx($E,{asChild:!0,children:x.jsx("select",{...r,ref:i,defaultValue:n})})});E$.displayName="BubbleSelect";function R$(e){const t=ir(e),n=T.useRef(""),r=T.useRef(0),o=T.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]),i=T.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return T.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function T$(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=Whe(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function Whe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Vhe=J3,k$=t$,Uhe=r$,Ghe=o$,qhe=i$,P$=s$,Yhe=u$,Khe=f$,O$=p$,M$=m$,Xhe=b$,Qhe=v$,A$=x$,D$=w$,I$=_$;const $s=Vhe,_u=Khe,js=Uhe,Vi=T.forwardRef(({className:e,children:t,...n},r)=>x.jsxs(k$,{ref:r,className:me("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,x.jsx(Ghe,{asChild:!0,children:x.jsx(Tp,{className:"h-4 w-4 opacity-50"})})]}));Vi.displayName=k$.displayName;const N$=T.forwardRef(({className:e,...t},n)=>x.jsx(A$,{ref:n,className:me("flex cursor-default items-center justify-center py-1",e),...t,children:x.jsx(lF,{className:"h-4 w-4"})}));N$.displayName=A$.displayName;const F$=T.forwardRef(({className:e,...t},n)=>x.jsx(D$,{ref:n,className:me("flex cursor-default items-center justify-center py-1",e),...t,children:x.jsx(Tp,{className:"h-4 w-4"})}));F$.displayName=D$.displayName;const Ui=T.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>x.jsx(qhe,{children:x.jsx(Lc,{children:x.jsxs(P$,{ref:o,className:me("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:[x.jsx(N$,{}),x.jsx(Yhe,{className:me("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),x.jsx(F$,{})]})})}));Ui.displayName=P$.displayName;const jl=T.forwardRef(({className:e,...t},n)=>x.jsx(O$,{ref:n,className:me("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));jl.displayName=O$.displayName;const Bn=T.forwardRef(({className:e,children:t,...n},r)=>x.jsxs(M$,{ref:r,className:me("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:[x.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:x.jsx(Qhe,{children:x.jsx(Fd,{className:"h-4 w-4"})})}),x.jsx(Xhe,{children:t})]}));Bn.displayName=M$.displayName;const Sh=T.forwardRef(({className:e,...t},n)=>x.jsx(I$,{ref:n,className:me("-mx-1 my-1 h-px bg-muted",e),...t}));Sh.displayName=I$.displayName;const mc=T.forwardRef(({className:e,type:t,...n},r)=>x.jsx("input",{type:t,className:me("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}));mc.displayName="Input";var Zhe="Label",L$=T.forwardRef((e,t)=>x.jsx(je.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));L$.displayName=Zhe;var $$=L$;const Jhe=HE("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Tn=T.forwardRef(({className:e,...t},n)=>x.jsx($$,{ref:n,className:me(Jhe(),e),...t}));Tn.displayName=$$.displayName;var QE="Popover",[j$,VAe]=lr(QE,[vs]),Bp=vs(),[epe,dl]=j$(QE),z$=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,a=Bp(t),l=T.useRef(null),[c,u]=T.useState(!1),[d=!1,p]=$r({prop:r,defaultProp:o,onChange:i});return x.jsx(Ap,{...a,children:x.jsx(epe,{scope:t,contentId:Jn(),triggerRef:l,open:d,onOpenChange:p,onOpenToggle:T.useCallback(()=>p(h=>!h),[p]),hasCustomAnchor:c,onCustomAnchorAdd:T.useCallback(()=>u(!0),[]),onCustomAnchorRemove:T.useCallback(()=>u(!1),[]),modal:s,children:n})})};z$.displayName=QE;var B$="PopoverAnchor",tpe=T.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=dl(B$,n),i=Bp(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:a}=o;return T.useEffect(()=>(s(),()=>a()),[s,a]),x.jsx(Wd,{...i,...r,ref:t})});tpe.displayName=B$;var H$="PopoverTrigger",W$=T.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=dl(H$,n),i=Bp(n),s=dt(t,o.triggerRef),a=x.jsx(je.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Y$(o.open),...r,ref:s,onClick:Te(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:x.jsx(Wd,{asChild:!0,...i,children:a})});W$.displayName=H$;var ZE="PopoverPortal",[npe,rpe]=j$(ZE,{forceMount:void 0}),V$=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=dl(ZE,t);return x.jsx(npe,{scope:t,forceMount:n,children:x.jsx(er,{present:n||i.open,children:x.jsx(Np,{asChild:!0,container:o,children:r})})})};V$.displayName=ZE;var Td="PopoverContent",U$=T.forwardRef((e,t)=>{const n=rpe(Td,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=dl(Td,e.__scopePopover);return x.jsx(er,{present:r||i.open,children:i.modal?x.jsx(ope,{...o,ref:t}):x.jsx(ipe,{...o,ref:t})})});U$.displayName=Td;var ope=T.forwardRef((e,t)=>{const n=dl(Td,e.__scopePopover),r=T.useRef(null),o=dt(t,r),i=T.useRef(!1);return T.useEffect(()=>{const s=r.current;if(s)return S0(s)},[]),x.jsx(jp,{as:Js,allowPinchZoom:!0,children:x.jsx(G$,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Te(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),i.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Te(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;i.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Te(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),ipe=T.forwardRef((e,t)=>{const n=dl(Td,e.__scopePopover),r=T.useRef(!1),o=T.useRef(!1);return x.jsx(G$,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;((c=n.triggerRef.current)==null?void 0:c.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),G$=T.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...d}=e,p=dl(Td,n),h=Bp(n);return x0(),x.jsx($p,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:x.jsx(Wc,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>p.onOpenChange(!1),children:x.jsx(Dp,{"data-state":Y$(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)"}})})})}),q$="PopoverClose",spe=T.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=dl(q$,n);return x.jsx(je.button,{type:"button",...r,ref:t,onClick:Te(e.onClick,()=>o.onOpenChange(!1))})});spe.displayName=q$;var ape="PopoverArrow",lpe=T.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Bp(n);return x.jsx(Ip,{...o,...r,ref:t})});lpe.displayName=ape;function Y$(e){return e?"open":"closed"}var cpe=z$,upe=W$,dpe=V$,K$=U$;const T0=cpe,k0=upe,Hp=T.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>x.jsx(dpe,{children:x.jsx(Lc,{children:x.jsx(K$,{ref:o,align:t,sideOffset:n,className:me("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})})}));Hp.displayName=K$.displayName;function fpe(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 X$({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 o(s){const a=[...e];a.splice(s,1),t(a)}function i(){t([...e,n])}return x.jsxs("div",{className:"space-y-3",children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx(Tn,{children:"Color Range"}),x.jsx(sr,{onClick:i,variant:"secondary",className:"h-5 p-1 text-muted-foreground",children:x.jsx(Zy,{className:"size-3"})})]}),e.map((s,a)=>x.jsxs("div",{className:"flex items-center gap-2 px-2",children:[x.jsx(mc,{onChange:l=>r(a,"start",l.target.value),value:s.start,className:me(`h-7 ${ch}`)}),x.jsx("span",{children:"-"}),x.jsx(mc,{value:s.end,onChange:l=>r(a,"end",l.target.value),className:me(`h-7 ${ch}`)}),x.jsx(mc,{onChange:l=>r(a,"color",l.target.value),value:s.color,className:me(`h-7 min-w-14 p-0 ${ch}`),type:"color",list:"presetColors"}),x.jsxs("datalist",{id:"presetColors",children:[x.jsx("option",{children:Ut.green[600]}),x.jsx("option",{children:Ut.red[500]}),x.jsx("option",{children:Ut.yellow[400]}),x.jsx("option",{children:Ut.orange[500]})]}),x.jsx(sr,{onClick:()=>o(a),variant:"secondary",className:"h-5 p-1 text-muted-foreground",children:x.jsx(Bc,{className:"size-3"})})]},a))]})}var hpe="Toggle",Q$=T.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:o,...i}=e,[s=!1,a]=$r({prop:n,onChange:o,defaultProp:r});return x.jsx(je.button,{type:"button","aria-pressed":s,"data-state":s?"on":"off","data-disabled":e.disabled?"":void 0,...i,ref:t,onClick:Te(e.onClick,()=>{e.disabled||a(!s)})})});Q$.displayName=hpe;var Z$=Q$;const ppe=HE("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"}}),P0=T.forwardRef(({className:e,variant:t,size:n,...r},o)=>x.jsx(Z$,{ref:o,className:me(ppe({variant:t,size:n,className:e})),...r}));P0.displayName=Z$.displayName;function gpe(e,t){var r;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(o=>o.columnIdx===t);return n==null?void 0:n.type}function mpe(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t);return((o=n==null?void 0:n.options)==null?void 0:o.locale)||"en-US"}function bpe(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t&&i.type==="date");return((o=n==null?void 0:n.options)==null?void 0:o.format)||"short-date-time"}function ype(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t);return(o=n==null?void 0:n.options)==null?void 0:o.currency}function vpe(e,t){var r,o,i;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(s=>s.columnIdx===t);return((i=(o=n==null?void 0:n.options)==null?void 0:o.options)==null?void 0:i.minimumFractionDigits)||0}function xpe(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t);return((o=n==null?void 0:n.options)==null?void 0:o.colorRanges)||[]}function wpe(e,t){var r,o,i;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(s=>s.columnIdx===t);return((i=(o=n==null?void 0:n.options)==null?void 0:o.options)==null?void 0:i.style)==="percent"}function Spe(e,t){var r;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(o=>o.columnIdx===t);return n==null?void 0:n.textAlign}function _pe(e,t){var r;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(o=>o.columnIdx===t);return n==null?void 0:n.width}function Cpe({columnIndex:e,columnName:t}){const[n,r]=k.useState(!1),o=bo(B=>{var W;return(W=B.card)==null?void 0:W.preferences}),[i,s]=k.useState(gpe(o,e)),[a,l]=k.useState(Spe(o,e)),[c,u]=k.useState(_pe(o,e)),[d,p]=k.useState(xpe(o,e)),[h,m]=k.useState(mpe(o,e)),[b,y]=k.useState(bpe(o,e)),[v,w]=k.useState(ype(o,e)),[_,R]=k.useState(vpe(o,e).toString()),[C,E]=k.useState(wpe(o,e)),[P,A]=k.useState(""),I=bo(B=>B.actions.setCardPreferences);function F(){return x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[x.jsx(Tn,{className:"col-span-3",htmlFor:"format",children:"Text Align"}),x.jsxs($s,{value:a||"left",onValueChange:B=>l(B),children:[x.jsx(Vi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:x.jsx(js,{})}),x.jsxs(Ui,{children:[x.jsx(Bn,{value:"left",children:"Left"}),x.jsx(Bn,{value:"center",children:"Center"}),x.jsx(Bn,{value:"right",children:"Right"})]})]})]}),x.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[x.jsx(Tn,{className:"col-span-3",htmlFor:"format",children:"Width (px)"}),x.jsx(mc,{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:B=>{B.target.value===""?u(void 0):u(Number(B.target.value))}})]})]})}function L(){const B=[...new Set(E1.map(W=>W.currency))];return x.jsx(x.Fragment,{children:x.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[x.jsx(Tn,{className:"col-span-3",htmlFor:"format",children:"Locale"}),x.jsxs($s,{value:h,onValueChange:W=>m(W),children:[x.jsx(Vi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:x.jsx(js,{})}),x.jsx(Ui,{children:x.jsxs(_u,{children:[x.jsx(jl,{children:"Locale"}),E1.map(W=>x.jsx(Bn,{value:W.locale,children:W.locale},W.locale))]})})]}),x.jsx(Tn,{className:"col-span-3",htmlFor:"format",children:"Currency"}),x.jsxs($s,{value:v||"none",onValueChange:W=>w(W==="none"?void 0:W),children:[x.jsx(Vi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:x.jsx(js,{})}),x.jsx(Ui,{children:x.jsxs(_u,{children:[x.jsx(jl,{children:"Currency"}),x.jsx(Bn,{value:"none",children:"None"}),B.map(W=>x.jsx(Bn,{value:W,children:W},W))]})})]}),x.jsx(Tn,{className:"col-span-3",htmlFor:"format",children:"Decimals"}),x.jsxs($s,{value:_,onValueChange:W=>R(W),children:[x.jsx(Vi,{className:"col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0",children:x.jsx(js,{})}),x.jsx(Ui,{children:["0","1","2","3","4"].map(W=>x.jsx(Bn,{value:W,children:W},W))})]}),!v&&x.jsx(P0,{onPressedChange:W=>E(W),variant:"outline",size:"sm",className:"col-span-3 h-8","aria-label":"Toggle italic",children:x.jsx(xF,{className:"size-3"})})]})})}function j(){return x.jsx(x.Fragment,{children:x.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[x.jsx(Tn,{className:"col-span-3",htmlFor:"format",children:"Locale"}),x.jsxs($s,{defaultValue:"en-US",value:h,onValueChange:B=>m(B),children:[x.jsx(Vi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:x.jsx(js,{})}),x.jsx(Ui,{children:pX.map(B=>x.jsxs(_u,{children:[x.jsx(jl,{children:B.label}),B.locales.map(W=>x.jsx(Bn,{value:W.code,children:W.name},W.code))]},B.label))})]}),x.jsx(Tn,{className:"col-span-3",htmlFor:"format",children:"Format"}),x.jsxs($s,{defaultValue:"short-date-time",value:b,onValueChange:B=>{console.log("format",B),y(B)},children:[x.jsx(Vi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:x.jsx(js,{})}),x.jsx(Ui,{className:"",id:"type",children:x.jsxs(_u,{children:[x.jsx(jl,{children:"Option"}),x.jsx(Bn,{value:"full-date-time",children:"Full Date-Time"}),x.jsx(Bn,{value:"short-date-time",children:"Short Date-Time"}),x.jsx(Bn,{value:"hours-date-time",children:"24-Hour Date-Time"}),x.jsx(Bn,{value:"short-date",children:"Short Date"}),x.jsx(Bn,{value:"long-date",children:"Long Date"})]})})]})]})})}function X(){I({...o,columnSettings:[]})}function U(){var B;I({...o,columnSettings:[...((B=o==null?void 0:o.columnSettings)==null?void 0:B.filter(W=>W.columnIdx!==e))||[]]})}function $(){var B,W,q,Q;if(i==="date"){const D=fpe(h,b),G={columnIdx:e,type:i,options:D};I({...o,columnSettings:[...((B=o==null?void 0:o.columnSettings)==null?void 0:B.filter(V=>V.columnIdx!==e))||[],G]})}else if(i==="number"){let D;v?D={locale:h,currency:v,options:{style:"currency",currency:v,minimumFractionDigits:Number(_)},colorRanges:d.length>0?d:void 0}:D={locale:h,currency:void 0,options:{style:C?"percent":"decimal",minimumFractionDigits:Number(_)},colorRanges:d.length>0?d:void 0};const G={columnIdx:e,type:i,textAlign:a,width:c,options:D};I({...o,columnSettings:[...((W=o==null?void 0:o.columnSettings)==null?void 0:W.filter(V=>V.columnIdx!==e))||[],G]})}else if(i==="html"){const D={columnIdx:e,type:i,options:{html:""}};I({...o,columnSettings:[...((q=o==null?void 0:o.columnSettings)==null?void 0:q.filter(G=>G.columnIdx!==e))||[],D]})}else{const D={columnIdx:e,type:"none",textAlign:a,width:c,options:{}};I({...o,columnSettings:[...((Q=o==null?void 0:o.columnSettings)==null?void 0:Q.filter(G=>G.columnIdx!==e))||[],D]})}}return x.jsxs(T0,{onOpenChange:B=>r(B),children:[x.jsx(k0,{asChild:!0,children:x.jsx(vF,{className:"size-3 cursor-pointer text-muted"})}),x.jsx(Hp,{align:"center",className:"max-w-70 z-20",children:x.jsxs("div",{className:"grid gap-4",children:[x.jsxs("div",{className:"space-y-2",children:[x.jsx("h4",{className:"font-medium leading-none",children:"Display Settings"}),x.jsx("p",{className:"text-sm text-muted-foreground",children:`Display setting for '${t}'`})]}),x.jsxs("div",{className:"grid gap-2",children:[x.jsxs("div",{className:"grid grid-cols-3 items-center gap-2",children:[x.jsx(Tn,{htmlFor:"scale",children:"Type"}),x.jsxs($s,{value:i||"none",onValueChange:B=>s(B),children:[x.jsx(Vi,{className:"col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0",children:x.jsx(js,{})}),x.jsx(Ui,{id:"type",children:x.jsxs(_u,{children:[x.jsx(jl,{children:"Option"}),x.jsx(Bn,{value:"number",children:"Number"}),x.jsx(Bn,{value:"date",children:"Date"}),x.jsx(Bn,{value:"html",children:"HTML"}),x.jsx(Bn,{value:"none",children:"None"})]})})]})]}),F(),x.jsx(Sh,{}),i==="number"&&L(),i==="date"&&j(),i==="number"&&x.jsxs(x.Fragment,{children:[x.jsx(Sh,{}),x.jsx(X$,{colorRanges:d,setColorRanges:p})]}),x.jsx(Sh,{}),x.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[x.jsx(sr,{onClick:X,variant:"secondary",className:"col-span-1 col-start-1 h-8 w-full text-destructive",children:"Reset All"}),x.jsx(sr,{onClick:U,variant:"secondary",className:"col-span-1 col-start-2 h-8 w-full",children:"Reset"}),x.jsx(sr,{onClick:$,variant:"secondary",className:"col-span-1 col-start-3 h-8 w-full",children:"Apply"})]})]})]})})]})}function Epe(e){const t=new Date(e);return!isNaN(t.getTime())}function J$({data:e,card:t}){var R,C,E,P;const[n,r]=k.useState([]),{keys:o}=hr(e),i=ye(A=>A.filteringCards),s=ye(A=>A.themeStyle),a=ye(A=>A.isVisualEditing),l=i==null?void 0:i.find(A=>A.id===t.id),c=(R=t==null?void 0:t.preferences)==null?void 0:R.onClickFilter,{addOrUpdateFilterValues:u,addFilteringCard:d,removeFilterValues:p,removeFilteringCard:h}=Yn(),m=t==null?void 0:t.preferences;function b(A,I){if((I==null?void 0:I.type)==="date"&&Epe(A)){const{locale:F,options:L}=I.options,j=new Date(A);return new Date(j.getTime()).toLocaleDateString(F,L)}if((I==null?void 0:I.type)==="number"){const{locale:F,currency:L,options:j}=I.options;return L?new Intl.NumberFormat(F,{style:"currency",currency:L,...j}).format(A):new Intl.NumberFormat(F,j).format(A)}if((I==null?void 0:I.type)==="html"){const F=HS.sanitize(A);return x.jsx("div",{className:"hover:underline",dangerouslySetInnerHTML:{__html:F}})}return A}const y=o.map((A,I)=>({accessorKey:A,header:({column:F})=>{var W;const L=F.getIsSorted(),j=I,X=(W=m==null?void 0:m.columnSettings)==null?void 0:W.find(q=>q.columnIdx===j),U=X==null?void 0:X.textAlign,$=X==null?void 0:X.width,B=$?{width:$}:{};return x.jsxs("div",{className:"flex w-full items-center justify-between gap-2",children:[x.jsxs("div",{className:me("flex grow cursor-pointer items-center",{"justify-center":U==="center","justify-end":U==="right","justify-start":U==="left"}),style:B,onClick:()=>F.toggleSorting(F.getIsSorted()==="asc"),children:[A,L==="asc"?x.jsx(rF,{className:"ml-2 h-5 w-5"}):L==="desc"?x.jsx(nF,{className:"ml-2 h-5 w-5"}):null]}),x.jsx("div",{className:"opacity-0 group-hover:opacity-100",children:a&&x.jsx(Cpe,{columnName:F.id,columnIndex:I})})]})},cell:({cell:F})=>{var B,W;const L=F.getValue(),j=(B=m==null?void 0:m.columnSettings)==null?void 0:B.find(q=>q.columnIdx===I),X=b(L,j),U=YC(L,(W=j==null?void 0:j.options)==null?void 0:W.colorRanges),$=j==null?void 0:j.textAlign;return j!=null&&j.width&&j.width,x.jsx("p",{title:X,className:me("overflow-auto px-2 py-1",{"text-center":$==="center","text-right":$==="right","text-left":$==="left"}),style:{backgroundColor:U},children:X})}})),v=W3({data:e,columns:y,getCoreRowModel:z3(),getPaginationRowModel:B3(),onSortingChange:r,getSortedRowModel:H3(),manualPagination:!0,state:{sorting:n}}),w=v.getSelectedRowModel().rows;k.useEffect(()=>{if(w.length===0){if(l){const A=t.id;p(A),h(t)}return}if(c){const{dimensionKeys:A}=hr(e),I=c.map(F=>{const L=A==null?void 0:A[F.columnIndex],j=w.map(U=>U.getValue(L));return{filterId:t.id+"-"+L,connectionId:t==null?void 0:t.connectionId,tableName:t.lastSelectedTable,name:L,expression:F.expression,valueType:My(j[0]===void 0?"":j[0]),operation:"in",values:j}});u(I),d(t)}},[d,u,t,e,l,c,p,h,w]);function _(A){A.toggleSelected()}return x.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:(E=s==null?void 0:s.chart)==null?void 0:E.options.borderRadius},children:x.jsxs("table",{className:"w-full",onMouseDown:A=>A.stopPropagation(),children:[x.jsx(WE,{className:"group",children:v.getHeaderGroups().map(A=>x.jsx(xh,{children:A.headers.map((I,F)=>{var L,j,X,U,$,B,W;return x.jsx(UE,{style:{backgroundColor:(X=(j=(L=s==null?void 0:s.chart)==null?void 0:L.dataset)==null?void 0:j.backgroundColor)==null?void 0:X[0],color:ud((B=($=(U=s==null?void 0:s.chart)==null?void 0:U.dataset)==null?void 0:$.backgroundColor)==null?void 0:B[0])},className:me("sticky -top-[1px] h-9 bg-muted-foreground px-2 text-background",{"border-x":F>0&&F<A.headers.length-1,"border-l":F===1&&A.headers.length==2},(W=s==null?void 0:s.table)==null?void 0:W.tableHeaderColor),children:I.isPlaceholder?null:YS(I.column.columnDef.header,I.getContext())},I.id)})},A.id))}),x.jsx(VE,{children:(P=v.getRowModel().rows)!=null&&P.length?v.getRowModel().rows.map((A,I)=>x.jsx(xh,{onClick:()=>_(A),className:me("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":A.getIsSelected()&&"selected",children:A.getVisibleCells().map((F,L)=>{var $,B;const j=($=m==null?void 0:m.columnSettings)==null?void 0:$.find(W=>W.columnIdx===L),X=j==null?void 0:j.width,U=X?{width:X,maxWidth:X}:{};return x.jsx("td",{style:U,onClick:W=>{var Q;const q=((Q=window==null?void 0:window.getSelection())==null?void 0:Q.toString())||"";(q==null?void 0:q.length)>0&&W.stopPropagation()},className:me("",{"border-x":L>0&&L<y.length-1||L===1&&y.length==2,"border-l":L==0,"border-r":L===y.length-1,"border-b":I===((B=v.getRowModel().rows)==null?void 0:B.length)-1}),children:YS(F.column.columnDef.cell,F.getContext())},F.id)})},A.id)):x.jsx(xh,{children:x.jsx(GE,{colSpan:y.length,className:"p-1 text-center",children:"No results."})})})]})})}async function Rpe(e,t){const n=`${e}/index.js`,r=`${e}/style.css`;return document.querySelector(`link[href="${r}"]`)||await new Promise((i,s)=>{const a=document.createElement("link");a.rel="stylesheet",a.href=r,a.onload=()=>i(void 0),a.onerror=()=>s(new Error("Failed to load CSS")),document.head.appendChild(a)}),{default:(await import(n))[t]}}async function Tpe(e){try{const t=await import(e),n=Object.keys(t),r=[];return n.forEach(o=>{typeof t[o]=="function"&&(o==null?void 0:o[0])===(o==null?void 0:o[0].toUpperCase())&&r.push({name:o,component:o})}),r}catch(t){return console.error("Error loading the library:",t),[]}}async function e6(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 t6=e=>{const[t,n]=k.useState([]),[r,o]=k.useState(!1),[i,s]=k.useState(null);k.useEffect(()=>{window.React=k,window.ReactDOM=Ir,o(!0)},[]),k.useEffect(()=>{e&&r&&e6(e).then(c=>{n(c.visuals),s(c)}).catch(()=>{Tpe(e).then(c=>{console.log("componentNames",c),n(c)}).catch(c=>{console.error("Error loading manifest:",c)})})},[e,r]);const a=k.useMemo(()=>(t==null?void 0:t.map(c=>{const{name:u,component:d,dataInputs:p}=c;return{name:u,componentName:d,Component:k.lazy(()=>Rpe(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:i}};function n6({onLoadingStatus:e,onDataChange:t,card:n}){const{isFetching:r,isLoading:o,data:i,queryKey:s}=qa(n),a=JSON.stringify(s);return k.useEffect(()=>{e==null||e(o)},[r,o,e]),k.useEffect(()=>{t(n.id,(i==null?void 0:i.records)||[])},[i==null?void 0:i.records,n.id,a,t]),x.jsx(x.Fragment,{})}function kpe({card:e,frame:t}){var w,_,R,C,E,P,A,I;const[n,r]=k.useState([]),{authToken:o}=Uo(),i=PN(o==null?void 0:o.accessToken),s=ye(F=>F.themeStyle),a={colors:((_=(w=s==null?void 0:s.chart)==null?void 0:w.dataset)==null?void 0:_.backgroundColor)||[]},[l,c]=k.useState(!1),{getCard:u}=t6(((R=e.customCardPreferences)==null?void 0:R.url)||""),d=((C=e.customCardPreferences)==null?void 0:C.visualType)||"single",p=(E=e.customCardPreferences)==null?void 0:E.componentName,{data:h}=qa(e),m=k.useCallback((F,L)=>{r(j=>({...j,[F]:L}))},[]);if(!p)return null;const b=u(p),y=Object.keys(((P=e.customCardPreferences)==null?void 0:P.dataInputCardIds)||{}).map(F=>{var X,U,$;const L=(U=(X=e.customCardPreferences)==null?void 0:X.dataInputCardIds)==null?void 0:U[F].cardId,j=($=t==null?void 0:t.cards)==null?void 0:$.find(B=>B.id===L);return j||null});function v(F){c(F)}return x.jsx("div",{className:"semaphor-custom mb-3 flex grow basis-0 flex-col space-y-2 overflow-y-auto",children:x.jsxs(k.Suspense,{fallback:x.jsx(x.Fragment,{}),children:[b&&d==="single"&&x.jsx(b,{params:i,theme:a,settings:(A=e.customCardPreferences)==null?void 0:A.settings,onDataChange:m,data:(h==null?void 0:h.records)||[]}),b&&d==="multiple"&&x.jsxs("div",{children:[Object.keys(((I=e.customCardPreferences)==null?void 0:I.dataInputCardIds)||{}).map(F=>{var X,U,$;const L=(U=(X=e.customCardPreferences)==null?void 0:X.dataInputCardIds)==null?void 0:U[F].cardId,j=($=t==null?void 0:t.cards)==null?void 0:$.find(B=>B.id===L);if(j)return x.jsx(n6,{onLoadingStatus:v,onDataChange:m,dataInputIndex:F,card:j},j.id+F)}),d==="multiple"&&x.jsx("div",{className:me("flex flex-col gap-2",{"opacity-50":l}),children:x.jsx(b,{params:i,theme:a,onDataChange:m,settings:y.map(F=>{var L;return(L=F==null?void 0:F.customCardPreferences)==null?void 0:L.settings}),data:y.map(F=>F!=null&&F.id?n==null?void 0:n[F.id]:[])})})]})]},e.id)})}/*!
378
+ * chartjs-plugin-datalabels v2.2.0
379
+ * https://chartjs-plugin-datalabels.netlify.app
380
+ * (c) 2017-2022 chartjs-plugin-datalabels contributors
381
+ * Released under the MIT license
382
+ */var jA=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}(),_h={toTextLines:function(e){var t=[],n;for(e=[].concat(e);e.length;)n=e.pop(),typeof n=="string"?t.unshift.apply(t,n.split(`
383
+ `)):Array.isArray(n)?e.push.apply(e,n):yt(e)||t.unshift(""+n);return t},textSize:function(e,t,n){var r=[].concat(t),o=r.length,i=e.font,s=0,a;for(e.font=n.string,a=0;a<o;++a)s=Math.max(e.measureText(r[a]).width,s);return e.font=i,{height:o*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=[],o,i,s,a;for(o=0,s=t.length;o<s;++o)a=t[o],i=n.indexOf(a),i===-1?r.push([a,1]):n.splice(i,1);for(o=0,s=n.length;o<s;++o)r.push([n[o],-1]);return r},rasterize:function(e){return Math.round(e*jA)/jA}};function Pw(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 o=e.x-n,i=e.y-r,s=Math.sqrt(o*o+i*i);return{x:s?o/s:0,y:s?i/s:-1}}function Ppe(e,t,n,r,o){switch(o){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:o*=Math.PI/180,n=Math.cos(o),r=Math.sin(o);break}return{x:e,y:t,vx:n,vy:r}}var Ope=0,r6=1,o6=2,i6=4,s6=8;function Lm(e,t,n){var r=Ope;return e<n.left?r|=r6:e>n.right&&(r|=o6),t<n.top?r|=s6:t>n.bottom&&(r|=i6),r}function Mpe(e,t){for(var n=e.x0,r=e.y0,o=e.x1,i=e.y1,s=Lm(n,r,t),a=Lm(o,i,t),l,c,u;!(!(s|a)||s&a);)l=s||a,l&s6?(c=n+(o-n)*(t.top-r)/(i-r),u=t.top):l&i6?(c=n+(o-n)*(t.bottom-r)/(i-r),u=t.bottom):l&o6?(u=r+(i-r)*(t.right-n)/(o-n),c=t.right):l&r6&&(u=r+(i-r)*(t.left-n)/(o-n),c=t.left),l===s?(n=c,r=u,s=Lm(n,r,t)):(o=c,i=u,a=Lm(o,i,t));return{x0:n,x1:o,y0:r,y1:i}}function $m(e,t){var n=t.anchor,r=e,o,i;return t.clamp&&(r=Mpe(r,t.area)),n==="start"?(o=r.x0,i=r.y0):n==="end"?(o=r.x1,i=r.y1):(o=(r.x0+r.x1)/2,i=(r.y0+r.y1)/2),Ppe(o,i,e.vx,e.vy,t.align)}var jm={arc:function(e,t){var n=(e.startAngle+e.endAngle)/2,r=Math.cos(n),o=Math.sin(n),i=e.innerRadius,s=e.outerRadius;return $m({x0:e.x+r*i,y0:e.y+o*i,x1:e.x+r*s,y1:e.y+o*s,vx:r,vy:o},t)},point:function(e,t){var n=Pw(e,t.origin),r=n.x*e.options.radius,o=n.y*e.options.radius;return $m({x0:e.x-r,y0:e.y-o,x1:e.x+r,y1:e.y+o,vx:n.x,vy:n.y},t)},bar:function(e,t){var n=Pw(e,t.origin),r=e.x,o=e.y,i=0,s=0;return e.horizontal?(r=Math.min(e.x,e.base),i=Math.abs(e.base-e.x)):(o=Math.min(e.y,e.base),s=Math.abs(e.base-e.y)),$m({x0:r,y0:o+s,x1:r+i,y1:o,vx:n.x,vy:n.y},t)},fallback:function(e,t){var n=Pw(e,t.origin);return $m({x0:e.x,y0:e.y,x1:e.x+(e.width||0),y1:e.y+(e.height||0),vx:n.x,vy:n.y},t)}},Ks=_h.rasterize;function Ape(e){var t=e.borderWidth||0,n=e.padding,r=e.size.height,o=e.size.width,i=-o/2,s=-r/2;return{frame:{x:i-n.left-t,y:s-n.top-t,w:o+n.width+t*2,h:r+n.height+t*2},text:{x:i,y:s,w:o,h:r}}}function Dpe(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 Ipe(e){return e instanceof Tu?jm.arc:e instanceof fc?jm.point:e instanceof hc?jm.bar:jm.fallback}function Npe(e,t,n,r,o,i){var s=Math.PI/2;if(i){var a=Math.min(i,o/2,r/2),l=t+a,c=n+a,u=t+r-a,d=n+o-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,o)}function Fpe(e,t,n){var r=n.backgroundColor,o=n.borderColor,i=n.borderWidth;!r&&(!o||!i)||(e.beginPath(),Npe(e,Ks(t.x)+i/2,Ks(t.y)+i/2,Ks(t.w)-i,Ks(t.h)-i,n.borderRadius),e.closePath(),r&&(e.fillStyle=r,e.fill()),o&&i&&(e.strokeStyle=o,e.lineWidth=i,e.lineJoin="miter",e.stroke()))}function Lpe(e,t,n){var r=n.lineHeight,o=e.w,i=e.x,s=e.y+r/2;return t==="center"?i+=o/2:(t==="end"||t==="right")&&(i+=o),{h:r,w:o,x:i,y:s}}function $pe(e,t,n){var r=e.shadowBlur,o=n.stroked,i=Ks(n.x),s=Ks(n.y),a=Ks(n.w);o&&e.strokeText(t,i,s,a),n.filled&&(r&&o&&(e.shadowBlur=0),e.fillText(t,i,s,a),r&&o&&(e.shadowBlur=r))}function jpe(e,t,n,r){var o=r.textAlign,i=r.color,s=!!i,a=r.font,l=t.length,c=r.textStrokeColor,u=r.textStrokeWidth,d=c&&u,p;if(!(!l||!s&&!d))for(n=Lpe(n,o,a),e.font=a.string,e.textAlign=o,e.textBaseline="middle",e.shadowBlur=r.textShadowBlur,e.shadowColor=r.textShadowColor,s&&(e.fillStyle=i),d&&(e.lineJoin="round",e.lineWidth=u,e.strokeStyle=c),p=0,l=t.length;p<l;++p)$pe(e,t[p],{stroked:d,filled:s,w:n.w,x:n.x,y:n.y+n.h*p})}var a6=function(e,t,n,r){var o=this;o._config=e,o._index=r,o._model=null,o._rects=null,o._ctx=t,o._el=n};mr(a6.prototype,{_modelize:function(e,t,n,r){var o=this,i=o._index,s=Zn(Rn([n.font,{}],r,i)),a=Rn([n.color,On.color],r,i);return{align:Rn([n.align,"center"],r,i),anchor:Rn([n.anchor,"center"],r,i),area:r.chart.chartArea,backgroundColor:Rn([n.backgroundColor,null],r,i),borderColor:Rn([n.borderColor,null],r,i),borderRadius:Rn([n.borderRadius,0],r,i),borderWidth:Rn([n.borderWidth,0],r,i),clamp:Rn([n.clamp,!1],r,i),clip:Rn([n.clip,!1],r,i),color:a,display:e,font:s,lines:t,offset:Rn([n.offset,4],r,i),opacity:Rn([n.opacity,1],r,i),origin:Dpe(o._el,r),padding:Er(Rn([n.padding,4],r,i)),positioner:Ipe(o._el),rotation:Rn([n.rotation,0],r,i)*(Math.PI/180),size:_h.textSize(o._ctx,t,s),textAlign:Rn([n.textAlign,"start"],r,i),textShadowBlur:Rn([n.textShadowBlur,0],r,i),textShadowColor:Rn([n.textShadowColor,a],r,i),textStrokeColor:Rn([n.textStrokeColor,a],r,i),textStrokeWidth:Rn([n.textStrokeWidth,0],r,i)}},update:function(e){var t=this,n=null,r=null,o=t._index,i=t._config,s,a,l,c=Rn([i.display,!0],e,o);c&&(s=e.dataset.data[o],a=ut(hn(i.formatter,[s,e]),s),l=yt(a)?[]:_h.toTextLines(a),l.length&&(n=t._modelize(c,l,i,e),r=Ape(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,o=n._model,i=n._rects,s;this.visible()&&(r.save(),o.clip&&(s=o.area,r.beginPath(),r.rect(s.left,s.top,s.right-s.left,s.bottom-s.top),r.clip()),r.globalAlpha=_h.bound(0,o.opacity,1),r.translate(Ks(t.x),Ks(t.y)),r.rotate(o.rotation),Fpe(r,i.frame,o),jpe(r,o.lines,i.text,o),r.restore())}});var zpe=Number.MIN_SAFE_INTEGER||-9007199254740991,Bpe=Number.MAX_SAFE_INTEGER||9007199254740991;function Df(e,t,n){var r=Math.cos(n),o=Math.sin(n),i=t.x,s=t.y;return{x:i+r*(e.x-i)-o*(e.y-s),y:s+o*(e.x-i)+r*(e.y-s)}}function zA(e,t){var n=Bpe,r=zpe,o=t.origin,i,s,a,l,c;for(i=0;i<e.length;++i)s=e[i],a=s.x-o.x,l=s.y-o.y,c=t.vx*a+t.vy*l,n=Math.min(n,c),r=Math.max(r,c);return{min:n,max:r}}function zm(e,t){var n=t.x-e.x,r=t.y-e.y,o=Math.sqrt(n*n+r*r);return{vx:(t.x-e.x)/o,vy:(t.y-e.y)/o,origin:e,ln:o}}var l6=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};mr(l6.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=Df(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=[zm(t[0],t[1]),zm(t[0],t[3])],o,i,s;for(this._rotation!==e._rotation&&r.push(zm(n[0],n[1]),zm(n[0],n[3])),o=0;o<r.length;++o)if(i=zA(t,r[o]),s=zA(n,r[o]),i.max<s.min||s.max<i.min)return!1;return!0},_points:function(){var e=this,t=e._rect,n=e._rotation,r=e.center();return[Df({x:t.x,y:t.y},r,n),Df({x:t.x+t.w,y:t.y},r,n),Df({x:t.x+t.w,y:t.y+t.h},r,n),Df({x:t.x,y:t.y+t.h},r,n)]}});function c6(e,t,n){var r=t.positioner(e,t),o=r.vx,i=r.vy;if(!o&&!i)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(o),Math.abs(i));return c*=o*d,u*=i*d,c+=t.offset*o,u+=t.offset*i,{x:r.x+c,y:r.y+u}}function Hpe(e,t){var n,r,o,i;for(n=e.length-1;n>=0;--n)for(o=e[n].$layout,r=n-1;r>=0&&o._visible;--r)i=e[r].$layout,i._visible&&o._box.intersects(i._box)&&t(o,i);return e}function Wpe(e){var t,n,r,o,i,s,a;for(t=0,n=e.length;t<n;++t)r=e[t],o=r.$layout,o._visible&&(a=new Proxy(r._el,{get:(l,c)=>l.getProps([c],!0)[c]}),i=r.geometry(),s=c6(a,r.model(),i),o._box.update(s,i,r.rotation()));return Hpe(e,function(l,c){var u=l._hidable,d=c._hidable;u&&d||d?c._visible=!1:u&&(l._visible=!1)})}var Ch={prepare:function(e){var t=[],n,r,o,i,s;for(n=0,o=e.length;n<o;++n)for(r=0,i=e[n].length;r<i;++r)s=e[n][r],t.push(s),s.$layout={_box:new l6,_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,o,i,s;for(n=0,r=e.length;n<r;++n)o=e[n],i=o.model(),s=o.$layout,s._hidable=i&&i.display==="auto",s._visible=o.visible(),t|=s._hidable;t&&Wpe(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,o,i,s,a;for(n=0,r=t.length;n<r;++n)o=t[n],i=o.$layout,i._visible&&(s=o.geometry(),a=c6(o._el,o.model(),s),i._box.update(a,s,o.rotation()),o.draw(e,a))}},Vpe=function(e){if(yt(e))return null;var t=e,n,r,o;if(Lt(e))if(!yt(e.label))t=e.label;else if(!yt(e.r))t=e.r;else for(t="",n=Object.keys(e),o=0,r=n.length;o<r;++o)t+=(o!==0?", ":"")+n[o]+": "+e[n[o]];return""+t},Upe={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:Vpe,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},ho="$datalabels",u6="$default";function Gpe(e,t){var n=e.datalabels,r={},o=[],i,s;return n===!1?null:(n===!0&&(n={}),t=mr({},[t,n]),i=t.labels||{},s=Object.keys(i),delete t.labels,s.length?s.forEach(function(a){i[a]&&o.push(mr({},[t,i[a],{_key:a}]))}):o.push(t),r=o.reduce(function(a,l){return sn(l.listeners||{},function(c,u){a[u]=a[u]||{},a[u][l._key||u6]=c}),delete l.listeners,a},{}),{labels:o,listeners:r})}function n_(e,t,n,r){if(t){var o=n.$context,i=n.$groups,s;t[i._set]&&(s=t[i._set][i._key],s&&hn(s,[o,r])===!0&&(e[ho]._dirty=!0,n.update(o)))}}function qpe(e,t,n,r,o){var i,s;!n&&!r||(n?r?n!==r&&(s=i=!0):s=!0:i=!0,s&&n_(e,t.leave,n,o),i&&n_(e,t.enter,r,o))}function Ype(e,t){var n=e[ho],r=n._listeners,o,i;if(!(!r.enter&&!r.leave)){if(t.type==="mousemove")i=Ch.lookup(n._labels,t);else if(t.type!=="mouseout")return;o=n._hovered,n._hovered=i,qpe(e,r,o,i,t)}}function Kpe(e,t){var n=e[ho],r=n._listeners.click,o=r&&Ch.lookup(n._labels,t);o&&n_(e,r,o,t)}var Xpe={id:"datalabels",defaults:Upe,beforeInit:function(e){e[ho]={_actives:[]}},beforeUpdate:function(e){var t=e[ho];t._listened=!1,t._listeners={},t._datasets=[],t._labels=[]},afterDatasetUpdate:function(e,t,n){var r=t.index,o=e[ho],i=o._datasets[r]=[],s=e.isDatasetVisible(r),a=e.data.datasets[r],l=Gpe(a,n),c=t.meta.data||[],u=e.ctx,d,p,h,m,b,y,v,w;for(u.save(),d=0,h=c.length;d<h;++d)if(v=c[d],v[ho]=[],s&&v&&e.getDataVisibility(d)&&!v.skip)for(p=0,m=l.labels.length;p<m;++p)b=l.labels[p],y=b._key,w=new a6(b,u,v,d),w.$groups={_set:r,_key:y||u6},w.$context={active:!1,chart:e,dataIndex:d,dataset:a,datasetIndex:r},w.update(w.$context),v[ho].push(w),i.push(w);u.restore(),mr(o._listeners,l.listeners,{merger:function(_,R,C){R[_]=R[_]||{},R[_][t.index]=C[_],o._listened=!0}})},afterUpdate:function(e){e[ho]._labels=Ch.prepare(e[ho]._datasets)},afterDatasetsDraw:function(e){Ch.draw(e,e[ho]._labels)},beforeEvent:function(e,t){if(e[ho]._listened){var n=t.event;switch(n.type){case"mousemove":case"mouseout":Ype(e,n);break;case"click":Kpe(e,n);break}}},afterEvent:function(e){var t=e[ho],n=t._actives,r=t._actives=e.getActiveElements(),o=_h.arrayDiff(n,r),i,s,a,l,c,u,d;for(i=0,s=o.length;i<s;++i)if(c=o[i],c[1])for(d=c[0].element[ho]||[],a=0,l=d.length;a<l;++a)u=d[a],u.$context.active=c[1]===1,u.update(u.$context);(t._dirty||o.length)&&(Ch.update(t._labels),e.render()),delete t._dirty}};Ln.register(...Cse);Ln.register(Xpe);Ln.register(fc);Ln.register(jd);Ln.register(zd);Ln.register(ea);Ln.register(Hc);Ln.register(Qa);Ln.register(Za);Ln.register($b);Ln.register(AL);function JE({cfg:e,onDatapointClick:t}){var d;const[n,r]=k.useState(""),o=ye(p=>p.selectedLensId),i=k.useRef(null),[s,a]=k.useState(),l=ye(p=>p.themeStyle);k.useEffect(()=>{if(i.current){const p=window.getComputedStyle(i.current);r(p.fontFamily)}},[]),k.useEffect(()=>{var b,y,v,w;if(!n)return;(y=(b=l==null?void 0:l.chart)==null?void 0:b.font)!=null&&y.family&&(Ln.defaults.font={...Ln.defaults.font,...(v=l==null?void 0:l.chart)==null?void 0:v.font,family:n});const p={...e,options:{...e.options,responsive:!0,maintainAspectRatio:!1}},h=(w=i==null?void 0:i.current)==null?void 0:w.getContext("2d");if(!h)return;let m;try{const _=Oce(p,h);m=new Ln(h,_),a(m)}catch(_){console.log("error creating chart",_)}return()=>{m&&m.destroy()}},[(d=l==null?void 0:l.chart)==null?void 0:d.font,o,n]);function c(p){var m,b;if(!s)return;const h=s==null?void 0:s.getElementsAtEventForMode(p,"nearest",{intersect:!0},!0);if(h&&h.length>0){const y=h[0].datasetIndex,v=h[0].index,w=(b=(m=h[0].element)==null?void 0:m.$context)==null?void 0:b.raw;t==null||t(s,y,v,w)}}const u=e.type==="doughnut"||e.type==="pie";return x.jsx("div",{onClick:c,className:me("relative h-[99%]",{"mx-14":u}),children:x.jsx("canvas",{ref:i})})}function Qpe(e,t){return T.useReducer((n,r)=>t[n][r]??n,e)}var eR="ScrollArea",[d6,UAe]=lr(eR),[Zpe,pi]=d6(eR),f6=T.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...s}=e,[a,l]=T.useState(null),[c,u]=T.useState(null),[d,p]=T.useState(null),[h,m]=T.useState(null),[b,y]=T.useState(null),[v,w]=T.useState(0),[_,R]=T.useState(0),[C,E]=T.useState(!1),[P,A]=T.useState(!1),I=dt(t,L=>l(L)),F=$c(o);return x.jsx(Zpe,{scope:n,type:r,dir:F,scrollHideDelay:i,scrollArea:a,viewport:c,onViewportChange:u,content:d,onContentChange:p,scrollbarX:h,onScrollbarXChange:m,scrollbarXEnabled:C,onScrollbarXEnabledChange:E,scrollbarY:b,onScrollbarYChange:y,scrollbarYEnabled:P,onScrollbarYEnabledChange:A,onCornerWidthChange:w,onCornerHeightChange:R,children:x.jsx(je.div,{dir:F,...s,ref:I,style:{position:"relative","--radix-scroll-area-corner-width":v+"px","--radix-scroll-area-corner-height":_+"px",...e.style}})})});f6.displayName=eR;var h6="ScrollAreaViewport",p6=T.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...i}=e,s=pi(h6,n),a=T.useRef(null),l=dt(t,a,s.onViewportChange);return x.jsxs(x.Fragment,{children:[x.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:o}),x.jsx(je.div,{"data-radix-scroll-area-viewport":"",...i,ref:l,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:x.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});p6.displayName=h6;var xs="ScrollAreaScrollbar",tR=T.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=pi(xs,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=o,a=e.orientation==="horizontal";return T.useEffect(()=>(a?i(!0):s(!0),()=>{a?i(!1):s(!1)}),[a,i,s]),o.type==="hover"?x.jsx(Jpe,{...r,ref:t,forceMount:n}):o.type==="scroll"?x.jsx(ege,{...r,ref:t,forceMount:n}):o.type==="auto"?x.jsx(g6,{...r,ref:t,forceMount:n}):o.type==="always"?x.jsx(nR,{...r,ref:t}):null});tR.displayName=xs;var Jpe=T.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=pi(xs,e.__scopeScrollArea),[i,s]=T.useState(!1);return T.useEffect(()=>{const a=o.scrollArea;let l=0;if(a){const c=()=>{window.clearTimeout(l),s(!0)},u=()=>{l=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",u),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",u)}}},[o.scrollArea,o.scrollHideDelay]),x.jsx(er,{present:n||i,children:x.jsx(g6,{"data-state":i?"visible":"hidden",...r,ref:t})})}),ege=T.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=pi(xs,e.__scopeScrollArea),i=e.orientation==="horizontal",s=M0(()=>l("SCROLL_END"),100),[a,l]=Qpe("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 T.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,o.scrollHideDelay,l]),T.useEffect(()=>{const c=o.viewport,u=i?"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)}},[o.viewport,i,l,s]),x.jsx(er,{present:n||a!=="hidden",children:x.jsx(nR,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Te(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:Te(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),g6=T.forwardRef((e,t)=>{const n=pi(xs,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,s]=T.useState(!1),a=e.orientation==="horizontal",l=M0(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?c:u)}},10);return kd(n.viewport,l),kd(n.content,l),x.jsx(er,{present:r||i,children:x.jsx(nR,{"data-state":i?"visible":"hidden",...o,ref:t})})}),nR=T.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=pi(xs,e.__scopeScrollArea),i=T.useRef(null),s=T.useRef(0),[a,l]=T.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=x6(a.viewport,a.content),u={...r,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:p=>i.current=p,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:p=>s.current=p};function d(p,h){return sge(p,s.current,a,h)}return n==="horizontal"?x.jsx(tge,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollLeft,h=BA(p,a,o.dir);i.current.style.transform=`translate3d(${h}px, 0, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollLeft=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollLeft=d(p,o.dir))}}):n==="vertical"?x.jsx(nge,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollTop,h=BA(p,a);i.current.style.transform=`translate3d(0, ${h}px, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollTop=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollTop=d(p))}}):null}),tge=T.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=pi(xs,e.__scopeScrollArea),[s,a]=T.useState(),l=T.useRef(null),c=dt(t,l,i.onScrollbarXChange);return T.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),x.jsx(b6,{"data-orientation":"horizontal",...o,ref:c,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":O0(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,d)=>{if(i.viewport){const p=i.viewport.scrollLeft+u.deltaX;e.onWheelScroll(p),S6(p,d)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:cy(s.paddingLeft),paddingEnd:cy(s.paddingRight)}})}})}),nge=T.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=pi(xs,e.__scopeScrollArea),[s,a]=T.useState(),l=T.useRef(null),c=dt(t,l,i.onScrollbarYChange);return T.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),x.jsx(b6,{"data-orientation":"vertical",...o,ref:c,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":O0(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,d)=>{if(i.viewport){const p=i.viewport.scrollTop+u.deltaY;e.onWheelScroll(p),S6(p,d)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:cy(s.paddingTop),paddingEnd:cy(s.paddingBottom)}})}})}),[rge,m6]=d6(xs),b6=T.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:d,...p}=e,h=pi(xs,n),[m,b]=T.useState(null),y=dt(t,I=>b(I)),v=T.useRef(null),w=T.useRef(""),_=h.viewport,R=r.content-r.viewport,C=ir(u),E=ir(l),P=M0(d,10);function A(I){if(v.current){const F=I.clientX-v.current.left,L=I.clientY-v.current.top;c({x:F,y:L})}}return T.useEffect(()=>{const I=F=>{const L=F.target;(m==null?void 0:m.contains(L))&&C(F,R)};return document.addEventListener("wheel",I,{passive:!1}),()=>document.removeEventListener("wheel",I,{passive:!1})},[_,m,R,C]),T.useEffect(E,[r,E]),kd(m,P),kd(h.content,P),x.jsx(rge,{scope:n,scrollbar:m,hasThumb:o,onThumbChange:ir(i),onThumbPointerUp:ir(s),onThumbPositionChange:E,onThumbPointerDown:ir(a),children:x.jsx(je.div,{...p,ref:y,style:{position:"absolute",...p.style},onPointerDown:Te(e.onPointerDown,I=>{I.button===0&&(I.target.setPointerCapture(I.pointerId),v.current=m.getBoundingClientRect(),w.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),A(I))}),onPointerMove:Te(e.onPointerMove,A),onPointerUp:Te(e.onPointerUp,I=>{const F=I.target;F.hasPointerCapture(I.pointerId)&&F.releasePointerCapture(I.pointerId),document.body.style.webkitUserSelect=w.current,h.viewport&&(h.viewport.style.scrollBehavior=""),v.current=null})})})}),ly="ScrollAreaThumb",y6=T.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=m6(ly,e.__scopeScrollArea);return x.jsx(er,{present:n||o.hasThumb,children:x.jsx(oge,{ref:t,...r})})}),oge=T.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=pi(ly,n),s=m6(ly,n),{onThumbPositionChange:a}=s,l=dt(t,d=>s.onThumbChange(d)),c=T.useRef(void 0),u=M0(()=>{c.current&&(c.current(),c.current=void 0)},100);return T.useEffect(()=>{const d=i.viewport;if(d){const p=()=>{if(u(),!c.current){const h=age(d,a);c.current=h,a()}};return a(),d.addEventListener("scroll",p),()=>d.removeEventListener("scroll",p)}},[i.viewport,u,a]),x.jsx(je.div,{"data-state":s.hasThumb?"visible":"hidden",...o,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Te(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:Te(e.onPointerUp,s.onThumbPointerUp)})});y6.displayName=ly;var rR="ScrollAreaCorner",v6=T.forwardRef((e,t)=>{const n=pi(rR,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?x.jsx(ige,{...e,ref:t}):null});v6.displayName=rR;var ige=T.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=pi(rR,n),[i,s]=T.useState(0),[a,l]=T.useState(0),c=!!(i&&a);return kd(o.scrollbarX,()=>{var d;const u=((d=o.scrollbarX)==null?void 0:d.offsetHeight)||0;o.onCornerHeightChange(u),l(u)}),kd(o.scrollbarY,()=>{var d;const u=((d=o.scrollbarY)==null?void 0:d.offsetWidth)||0;o.onCornerWidthChange(u),s(u)}),c?x.jsx(je.div,{...r,ref:t,style:{width:i,height:a,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function cy(e){return e?parseInt(e,10):0}function x6(e,t){const n=e/t;return isNaN(n)?0:n}function O0(e){const t=x6(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function sge(e,t,n,r="ltr"){const o=O0(n),i=o/2,s=t||i,a=o-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 w6([l,c],d)(e)}function BA(e,t,n="ltr"){const r=O0(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,s=t.content-t.viewport,a=i-r,l=n==="ltr"?[0,s]:[s*-1,0],c=KS(e,l);return w6([0,s],[0,a])(c)}function w6(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 S6(e,t){return e>0&&e<t}var age=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const i={left:e.scrollLeft,top:e.scrollTop},s=n.left!==i.left,a=n.top!==i.top;(s||a)&&t(),n=i,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function M0(e,t){const n=ir(e),r=T.useRef(0);return T.useEffect(()=>()=>window.clearTimeout(r.current),[]),T.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function kd(e,t){const n=ir(t);Cr(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}var _6=f6,lge=p6,cge=v6;const bc=T.forwardRef(({className:e,children:t,...n},r)=>x.jsxs(_6,{ref:r,className:me("relative overflow-hidden",e),...n,children:[x.jsx(lge,{className:"h-full w-full rounded-[inherit]",children:t}),x.jsx(Wp,{}),x.jsx(cge,{})]}));bc.displayName=_6.displayName;const Wp=T.forwardRef(({className:e,orientation:t="vertical",...n},r)=>x.jsx(tR,{ref:r,orientation:t,className:me("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:x.jsx(y6,{className:"relative flex-1 rounded-full bg-border"})}));Wp.displayName=tR.displayName;function gi(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 nl(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function uge(e,t){const n=+gi(e);return nl(e,n+t)}const C6=6048e5,dge=864e5,fge=36e5;function HA(e,t){return uge(e,t*fge)}let hge={};function A0(){return hge}function Qh(e,t){var a,l,c,u;const n=A0(),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,o=gi(e),i=o.getDay(),s=(i<r?7:0)+i-r;return o.setDate(o.getDate()-s),o.setHours(0,0,0,0),o}function uy(e){return Qh(e,{weekStartsOn:1})}function E6(e){const t=gi(e),n=t.getFullYear(),r=nl(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=uy(r),i=nl(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const s=uy(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function WA(e){const t=gi(e);return t.setHours(0,0,0,0),t}function VA(e){const t=gi(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 pge(e,t){const n=WA(e),r=WA(t),o=+n-VA(n),i=+r-VA(r);return Math.round((o-i)/dge)}function gge(e){const t=E6(e),n=nl(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),uy(n)}function mge(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function bge(e){if(!mge(e)&&typeof e!="number")return!1;const t=gi(e);return!isNaN(Number(t))}function yge(e){const t=gi(e),n=nl(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}const vge={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"}},xge=(e,t,n)=>{let r;const o=vge[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Ow(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const wge={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Sge={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},_ge={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Cge={date:Ow({formats:wge,defaultWidth:"full"}),time:Ow({formats:Sge,defaultWidth:"full"}),dateTime:Ow({formats:_ge,defaultWidth:"full"})},Ege={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Rge=(e,t,n,r)=>Ege[e];function If(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):s;o=e.formattingValues[a]||e.formattingValues[s]}else{const s=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[a]||e.values[s]}const i=e.argumentCallback?e.argumentCallback(t):t;return o[i]}}const Tge={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},kge={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Pge={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"]},Oge={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"]},Mge={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"}},Age={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"}},Dge=(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"},Ige={ordinalNumber:Dge,era:If({values:Tge,defaultWidth:"wide"}),quarter:If({values:kge,defaultWidth:"wide",argumentCallback:e=>e-1}),month:If({values:Pge,defaultWidth:"wide"}),day:If({values:Oge,defaultWidth:"wide"}),dayPeriod:If({values:Mge,defaultWidth:"wide",formattingValues:Age,defaultFormattingWidth:"wide"})};function Nf(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;const s=i[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?Fge(a,d=>d.test(s)):Nge(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 Nge(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Fge(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Lge(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],i=t.match(e.parsePattern);if(!i)return null;let s=e.valueCallback?e.valueCallback(i[0]):i[0];s=n.valueCallback?n.valueCallback(s):s;const a=t.slice(o.length);return{value:s,rest:a}}}const $ge=/^(\d+)(th|st|nd|rd)?/i,jge=/\d+/i,zge={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},Bge={any:[/^b/i,/^(a|c)/i]},Hge={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Wge={any:[/1/i,/2/i,/3/i,/4/i]},Vge={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},Uge={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]},Gge={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},qge={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]},Yge={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},Kge={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}},Xge={ordinalNumber:Lge({matchPattern:$ge,parsePattern:jge,valueCallback:e=>parseInt(e,10)}),era:Nf({matchPatterns:zge,defaultMatchWidth:"wide",parsePatterns:Bge,defaultParseWidth:"any"}),quarter:Nf({matchPatterns:Hge,defaultMatchWidth:"wide",parsePatterns:Wge,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Nf({matchPatterns:Vge,defaultMatchWidth:"wide",parsePatterns:Uge,defaultParseWidth:"any"}),day:Nf({matchPatterns:Gge,defaultMatchWidth:"wide",parsePatterns:qge,defaultParseWidth:"any"}),dayPeriod:Nf({matchPatterns:Yge,defaultMatchWidth:"any",parsePatterns:Kge,defaultParseWidth:"any"})},Qge={code:"en-US",formatDistance:xge,formatLong:Cge,formatRelative:Rge,localize:Ige,match:Xge,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Zge(e){const t=gi(e);return pge(t,yge(t))+1}function Jge(e){const t=gi(e),n=+uy(t)-+gge(t);return Math.round(n/C6)+1}function R6(e,t){var u,d,p,h;const n=gi(e),r=n.getFullYear(),o=A0(),i=(t==null?void 0:t.firstWeekContainsDate)??((d=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??o.firstWeekContainsDate??((h=(p=o.locale)==null?void 0:p.options)==null?void 0:h.firstWeekContainsDate)??1,s=nl(e,0);s.setFullYear(r+1,0,i),s.setHours(0,0,0,0);const a=Qh(s,t),l=nl(e,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const c=Qh(l,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function eme(e,t){var a,l,c,u;const n=A0(),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,o=R6(e,t),i=nl(e,0);return i.setFullYear(o,0,r),i.setHours(0,0,0,0),Qh(i,t)}function tme(e,t){const n=gi(e),r=+Qh(n,t)-+eme(n,t);return Math.round(r/C6)+1}function un(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Sa={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return un(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):un(n+1,2)},d(e,t){return un(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 un(e.getHours()%12||12,t.length)},H(e,t){return un(e.getHours(),t.length)},m(e,t){return un(e.getMinutes(),t.length)},s(e,t){return un(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return un(o,t.length)}},bu={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},UA={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(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return Sa.y(e,t)},Y:function(e,t,n,r){const o=R6(e,r),i=o>0?o:1-o;if(t==="YY"){const s=i%100;return un(s,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):un(i,t.length)},R:function(e,t){const n=E6(e);return un(n,t.length)},u:function(e,t){const n=e.getFullYear();return un(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 un(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 un(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 Sa.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 un(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 o=tme(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):un(o,t.length)},I:function(e,t,n){const r=Jge(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):un(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Sa.d(e,t)},D:function(e,t,n){const r=Zge(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):un(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 o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return un(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return un(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return un(o,t.length);case"io":return n.ordinalNumber(o,{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 o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=bu.noon:r===0?o=bu.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=bu.evening:r>=12?o=bu.afternoon:r>=4?o=bu.morning:o=bu.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(o,{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 Sa.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Sa.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):un(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):un(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Sa.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Sa.s(e,t)},S:function(e,t){return Sa.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return qA(r);case"XXXX":case"XX":return Fl(r);case"XXXXX":case"XXX":default:return Fl(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return qA(r);case"xxxx":case"xx":return Fl(r);case"xxxxx":case"xxx":default:return Fl(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+GA(r,":");case"OOOO":default:return"GMT"+Fl(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+GA(r,":");case"zzzz":default:return"GMT"+Fl(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return un(r,t.length)},T:function(e,t,n){const r=e.getTime();return un(r,t.length)}};function GA(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),i=r%60;return i===0?n+String(o):n+String(o)+t+un(i,2)}function qA(e,t){return e%60===0?(e>0?"-":"+")+un(Math.abs(e)/60,2):Fl(e,t)}function Fl(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=un(Math.trunc(r/60),2),i=un(r%60,2);return n+o+t+i}const YA=(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"})}},T6=(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"})}},nme=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return YA(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",YA(r,t)).replace("{{time}}",T6(o,t))},rme={p:T6,P:nme},ome=/^D+$/,ime=/^Y+$/,sme=["D","DD","YY","YYYY"];function ame(e){return ome.test(e)}function lme(e){return ime.test(e)}function cme(e,t,n){const r=ume(e,t,n);if(console.warn(r),sme.includes(e))throw new RangeError(r)}function ume(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 dme=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,fme=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,hme=/^'([^]*?)'?$/,pme=/''/g,gme=/[a-zA-Z]/;function Mw(e,t,n){var u,d,p,h;const r=A0(),o=r.locale??Qge,i=r.firstWeekContainsDate??((d=(u=r.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??1,s=r.weekStartsOn??((h=(p=r.locale)==null?void 0:p.options)==null?void 0:h.weekStartsOn)??0,a=gi(e);if(!bge(a))throw new RangeError("Invalid time value");let l=t.match(fme).map(m=>{const b=m[0];if(b==="p"||b==="P"){const y=rme[b];return y(m,o.formatLong)}return m}).join("").match(dme).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const b=m[0];if(b==="'")return{isToken:!1,value:mme(m)};if(UA[b])return{isToken:!0,value:m};if(b.match(gme))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");return{isToken:!1,value:m}});o.localize.preprocessor&&(l=o.localize.preprocessor(a,l));const c={firstWeekContainsDate:i,weekStartsOn:s,locale:o};return l.map(m=>{if(!m.isToken)return m.value;const b=m.value;(lme(b)||ame(b))&&cme(b,t,String(e));const y=UA[b[0]];return y(a,b,o.localize,c)}).join("")}function mme(e){const t=e.match(hme);return t?t[1].replace(pme,"'"):e}var Qe;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})(Qe||(Qe={}));var wn;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(wn||(wn={}));var Oi;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(Oi||(Oi={}));const Aw={},oh={};function Eh(e,t){try{const r=(Aw[e]||(Aw[e]=new Intl.DateTimeFormat("en-GB",{timeZone:e,hour:"numeric",timeZoneName:"longOffset"}).format))(t).split("GMT")[1]||"";return r in oh?oh[r]:KA(r,r.split(":"))}catch{if(e in oh)return oh[e];const n=e==null?void 0:e.match(bme);return n?KA(e,n.slice(1)):NaN}}const bme=/([+-]\d\d):?(\d\d)?/;function KA(e,t){const n=+t[0],r=+(t[1]||0);return oh[e]=n>0?n*60+r:n*60-r}class ns extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Eh(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),k6(this),r_(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new ns(...n,t):new ns(Date.now(),t)}withTimeZone(t){return new ns(+this,t)}getTimezoneOffset(){return-Eh(this.timeZone,this)}setTime(t){return Date.prototype.setTime.apply(this,arguments),r_(this),+this}[Symbol.for("constructDateFrom")](t){return new ns(+new Date(t),this.timeZone)}}const XA=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!XA.test(e))return;const t=e.replace(XA,"$1UTC");ns.prototype[t]&&(e.startsWith("get")?ns.prototype[e]=function(){return this.internal[t]()}:(ns.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),yme(this),+this},ns.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),r_(this),+this}))});function r_(e){e.internal.setTime(+e),e.internal.setUTCMinutes(e.internal.getUTCMinutes()-e.getTimezoneOffset())}function yme(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),k6(e)}function k6(e){const t=Eh(e.timeZone,e),n=new Date(+e);n.setUTCHours(n.getUTCHours()-1);const r=-new Date(+e).getTimezoneOffset(),o=-new Date(+n).getTimezoneOffset(),i=r-o,s=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();i&&s&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+i);const a=r-t;a&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+a);const l=Eh(e.timeZone,e),u=-new Date(+e).getTimezoneOffset()-l,d=l!==t,p=u-a;if(d&&p){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+p);const h=Eh(e.timeZone,e),m=l-h;m&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+m),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+m))}}class ql extends ns{static tz(t,...n){return n.length?new ql(...n,t):new ql(Date.now(),t)}toISOString(){const[t,n,r]=this.tzComponents(),o=`${t}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+o}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,r,o]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${r} ${n} ${o}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,r,o]=this.tzComponents();return`${t} GMT${n}${r}${o} (${vme(this.timeZone,this)})`}toLocaleString(t,n){return Date.prototype.toLocaleString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleDateString(t,n){return Date.prototype.toLocaleDateString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleTimeString(t,n){return Date.prototype.toLocaleTimeString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),n=t>0?"-":"+",r=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),o=String(Math.abs(t)%60).padStart(2,"0");return[n,r,o]}withTimeZone(t){return new ql(+this,t)}[Symbol.for("constructDateFrom")](t){return new ql(+new Date(t),this.timeZone)}}function vme(e,t){return new Intl.DateTimeFormat("en-GB",{timeZone:e,timeZoneName:"long"}).format(t).slice(12)}const P6=6048e5,xme=864e5,QA=Symbol.for("constructDateFrom");function ar(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&QA in e?e[QA](t):e instanceof Date?new e.constructor(t):new Date(t)}function gn(e,t){return ar(t||e,e)}function O6(e,t,n){const r=gn(e,n==null?void 0:n.in);return isNaN(t)?ar(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function M6(e,t,n){const r=gn(e,n==null?void 0:n.in);if(isNaN(t))return ar(e,NaN);if(!t)return r;const o=r.getDate(),i=ar(e,r.getTime());i.setMonth(r.getMonth()+t+1,0);const s=i.getDate();return o>=s?i:(r.setFullYear(i.getFullYear(),i.getMonth(),o),r)}let wme={};function Vp(){return wme}function Pd(e,t){var a,l,c,u;const n=Vp(),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,o=gn(e,t==null?void 0:t.in),i=o.getDay(),s=(i<r?7:0)+i-r;return o.setDate(o.getDate()-s),o.setHours(0,0,0,0),o}function Zh(e,t){return Pd(e,{...t,weekStartsOn:1})}function A6(e,t){const n=gn(e,t==null?void 0:t.in),r=n.getFullYear(),o=ar(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const i=Zh(o),s=ar(n,0);s.setFullYear(r,0,4),s.setHours(0,0,0,0);const a=Zh(s);return n.getTime()>=i.getTime()?r+1:n.getTime()>=a.getTime()?r:r-1}function ZA(e){const t=gn(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 Gd(e,...t){const n=ar.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function Jh(e,t){const n=gn(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function D6(e,t,n){const[r,o]=Gd(n==null?void 0:n.in,e,t),i=Jh(r),s=Jh(o),a=+i-ZA(i),l=+s-ZA(s);return Math.round((a-l)/xme)}function Sme(e,t){const n=A6(e,t),r=ar(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Zh(r)}function _me(e,t,n){return O6(e,t*7,n)}function Cme(e,t,n){return M6(e,t*12,n)}function Eme(e,t){let n,r=t==null?void 0:t.in;return e.forEach(o=>{!r&&typeof o=="object"&&(r=ar.bind(null,o));const i=gn(o,r);(!n||n<i||isNaN(+i))&&(n=i)}),ar(r,n||NaN)}function Rme(e,t){let n,r=t==null?void 0:t.in;return e.forEach(o=>{!r&&typeof o=="object"&&(r=ar.bind(null,o));const i=gn(o,r);(!n||n>i||isNaN(+i))&&(n=i)}),ar(r,n||NaN)}function Tme(e,t,n){const[r,o]=Gd(n==null?void 0:n.in,e,t);return+Jh(r)==+Jh(o)}function I6(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function kme(e){return!(!I6(e)&&typeof e!="number"||isNaN(+gn(e)))}function Pme(e,t,n){const[r,o]=Gd(n==null?void 0:n.in,e,t),i=r.getFullYear()-o.getFullYear(),s=r.getMonth()-o.getMonth();return i*12+s}function Ome(e,t){const n=gn(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function Mme(e,t){const[n,r]=Gd(e,t.start,t.end);return{start:n,end:r}}function Ame(e,t){const{start:n,end:r}=Mme(t==null?void 0:t.in,e);let o=+n>+r;const i=o?+n:+r,s=o?r:n;s.setHours(0,0,0,0),s.setDate(1);let a=1;const l=[];for(;+s<=i;)l.push(ar(n,s)),s.setMonth(s.getMonth()+a);return o?l.reverse():l}function Dme(e,t){const n=gn(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function Ime(e,t){const n=gn(e,t==null?void 0:t.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function N6(e,t){const n=gn(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function F6(e,t){var a,l,c,u;const n=Vp(),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,o=gn(e,t==null?void 0:t.in),i=o.getDay(),s=(i<r?-7:0)+6-(i-r);return o.setDate(o.getDate()+s),o.setHours(23,59,59,999),o}function Nme(e,t){return F6(e,{...t,weekStartsOn:1})}const Fme={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"}},Lme=(e,t,n)=>{let r;const o=Fme[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Dw(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const $me={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},jme={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},zme={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Bme={date:Dw({formats:$me,defaultWidth:"full"}),time:Dw({formats:jme,defaultWidth:"full"}),dateTime:Dw({formats:zme,defaultWidth:"full"})},Hme={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Wme=(e,t,n,r)=>Hme[e];function Ff(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):s;o=e.formattingValues[a]||e.formattingValues[s]}else{const s=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[a]||e.values[s]}const i=e.argumentCallback?e.argumentCallback(t):t;return o[i]}}const Vme={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ume={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Gme={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"]},qme={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"]},Yme={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"}},Kme={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"}},Xme=(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"},Qme={ordinalNumber:Xme,era:Ff({values:Vme,defaultWidth:"wide"}),quarter:Ff({values:Ume,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Ff({values:Gme,defaultWidth:"wide"}),day:Ff({values:qme,defaultWidth:"wide"}),dayPeriod:Ff({values:Yme,defaultWidth:"wide",formattingValues:Kme,defaultFormattingWidth:"wide"})};function Lf(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;const s=i[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?Jme(a,d=>d.test(s)):Zme(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 Zme(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Jme(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function ebe(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],i=t.match(e.parsePattern);if(!i)return null;let s=e.valueCallback?e.valueCallback(i[0]):i[0];s=n.valueCallback?n.valueCallback(s):s;const a=t.slice(o.length);return{value:s,rest:a}}}const tbe=/^(\d+)(th|st|nd|rd)?/i,nbe=/\d+/i,rbe={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},obe={any:[/^b/i,/^(a|c)/i]},ibe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},sbe={any:[/1/i,/2/i,/3/i,/4/i]},abe={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},lbe={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]},cbe={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},ube={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]},dbe={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},fbe={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}},hbe={ordinalNumber:ebe({matchPattern:tbe,parsePattern:nbe,valueCallback:e=>parseInt(e,10)}),era:Lf({matchPatterns:rbe,defaultMatchWidth:"wide",parsePatterns:obe,defaultParseWidth:"any"}),quarter:Lf({matchPatterns:ibe,defaultMatchWidth:"wide",parsePatterns:sbe,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Lf({matchPatterns:abe,defaultMatchWidth:"wide",parsePatterns:lbe,defaultParseWidth:"any"}),day:Lf({matchPatterns:cbe,defaultMatchWidth:"wide",parsePatterns:ube,defaultParseWidth:"any"}),dayPeriod:Lf({matchPatterns:dbe,defaultMatchWidth:"any",parsePatterns:fbe,defaultParseWidth:"any"})},oR={code:"en-US",formatDistance:Lme,formatLong:Bme,formatRelative:Wme,localize:Qme,match:hbe,options:{weekStartsOn:0,firstWeekContainsDate:1}};function pbe(e,t){const n=gn(e,t==null?void 0:t.in);return D6(n,N6(n))+1}function L6(e,t){const n=gn(e,t==null?void 0:t.in),r=+Zh(n)-+Sme(n);return Math.round(r/P6)+1}function $6(e,t){var u,d,p,h;const n=gn(e,t==null?void 0:t.in),r=n.getFullYear(),o=Vp(),i=(t==null?void 0:t.firstWeekContainsDate)??((d=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??o.firstWeekContainsDate??((h=(p=o.locale)==null?void 0:p.options)==null?void 0:h.firstWeekContainsDate)??1,s=ar((t==null?void 0:t.in)||e,0);s.setFullYear(r+1,0,i),s.setHours(0,0,0,0);const a=Pd(s,t),l=ar((t==null?void 0:t.in)||e,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const c=Pd(l,t);return+n>=+a?r+1:+n>=+c?r:r-1}function gbe(e,t){var a,l,c,u;const n=Vp(),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,o=$6(e,t),i=ar((t==null?void 0:t.in)||e,0);return i.setFullYear(o,0,r),i.setHours(0,0,0,0),Pd(i,t)}function j6(e,t){const n=gn(e,t==null?void 0:t.in),r=+Pd(n,t)-+gbe(n,t);return Math.round(r/P6)+1}function dn(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const _a={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return dn(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):dn(n+1,2)},d(e,t){return dn(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 dn(e.getHours()%12||12,t.length)},H(e,t){return dn(e.getHours(),t.length)},m(e,t){return dn(e.getMinutes(),t.length)},s(e,t){return dn(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return dn(o,t.length)}},yu={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},JA={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(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return _a.y(e,t)},Y:function(e,t,n,r){const o=$6(e,r),i=o>0?o:1-o;if(t==="YY"){const s=i%100;return dn(s,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):dn(i,t.length)},R:function(e,t){const n=A6(e);return dn(n,t.length)},u:function(e,t){const n=e.getFullYear();return dn(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 dn(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 dn(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 _a.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 dn(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 o=j6(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):dn(o,t.length)},I:function(e,t,n){const r=L6(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):dn(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):_a.d(e,t)},D:function(e,t,n){const r=pbe(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):dn(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 o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return dn(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return dn(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return dn(o,t.length);case"io":return n.ordinalNumber(o,{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 o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=yu.noon:r===0?o=yu.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=yu.evening:r>=12?o=yu.afternoon:r>=4?o=yu.morning:o=yu.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(o,{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 _a.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):_a.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):dn(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):dn(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):_a.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):_a.s(e,t)},S:function(e,t){return _a.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return tD(r);case"XXXX":case"XX":return Ll(r);case"XXXXX":case"XXX":default:return Ll(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return tD(r);case"xxxx":case"xx":return Ll(r);case"xxxxx":case"xxx":default:return Ll(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+eD(r,":");case"OOOO":default:return"GMT"+Ll(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+eD(r,":");case"zzzz":default:return"GMT"+Ll(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return dn(r,t.length)},T:function(e,t,n){return dn(+e,t.length)}};function eD(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),i=r%60;return i===0?n+String(o):n+String(o)+t+dn(i,2)}function tD(e,t){return e%60===0?(e>0?"-":"+")+dn(Math.abs(e)/60,2):Ll(e,t)}function Ll(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=dn(Math.trunc(r/60),2),i=dn(r%60,2);return n+o+t+i}const nD=(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"})}},z6=(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"})}},mbe=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return nD(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",nD(r,t)).replace("{{time}}",z6(o,t))},bbe={p:z6,P:mbe},ybe=/^D+$/,vbe=/^Y+$/,xbe=["D","DD","YY","YYYY"];function wbe(e){return ybe.test(e)}function Sbe(e){return vbe.test(e)}function _be(e,t,n){const r=Cbe(e,t,n);if(console.warn(r),xbe.includes(e))throw new RangeError(r)}function Cbe(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 Ebe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Rbe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Tbe=/^'([^]*?)'?$/,kbe=/''/g,Pbe=/[a-zA-Z]/;function Obe(e,t,n){var u,d,p,h,m,b,y,v;const r=Vp(),o=(n==null?void 0:n.locale)??r.locale??oR,i=(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??((v=(y=r.locale)==null?void 0:y.options)==null?void 0:v.weekStartsOn)??0,a=gn(e,n==null?void 0:n.in);if(!kme(a))throw new RangeError("Invalid time value");let l=t.match(Rbe).map(w=>{const _=w[0];if(_==="p"||_==="P"){const R=bbe[_];return R(w,o.formatLong)}return w}).join("").match(Ebe).map(w=>{if(w==="''")return{isToken:!1,value:"'"};const _=w[0];if(_==="'")return{isToken:!1,value:Mbe(w)};if(JA[_])return{isToken:!0,value:w};if(_.match(Pbe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");return{isToken:!1,value:w}});o.localize.preprocessor&&(l=o.localize.preprocessor(a,l));const c={firstWeekContainsDate:i,weekStartsOn:s,locale:o};return l.map(w=>{if(!w.isToken)return w.value;const _=w.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&Sbe(_)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&wbe(_))&&_be(_,t,String(e));const R=JA[_[0]];return R(a,_,o.localize,c)}).join("")}function Mbe(e){const t=e.match(Tbe);return t?t[1].replace(kbe,"'"):e}function Abe(e,t){const n=gn(e,t==null?void 0:t.in),r=n.getFullYear(),o=n.getMonth(),i=ar(n,0);return i.setFullYear(r,o+1,0),i.setHours(0,0,0,0),i.getDate()}function Dbe(e,t){return gn(e,t==null?void 0:t.in).getMonth()}function Ibe(e,t){return gn(e,t==null?void 0:t.in).getFullYear()}function Nbe(e,t){return+gn(e)>+gn(t)}function Fbe(e,t){return+gn(e)<+gn(t)}function Lbe(e,t,n){const[r,o]=Gd(n==null?void 0:n.in,e,t);return r.getFullYear()===o.getFullYear()&&r.getMonth()===o.getMonth()}function $be(e,t,n){const[r,o]=Gd(n==null?void 0:n.in,e,t);return r.getFullYear()===o.getFullYear()}function jbe(e,t,n){const r=gn(e,n==null?void 0:n.in),o=r.getFullYear(),i=r.getDate(),s=ar(e,0);s.setFullYear(o,t,15),s.setHours(0,0,0,0);const a=Abe(s);return r.setMonth(t,Math.min(i,a)),r}function zbe(e,t,n){const r=gn(e,n==null?void 0:n.in);return isNaN(+r)?ar(e,NaN):(r.setFullYear(t),r)}const rD=5,Bbe=4;function Hbe(e,t){const n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,o=t.addDays(e,-r+1),i=t.addDays(o,rD*7-1);return t.getMonth(e)===t.getMonth(i)?rD:Bbe}function B6(e,t){const n=t.startOfMonth(e),r=n.getDay();return r===1?n:r===0?t.addDays(n,-1*6):t.addDays(n,-1*(r-1))}function Wbe(e,t){const n=B6(e,t),r=Hbe(e,t);return t.addDays(n,r*7-1)}class oa{constructor(t,n){this.Date=Date,this.today=()=>{var r;return(r=this.overrides)!=null&&r.today?this.overrides.today():this.options.timeZone?ql.tz(this.options.timeZone):new this.Date},this.newDate=(r,o,i)=>{var s;return(s=this.overrides)!=null&&s.newDate?this.overrides.newDate(r,o,i):this.options.timeZone?new ql(r,o,i,this.options.timeZone):new Date(r,o,i)},this.addDays=(r,o)=>{var i,s;return((s=(i=this.overrides)==null?void 0:i.addDays)==null?void 0:s.call(i,r,o))??O6(r,o)},this.addMonths=(r,o)=>{var i,s;return((s=(i=this.overrides)==null?void 0:i.addMonths)==null?void 0:s.call(i,r,o))??M6(r,o)},this.addWeeks=(r,o)=>{var i,s;return((s=(i=this.overrides)==null?void 0:i.addWeeks)==null?void 0:s.call(i,r,o))??_me(r,o)},this.addYears=(r,o)=>{var i,s;return((s=(i=this.overrides)==null?void 0:i.addYears)==null?void 0:s.call(i,r,o))??Cme(r,o)},this.differenceInCalendarDays=(r,o)=>{var i,s;return((s=(i=this.overrides)==null?void 0:i.differenceInCalendarDays)==null?void 0:s.call(i,r,o))??D6(r,o)},this.differenceInCalendarMonths=(r,o)=>{var i,s;return((s=(i=this.overrides)==null?void 0:i.differenceInCalendarMonths)==null?void 0:s.call(i,r,o))??Pme(r,o)},this.eachMonthOfInterval=r=>{var o,i;return((i=(o=this.overrides)==null?void 0:o.eachMonthOfInterval)==null?void 0:i.call(o,r))??Ame(r)},this.endOfBroadcastWeek=(r,o)=>{var i,s;return((s=(i=this.overrides)==null?void 0:i.endOfBroadcastWeek)==null?void 0:s.call(i,r,o))??Wbe(r,this)},this.endOfISOWeek=r=>{var o,i;return((i=(o=this.overrides)==null?void 0:o.endOfISOWeek)==null?void 0:i.call(o,r))??Nme(r)},this.endOfMonth=r=>{var o,i;return((i=(o=this.overrides)==null?void 0:o.endOfMonth)==null?void 0:i.call(o,r))??Ome(r)},this.endOfWeek=(r,o)=>{var i,s;return((s=(i=this.overrides)==null?void 0:i.endOfWeek)==null?void 0:s.call(i,r,o??this.options))??F6(r,o??this.options)},this.endOfYear=r=>{var o,i;return((i=(o=this.overrides)==null?void 0:o.endOfYear)==null?void 0:i.call(o,r))??Ime(r)},this.format=(r,o,i)=>{var a,l;const s=((l=(a=this.overrides)==null?void 0:a.format)==null?void 0:l.call(a,r,o,i??this.options))??Obe(r,o,i??this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(s):s},this.getISOWeek=r=>{var o,i;return((i=(o=this.overrides)==null?void 0:o.getISOWeek)==null?void 0:i.call(o,r))??L6(r)},this.getMonth=r=>{var o,i;return((i=(o=this.overrides)==null?void 0:o.getMonth)==null?void 0:i.call(o,r))??Dbe(r)},this.getYear=r=>{var o,i;return((i=(o=this.overrides)==null?void 0:o.getYear)==null?void 0:i.call(o,r))??Ibe(r)},this.getWeek=(r,o)=>{var i,s;return((s=(i=this.overrides)==null?void 0:i.getWeek)==null?void 0:s.call(i,r,o??this.options))??j6(r,o??this.options)},this.isAfter=(r,o)=>{var i,s;return((s=(i=this.overrides)==null?void 0:i.isAfter)==null?void 0:s.call(i,r,o))??Nbe(r,o)},this.isBefore=(r,o)=>{var i,s;return((s=(i=this.overrides)==null?void 0:i.isBefore)==null?void 0:s.call(i,r,o))??Fbe(r,o)},this.isDate=r=>{var o,i;return((i=(o=this.overrides)==null?void 0:o.isDate)==null?void 0:i.call(o,r))??I6(r)},this.isSameDay=(r,o)=>{var i,s;return((s=(i=this.overrides)==null?void 0:i.isSameDay)==null?void 0:s.call(i,r,o))??Tme(r,o)},this.isSameMonth=(r,o)=>{var i,s;return((s=(i=this.overrides)==null?void 0:i.isSameMonth)==null?void 0:s.call(i,r,o))??Lbe(r,o)},this.isSameYear=(r,o)=>{var i,s;return((s=(i=this.overrides)==null?void 0:i.isSameYear)==null?void 0:s.call(i,r,o))??$be(r,o)},this.max=r=>{var o,i;return((i=(o=this.overrides)==null?void 0:o.max)==null?void 0:i.call(o,r))??Eme(r)},this.min=r=>{var o,i;return((i=(o=this.overrides)==null?void 0:o.min)==null?void 0:i.call(o,r))??Rme(r)},this.setMonth=(r,o)=>{var i,s;return((s=(i=this.overrides)==null?void 0:i.setMonth)==null?void 0:s.call(i,r,o))??jbe(r,o)},this.setYear=(r,o)=>{var i,s;return((s=(i=this.overrides)==null?void 0:i.setYear)==null?void 0:s.call(i,r,o))??zbe(r,o)},this.startOfBroadcastWeek=(r,o)=>{var i,s;return((s=(i=this.overrides)==null?void 0:i.startOfBroadcastWeek)==null?void 0:s.call(i,r,o??this))??B6(r,o??this)},this.startOfDay=r=>{var o,i;return((i=(o=this.overrides)==null?void 0:o.startOfDay)==null?void 0:i.call(o,r))??Jh(r)},this.startOfISOWeek=r=>{var o,i;return((i=(o=this.overrides)==null?void 0:o.startOfISOWeek)==null?void 0:i.call(o,r))??Zh(r)},this.startOfMonth=r=>{var o,i;return((i=(o=this.overrides)==null?void 0:o.startOfMonth)==null?void 0:i.call(o,r))??Dme(r)},this.startOfWeek=r=>{var o,i;return((i=(o=this.overrides)==null?void 0:o.startOfWeek)==null?void 0:i.call(o,r))??Pd(r,this.options)},this.startOfYear=r=>{var o,i;return((i=(o=this.overrides)==null?void 0:o.startOfYear)==null?void 0:i.call(o,r))??N6(r)},this.options={locale:oR,...t},this.overrides=n}getDigitMap(){const{numerals:t="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:t}),r={};for(let o=0;o<10;o++)r[o.toString()]=n.format(o);return r}replaceDigits(t){const n=this.getDigitMap();return t.replace(/\d/g,r=>n[r]||r)}formatNumber(t){return this.replaceDigits(t.toString())}}const ia=new oa;function Vbe(e,t,n={}){return Object.entries(e).filter(([,o])=>o===!0).reduce((o,[i])=>(n[i]?o.push(n[i]):t[wn[i]]?o.push(t[wn[i]]):t[Oi[i]]&&o.push(t[Oi[i]]),o),[t[Qe.Day]])}function Ube(e){return k.createElement("button",{...e})}function Gbe(e){return k.createElement("span",{...e})}function qbe(e){const{size:t=24,orientation:n="left",className:r}=e;return k.createElement("svg",{className:r,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&k.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&k.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&k.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&k.createElement("polygon",{points:"8 18.612 14.1888889 12.5 8 6.37733333 9.91111111 4.5 18 12.5 9.91111111 20.5"}))}function Ybe(e){const{day:t,modifiers:n,...r}=e;return k.createElement("td",{...r})}function Kbe(e){const{day:t,modifiers:n,...r}=e,o=k.useRef(null);return k.useEffect(()=>{var i;n.focused&&((i=o.current)==null||i.focus())},[n.focused]),k.createElement("button",{ref:o,...r})}function Xbe(e){const{options:t,className:n,components:r,classNames:o,...i}=e,s=[o[Qe.Dropdown],n].join(" "),a=t==null?void 0:t.find(({value:l})=>l===i.value);return k.createElement("span",{"data-disabled":i.disabled,className:o[Qe.DropdownRoot]},k.createElement(r.Select,{className:s,...i},t==null?void 0:t.map(({value:l,label:c,disabled:u})=>k.createElement(r.Option,{key:l,value:l,disabled:u},c))),k.createElement("span",{className:o[Qe.CaptionLabel],"aria-hidden":!0},a==null?void 0:a.label,k.createElement(r.Chevron,{orientation:"down",size:18,className:o[Qe.Chevron]})))}function Qbe(e){return k.createElement("div",{...e})}function Zbe(e){return k.createElement("div",{...e})}function Jbe(e){const{calendarMonth:t,displayIndex:n,...r}=e;return k.createElement("div",{...r},e.children)}function eye(e){const{calendarMonth:t,displayIndex:n,...r}=e;return k.createElement("div",{...r})}function tye(e){return k.createElement("table",{...e})}function nye(e){return k.createElement("div",{...e})}const H6=k.createContext(void 0);function Up(){const e=k.useContext(H6);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function rye(e){const{components:t}=Up();return k.createElement(t.Dropdown,{...e})}function oye(e){const{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:o,...i}=e,{components:s,classNames:a,labels:{labelPrevious:l,labelNext:c}}=Up();return k.createElement("nav",{...i},k.createElement(s.PreviousMonthButton,{type:"button",className:a[Qe.PreviousMonthButton],tabIndex:r?void 0:-1,disabled:r?void 0:!0,"aria-label":l(r),onClick:e.onPreviousClick},k.createElement(s.Chevron,{disabled:r?void 0:!0,className:a[Qe.Chevron],orientation:"left"})),k.createElement(s.NextMonthButton,{type:"button",className:a[Qe.NextMonthButton],tabIndex:o?void 0:-1,disabled:o?void 0:!0,"aria-label":c(o),onClick:e.onNextClick},k.createElement(s.Chevron,{disabled:o?void 0:!0,orientation:"right",className:a[Qe.Chevron]})))}function iye(e){const{components:t}=Up();return k.createElement(t.Button,{...e})}function sye(e){return k.createElement("option",{...e})}function aye(e){const{components:t}=Up();return k.createElement(t.Button,{...e})}function lye(e){return k.createElement("div",{...e})}function cye(e){return k.createElement("select",{...e})}function uye(e){const{week:t,...n}=e;return k.createElement("tr",{...n})}function dye(e){return k.createElement("th",{...e})}function fye(e){return k.createElement("thead",{"aria-hidden":!0},k.createElement("tr",{...e}))}function hye(e){const{week:t,...n}=e;return k.createElement("th",{...n})}function pye(e){return k.createElement("th",{...e})}function gye(e){return k.createElement("tbody",{...e})}function mye(e){const{components:t}=Up();return k.createElement(t.Dropdown,{...e})}const bye=Object.freeze(Object.defineProperty({__proto__:null,Button:Ube,CaptionLabel:Gbe,Chevron:qbe,Day:Ybe,DayButton:Kbe,Dropdown:Xbe,DropdownNav:Qbe,Footer:Zbe,Month:Jbe,MonthCaption:eye,MonthGrid:tye,Months:nye,MonthsDropdown:rye,Nav:oye,NextMonthButton:iye,Option:sye,PreviousMonthButton:aye,Root:lye,Select:cye,Week:uye,WeekNumber:hye,WeekNumberHeader:pye,Weekday:dye,Weekdays:fye,Weeks:gye,YearsDropdown:mye},Symbol.toStringTag,{value:"Module"}));function yye(e){return{...bye,...e}}function vye(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0};return Object.entries(e).forEach(([n,r])=>{n.startsWith("data-")&&(t[n]=r)}),t}function xye(){const e={};for(const t in Qe)e[Qe[t]]=`rdp-${Qe[t]}`;for(const t in wn)e[wn[t]]=`rdp-${wn[t]}`;for(const t in Oi)e[Oi[t]]=`rdp-${Oi[t]}`;return e}function W6(e,t,n){return(n??new oa(t)).format(e,"LLLL y")}const wye=W6;function Sye(e,t,n){return(n??new oa(t)).format(e,"d")}function _ye(e,t=ia){return t.format(e,"LLLL")}function Cye(e){return e<10?`0${e.toLocaleString()}`:`${e.toLocaleString()}`}function Eye(){return""}function Rye(e,t,n){return(n??new oa(t)).format(e,"cccccc")}function V6(e,t=ia){return t.format(e,"yyyy")}const Tye=V6,kye=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:W6,formatDay:Sye,formatMonthCaption:wye,formatMonthDropdown:_ye,formatWeekNumber:Cye,formatWeekNumberHeader:Eye,formatWeekdayName:Rye,formatYearCaption:Tye,formatYearDropdown:V6},Symbol.toStringTag,{value:"Module"}));function Pye(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...kye,...e}}function Oye(e,t,n,r,o){const{startOfMonth:i,startOfYear:s,endOfYear:a,eachMonthOfInterval:l,getMonth:c}=o;return l({start:s(e),end:a(e)}).map(p=>{const h=r.formatMonthDropdown(p,o),m=c(p),b=t&&p<i(t)||n&&p>i(n)||!1;return{value:m,label:h,disabled:b}})}function Mye(e,t={},n={}){let r={...t==null?void 0:t[Qe.Day]};return Object.entries(e).filter(([,o])=>o===!0).forEach(([o])=>{r={...r,...n==null?void 0:n[o]}}),r}function Aye(e,t,n){const r=e.today(),o=t?e.startOfISOWeek(r):e.startOfWeek(r),i=[];for(let s=0;s<7;s++){const a=e.addDays(o,s);i.push(a)}return i}function Dye(e,t,n,r){if(!e||!t)return;const{startOfYear:o,endOfYear:i,addYears:s,getYear:a,isBefore:l,isSameYear:c}=r,u=o(e),d=i(t),p=[];let h=u;for(;l(h,d)||c(h,d);)p.push(h),h=s(h,1);return p.map(m=>{const b=n.formatYearDropdown(m,r);return{value:a(m),label:b,disabled:!1}})}function U6(e,t,n){return(n??new oa(t)).format(e,"LLLL y")}const Iye=U6;function Nye(e,t,n,r){let o=(r??new oa(n)).format(e,"PPPP");return t!=null&&t.today&&(o=`Today, ${o}`),o}function G6(e,t,n,r){let o=(r??new oa(n)).format(e,"PPPP");return t.today&&(o=`Today, ${o}`),t.selected&&(o=`${o}, selected`),o}const Fye=G6;function Lye(){return""}function $ye(e){return"Choose the Month"}function jye(e){return"Go to the Next Month"}function zye(e){return"Go to the Previous Month"}function Bye(e,t,n){return(n??new oa(t)).format(e,"cccc")}function Hye(e,t){return`Week ${e}`}function Wye(e){return"Week Number"}function Vye(e){return"Choose the Year"}const Uye=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:Iye,labelDay:Fye,labelDayButton:G6,labelGrid:U6,labelGridcell:Nye,labelMonthDropdown:$ye,labelNav:Lye,labelNext:jye,labelPrevious:zye,labelWeekNumber:Hye,labelWeekNumberHeader:Wye,labelWeekday:Bye,labelYearDropdown:Vye},Symbol.toStringTag,{value:"Module"}));function Gye(e,t,n,r){const o=e[0],i=e[e.length-1],{ISOWeek:s,fixedWeeks:a,broadcastCalendar:l}=n??{},{addDays:c,differenceInCalendarDays:u,differenceInCalendarMonths:d,endOfBroadcastWeek:p,endOfISOWeek:h,endOfMonth:m,endOfWeek:b,isAfter:y,startOfBroadcastWeek:v,startOfISOWeek:w,startOfWeek:_}=r,R=l?v(o,r):s?w(o):_(o),C=l?p(i,r):s?h(m(i)):b(m(i)),E=u(C,R),P=d(i,o)+1,A=[];for(let L=0;L<=E;L++){const j=c(R,L);if(t&&y(j,t))break;A.push(j)}const F=(l?35:42)*P;if(a&&A.length<F){const L=F-A.length;for(let j=0;j<L;j++){const X=c(A[A.length-1],1);A.push(X)}}return A}function qye(e){const t=[];return e.reduce((n,r)=>{const o=[],i=r.weeks.reduce((s,a)=>[...s,...a.days],o);return[...n,...i]},t)}function Yye(e,t,n,r){const{numberOfMonths:o=1}=n,i=[];for(let s=0;s<o;s++){const a=r.addMonths(e,s);if(t&&a>t)break;i.push(a)}return i}function oD(e,t){const{month:n,defaultMonth:r,today:o=t.today(),numberOfMonths:i=1,endMonth:s,startMonth:a}=e;let l=n||r||o;const{differenceInCalendarMonths:c,addMonths:u,startOfMonth:d}=t;if(s&&c(s,l)<0){const p=-1*(i-1);l=u(s,p)}return a&&c(l,a)<0&&(l=a),d(l)}class q6{constructor(t,n,r=ia){this.date=t,this.displayMonth=n,this.outside=!!(n&&!r.isSameMonth(t,n)),this.dateLib=r}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class Kye{constructor(t,n){this.date=t,this.weeks=n}}class Xye{constructor(t,n){this.days=n,this.weekNumber=t}}function Qye(e,t,n,r){const{addDays:o,endOfBroadcastWeek:i,endOfISOWeek:s,endOfMonth:a,endOfWeek:l,getISOWeek:c,getWeek:u,startOfBroadcastWeek:d,startOfISOWeek:p,startOfWeek:h}=r,m=e.reduce((b,y)=>{const v=n.broadcastCalendar?d(y,r):n.ISOWeek?p(y):h(y),w=n.broadcastCalendar?i(y,r):n.ISOWeek?s(a(y)):l(a(y)),_=t.filter(P=>P>=v&&P<=w),R=n.broadcastCalendar?35:42;if(n.fixedWeeks&&_.length<R){const P=t.filter(A=>{const I=R-_.length;return A>w&&A<=o(w,I)});_.push(...P)}const C=_.reduce((P,A)=>{const I=n.ISOWeek?c(A):u(A),F=P.find(j=>j.weekNumber===I),L=new q6(A,y,r);return F?F.days.push(L):P.push(new Xye(I,[L])),P},[]),E=new Kye(y,C);return b.push(E),b},[]);return n.reverseMonths?m.reverse():m}function Zye(e,t){let{startMonth:n,endMonth:r}=e;const{startOfYear:o,startOfDay:i,startOfMonth:s,endOfMonth:a,addYears:l,endOfYear:c,newDate:u,today:d}=t,{fromYear:p,toYear:h,fromMonth:m,toMonth:b}=e;!n&&m&&(n=m),!n&&p&&(n=t.newDate(p,0,1)),!r&&b&&(r=b),!r&&h&&(r=u(h,11,31));const y=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=s(n):p?n=u(p,0,1):!n&&y&&(n=o(l(e.today??d(),-100))),r?r=a(r):h?r=u(h,11,31):!r&&y&&(r=c(e.today??d())),[n&&i(n),r&&i(r)]}function Jye(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:i=1}=n,{startOfMonth:s,addMonths:a,differenceInCalendarMonths:l}=r,c=o?i:1,u=s(e);if(!t)return a(u,c);if(!(l(t,e)<i))return a(u,c)}function e0e(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:i}=n,{startOfMonth:s,addMonths:a,differenceInCalendarMonths:l}=r,c=o?i??1:1,u=s(e);if(!t)return a(u,-c);if(!(l(u,t)<=0))return a(u,-c)}function t0e(e){const t=[];return e.reduce((n,r)=>[...n,...r.weeks],t)}function D0(e,t){const[n,r]=k.useState(e);return[t===void 0?n:t,r]}function n0e(e,t){const[n,r]=Zye(e,t),{startOfMonth:o,endOfMonth:i}=t,s=oD(e,t),[a,l]=D0(s,e.month?s:void 0);k.useEffect(()=>{const E=oD(e,t);l(E)},[e.timeZone]);const c=Yye(a,r,e,t),u=Gye(c,e.endMonth?i(e.endMonth):void 0,e,t),d=Qye(c,u,e,t),p=t0e(d),h=qye(d),m=e0e(a,n,e,t),b=Jye(a,r,e,t),{disableNavigation:y,onMonthChange:v}=e,w=E=>p.some(P=>P.days.some(A=>A.isEqualTo(E))),_=E=>{if(y)return;let P=o(E);n&&P<o(n)&&(P=o(n)),r&&P>o(r)&&(P=o(r)),l(P),v==null||v(P)};return{months:d,weeks:p,days:h,navStart:n,navEnd:r,previousMonth:m,nextMonth:b,goToMonth:_,goToDay:E=>{w(E)||_(E.date)}}}function r0e(e,t,n,r){let o,i=0,s=!1;for(;i<e.length&&!s;){const a=e[i],l=t(a);!l[wn.disabled]&&!l[wn.hidden]&&!l[wn.outside]&&(l[wn.focused]||r!=null&&r.isEqualTo(a)||n(a.date)||l[wn.today])&&(o=a,s=!0),i++}return o||(o=e.find(a=>{const l=t(a);return!l[wn.disabled]&&!l[wn.hidden]&&!l[wn.outside]})),o}function Xs(e,t,n=!1,r=ia){let{from:o,to:i}=e;const{differenceInCalendarDays:s,isSameDay:a}=r;return o&&i?(s(i,o)<0&&([o,i]=[i,o]),s(t,o)>=(n?1:0)&&s(i,t)>=(n?1:0)):!n&&i?a(i,t):!n&&o?a(o,t):!1}function Y6(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function iR(e){return!!(e&&typeof e=="object"&&"from"in e)}function K6(e){return!!(e&&typeof e=="object"&&"after"in e)}function X6(e){return!!(e&&typeof e=="object"&&"before"in e)}function Q6(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function Z6(e,t){return Array.isArray(e)&&e.every(t.isDate)}function Qs(e,t,n=ia){const r=Array.isArray(t)?t:[t],{isSameDay:o,differenceInCalendarDays:i,isAfter:s}=n;return r.some(a=>{if(typeof a=="boolean")return a;if(n.isDate(a))return o(e,a);if(Z6(a,n))return a.includes(e);if(iR(a))return Xs(a,e,!1,n);if(Q6(a))return Array.isArray(a.dayOfWeek)?a.dayOfWeek.includes(e.getDay()):a.dayOfWeek===e.getDay();if(Y6(a)){const l=i(a.before,e),c=i(a.after,e),u=l>0,d=c<0;return s(a.before,a.after)?d&&u:u||d}return K6(a)?i(e,a.after)>0:X6(a)?i(a.before,e)>0:typeof a=="function"?a(e):!1})}function o0e(e,t,n,r,o,i,s){const{ISOWeek:a,broadcastCalendar:l}=i,{addDays:c,addMonths:u,addWeeks:d,addYears:p,endOfBroadcastWeek:h,endOfISOWeek:m,endOfWeek:b,max:y,min:v,startOfBroadcastWeek:w,startOfISOWeek:_,startOfWeek:R}=s;let E={day:c,week:d,month:u,year:p,startOfWeek:P=>l?w(P,s):a?_(P):R(P),endOfWeek:P=>l?h(P,s):a?m(P):b(P)}[e](n,t==="after"?1:-1);return t==="before"&&r?E=y([r,E]):t==="after"&&o&&(E=v([o,E])),E}function J6(e,t,n,r,o,i,s,a=0){if(a>365)return;const l=o0e(e,t,n.date,r,o,i,s),c=!!(i.disabled&&Qs(l,i.disabled,s)),u=!!(i.hidden&&Qs(l,i.hidden,s)),d=l,p=new q6(l,d,s);return!c&&!u?p:J6(e,t,p,r,o,i,s,a+1)}function i0e(e,t,n,r,o){const{autoFocus:i}=e,[s,a]=k.useState(),l=r0e(t.days,n,r||(()=>!1),s),[c,u]=k.useState(i?l:void 0);return{isFocusTarget:b=>!!(l!=null&&l.isEqualTo(b)),setFocused:u,focused:c,blur:()=>{a(c),u(void 0)},moveFocus:(b,y)=>{if(!c)return;const v=J6(b,y,c,t.navStart,t.navEnd,e,o);v&&(t.goToDay(v),u(v))}}}function s0e(e,t,n){const{disabled:r,hidden:o,modifiers:i,showOutsideDays:s,broadcastCalendar:a,today:l}=t,{isSameDay:c,isSameMonth:u,startOfMonth:d,isBefore:p,endOfMonth:h,isAfter:m}=n,b=t.startMonth&&d(t.startMonth),y=t.endMonth&&h(t.endMonth),v={[wn.focused]:[],[wn.outside]:[],[wn.disabled]:[],[wn.hidden]:[],[wn.today]:[]},w={};for(const _ of e){const{date:R,displayMonth:C}=_,E=!!(C&&!u(R,C)),P=!!(b&&p(R,b)),A=!!(y&&m(R,y)),I=!!(r&&Qs(R,r,n)),F=!!(o&&Qs(R,o,n))||P||A||!a&&!s&&E||a&&s===!1&&E,L=c(R,l??n.today());E&&v.outside.push(_),I&&v.disabled.push(_),F&&v.hidden.push(_),L&&v.today.push(_),i&&Object.keys(i).forEach(j=>{const X=i==null?void 0:i[j];X&&Qs(R,X,n)&&(w[j]?w[j].push(_):w[j]=[_])})}return _=>{const R={[wn.focused]:!1,[wn.disabled]:!1,[wn.hidden]:!1,[wn.outside]:!1,[wn.today]:!1},C={};for(const E in v){const P=v[E];R[E]=P.some(A=>A===_)}for(const E in w)C[E]=w[E].some(P=>P===_);return{...R,...C}}}function a0e(e,t){const{selected:n,required:r,onSelect:o}=e,[i,s]=D0(n,o?n:void 0),a=o?n:i,{isSameDay:l}=t,c=h=>(a==null?void 0:a.some(m=>l(m,h)))??!1,{min:u,max:d}=e;return{selected:a,select:(h,m,b)=>{let y=[...a??[]];if(c(h)){if((a==null?void 0:a.length)===u||r&&(a==null?void 0:a.length)===1)return;y=a==null?void 0:a.filter(v=>!l(v,h))}else(a==null?void 0:a.length)===d?y=[h]:y=[...y,h];return o||s(y),o==null||o(y,h,m,b),y},isSelected:c}}function l0e(e,t,n=0,r=0,o=!1,i=ia){const{from:s,to:a}=t||{},{isSameDay:l,isAfter:c,isBefore:u}=i;let d;if(!s&&!a)d={from:e,to:n>0?void 0:e};else if(s&&!a)l(s,e)?o?d={from:s,to:void 0}:d=void 0:u(e,s)?d={from:e,to:s}:d={from:s,to:e};else if(s&&a)if(l(s,e)&&l(a,e))o?d={from:s,to:a}:d=void 0;else if(l(s,e))d={from:s,to:n>0?void 0:e};else if(l(a,e))d={from:e,to:n>0?void 0:e};else if(u(e,s))d={from:e,to:a};else if(c(e,s))d={from:s,to:e};else if(c(e,a))d={from:s,to:e};else throw new Error("Invalid range");if(d!=null&&d.from&&(d!=null&&d.to)){const p=i.differenceInCalendarDays(d.to,d.from);r>0&&p>r?d={from:e,to:void 0}:n>1&&p<n&&(d={from:e,to:void 0})}return d}function c0e(e,t,n=ia){const r=Array.isArray(t)?t:[t];let o=e.from;const i=n.differenceInCalendarDays(e.to,e.from),s=Math.min(i,6);for(let a=0;a<=s;a++){if(r.includes(o.getDay()))return!0;o=n.addDays(o,1)}return!1}function iD(e,t,n=ia){return Xs(e,t.from,!1,n)||Xs(e,t.to,!1,n)||Xs(t,e.from,!1,n)||Xs(t,e.to,!1,n)}function u0e(e,t,n=ia){const r=Array.isArray(t)?t:[t];if(r.filter(a=>typeof a!="function").some(a=>typeof a=="boolean"?a:n.isDate(a)?Xs(e,a,!1,n):Z6(a,n)?a.some(l=>Xs(e,l,!1,n)):iR(a)?a.from&&a.to?iD(e,{from:a.from,to:a.to},n):!1:Q6(a)?c0e(e,a.dayOfWeek,n):Y6(a)?n.isAfter(a.before,a.after)?iD(e,{from:n.addDays(a.after,1),to:n.addDays(a.before,-1)},n):Qs(e.from,a,n)||Qs(e.to,a,n):K6(a)||X6(a)?Qs(e.from,a,n)||Qs(e.to,a,n):!1))return!0;const s=r.filter(a=>typeof a=="function");if(s.length){let a=e.from;const l=n.differenceInCalendarDays(e.to,e.from);for(let c=0;c<=l;c++){if(s.some(u=>u(a)))return!0;a=n.addDays(a,1)}}return!1}function d0e(e,t){const{disabled:n,excludeDisabled:r,selected:o,required:i,onSelect:s}=e,[a,l]=D0(o,s?o:void 0),c=s?o:a;return{selected:c,select:(p,h,m)=>{const{min:b,max:y}=e,v=p?l0e(p,c,b,y,i,t):void 0;return r&&n&&(v!=null&&v.from)&&v.to&&u0e({from:v.from,to:v.to},n,t)&&(v.from=p,v.to=void 0),s||l(v),s==null||s(v,p,h,m),v},isSelected:p=>c&&Xs(c,p,!1,t)}}function f0e(e,t){const{selected:n,required:r,onSelect:o}=e,[i,s]=D0(n,o?n:void 0),a=o?n:i,{isSameDay:l}=t;return{selected:a,select:(d,p,h)=>{let m=d;return!r&&a&&a&&l(d,a)&&(m=void 0),o||s(m),o==null||o(m,d,p,h),m},isSelected:d=>a?l(a,d):!1}}function h0e(e,t){const n=f0e(e,t),r=a0e(e,t),o=d0e(e,t);switch(e.mode){case"single":return n;case"multiple":return r;case"range":return o;default:return}}function p0e(e){const{components:t,formatters:n,labels:r,dateLib:o,locale:i,classNames:s}=k.useMemo(()=>{const Ue={...oR,...e.locale};return{dateLib:new oa({locale:Ue,weekStartsOn:e.broadcastCalendar?1:e.weekStartsOn,firstWeekContainsDate:e.firstWeekContainsDate,useAdditionalWeekYearTokens:e.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:e.useAdditionalDayOfYearTokens,timeZone:e.timeZone,numerals:e.numerals},e.dateLib),components:yye(e.components),formatters:Pye(e.formatters),labels:{...Uye,...e.labels},locale:Ue,classNames:{...xye(),...e.classNames}}},[e.locale,e.broadcastCalendar,e.weekStartsOn,e.firstWeekContainsDate,e.useAdditionalWeekYearTokens,e.useAdditionalDayOfYearTokens,e.timeZone,e.numerals,e.dateLib,e.components,e.formatters,e.labels,e.classNames]),{captionLayout:a,mode:l,onDayBlur:c,onDayClick:u,onDayFocus:d,onDayKeyDown:p,onDayMouseEnter:h,onDayMouseLeave:m,onNextClick:b,onPrevClick:y,showWeekNumber:v,styles:w}=e,{formatCaption:_,formatDay:R,formatMonthDropdown:C,formatWeekNumber:E,formatWeekNumberHeader:P,formatWeekdayName:A,formatYearDropdown:I}=n,F=n0e(e,o),{days:L,months:j,navStart:X,navEnd:U,previousMonth:$,nextMonth:B,goToMonth:W}=F,q=s0e(L,e,o),{isSelected:Q,select:D,selected:G}=h0e(e,o)??{},{blur:V,focused:M,isFocusTarget:ee,moveFocus:K,setFocused:re}=i0e(e,F,q,Q??(()=>!1),o),{labelDayButton:Y,labelGridcell:J,labelGrid:ie,labelMonthDropdown:de,labelNav:he,labelWeekday:se,labelWeekNumber:ge,labelWeekNumberHeader:ue,labelYearDropdown:Ce}=r,ke=k.useMemo(()=>Aye(o,e.ISOWeek),[o,e.ISOWeek]),Ne=l!==void 0||u!==void 0,Oe=k.useCallback(()=>{$&&(W($),y==null||y($))},[$,W,y]),Le=k.useCallback(()=>{B&&(W(B),b==null||b(B))},[W,B,b]),Je=k.useCallback((Ue,lt)=>Ge=>{Ge.preventDefault(),Ge.stopPropagation(),re(Ue),D==null||D(Ue.date,lt,Ge),u==null||u(Ue.date,lt,Ge)},[D,u,re]),it=k.useCallback((Ue,lt)=>Ge=>{re(Ue),d==null||d(Ue.date,lt,Ge)},[d,re]),ln=k.useCallback((Ue,lt)=>Ge=>{V(),c==null||c(Ue.date,lt,Ge)},[V,c]),vt=k.useCallback((Ue,lt)=>Ge=>{const tn={ArrowLeft:["day",e.dir==="rtl"?"after":"before"],ArrowRight:["day",e.dir==="rtl"?"before":"after"],ArrowDown:["week","after"],ArrowUp:["week","before"],PageUp:[Ge.shiftKey?"year":"month","before"],PageDown:[Ge.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(tn[Ge.key]){Ge.preventDefault(),Ge.stopPropagation();const[gt,In]=tn[Ge.key];K(gt,In)}p==null||p(Ue.date,lt,Ge)},[K,p,e.dir]),$n=k.useCallback((Ue,lt)=>Ge=>{h==null||h(Ue.date,lt,Ge)},[h]),Ct=k.useCallback((Ue,lt)=>Ge=>{m==null||m(Ue.date,lt,Ge)},[m]),fe=k.useCallback(Ue=>lt=>{const Ge=Number(lt.target.value),tn=o.setMonth(o.startOfMonth(Ue),Ge);W(tn)},[o,W]),_e=k.useCallback(Ue=>lt=>{const Ge=Number(lt.target.value),tn=o.setYear(o.startOfMonth(Ue),Ge);W(tn)},[o,W]),{className:He,style:Ve}=k.useMemo(()=>({className:[s[Qe.Root],e.className].filter(Boolean).join(" "),style:{...w==null?void 0:w[Qe.Root],...e.style}}),[s,e.className,e.style,w]),rt=vye(e),An={dayPickerProps:e,selected:G,select:D,isSelected:Q,months:j,nextMonth:B,previousMonth:$,goToMonth:W,getModifiers:q,components:t,classNames:s,styles:w,labels:r,formatters:n};return k.createElement(H6.Provider,{value:An},k.createElement(t.Root,{className:He,style:Ve,dir:e.dir,id:e.id,lang:e.lang,nonce:e.nonce,title:e.title,role:e.role,"aria-label":e["aria-label"],...rt},k.createElement(t.Months,{className:s[Qe.Months],style:w==null?void 0:w[Qe.Months]},!e.hideNavigation&&k.createElement(t.Nav,{className:s[Qe.Nav],style:w==null?void 0:w[Qe.Nav],"aria-label":he(),onPreviousClick:Oe,onNextClick:Le,previousMonth:$,nextMonth:B}),j.map((Ue,lt)=>{const Ge=Oye(Ue.date,X,U,n,o),tn=Dye(X,U,n,o);return k.createElement(t.Month,{className:s[Qe.Month],style:w==null?void 0:w[Qe.Month],key:lt,displayIndex:lt,calendarMonth:Ue},k.createElement(t.MonthCaption,{className:s[Qe.MonthCaption],style:w==null?void 0:w[Qe.MonthCaption],calendarMonth:Ue,displayIndex:lt},a!=null&&a.startsWith("dropdown")?k.createElement(t.DropdownNav,{className:s[Qe.Dropdowns],style:w==null?void 0:w[Qe.Dropdowns]},a==="dropdown"||a==="dropdown-months"?k.createElement(t.MonthsDropdown,{className:s[Qe.MonthsDropdown],"aria-label":de(),classNames:s,components:t,disabled:!!e.disableNavigation,onChange:fe(Ue.date),options:Ge,style:w==null?void 0:w[Qe.Dropdown],value:o.getMonth(Ue.date)}):k.createElement("span",{role:"status","aria-live":"polite"},C(Ue.date,o)),a==="dropdown"||a==="dropdown-years"?k.createElement(t.YearsDropdown,{className:s[Qe.YearsDropdown],"aria-label":Ce(o.options),classNames:s,components:t,disabled:!!e.disableNavigation,onChange:_e(Ue.date),options:tn,style:w==null?void 0:w[Qe.Dropdown],value:o.getYear(Ue.date)}):k.createElement("span",{role:"status","aria-live":"polite"},I(Ue.date,o))):k.createElement(t.CaptionLabel,{className:s[Qe.CaptionLabel],role:"status","aria-live":"polite"},_(Ue.date,o.options,o))),k.createElement(t.MonthGrid,{role:"grid","aria-multiselectable":l==="multiple"||l==="range","aria-label":ie(Ue.date,o.options,o)||void 0,className:s[Qe.MonthGrid],style:w==null?void 0:w[Qe.MonthGrid]},!e.hideWeekdays&&k.createElement(t.Weekdays,{className:s[Qe.Weekdays],style:w==null?void 0:w[Qe.Weekdays]},v&&k.createElement(t.WeekNumberHeader,{"aria-label":ue(o.options),className:s[Qe.WeekNumberHeader],style:w==null?void 0:w[Qe.WeekNumberHeader],scope:"col"},P()),ke.map((gt,In)=>k.createElement(t.Weekday,{"aria-label":se(gt,o.options,o),className:s[Qe.Weekday],key:In,style:w==null?void 0:w[Qe.Weekday],scope:"col"},A(gt,o.options,o)))),k.createElement(t.Weeks,{className:s[Qe.Weeks],style:w==null?void 0:w[Qe.Weeks]},Ue.weeks.map((gt,In)=>k.createElement(t.Week,{className:s[Qe.Week],key:gt.weekNumber,style:w==null?void 0:w[Qe.Week],week:gt},v&&k.createElement(t.WeekNumber,{week:gt,style:w==null?void 0:w[Qe.WeekNumber],"aria-label":ge(gt.weekNumber,{locale:i}),className:s[Qe.WeekNumber],scope:"row",role:"rowheader"},E(gt.weekNumber)),gt.days.map($t=>{const{date:Nn}=$t,st=q($t);if(st[wn.focused]=!st.hidden&&!!(M!=null&&M.isEqualTo($t)),st[Oi.selected]=!st.disabled&&((Q==null?void 0:Q(Nn))||st.selected),iR(G)){const{from:mi,to:$e}=G;st[Oi.range_start]=!!(mi&&$e&&o.isSameDay(Nn,mi)),st[Oi.range_end]=!!(mi&&$e&&o.isSameDay(Nn,$e)),st[Oi.range_middle]=Xs(G,Nn,!0,o)}const qo=Mye(st,w,e.modifiersStyles),cr=Vbe(st,s,e.modifiersClassNames),br=!Ne&&!st.hidden?J(Nn,st,o.options,o):void 0;return k.createElement(t.Day,{key:`${o.format(Nn,"yyyy-MM-dd")}_${o.format($t.displayMonth,"yyyy-MM")}`,day:$t,modifiers:st,className:cr.join(" "),style:qo,role:"gridcell","aria-selected":st.selected||void 0,"aria-label":br,"data-day":o.format(Nn,"yyyy-MM-dd"),"data-month":$t.outside?o.format(Nn,"yyyy-MM"):void 0,"data-selected":st.selected||void 0,"data-disabled":st.disabled||void 0,"data-hidden":st.hidden||void 0,"data-outside":$t.outside||void 0,"data-focused":st.focused||void 0,"data-today":st.today||void 0},!st.hidden&&Ne?k.createElement(t.DayButton,{className:s[Qe.DayButton],style:w==null?void 0:w[Qe.DayButton],type:"button",day:$t,modifiers:st,disabled:st.disabled||void 0,tabIndex:ee($t)?0:-1,"aria-label":Y(Nn,st,o.options,o),onClick:Je($t,st),onBlur:ln($t,st),onFocus:it($t,st),onKeyDown:vt($t,st),onMouseEnter:$n($t,st),onMouseLeave:Ct($t,st)},R(Nn,o.options,o)):!st.hidden&&R($t.date,o.options,o))}))))))})),e.footer&&k.createElement(t.Footer,{className:s[Qe.Footer],style:w==null?void 0:w[Qe.Footer],role:"status","aria-live":"polite"},e.footer)))}function ej({className:e,classNames:t,showOutsideDays:n=!0,...r}){return x.jsx(p0e,{showOutsideDays:n,className:me("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:me(Xh({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:me(Xh({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},...r})}ej.displayName="Calendar";function tj(e){const{authToken:t}=Uo(),n=ye(R=>R.authToken),r=t||n,o=ye(R=>R.dashboard.filters),i=ye(R=>R.selectedSheetId),s=ye(R=>R.filterValues),[a,l]=k.useState(!0),c=o==null?void 0:o.filter(R=>R.sheetId===i||!R.sheetId),u=s==null?void 0:s.filter(R=>(c==null?void 0:c.some(C=>C.id===R.filterId))||R.filterId.endsWith(i));function d(R){return a?{allowQuery:!0,filterValues:R.filter(P=>P.filterId!==e.id)}:(R==null?void 0:R.find(E=>E.filterId===e.id))?{allowQuery:!1,filterValues:R}:{allowQuery:!0,filterValues:R}}const{allowQuery:p,filterValues:h}=d(u||[]),{data:m,isLoading:b,isFetching:y,isError:v,refetch:w,isSuccess:_}=Sp({queryKey:["filter",e.id,e.sql,JSON.stringify(h)],queryFn:()=>Ay("https://semaphor.cloud/api/v1/query",(r==null?void 0:r.accessToken)||"",{connection_id:e.connectionId,sql:e.sql,active_filters:h,cache_config:oC({filter:e})}),enabled:!!e.sql&&!!e.connectionId&&p&&!!(r!=null&&r.accessToken),placeholderData:R=>R});return k.useEffect(()=>{_&&a&&l(!1)},[_,a]),{data:m,isLoading:b,isFetching:y,isError:v,refetch:w}}function g0e(e){const t=ye(o=>{var i,s;return(s=(i=o.dashboard)==null?void 0:i.filters)==null?void 0:s.find(a=>a.id===e)}),{setDateRange:n,...r}=nj(t||{});return r}function nj(e){const[t,n]=k.useState(),[r,o]=k.useState(),i=ye(m=>m.filterValues),s=ye(m=>m.actions.addOrUpdateFilterValue),{removeFilterValues:a}=Yn(),{data:l,isLoading:c,isFetching:u,isError:d}=tj(e);k.useEffect(()=>{var m;if(((m=l==null?void 0:l.records)==null?void 0:m.length)>0){const b=l.records[0];if(!b.min||!b.max)return;n({from:new Date(b.min),to:new Date(b.max)}),o({from:new Date(b.min),to:new Date(b.max)})}},[l]),k.useEffect(()=>{var m;if(i){const b=i.find(y=>y.filterId===e.id);if(!b)n(r);else if(((m=b.values)==null?void 0:m.length)===2){const[y,v]=b.values;n({from:y?new Date(y):void 0,to:v?new Date(v):void 0})}}},[i,e.id,r]);function p(){a(e.id),n(r)}function h(m){if(!m)return;let b=[m==null?void 0:m.from,m==null?void 0:m.to];m.from&&m.to===void 0?b=[m.from,HA(m.from,24)]:m.from&&m.to&&m.from.getTime()===m.to.getTime()?b=[m.from,HA(m.to,24)]:b=[m.from,m.to],n({from:b[0],to:b[1]});const y={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:Iu(e),name:e.column,operation:"between",values:b};s(y)}return{records:l==null?void 0:l.records,isLoading:c,isFetching:u,isError:d,initialDateRange:r,dateRange:t,setDateRange:n,handleClear:p,handleChange:h}}function m0e({filter:e,className:t}){var h,m,b,y,v,w,_,R;const n=ye(C=>C.themeStyle),[r,o]=k.useState(!1),{records:i,dateRange:s,isLoading:a,isFetching:l,isError:c,setDateRange:u,handleClear:d,handleChange:p}=nj(e);return a||l?x.jsx("div",{children:x.jsx(Fu,{className:"h-8 w-full bg-foreground/10"})}):c?x.jsx("div",{className:"h-8 w-full bg-muted px-2",children:"Error"}):i?x.jsx("div",{className:me("grid gap-2",t),children:x.jsxs(T0,{open:r,onOpenChange:o,children:[x.jsx(k0,{style:{borderRadius:(m=(h=n==null?void 0:n.chart)==null?void 0:h.options)==null?void 0:m.borderRadius},asChild:!0,children:x.jsxs(sr,{size:"sm",id:"date",variant:"outline",className:me("h-[34px] w-full justify-start rounded-sm text-left font-normal",!s&&"text-muted-foreground"),children:[x.jsx(sF,{className:"mr-2 h-4 w-4"}),s!=null&&s.from?s.to?x.jsxs(x.Fragment,{children:[Mw(s.from,"LLL dd, y")," -"," ",Mw(s.to,"LLL dd, y")]}):Mw(s.from,"LLL dd, y"):x.jsx("span",{children:"Pick a date"})]})}),x.jsxs(Hp,{style:{borderRadius:(y=(b=n==null?void 0:n.chart)==null?void 0:b.options)==null?void 0:y.borderRadius},className:"w-auto p-0",align:"start",children:[x.jsx("div",{className:"px-4 pt-3",children:x.jsx(Tn,{children:e.title})}),x.jsx(ej,{initialFocus:!0,mode:"range",defaultMonth:s==null?void 0:s.from,selected:s,onSelect:u,numberOfMonths:2}),x.jsxs("div",{className:"flex justify-end gap-2 px-4 py-3",children:[x.jsx(sr,{style:{borderRadius:(w=(v=n==null?void 0:n.chart)==null?void 0:v.options)==null?void 0:w.borderRadius},size:"sm",variant:"outline",onClick:()=>{p(s),o(!1)},children:"Apply"}),x.jsx(sr,{style:{borderRadius:(R=(_=n==null?void 0:n.chart)==null?void 0:_.options)==null?void 0:R.borderRadius},size:"sm",variant:"outline",onClick:d,children:"Clear"})]})]})]})}):x.jsxs(Tn,{className:"w-fulll flex h-8 items-center bg-muted px-2",children:[" ","No Data"]})}const rj=typeof document<"u"?k.useLayoutEffect:()=>{};function b0e(e){const t=k.useRef(null);return rj(()=>{t.current=e},[e]),k.useCallback((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const Gp=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},Yl=e=>e&&"window"in e&&e.window===e?e:Gp(e).defaultView||window;function y0e(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 v0e(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 oj(e){let t=null;return()=>(t==null&&(t=e()),t)}const x0e=oj(function(){return v0e(/^Mac/i)}),w0e=oj(function(){return y0e(/Android/i)});function S0e(e){return e.mozInputSource===0&&e.isTrusted?!0:w0e()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}class _0e{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 ij(e){let t=k.useRef({isFocused:!1,observer:null});rj(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=b0e(r=>{e==null||e(r)});return k.useCallback(r=>{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){t.current.isFocused=!0;let o=r.target,i=s=>{t.current.isFocused=!1,o.disabled&&n(new _0e("blur",s)),t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};o.addEventListener("focusout",i,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&o.disabled){var s;(s=t.current.observer)===null||s===void 0||s.disconnect();let a=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:a})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:a}))}}),t.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[n])}function C0e(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const i=k.useCallback(l=>{if(l.target===l.currentTarget)return r&&r(l),o&&o(!1),!0},[r,o]),s=ij(i),a=k.useCallback(l=>{const c=Gp(l.target);l.target===l.currentTarget&&c.activeElement===l.target&&(n&&n(l),o&&o(!0),s(l))},[o,n,s]);return{focusProps:{onFocus:!t&&(n||o||r)?a:void 0,onBlur:!t&&(r||o)?i:void 0}}}let qp=null,o_=new Set,Rh=new Map,Ac=!1,i_=!1;const E0e={Tab:!0,Escape:!0};function sR(e,t){for(let n of o_)n(e,t)}function R0e(e){return!(e.metaKey||!x0e()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function dy(e){Ac=!0,R0e(e)&&(qp="keyboard",sR("keyboard",e))}function ii(e){qp="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(Ac=!0,sR("pointer",e))}function sj(e){S0e(e)&&(Ac=!0,qp="virtual")}function aj(e){e.target===window||e.target===document||(!Ac&&!i_&&(qp="virtual",sR("virtual",e)),Ac=!1,i_=!1)}function lj(){Ac=!1,i_=!0}function s_(e){if(typeof window>"u"||Rh.get(Yl(e)))return;const t=Yl(e),n=Gp(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){Ac=!0,r.apply(this,arguments)},n.addEventListener("keydown",dy,!0),n.addEventListener("keyup",dy,!0),n.addEventListener("click",sj,!0),t.addEventListener("focus",aj,!0),t.addEventListener("blur",lj,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",ii,!0),n.addEventListener("pointermove",ii,!0),n.addEventListener("pointerup",ii,!0)):(n.addEventListener("mousedown",ii,!0),n.addEventListener("mousemove",ii,!0),n.addEventListener("mouseup",ii,!0)),t.addEventListener("beforeunload",()=>{cj(e)},{once:!0}),Rh.set(t,{focus:r})}const cj=(e,t)=>{const n=Yl(e),r=Gp(e);t&&r.removeEventListener("DOMContentLoaded",t),Rh.has(n)&&(n.HTMLElement.prototype.focus=Rh.get(n).focus,r.removeEventListener("keydown",dy,!0),r.removeEventListener("keyup",dy,!0),r.removeEventListener("click",sj,!0),n.removeEventListener("focus",aj,!0),n.removeEventListener("blur",lj,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",ii,!0),r.removeEventListener("pointermove",ii,!0),r.removeEventListener("pointerup",ii,!0)):(r.removeEventListener("mousedown",ii,!0),r.removeEventListener("mousemove",ii,!0),r.removeEventListener("mouseup",ii,!0)),Rh.delete(n))};function T0e(e){const t=Gp(e);let n;return t.readyState!=="loading"?s_(e):(n=()=>{s_(e)},t.addEventListener("DOMContentLoaded",n)),()=>cj(e,n)}typeof document<"u"&&T0e();function uj(){return qp!=="pointer"}const k0e=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function P0e(e,t,n){var r;const o=typeof window<"u"?Yl(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,i=typeof window<"u"?Yl(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,s=typeof window<"u"?Yl(n==null?void 0:n.target).HTMLElement:HTMLElement,a=typeof window<"u"?Yl(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||(n==null?void 0:n.target)instanceof o&&!k0e.has(n==null||(r=n.target)===null||r===void 0?void 0:r.type)||(n==null?void 0:n.target)instanceof i||(n==null?void 0:n.target)instanceof s&&(n==null?void 0:n.target.isContentEditable),!(e&&t==="keyboard"&&n instanceof a&&!E0e[n.key])}function O0e(e,t,n){s_(),k.useEffect(()=>{let r=(o,i)=>{P0e(!!(n!=null&&n.isTextInput),o,i)&&e(uj())};return o_.add(r),()=>{o_.delete(r)}},t)}function M0e(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,i=k.useRef({isFocusWithin:!1}),s=k.useCallback(c=>{i.current.isFocusWithin&&!c.currentTarget.contains(c.relatedTarget)&&(i.current.isFocusWithin=!1,n&&n(c),o&&o(!1))},[n,o,i]),a=ij(s),l=k.useCallback(c=>{!i.current.isFocusWithin&&document.activeElement===c.target&&(r&&r(c),o&&o(!0),i.current.isFocusWithin=!0,a(c))},[r,o,a]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:l,onBlur:s}}}let fy=!1,Iw=0;function a_(){fy=!0,setTimeout(()=>{fy=!1},50)}function sD(e){e.pointerType==="touch"&&a_()}function A0e(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",sD):document.addEventListener("touchend",a_),Iw++,()=>{Iw--,!(Iw>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",sD):document.removeEventListener("touchend",a_))}}function dj(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[i,s]=k.useState(!1),a=k.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;k.useEffect(A0e,[]);let{hoverProps:l,triggerHoverEnd:c}=k.useMemo(()=>{let u=(h,m)=>{if(a.pointerType=m,o||m==="touch"||a.isHovered||!h.currentTarget.contains(h.target))return;a.isHovered=!0;let b=h.currentTarget;a.target=b,t&&t({type:"hoverstart",target:b,pointerType:m}),n&&n(!0),s(!0)},d=(h,m)=>{if(a.pointerType="",a.target=null,m==="touch"||!a.isHovered)return;a.isHovered=!1;let b=h.currentTarget;r&&r({type:"hoverend",target:b,pointerType:m}),n&&n(!1),s(!1)},p={};return typeof PointerEvent<"u"?(p.onPointerEnter=h=>{fy&&h.pointerType==="mouse"||u(h,h.pointerType)},p.onPointerLeave=h=>{!o&&h.currentTarget.contains(h.target)&&d(h,h.pointerType)}):(p.onTouchStart=()=>{a.ignoreEmulatedMouseEvents=!0},p.onMouseEnter=h=>{!a.ignoreEmulatedMouseEvents&&!fy&&u(h,"mouse"),a.ignoreEmulatedMouseEvents=!1},p.onMouseLeave=h=>{!o&&h.currentTarget.contains(h.target)&&d(h,"mouse")}),{hoverProps:p,triggerHoverEnd:d}},[t,n,r,o,a]);return k.useEffect(()=>{o&&c({currentTarget:a.target},a.pointerType)},[o]),{hoverProps:l,isHovered:i}}function fj(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=k.useRef({isFocused:!1,isFocusVisible:t||uj()}),[i,s]=k.useState(!1),[a,l]=k.useState(()=>o.current.isFocused&&o.current.isFocusVisible),c=k.useCallback(()=>l(o.current.isFocused&&o.current.isFocusVisible),[]),u=k.useCallback(h=>{o.current.isFocused=h,s(h),c()},[c]);O0e(h=>{o.current.isFocusVisible=h,c()},[],{isTextInput:n});let{focusProps:d}=C0e({isDisabled:r,onFocusChange:u}),{focusWithinProps:p}=M0e({isDisabled:!r,onFocusWithinChange:u});return{isFocused:i,isFocusVisible:a,focusProps:r?p:d}}var D0e=Object.defineProperty,I0e=(e,t,n)=>t in e?D0e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Nw=(e,t,n)=>(I0e(e,typeof t!="symbol"?t+"":t,n),n);let N0e=class{constructor(){Nw(this,"current",this.detect()),Nw(this,"handoffState","pending"),Nw(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"}},yc=new N0e;function Yp(e){return yc.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}function hj(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function fs(){let e=[],t={addEventListener(n,r,o,i){return n.addEventListener(r,o,i),t.add(()=>n.removeEventListener(r,o,i))},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 hj(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,o){let i=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:o}),this.add(()=>{Object.assign(n.style,{[r]:i})})},group(n){let r=fs();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 o of e.splice(r,1))o()}},dispose(){for(let n of e.splice(0))n()}};return t}function qd(){let[e]=k.useState(fs);return k.useEffect(()=>()=>e.dispose(),[e]),e}let fn=(e,t)=>{yc.isServer?k.useEffect(e,t):k.useLayoutEffect(e,t)};function fl(e){let t=k.useRef(e);return fn(()=>{t.current=e},[e]),t}let Ze=function(e){let t=fl(e);return k.useCallback((...n)=>t.current(...n),[t])};function F0e(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 L0e(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function $0e({disabled:e=!1}={}){let t=k.useRef(null),[n,r]=k.useState(!1),o=qd(),i=Ze(()=>{t.current=null,r(!1),o.dispose()}),s=Ze(a=>{if(o.dispose(),t.current===null){t.current=a.currentTarget,r(!0);{let l=Yp(a.currentTarget);o.addEventListener(l,"pointerup",i,!1),o.addEventListener(l,"pointermove",c=>{if(t.current){let u=F0e(c);r(L0e(u,t.current.getBoundingClientRect()))}},!1),o.addEventListener(l,"pointercancel",i,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:s,onPointerUp:i,onClick:i}}}let j0e=k.createContext(void 0);function aR(){return k.useContext(j0e)}function l_(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function Di(e,t,...n){if(e in t){let o=t[e];return typeof o=="function"?o(...n):o}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Di),r}var hy=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(hy||{}),Ba=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Ba||{});function Go(){let e=B0e();return k.useCallback(t=>z0e({mergeRefs:e,...t}),[e])}function z0e({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:s,mergeRefs:a}){a=a??H0e;let l=pj(t,e);if(i)return Bm(l,n,r,s,a);let c=o??0;if(c&2){let{static:u=!1,...d}=l;if(u)return Bm(d,n,r,s,a)}if(c&1){let{unmount:u=!0,...d}=l;return Di(u?0:1,{0(){return null},1(){return Bm({...d,hidden:!0,style:{display:"none"}},n,r,s,a)}})}return Bm(l,n,r,s,a)}function Bm(e,t={},n,r,o){let{as:i=n,children:s,refName:a="ref",...l}=Fw(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,y=>`-${y.toLowerCase()}`));if(p){d["data-headlessui-state"]=h.join(" ");for(let m of h)d[`data-${m}`]=""}}if(i===k.Fragment&&(Object.keys(Ta(l)).length>0||Object.keys(Ta(d)).length>0))if(!k.isValidElement(u)||Array.isArray(u)&&u.length>1){if(Object.keys(Ta(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(Ta(l)).concat(Object.keys(Ta(d))).map(p=>` - ${p}`).join(`
384
+ `),"","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(`
385
+ `)].join(`
386
+ `))}else{let p=u.props,h=p==null?void 0:p.className,m=typeof h=="function"?(...v)=>l_(h(...v),l.className):l_(h,l.className),b=m?{className:m}:{},y=pj(u.props,Ta(Fw(l,["ref"])));for(let v in d)v in y&&delete d[v];return k.cloneElement(u,Object.assign({},y,d,c,{ref:o(W0e(u),c.ref)},b))}return k.createElement(i,Object.assign({},Fw(l,["ref"]),i!==k.Fragment&&c,i!==k.Fragment&&d),u)}function B0e(){let e=k.useRef([]),t=k.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 H0e(...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 pj(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];if(t.disabled||t["aria-disabled"])for(let r in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r)&&(n[r]=[o=>{var i;return(i=o==null?void 0:o.preventDefault)==null?void 0:i.call(o)}]);for(let r in n)Object.assign(t,{[r](o,...i){let s=n[r];for(let a of s){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;a(o,...i)}}});return t}function lR(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];for(let r in n)Object.assign(t,{[r](...o){let i=n[r];for(let s of i)s==null||s(...o)}});return t}function So(e){var t;return Object.assign(k.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Ta(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function Fw(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function W0e(e){return k.version.split(".")[0]>="19"?e.props.ref:e.ref}function V0e(e,t,n){let[r,o]=k.useState(n),i=e!==void 0,s=k.useRef(i),a=k.useRef(!1),l=k.useRef(!1);return i&&!s.current&&!a.current?(a.current=!0,s.current=i,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.")):!i&&s.current&&!l.current&&(l.current=!0,s.current=i,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.")),[i?e:r,Ze(c=>(i||o(c),t==null?void 0:t(c)))]}function U0e(e){let[t]=k.useState(e);return t}function gj(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))bj(n,mj(t,r),o);return n}function mj(e,t){return e?e+"["+t+"]":t}function bj(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())bj(e,mj(t,r.toString()),o);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,""]):gj(n,t,e)}let G0e="span";var cR=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(cR||{});function q0e(e,t){var n;let{features:r=1,...o}=e,i={ref:t,"aria-hidden":(r&2)===2?!0:(n=o["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 Go()({ourProps:i,theirProps:o,slot:{},defaultTag:G0e,name:"Hidden"})}let yj=So(q0e),Y0e=k.createContext(null);function K0e({children:e}){let t=k.useContext(Y0e);if(!t)return k.createElement(k.Fragment,null,e);let{target:n}=t;return n?Ir.createPortal(k.createElement(k.Fragment,null,e),n):null}function X0e({data:e,form:t,disabled:n,onReset:r,overrides:o}){let[i,s]=k.useState(null),a=qd();return k.useEffect(()=>{if(r&&i)return a.addEventListener(i,"reset",r)},[i,t,r]),k.createElement(K0e,null,k.createElement(Q0e,{setForm:s,formId:t}),gj(e).map(([l,c])=>k.createElement(yj,{features:cR.Hidden,...Ta({key:l,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:l,value:c,...o})})))}function Q0e({setForm:e,formId:t}){return k.useEffect(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:k.createElement(yj,{features:cR.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let Z0e=k.createContext(void 0);function vj(){return k.useContext(Z0e)}function J0e(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&&eve(n)?!1:r}function eve(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}let xj=Symbol();function tve(e,t=!0){return Object.assign(e,{[xj]:t})}function Fi(...e){let t=k.useRef(e);k.useEffect(()=>{t.current=e},[e]);let n=Ze(r=>{for(let o of t.current)o!=null&&(typeof o=="function"?o(r):o.current=r)});return e.every(r=>r==null||(r==null?void 0:r[xj]))?void 0:n}let uR=k.createContext(null);uR.displayName="DescriptionContext";function wj(){let e=k.useContext(uR);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,wj),t}return e}function nve(){var e,t;return(t=(e=k.useContext(uR))==null?void 0:e.value)!=null?t:void 0}let rve="p";function ove(e,t){let n=k.useId(),r=aR(),{id:o=`headlessui-description-${n}`,...i}=e,s=wj(),a=Fi(t);fn(()=>s.register(o),[o,s.register]);let l=r||!1,c=k.useMemo(()=>({...s.slot,disabled:l}),[s.slot,l]),u={ref:a,...s.props,id:o};return Go()({ourProps:u,theirProps:i,slot:c,defaultTag:rve,name:s.name||"Description"})}let ive=So(ove);Object.assign(ive,{});var Kr=(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))(Kr||{});let I0=k.createContext(null);I0.displayName="LabelContext";function Sj(){let e=k.useContext(I0);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,Sj),t}return e}function N0(e){var t,n,r;let o=(n=(t=k.useContext(I0))==null?void 0:t.value)!=null?n:void 0;return((r=e==null?void 0:e.length)!=null?r:0)>0?[o,...e].filter(Boolean).join(" "):o}function sve({inherit:e=!1}={}){let t=N0(),[n,r]=k.useState([]),o=e?[t,...n].filter(Boolean):n;return[o.length>0?o.join(" "):void 0,k.useMemo(()=>function(i){let s=Ze(l=>(r(c=>[...c,l]),()=>r(c=>{let u=c.slice(),d=u.indexOf(l);return d!==-1&&u.splice(d,1),u}))),a=k.useMemo(()=>({register:s,slot:i.slot,name:i.name,props:i.props,value:i.value}),[s,i.slot,i.name,i.props,i.value]);return k.createElement(I0.Provider,{value:a},i.children)},[r])]}let ave="label";function lve(e,t){var n;let r=k.useId(),o=Sj(),i=vj(),s=aR(),{id:a=`headlessui-label-${r}`,htmlFor:l=i??((n=o.props)==null?void 0:n.htmlFor),passive:c=!1,...u}=e,d=Fi(t);fn(()=>o.register(a),[a,o.register]);let p=Ze(y=>{let v=y.currentTarget;if(v instanceof HTMLLabelElement&&y.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(y),v instanceof HTMLLabelElement){let w=document.getElementById(v.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=k.useMemo(()=>({...o.slot,disabled:h}),[o.slot,h]),b={ref:d,...o.props,id:a,htmlFor:l,onClick:p};return c&&("onClick"in b&&(delete b.htmlFor,delete b.onClick),"onClick"in u&&delete u.onClick),Go()({ourProps:b,theirProps:u,slot:m,defaultTag:l?ave:"div",name:o.name||"Label"})}let cve=So(lve),uve=Object.assign(cve,{});function vu(e,t,n){let r=n.initialDeps??[],o;return()=>{var i,s,a,l;let c;n.key&&((i=n.debug)!=null&&i.call(n))&&(c=Date.now());const u=e();if(!(u.length!==r.length||u.some((h,m)=>r[m]!==h)))return o;r=u;let p;if(n.key&&((s=n.debug)!=null&&s.call(n))&&(p=Date.now()),o=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,y=(v,w)=>{for(v=String(v);v.length<w;)v=" "+v;return v};console.info(`%c⏱ ${y(m,5)} /${y(h,5)} ms`,`
387
+ font-size: .6rem;
388
+ font-weight: bold;
389
+ 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,o),o}}function Lw(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const dve=(e,t)=>Math.abs(e-t)<1,fve=(e,t,n)=>{let r;return function(...o){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,o),n)}},hve=e=>e,pve=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let o=t;o<=n;o++)r.push(o);return r},gve=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const o=s=>{const{width:a,height:l}=s;t({width:Math.round(a),height:Math.round(l)})};if(o(n.getBoundingClientRect()),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(s=>{const a=()=>{const l=s[0];if(l!=null&&l.borderBoxSize){const c=l.borderBoxSize[0];if(c){o({width:c.inlineSize,height:c.blockSize});return}}o(n.getBoundingClientRect())};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},aD={passive:!0},lD=typeof window>"u"?!0:"onscrollend"in window,mve=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let o=0;const i=e.options.useScrollendEvent&&lD?()=>{}:fve(r,()=>{t(o,!1)},e.options.isScrollingResetDelay),s=u=>()=>{const{horizontal:d,isRtl:p}=e.options;o=d?n.scrollLeft*(p&&-1||1):n.scrollTop,i(),t(o,u)},a=s(!0),l=s(!1);l(),n.addEventListener("scroll",a,aD);const c=e.options.useScrollendEvent&&lD;return c&&n.addEventListener("scrollend",l,aD),()=>{n.removeEventListener("scroll",a),c&&n.removeEventListener("scrollend",l)}},bve=(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"])},yve=(e,{adjustments:t=0,behavior:n},r)=>{var o,i;const s=e+t;(i=(o=r.scrollElement)==null?void 0:o.scrollTo)==null||i.call(o,{[r.options.horizontal?"left":"top"]:s,behavior:n})};class vve{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(o=>{o.forEach(i=>{const s=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()})}));return{disconnect:()=>{var o;(o=r())==null||o.disconnect(),n=null},observe:o=>{var i;return(i=r())==null?void 0:i.observe(o,{box:"border-box"})},unobserve:o=>{var i;return(i=r())==null?void 0:i.unobserve(o)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,o])=>{typeof o>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:hve,rangeExtractor:pve,onChange:()=>{},measureElement:bve,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!0,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,o;(o=(r=this.options).onChange)==null||o.call(r,this,n)},this.maybeNotify=vu(()=>(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(o=>{this.observer.observe(o)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=i,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 o=new Map,i=new Map;for(let s=r-1;s>=0;s--){const a=n[s];if(o.has(a.lane))continue;const l=i.get(a.lane);if(l==null||a.end>l.end?i.set(a.lane,a):a.end<l.end&&o.set(a.lane,!0),o.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((s,a)=>s.end===a.end?s.index-a.index:s.end-a.end)[0]:void 0},this.getMeasurementOptions=vu(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,r,o,i,s)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s}),{key:!1}),this.getMeasurements=vu(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:o,getItemKey:i,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=i(u),p=this.options.lanes===1?c[u-1]:this.getFurthestMeasurement(c,u),h=p?p.end+this.options.gap:r+o,m=a.get(d),b=typeof m=="number"?m:this.options.estimateSize(u),y=h+b,v=p?p.lane:u%this.options.lanes;c[u]={index:u,start:h,size:b,end:y,key:d,lane:v}}return this.measurementsCache=c,c},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=vu(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,o,i)=>this.range=n.length>0&&r>0?xve({measurements:n,outerSize:r,scrollOffset:o,lanes:i}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=vu(()=>{let n=null,r=null;const o=this.calculateRange();return o&&(n=o.startIndex,r=o.endIndex),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,o,i,s)=>i===null||s===null?[]:n({startIndex:i,endIndex:s,overscan:r,count:o}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,o=n.getAttribute(r);return o?parseInt(o,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const o=this.indexFromElement(n),i=this.measurementsCache[o];if(!i)return;const s=i.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(o,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const o=this.measurementsCache[n];if(!o)return;const i=this.itemSizeCache.get(o.key)??o.size,s=r-i;s!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,s,this):o.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(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,r)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((r,o)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(o))});return}this._measureElement(n,void 0)},this.getVirtualItems=vu(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const o=[];for(let i=0,s=n.length;i<s;i++){const a=n[i],l=r[a];o.push(l)}return o},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return Lw(r[_j(0,r.length-1,o=>Lw(r[o]).start,n)])},this.getOffsetForAlignment=(n,r,o=0)=>{const i=this.getSize(),s=this.getScrollOffset();r==="auto"&&(r=n>=s+i?"end":"start"),r==="center"?n+=(o-i)/2:r==="end"&&(n-=i);const a=this.options.horizontal?"scrollWidth":"scrollHeight",c=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[a]:this.scrollElement[a]:0)-i;return Math.max(Math.min(c,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.measurementsCache[n];if(!o)return;const i=this.getSize(),s=this.getScrollOffset();if(r==="auto")if(o.end>=s+i-this.options.scrollPaddingEnd)r="end";else if(o.start<=s+this.options.scrollPaddingStart)r="start";else return[s,r];const a=r==="end"?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,r,o.size),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:o}={})=>{this.cancelScrollToIndex(),o==="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:o})},this.scrollToIndex=(n,{align:r="auto",behavior:o}={})=>{n=Math.max(0,Math.min(n,this.options.count-1)),this.cancelScrollToIndex(),o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const i=this.getOffsetForIndex(n,r);if(!i)return;const[s,a]=i;this._scrollToOffset(s,{adjustments:void 0,behavior:o}),o!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(n))){const[c]=Lw(this.getOffsetForIndex(n,a));dve(c,this.getScrollOffset())||this.scrollToIndex(n,{align:a,behavior:o})}else this.scrollToIndex(n,{align:a,behavior:o})}))},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 o;return r.length===0?o=this.options.paddingStart:o=this.options.lanes===1?((n=r[r.length-1])==null?void 0:n.end)??0:Math.max(...r.slice(-this.options.lanes).map(i=>i.end)),Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:o})=>{this.options.scrollToFn(n,{behavior:o,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(t)}}const _j=(e,t,n,r)=>{for(;e<=t;){const o=(e+t)/2|0,i=n(o);if(i<r)e=o+1;else if(i>r)t=o-1;else return o}return e>0?e-1:0};function xve({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){const o=e.length-1;let s=_j(0,o,l=>e[l].start,n),a=s;for(;a<o&&e[a].end<n+t;)a++;return r>1&&(s=Math.max(0,s-s%r),a=Math.min(o,a+(r-1-a%r))),{startIndex:s,endIndex:a}}const cD=typeof document<"u"?T.useLayoutEffect:T.useEffect;function wve(e){const t=T.useReducer(()=>({}),{})[1],n={...e,onChange:(o,i)=>{var s;i?Ir.flushSync(t):t(),(s=e.onChange)==null||s.call(e,o,i)}},[r]=T.useState(()=>new vve(n));return r.setOptions(n),cD(()=>r._didMount(),[]),cD(()=>r._willUpdate()),r}function Sve(e){return wve({observeElementRect:gve,observeElementOffset:mve,scrollToFn:yve,...e})}function _ve(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 Cve(e=_ve){return k.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 Eve(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function uD(e,t=!1){let[n,r]=k.useReducer(()=>({}),{}),o=k.useMemo(()=>Eve(e),[e,n]);return fn(()=>{if(!e)return;let i=new ResizeObserver(r);return i.observe(e),()=>{i.disconnect()}},[e]),t?{width:`${o.width}px`,height:`${o.height}px`}:o}let Rve=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 Cj(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(o){return r.add(o),()=>r.delete(o)},dispatch(o,...i){let s=t[o].call(n,...i);s&&(n=s,r.forEach(a=>a()))}}}function Ej(e){return k.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}let Tve=new Rve(()=>Cj(()=>[],{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 dR(e,t){let n=Tve.get(t),r=k.useId(),o=Ej(n);if(fn(()=>{if(e)return n.dispatch("ADD",r),()=>n.dispatch("REMOVE",r)},[n,e]),!e)return!1;let i=o.indexOf(r),s=o.length;return i===-1&&(i=s,s+=1),i===s-1}let c_=new Map,Th=new Map;function dD(e){var t;let n=(t=Th.get(e))!=null?t:0;return Th.set(e,n+1),n!==0?()=>fD(e):(c_.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>fD(e))}function fD(e){var t;let n=(t=Th.get(e))!=null?t:1;if(n===1?Th.delete(e):Th.set(e,n-1),n!==1)return;let r=c_.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,c_.delete(e))}function kve(e,{allowed:t,disallowed:n}={}){let r=dR(e,"inert-others");fn(()=>{var o,i;if(!r)return;let s=fs();for(let l of(o=n==null?void 0:n())!=null?o:[])l&&s.add(dD(l));let a=(i=t==null?void 0:t())!=null?i:[];for(let l of a){if(!l)continue;let c=Yp(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(dD(d));u=u.parentElement}}return s.dispose},[r,t,n])}function Pve(e,t,n){let r=fl(o=>{let i=o.getBoundingClientRect();i.x===0&&i.y===0&&i.width===0&&i.height===0&&n()});k.useEffect(()=>{if(!e)return;let o=t===null?null:t instanceof HTMLElement?t:t.current;if(!o)return;let i=fs();if(typeof ResizeObserver<"u"){let s=new ResizeObserver(()=>r.current(o));s.observe(o),i.add(()=>s.disconnect())}if(typeof IntersectionObserver<"u"){let s=new IntersectionObserver(()=>r.current(o));s.observe(o),i.add(()=>s.disconnect())}return()=>i.dispose()},[t,r,e])}let u_=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var Ove=(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))(Ove||{}),Mve=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Mve||{}),Ave=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Ave||{}),Rj=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Rj||{});function Dve(e,t=0){var n;return e===((n=Yp(e))==null?void 0:n.body)?!1:Di(t,{0(){return e.matches(u_)},1(){let r=e;for(;r!==null;){if(r.matches(u_))return!0;r=r.parentElement}return!1}})}var Ive=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Ive||{});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 Nve(e,t=n=>n){return e.slice().sort((n,r)=>{let o=t(n),i=t(r);if(o===null||i===null)return 0;let s=o.compareDocumentPosition(i);return s&Node.DOCUMENT_POSITION_FOLLOWING?-1:s&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Tj(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Fve(){return/Android/gi.test(window.navigator.userAgent)}function kj(){return Tj()||Fve()}function $f(e,t,n,r){let o=fl(n);k.useEffect(()=>{if(!e)return;function i(s){o.current(s)}return document.addEventListener(t,i,r),()=>document.removeEventListener(t,i,r)},[e,t,r])}function Lve(e,t,n,r){let o=fl(n);k.useEffect(()=>{if(!e)return;function i(s){o.current(s)}return window.addEventListener(t,i,r),()=>window.removeEventListener(t,i,r)},[e,t,r])}const hD=30;function $ve(e,t,n){let r=dR(e,"outside-click"),o=fl(n),i=k.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!Dve(u,Rj.Loose)&&u.tabIndex!==-1&&l.preventDefault(),o.current(l,u)},[o,t]),s=k.useRef(null);$f(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),$f(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),$f(r,"click",l=>{kj()||s.current&&(i(l,()=>s.current),s.current=null)},!0);let a=k.useRef({x:0,y:0});$f(r,"touchstart",l=>{a.current.x=l.touches[0].clientX,a.current.y=l.touches[0].clientY},!0),$f(r,"touchend",l=>{let c={x:l.changedTouches[0].clientX,y:l.changedTouches[0].clientY};if(!(Math.abs(c.x-a.current.x)>=hD||Math.abs(c.y-a.current.y)>=hD))return i(l,()=>l.target instanceof HTMLElement?l.target:null)},!0),Lve(r,"blur",l=>i(l,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function F0(...e){return k.useMemo(()=>Yp(...e),[...e])}function jve(e,t,n,r){let o=fl(n);k.useEffect(()=>{e=e??window;function i(s){o.current(s)}return e.addEventListener(t,i,r),()=>e.removeEventListener(t,i,r)},[e,t,r])}function Pj(e){let t=k.useRef({value:"",selectionStart:null,selectionEnd:null});return jve(e,"blur",n=>{let r=n.target;r instanceof HTMLInputElement&&(t.current={value:r.value,selectionStart:r.selectionStart,selectionEnd:r.selectionEnd})}),Ze(()=>{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 zve(e,t){return k.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 Bve(){let e;return{before({doc:t}){var n;let r=t.documentElement,o=(n=t.defaultView)!=null?n:window;e=Math.max(0,o.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,o=Math.max(0,r.clientWidth-r.offsetWidth),i=Math.max(0,e-o);n.style(r,"paddingRight",`${i}px`)}}}function Hve(){return Tj()?{before({doc:e,d:t,meta:n}){function r(o){return n.containers.flatMap(i=>i()).some(i=>i.contains(o))}t.microTask(()=>{var o;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let a=fs();a.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>a.dispose()))}let i=(o=window.scrollY)!=null?o: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;i!==l&&window.scrollTo(0,i),s&&s.isConnected&&(s.scrollIntoView({block:"nearest"}),s=null)})})}}:{}}function Wve(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function Vve(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Kl=Cj(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:fs(),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:Vve(n)},o=[Hve(),Bve(),Wve()];o.forEach(({before:i})=>i==null?void 0:i(r)),o.forEach(({after:i})=>i==null?void 0:i(r))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Kl.subscribe(()=>{let e=Kl.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",o=n.count!==0;(o&&!r||!o&&r)&&Kl.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&Kl.dispatch("TEARDOWN",n)}});function Uve(e,t,n=()=>({containers:[]})){let r=Ej(Kl),o=t?r.get(t):void 0,i=o?o.count>0:!1;return fn(()=>{if(!(!t||!e))return Kl.dispatch("PUSH",t,n),()=>Kl.dispatch("POP",t,n)},[e,t]),i}function Gve(e,t,n=()=>[document.body]){let r=dR(e,"scroll-lock");Uve(r,t,o=>{var i;return{containers:[...(i=o.containers)!=null?i:[],n]}})}function pD(e){return[e.screenX,e.screenY]}function qve(){let e=k.useRef([-1,-1]);return{wasMoved(t){let n=pD(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=pD(t)}}}function Yve(e=0){let[t,n]=k.useState(e),r=k.useCallback(l=>n(l),[t]),o=k.useCallback(l=>n(c=>c|l),[t]),i=k.useCallback(l=>(t&l)===l,[t]),s=k.useCallback(l=>n(c=>c&~l),[n]),a=k.useCallback(l=>n(c=>c^l),[n]);return{flags:t,setFlag:r,addFlag:o,hasFlag:i,removeFlag:s,toggleFlag:a}}var gD,mD;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((gD=process==null?void 0:process.env)==null?void 0:gD.NODE_ENV)==="test"&&typeof((mD=Element==null?void 0:Element.prototype)==null?void 0:mD.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(`
390
+ `)),[]});var Kve=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(Kve||{});function Oj(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function Mj(e,t,n,r){let[o,i]=k.useState(n),{hasFlag:s,addFlag:a,removeFlag:l}=Yve(e&&o?3:0),c=k.useRef(!1),u=k.useRef(!1),d=qd();return fn(()=>{var p;if(e){if(n&&i(!0),!t){n&&a(3);return}return(p=r==null?void 0:r.start)==null||p.call(r,n),Xve(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||i(!1),(h=r==null?void 0:r.end)==null||h.call(r,n))}})}},[e,n,t,d]),e?[o,{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 Xve(e,{prepare:t,run:n,done:r,inFlight:o}){let i=fs();return Zve(e,{prepare:t,inFlight:o}),i.nextFrame(()=>{n(),i.requestAnimationFrame(()=>{i.add(Qve(e,r))})}),i.dispose}function Qve(e,t){var n,r;let o=fs();if(!e)return o.dispose;let i=!1;o.add(()=>{i=!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(),o.dispose):(Promise.allSettled(s.map(a=>a.finished)).then(()=>{i||t()}),o.dispose)}function Zve(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 Jve(e,{container:t,accept:n,walk:r}){let o=k.useRef(n),i=k.useRef(r);k.useEffect(()=>{o.current=n,i.current=r},[n,r]),fn(()=>{if(!t||!e)return;let s=Yp(t);if(!s)return;let a=o.current,l=i.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,o,i])}function bD(e,t){let n=k.useRef([]),r=Ze(e);k.useEffect(()=>{let o=[...n.current];for(let[i,s]of t.entries())if(n.current[i]!==s){let a=r(t,o);return n.current=t,a}},[r,...t])}function exe(){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 Aj={...T},txe=Aj.useInsertionEffect,nxe=txe||(e=>e());function Dj(e){const t=T.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return nxe(()=>{t.current=e}),T.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}var d_=typeof document<"u"?k.useLayoutEffect:k.useEffect;let yD=!1,rxe=0;const vD=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+rxe++;function oxe(){const[e,t]=T.useState(()=>yD?vD():void 0);return d_(()=>{e==null&&t(vD())},[]),T.useEffect(()=>{yD=!0},[]),e}const ixe=Aj.useId,sxe=ixe||oxe;let ep;process.env.NODE_ENV!=="production"&&(ep=new Set);function axe(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=ep)!=null&&e.has(o))){var i;(i=ep)==null||i.add(o),console.warn(o)}}function lxe(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=ep)!=null&&e.has(o))){var i;(i=ep)==null||i.add(o),console.error(o)}}function cxe(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(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(o=>o!==n))||[])}}}const uxe=T.createContext(null),dxe=T.createContext(null),fxe=()=>{var e;return((e=T.useContext(uxe))==null?void 0:e.id)||null},hxe=()=>T.useContext(dxe),pxe="data-floating-ui-focusable";function gxe(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=sxe(),i=T.useRef({}),[s]=T.useState(()=>cxe()),a=fxe()!=null;if(process.env.NODE_ENV!=="production"){const h=r.reference;h&&!Lr(h)&&lxe("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]=T.useState(r.reference),u=Dj((h,m,b)=>{i.current.openEvent=h?m:void 0,s.emit("openchange",{open:h,event:m,reason:b,nested:a}),n==null||n(h,m,b)}),d=T.useMemo(()=>({setPositionReference:c}),[]),p=T.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return T.useMemo(()=>({dataRef:i,open:t,onOpenChange:u,elements:p,events:s,floatingId:o,refs:d}),[t,u,p,s,o,d])}function mxe(e){e===void 0&&(e={});const{nodeId:t}=e,n=gxe({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,s]=T.useState(null),[a,l]=T.useState(null),u=(o==null?void 0:o.domReference)||i,d=T.useRef(null),p=hxe();d_(()=>{u&&(d.current=u)},[u]);const h=G4({...e,elements:{...o,...a&&{reference:a}}}),m=T.useCallback(_=>{const R=Lr(_)?{getBoundingClientRect:()=>_.getBoundingClientRect(),contextElement:_}:_;l(R),h.refs.setReference(R)},[h.refs]),b=T.useCallback(_=>{(Lr(_)||_===null)&&(d.current=_,s(_)),(Lr(h.refs.reference.current)||h.refs.reference.current===null||_!==null&&!Lr(_))&&h.refs.setReference(_)},[h.refs]),y=T.useMemo(()=>({...h.refs,setReference:b,setPositionReference:m,domReference:d}),[h.refs,b,m]),v=T.useMemo(()=>({...h.elements,domReference:u}),[h.elements,u]),w=T.useMemo(()=>({...h,...r,refs:y,elements:v,nodeId:t}),[h,y,v,t,r]);return d_(()=>{r.dataRef.current.floatingContext=w;const _=p==null?void 0:p.nodesRef.current.find(R=>R.id===t);_&&(_.context=w)}),T.useMemo(()=>({...h,context:w,refs:y,elements:v}),[h,y,v,w])}const xD="active",wD="selected";function $w(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[xD]:s,[wD]:a,...l}=e;i=l}return{...n==="floating"&&{tabIndex:-1,[pxe]:""},...i,...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(!(o&&[xD,wD].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(y=>y(...m)).find(y=>y!==void 0)}}}else s[c]=u}),s),{})}}function bxe(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),o=T.useCallback(a=>$w(a,e,"reference"),t),i=T.useCallback(a=>$w(a,e,"floating"),n),s=T.useCallback(a=>$w(a,e,"item"),r);return T.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:s}),[o,i,s])}function SD(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const yxe=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:r,onFallbackChange:o,offset:i=0,index:s=0,minItemsVisible:a=4,referenceOverflowThreshold:l=0,scrollRef:c,...u}=us(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,y=p.clientTop!==0,v=m.clientTop!==0,w=p===m;if(process.env.NODE_ENV!=="production"&&(t.placement.startsWith("bottom")||axe('`placement` side must be "bottom" when using the `inner`',"middleware.")),!h)return{};const _={...t,...await DE(-h.offsetTop-p.clientTop-d.reference.height/2-h.offsetHeight/2-i).fn(t)},R=await aw(SD(_,m.scrollHeight+b+p.clientTop),u),C=await aw(_,{...u,elementContext:"reference"}),E=Dr(0,R.top),P=_.y+E,F=(m.scrollHeight>m.clientHeight?L=>L:Yh)(Dr(0,m.scrollHeight+(y&&w||v?b*2:0)-E-Dr(0,R.bottom)));if(m.style.maxHeight=F+"px",m.scrollTop=E,o){const L=m.offsetHeight<h.offsetHeight*ta(a,n.current.length)-1||C.top>=-l||C.bottom>=-l;wc.flushSync(()=>o(L))}return r&&(r.current=await aw(SD({..._,y:P},m.offsetHeight+b+p.clientTop),u)),{y:P}}});function vxe(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:i,scrollRef:s,onChange:a}=t,l=Dj(a),c=T.useRef(!1),u=T.useRef(null),d=T.useRef(null);T.useEffect(()=>{if(!o)return;function h(b){if(b.ctrlKey||!m||i.current==null)return;const y=b.deltaY,v=i.current.top>=-.5,w=i.current.bottom>=-.5,_=m.scrollHeight-m.clientHeight,R=y<0?-1:1,C=y<0?"max":"min";m.scrollHeight<=m.clientHeight||(!v&&y>0||!w&&y<0?(b.preventDefault(),wc.flushSync(()=>{l(E=>E+Math[C](y,_*R))})):/firefox/i.test(exe())&&(m.scrollTop+=y))}const m=(s==null?void 0:s.current)||r.floating;if(n&&m)return m.addEventListener("wheel",h),requestAnimationFrame(()=>{u.current=m.scrollTop,i.current!=null&&(d.current={...i.current})}),()=>{u.current=null,d.current=null,m.removeEventListener("wheel",h)}},[o,n,r.floating,i,s,l]);const p=T.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(!(!i.current||!h||!c.current)){if(u.current!==null){const m=h.scrollTop-u.current;(i.current.bottom<-.5&&m<-1||i.current.top<-.5&&m>1)&&wc.flushSync(()=>l(b=>b+m))}requestAnimationFrame(()=>{u.current=h.scrollTop})}}}),[r.floating,l,i,s]);return T.useMemo(()=>o?{floating:p}:{},[o,p])}let Kp=k.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});Kp.displayName="FloatingContext";let fR=k.createContext(null);fR.displayName="PlacementContext";function xxe(e){return k.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function wxe(){return k.useContext(Kp).setReference}function Sxe(){let{getFloatingProps:e,slot:t}=k.useContext(Kp);return k.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function _xe(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=k.useContext(fR),n=k.useMemo(()=>e,[JSON.stringify(e,(o,i)=>{var s;return(s=i==null?void 0:i.outerHTML)!=null?s:i})]);fn(()=>{t==null||t(n??null)},[t,n]);let r=k.useContext(Kp);return k.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let _D=4;function Cxe({children:e,enabled:t=!0}){let[n,r]=k.useState(null),[o,i]=k.useState(0),s=k.useRef(null),[a,l]=k.useState(null);Exe(a);let c=t&&n!==null&&a!==null,{to:u="bottom",gap:d=0,offset:p=0,padding:h=0,inner:m}=Rxe(n,a),[b,y="center"]=u.split(" ");fn(()=>{c&&i(0)},[c]);let{refs:v,floatingStyles:w,context:_}=mxe({open:c,placement:b==="selection"?y==="center"?"bottom":`bottom-${y}`:y==="center"?`${b}`:`${b}-${y}`,strategy:"absolute",transform:!1,middleware:[DE({mainAxis:b==="selection"?0:d,crossAxis:p}),q4({padding:h}),b!=="selection"&&Y4({padding:h}),b==="selection"&&m?yxe({...m,padding:h,overflowRef:s,offset:o,minItemsVisible:_D,referenceOverflowThreshold:h,onFallbackChange(L){var j,X;if(!L)return;let U=_.elements.floating;if(!U)return;let $=parseFloat(getComputedStyle(U).scrollPaddingBottom)||0,B=Math.min(_D,U.childElementCount),W=0,q=0;for(let Q of(X=(j=_.elements.floating)==null?void 0:j.childNodes)!=null?X:[])if(Q instanceof HTMLElement){let D=Q.offsetTop,G=D+Q.clientHeight+$,V=U.scrollTop,M=V+U.clientHeight;if(D>=V&&G<=M)B--;else{q=Math.max(0,Math.min(G,M)-Math.max(D,V)),W=Q.clientHeight;break}}B>=1&&i(Q=>{let D=W*B-q+$;return Q>=D?Q:D})}}):null,K4({padding:h,apply({availableWidth:L,availableHeight:j,elements:X}){Object.assign(X.floating.style,{overflow:"auto",maxWidth:`${L}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${j}px)`})}})].filter(Boolean),whileElementsMounted:V4}),[R=b,C=y]=_.placement.split("-");b==="selection"&&(R="selection");let E=k.useMemo(()=>({anchor:[R,C].filter(Boolean).join(" ")}),[R,C]),P=vxe(_,{overflowRef:s,onChange:i}),{getReferenceProps:A,getFloatingProps:I}=bxe([P]),F=Ze(L=>{l(L),v.setFloating(L)});return T.createElement(fR.Provider,{value:r},T.createElement(Kp.Provider,{value:{setFloating:F,setReference:v.setReference,styles:w,getReferenceProps:A,getFloatingProps:I,slot:E}},e))}function Exe(e){fn(()=>{if(!e)return;let t=new MutationObserver(()=>{let n=window.getComputedStyle(e).maxHeight,r=parseFloat(n);if(isNaN(r))return;let o=parseInt(n);isNaN(o)||r!==o&&(e.style.maxHeight=`${Math.ceil(r)}px`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>{t.disconnect()}},[e])}function Rxe(e,t){var n,r,o;let i=jw((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),s=jw((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),a=jw((o=e==null?void 0:e.padding)!=null?o:"var(--anchor-padding, 0)",t);return{...e,gap:i,offset:s,padding:a}}function jw(e,t,n=void 0){let r=qd(),o=Ze((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=CD(l,c);return[u,d=>{let p=Ij(l);{let h=p.map(m=>window.getComputedStyle(c).getPropertyValue(m));r.requestAnimationFrame(function m(){r.nextFrame(m);let b=!1;for(let[v,w]of p.entries()){let _=window.getComputedStyle(c).getPropertyValue(w);if(h[v]!==_){h[v]=_,b=!0;break}}if(!b)return;let y=CD(l,c);u!==y&&(d(y),u=y)})}return r.dispose}]}return[n,null]}),i=k.useMemo(()=>o(e,t)[0],[e,t]),[s=i,a]=k.useState();return fn(()=>{let[l,c]=o(e,t);if(a(l),!!c)return c(a)},[e,t]),s}function Ij(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(),o=t[1].slice(n+1).trim();return o?[r,...Ij(o)]:[r]}return[]}function CD(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 Txe({children:e,freeze:t}){let n=f_(t,e);return k.createElement(k.Fragment,null,n)}function f_(e,t){let[n,r]=k.useState(t);return!e&&n!==t&&r(t),e?n:t}let hR=k.createContext(null);hR.displayName="OpenClosedContext";var Mi=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(Mi||{});function pR(){return k.useContext(hR)}function Nj({value:e,children:t}){return k.createElement(hR.Provider,{value:e},t)}function kxe(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let zl=[];kxe(()=>{function e(t){if(!(t.target instanceof HTMLElement)||t.target===document.body||zl[0]===t.target)return;let n=t.target;n=n.closest(u_),zl.unshift(n??t.target),zl=zl.filter(r=>r!=null&&r.isConnected),zl.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 Pxe(e){throw new Error("Unexpected object: "+e)}var Qn=(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))(Qn||{});function ED(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),o=r??-1;switch(e.focus){case 0:{for(let i=0;i<n.length;++i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 1:{o===-1&&(o=n.length);for(let i=o-1;i>=0;--i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 2:{for(let i=o+1;i<n.length;++i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 3:{for(let i=n.length-1;i>=0;--i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 4:{for(let i=0;i<n.length;++i)if(t.resolveId(n[i],i,n)===e.id)return i;return r}case 5:return null;default:Pxe(e)}}var gR=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(gR||{});function Oxe(e){let t=Ze(e),n=k.useRef(!1);k.useEffect(()=>(n.current=!1,()=>{n.current=!0,hj(()=>{n.current&&t()})}),[t])}function Mxe(){let e=typeof document>"u";return"useSyncExternalStore"in T?(t=>t.useSyncExternalStore)(T)(()=>()=>{},()=>!1,()=>!e):!1}function mR(){let e=Mxe(),[t,n]=T.useState(yc.isHandoffComplete);return t&&yc.isHandoffComplete===!1&&n(!1),T.useEffect(()=>{t!==!0&&n(!0)},[t]),T.useEffect(()=>yc.handoff(),[]),e?!1:t}let Axe=k.createContext(!1);function Dxe(){return k.useContext(Axe)}function Ixe(e){let t=Dxe(),n=k.useContext(Lj),r=F0(e),[o,i]=k.useState(()=>{var s;if(!t&&n!==null)return(s=n.current)!=null?s:null;if(yc.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 k.useEffect(()=>{o!==null&&(r!=null&&r.body.contains(o)||r==null||r.body.appendChild(o))},[o,r]),k.useEffect(()=>{t||n!==null&&i(n.current)},[n,i,t]),o}let Fj=k.Fragment,Nxe=So(function(e,t){let n=e,r=k.useRef(null),o=Fi(tve(d=>{r.current=d}),t),i=F0(r),s=Ixe(r),[a]=k.useState(()=>{var d;return yc.isServer?null:(d=i==null?void 0:i.createElement("div"))!=null?d:null}),l=k.useContext(jxe),c=mR();fn(()=>{!s||!a||s.contains(a)||(a.setAttribute("data-headlessui-portal",""),s.appendChild(a))},[s,a]),fn(()=>{if(a&&l)return l.register(a)},[l,a]),Oxe(()=>{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=Go();return c?!s||!a?null:Ir.createPortal(u({ourProps:{ref:o},theirProps:n,slot:{},defaultTag:Fj,name:"Portal"}),a):null});function Fxe(e,t){let n=Fi(t),{enabled:r=!0,...o}=e,i=Go();return r?k.createElement(Nxe,{...o,ref:n}):i({ourProps:{ref:n},theirProps:o,slot:{},defaultTag:Fj,name:"Portal"})}let Lxe=k.Fragment,Lj=k.createContext(null);function $xe(e,t){let{target:n,...r}=e,o={ref:Fi(t)},i=Go();return k.createElement(Lj.Provider,{value:n},i({ourProps:o,theirProps:r,defaultTag:Lxe,name:"Popover.Group"}))}let jxe=k.createContext(null),zxe=So(Fxe),Bxe=So($xe),Hxe=Object.assign(zxe,{Group:Bxe});var Wxe=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Wxe||{}),Vxe=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(Vxe||{}),Uxe=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(Uxe||{}),Gxe=(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))(Gxe||{});function zw(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=t(e.options.slice()),o=r.length>0&&r[0].dataRef.current.order!==null?r.sort((s,a)=>s.dataRef.current.order-a.dataRef.current.order):Nve(r,s=>s.dataRef.current.domRef.current),i=n?o.indexOf(n):null;return i===-1&&(i=null),{options:o,activeOptionIndex:i}}let qxe={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,o,i;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===Qn.Specific?t.idx:ED(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=(o=t.trigger)!=null?o:2;return e.activeOptionIndex===d&&e.activationTrigger===p?e:{...e,activeOptionIndex:d,activationTrigger:p,isTyping:!1,__demoMode:!1}}let s=zw(e);if(s.activeOptionIndex===null){let c=s.options.findIndex(u=>!u.dataRef.current.disabled);c!==-1&&(s.activeOptionIndex=c)}let a=t.focus===Qn.Specific?t.idx:ED(t,{resolveItems:()=>s.options,resolveActiveIndex:()=>s.activeOptionIndex,resolveId:c=>c.id,resolveDisabled:c=>c.dataRef.current.disabled}),l=(i=t.trigger)!=null?i: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,o;if((n=e.dataRef.current)!=null&&n.virtual)return{...e,options:[...e.options,t.payload]};let i=t.payload,s=zw(e,l=>(l.push(i),l));e.activeOptionIndex===null&&(r=e.dataRef.current)!=null&&r.isSelected(t.payload.dataRef.current.value)&&(s.activeOptionIndex=s.options.indexOf(i));let a={...e,...s,activationTrigger:2};return(o=e.dataRef.current)!=null&&o.__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(o=>o.id!==t.id)};let r=zw(e,o=>{let i=o.findIndex(s=>s.id===t.id);return i!==-1&&o.splice(i,1),o});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 o=e.activeOptionIndex;if(e.activeOptionIndex!==null){let i=t.options.indexOf(e.virtual.options[e.activeOptionIndex]);i!==-1?o=i:o=null}return{...e,activeOptionIndex:o,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}},bR=k.createContext(null);bR.displayName="ComboboxActionsContext";function Xp(e){let t=k.useContext(bR);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Xp),n}return t}let $j=k.createContext(null);function Yxe(e){let t=Yd("VirtualProvider"),{options:n}=t.virtual,[r,o]=k.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]),i=Sve({enabled:n.length!==0,scrollPaddingStart:r,scrollPaddingEnd:o,count:n.length,estimateSize(){return 40},getScrollElement(){return t.optionsElement},overscan:12}),[s,a]=k.useState(0);fn(()=>{a(c=>c+1)},[n]);let l=i.getVirtualItems();return l.length===0?null:k.createElement($j.Provider,{value:i},k.createElement("div",{style:{position:"relative",width:"100%",height:`${i.getTotalSize()}px`},ref:c=>{c&&t.activationTrigger!==0&&t.activeOptionIndex!==null&&n.length>t.activeOptionIndex&&i.scrollToIndex(t.activeOptionIndex)}},l.map(c=>{var u;return k.createElement(k.Fragment,{key:c.key},k.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 tp=k.createContext(null);tp.displayName="ComboboxDataContext";function Yd(e){let t=k.useContext(tp);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Yd),n}return t}function Kxe(e,t){return Di(t.type,qxe,e,t)}let Xxe=k.Fragment;function Qxe(e,t){var n,r;let o=aR(),{value:i,defaultValue:s,onChange:a,form:l,name:c,by:u,disabled:d=o||!1,onClose:p,__demoMode:h=!1,multiple:m=!1,immediate:b=!1,virtual:y=null,nullable:v,...w}=e,_=U0e(s),[R=m?[]:void 0,C]=V0e(i,a,_),[E,P]=k.useReducer(Kxe,{dataRef:k.createRef(),comboboxState:h?0:1,isTyping:!1,options:[],virtual:y?{options:y.options,disabled:(n=y.disabled)!=null?n:()=>!1}:null,activeOptionIndex:null,activationTrigger:2,inputElement:null,buttonElement:null,optionsElement:null,__demoMode:h}),A=k.useRef(!1),I=k.useRef({static:!1,hold:!1}),F=Cve(u),L=Ze(ue=>y?u===null?y.options.indexOf(ue):y.options.findIndex(Ce=>F(Ce,ue)):E.options.findIndex(Ce=>F(Ce.dataRef.current.value,ue))),j=k.useCallback(ue=>Di(U.mode,{1:()=>R.some(Ce=>F(Ce,ue)),0:()=>F(R,ue)}),[R]),X=Ze(ue=>E.activeOptionIndex===L(ue)),U=k.useMemo(()=>({...E,immediate:b,optionsPropsRef:I,value:R,defaultValue:_,disabled:d,mode:m?1:0,virtual:y?E.virtual:null,get activeOptionIndex(){if(A.current&&E.activeOptionIndex===null&&(y?y.options.length>0:E.options.length>0)){if(y){let Ce=y.options.findIndex(ke=>{var Ne,Oe;return!((Oe=(Ne=y.disabled)==null?void 0:Ne.call(y,ke))!=null&&Oe)});if(Ce!==-1)return Ce}let ue=E.options.findIndex(Ce=>!Ce.dataRef.current.disabled);if(ue!==-1)return ue}return E.activeOptionIndex},calculateIndex:L,compare:F,isSelected:j,isActive:X}),[R,_,d,m,h,E,y]);fn(()=>{var ue;y&&P({type:7,options:y.options,disabled:(ue=y.disabled)!=null?ue:null})},[y,y==null?void 0:y.options,y==null?void 0:y.disabled]),fn(()=>{E.dataRef.current=U},[U]);let $=U.comboboxState===0;$ve($,[U.buttonElement,U.inputElement,U.optionsElement],()=>J.closeCombobox());let B=k.useMemo(()=>{var ue,Ce,ke;return{open:U.comboboxState===0,disabled:d,activeIndex:U.activeOptionIndex,activeOption:U.activeOptionIndex===null?null:U.virtual?U.virtual.options[(ue=U.activeOptionIndex)!=null?ue:0]:(ke=(Ce=U.options[U.activeOptionIndex])==null?void 0:Ce.dataRef.current.value)!=null?ke:null,value:R}},[U,d,R]),W=Ze(()=>{if(U.activeOptionIndex!==null){if(J.setIsTyping(!1),U.virtual)M(U.virtual.options[U.activeOptionIndex]);else{let{dataRef:ue}=U.options[U.activeOptionIndex];M(ue.current.value)}J.goToOption(Qn.Specific,U.activeOptionIndex)}}),q=Ze(()=>{P({type:0}),A.current=!0}),Q=Ze(()=>{P({type:1}),A.current=!1,p==null||p()}),D=Ze(ue=>{P({type:3,isTyping:ue})}),G=Ze((ue,Ce,ke)=>(A.current=!1,ue===Qn.Specific?P({type:2,focus:Qn.Specific,idx:Ce,trigger:ke}):P({type:2,focus:ue,trigger:ke}))),V=Ze((ue,Ce)=>(P({type:4,payload:{id:ue,dataRef:Ce}}),()=>{U.isActive(Ce.current.value)&&(A.current=!0),P({type:5,id:ue})})),M=Ze(ue=>Di(U.mode,{0(){return C==null?void 0:C(ue)},1(){let Ce=U.value.slice(),ke=Ce.findIndex(Ne=>F(Ne,ue));return ke===-1?Ce.push(ue):Ce.splice(ke,1),C==null?void 0:C(Ce)}})),ee=Ze(ue=>{P({type:6,trigger:ue})}),K=Ze(ue=>{P({type:8,element:ue})}),re=Ze(ue=>{P({type:9,element:ue})}),Y=Ze(ue=>{P({type:10,element:ue})}),J=k.useMemo(()=>({onChange:M,registerOption:V,goToOption:G,setIsTyping:D,closeCombobox:Q,openCombobox:q,setActivationTrigger:ee,selectActiveOption:W,setInputElement:K,setButtonElement:re,setOptionsElement:Y}),[]),[ie,de]=sve(),he=t===null?{}:{ref:t},se=k.useCallback(()=>{if(_!==void 0)return C==null?void 0:C(_)},[C,_]),ge=Go();return k.createElement(de,{value:ie,props:{htmlFor:(r=U.inputElement)==null?void 0:r.id},slot:{open:U.comboboxState===0,disabled:d}},k.createElement(Cxe,null,k.createElement(bR.Provider,{value:J},k.createElement(tp.Provider,{value:U},k.createElement(Nj,{value:Di(U.comboboxState,{0:Mi.Open,1:Mi.Closed})},c!=null&&k.createElement(X0e,{disabled:d,data:R!=null?{[c]:R}:{},form:l,onReset:se}),ge({ourProps:he,theirProps:w,slot:B,defaultTag:Xxe,name:"Combobox"}))))))}let Zxe="input";function Jxe(e,t){var n,r,o,i,s;let a=Yd("Combobox.Input"),l=Xp("Combobox.Input"),c=k.useId(),u=vj(),{id:d=u||`headlessui-combobox-input-${c}`,onChange:p,displayValue:h,disabled:m=a.disabled||!1,autoFocus:b=!1,type:y="text",...v}=e,w=k.useRef(null),_=Fi(w,t,wxe(),l.setInputElement),R=F0(a.inputElement),C=qd(),E=Ze(()=>{l.onChange(null),a.optionsElement&&(a.optionsElement.scrollTop=0),l.goToOption(Qn.Nothing)}),P=k.useMemo(()=>{var M;return typeof h=="function"&&a.value!==void 0?(M=h(a.value))!=null?M:"":typeof a.value=="string"?a.value:""},[a.value,h]);bD(([M,ee],[K,re])=>{if(a.isTyping)return;let Y=w.current;Y&&((re===0&&ee===1||M!==K)&&(Y.value=M),requestAnimationFrame(()=>{if(a.isTyping||!Y||(R==null?void 0:R.activeElement)!==Y)return;let{selectionStart:J,selectionEnd:ie}=Y;Math.abs((ie??0)-(J??0))===0&&J===0&&Y.setSelectionRange(Y.value.length,Y.value.length)}))},[P,a.comboboxState,R,a.isTyping]),bD(([M],[ee])=>{if(M===0&&ee===1){if(a.isTyping)return;let K=w.current;if(!K)return;let re=K.value,{selectionStart:Y,selectionEnd:J,selectionDirection:ie}=K;K.value="",K.value=re,ie!==null?K.setSelectionRange(Y,J,ie):K.setSelectionRange(Y,J)}},[a.comboboxState]);let A=k.useRef(!1),I=Ze(()=>{A.current=!0}),F=Ze(()=>{C.nextFrame(()=>{A.current=!1})}),L=Ze(M=>{switch(l.setIsTyping(!0),M.key){case Kr.Enter:if(a.comboboxState!==0||A.current)return;if(M.preventDefault(),M.stopPropagation(),a.activeOptionIndex===null){l.closeCombobox();return}l.selectActiveOption(),a.mode===0&&l.closeCombobox();break;case Kr.ArrowDown:return M.preventDefault(),M.stopPropagation(),Di(a.comboboxState,{0:()=>l.goToOption(Qn.Next),1:()=>l.openCombobox()});case Kr.ArrowUp:return M.preventDefault(),M.stopPropagation(),Di(a.comboboxState,{0:()=>l.goToOption(Qn.Previous),1:()=>{Ir.flushSync(()=>l.openCombobox()),a.value||l.goToOption(Qn.Last)}});case Kr.Home:if(M.shiftKey)break;return M.preventDefault(),M.stopPropagation(),l.goToOption(Qn.First);case Kr.PageUp:return M.preventDefault(),M.stopPropagation(),l.goToOption(Qn.First);case Kr.End:if(M.shiftKey)break;return M.preventDefault(),M.stopPropagation(),l.goToOption(Qn.Last);case Kr.PageDown:return M.preventDefault(),M.stopPropagation(),l.goToOption(Qn.Last);case Kr.Escape:return a.comboboxState!==0?void 0:(M.preventDefault(),a.optionsElement&&!a.optionsPropsRef.current.static&&M.stopPropagation(),a.mode===0&&a.value===null&&E(),l.closeCombobox());case Kr.Tab:if(a.comboboxState!==0)return;a.mode===0&&a.activationTrigger!==1&&l.selectActiveOption(),l.closeCombobox();break}}),j=Ze(M=>{p==null||p(M),a.mode===0&&M.target.value===""&&E(),l.openCombobox()}),X=Ze(M=>{var ee,K,re;let Y=(ee=M.relatedTarget)!=null?ee:zl.find(J=>J!==M.currentTarget);if(!((K=a.optionsElement)!=null&&K.contains(Y))&&!((re=a.buttonElement)!=null&&re.contains(Y))&&a.comboboxState===0)return M.preventDefault(),a.mode===0&&a.value===null&&E(),l.closeCombobox()}),U=Ze(M=>{var ee,K,re;let Y=(ee=M.relatedTarget)!=null?ee:zl.find(J=>J!==M.currentTarget);(K=a.buttonElement)!=null&&K.contains(Y)||(re=a.optionsElement)!=null&&re.contains(Y)||a.disabled||a.immediate&&a.comboboxState!==0&&C.microTask(()=>{Ir.flushSync(()=>l.openCombobox()),l.setActivationTrigger(1)})}),$=N0(),B=nve(),{isFocused:W,focusProps:q}=fj({autoFocus:b}),{isHovered:Q,hoverProps:D}=dj({isDisabled:m}),G=k.useMemo(()=>({open:a.comboboxState===0,disabled:m,hover:Q,focus:W,autofocus:b}),[a,Q,W,b,m]),V=lR({ref:_,id:d,role:"combobox",type:y,"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(M=>!M.dataRef.current.disabled&&a.compare(M.dataRef.current.value,a.virtual.options[a.activeOptionIndex])))==null?void 0:r.id:(o=a.options[a.activeOptionIndex])==null?void 0:o.id,"aria-labelledby":$,"aria-describedby":B,"aria-autocomplete":"list",defaultValue:(s=(i=e.defaultValue)!=null?i:a.defaultValue!==void 0?h==null?void 0:h(a.defaultValue):null)!=null?s:a.defaultValue,disabled:m||void 0,autoFocus:b,onCompositionStart:I,onCompositionEnd:F,onKeyDown:L,onChange:j,onFocus:U,onBlur:X},q,D);return Go()({ourProps:V,theirProps:v,slot:G,defaultTag:Zxe,name:"Combobox.Input"})}let ewe="button";function twe(e,t){var n;let r=Yd("Combobox.Button"),o=Xp("Combobox.Button"),i=Fi(t,o.setButtonElement),s=k.useId(),{id:a=`headlessui-combobox-button-${s}`,disabled:l=r.disabled||!1,autoFocus:c=!1,...u}=e,d=Pj(r.inputElement),p=Ze(P=>{switch(P.key){case Kr.Space:case Kr.Enter:P.preventDefault(),P.stopPropagation(),r.comboboxState===1&&Ir.flushSync(()=>o.openCombobox()),d();return;case Kr.ArrowDown:P.preventDefault(),P.stopPropagation(),r.comboboxState===1&&(Ir.flushSync(()=>o.openCombobox()),r.value||o.goToOption(Qn.First)),d();return;case Kr.ArrowUp:P.preventDefault(),P.stopPropagation(),r.comboboxState===1&&(Ir.flushSync(()=>o.openCombobox()),r.value||o.goToOption(Qn.Last)),d();return;case Kr.Escape:if(r.comboboxState!==0)return;P.preventDefault(),r.optionsElement&&!r.optionsPropsRef.current.static&&P.stopPropagation(),Ir.flushSync(()=>o.closeCombobox()),d();return;default:return}}),h=Ze(P=>{P.preventDefault(),!J0e(P.currentTarget)&&(P.button===gR.Left&&(r.comboboxState===0?o.closeCombobox():o.openCombobox()),d())}),m=N0([a]),{isFocusVisible:b,focusProps:y}=fj({autoFocus:c}),{isHovered:v,hoverProps:w}=dj({isDisabled:l}),{pressed:_,pressProps:R}=$0e({disabled:l}),C=k.useMemo(()=>({open:r.comboboxState===0,active:_||r.comboboxState===0,disabled:l,value:r.value,hover:v,focus:b}),[r,v,b,_,l]),E=lR({ref:i,id:a,type:zve(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},y,w,R);return Go()({ourProps:E,theirProps:u,slot:C,defaultTag:ewe,name:"Combobox.Button"})}let nwe="div",rwe=hy.RenderStrategy|hy.Static;function owe(e,t){var n,r,o;let i=k.useId(),{id:s=`headlessui-combobox-options-${i}`,hold:a=!1,anchor:l,portal:c=!1,modal:u=!0,transition:d=!1,...p}=e,h=Yd("Combobox.Options"),m=Xp("Combobox.Options"),b=xxe(l);b&&(c=!0);let[y,v]=_xe(b),[w,_]=k.useState(null),R=Sxe(),C=Fi(t,b?y:null,m.setOptionsElement,_),E=F0(h.optionsElement),P=pR(),[A,I]=Mj(d,w,P!==null?(P&Mi.Open)===Mi.Open:h.comboboxState===0);Pve(A,h.inputElement,m.closeCombobox);let F=h.__demoMode?!1:u&&h.comboboxState===0;Gve(F,E);let L=h.__demoMode?!1:u&&h.comboboxState===0;kve(L,{allowed:k.useCallback(()=>[h.inputElement,h.buttonElement,h.optionsElement],[h.inputElement,h.buttonElement,h.optionsElement])}),fn(()=>{var V;h.optionsPropsRef.current.static=(V=e.static)!=null?V:!1},[h.optionsPropsRef,e.static]),fn(()=>{h.optionsPropsRef.current.hold=a},[h.optionsPropsRef,a]),Jve(h.comboboxState===0,{container:h.optionsElement,accept(V){return V.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:V.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(V){V.setAttribute("role","none")}});let j=N0([(n=h.buttonElement)==null?void 0:n.id]),X=k.useMemo(()=>({open:h.comboboxState===0,option:void 0}),[h.comboboxState]),U=Ze(()=>{m.setActivationTrigger(0)}),$=Ze(V=>{V.preventDefault(),m.setActivationTrigger(0)}),B=lR(b?R():{},{"aria-labelledby":j,role:"listbox","aria-multiselectable":h.mode===1?!0:void 0,id:s,ref:C,style:{...p.style,...v,"--input-width":uD(h.inputElement,!0).width,"--button-width":uD(h.buttonElement,!0).width},onWheel:h.activationTrigger===0?void 0:U,onMouseDown:$,...Oj(I)}),W=A&&h.comboboxState===1,q=f_(W,(r=h.virtual)==null?void 0:r.options),Q=f_(W,h.value),D=Ze(V=>h.compare(Q,V));if(h.virtual){if(q===void 0)throw new Error("Missing `options` in virtual mode");Object.assign(p,{children:k.createElement(tp.Provider,{value:q!==h.virtual.options?{...h,virtual:{...h.virtual,options:q}}:h},k.createElement(Yxe,{slot:X},p.children))})}let G=Go();return k.createElement(Hxe,{enabled:c?e.static||A:!1},k.createElement(tp.Provider,{value:h.mode===1?h:{...h,isSelected:D}},G({ourProps:B,theirProps:{...p,children:k.createElement(Txe,{freeze:W},typeof p.children=="function"?(o=p.children)==null?void 0:o.call(p,X):p.children)},slot:X,defaultTag:nwe,features:rwe,visible:A,name:"Combobox.Options"})))}let iwe="div";function swe(e,t){var n,r,o,i;let s=Yd("Combobox.Option"),a=Xp("Combobox.Option"),l=k.useId(),{id:c=`headlessui-combobox-option-${l}`,value:u,disabled:d=(o=(r=(n=s.virtual)==null?void 0:n.disabled)==null?void 0:r.call(n,u))!=null?o:!1,order:p=null,...h}=e,m=Pj(s.inputElement),b=s.virtual?s.activeOptionIndex===s.calculateIndex(u):s.activeOptionIndex===null?!1:((i=s.options[s.activeOptionIndex])==null?void 0:i.id)===c,y=s.isSelected(u),v=k.useRef(null),w=fl({disabled:d,value:u,domRef:v,order:p}),_=k.useContext($j),R=Fi(t,v,_?_.measureElement:null),C=Ze(()=>{a.setIsTyping(!1),a.onChange(u)});fn(()=>a.registerOption(c,w),[w,c]);let E=k.useRef(!(s.virtual||s.__demoMode));fn(()=>{if(!s.virtual&&!s.__demoMode)return fs().requestAnimationFrame(()=>{E.current=!0})},[s.virtual,s.__demoMode]),fn(()=>{if(E.current&&s.comboboxState===0&&b&&s.activationTrigger!==0)return fs().requestAnimationFrame(()=>{var $,B;(B=($=v.current)==null?void 0:$.scrollIntoView)==null||B.call($,{block:"nearest"})})},[v,b,s.comboboxState,s.activationTrigger,s.activeOptionIndex]);let P=Ze($=>{$.preventDefault(),$.button===gR.Left&&(d||(C(),kj()||requestAnimationFrame(()=>m()),s.mode===0&&a.closeCombobox()))}),A=Ze(()=>{if(d)return a.goToOption(Qn.Nothing);let $=s.calculateIndex(u);a.goToOption(Qn.Specific,$)}),I=qve(),F=Ze($=>I.update($)),L=Ze($=>{if(!I.wasMoved($)||d||b)return;let B=s.calculateIndex(u);a.goToOption(Qn.Specific,B,0)}),j=Ze($=>{I.wasMoved($)&&(d||b&&(s.optionsPropsRef.current.hold||a.goToOption(Qn.Nothing)))}),X=k.useMemo(()=>({active:b,focus:b,selected:y,disabled:d}),[b,y,d]),U={id:c,ref:R,role:"option",tabIndex:d===!0?void 0:-1,"aria-disabled":d===!0?!0:void 0,"aria-selected":y,disabled:void 0,onMouseDown:P,onFocus:A,onPointerEnter:F,onMouseEnter:F,onPointerMove:L,onMouseMove:L,onPointerLeave:j,onMouseLeave:j};return Go()({ourProps:U,theirProps:h,slot:X,defaultTag:iwe,name:"Combobox.Option"})}let awe=So(Qxe),jj=So(twe),zj=So(Jxe),lwe=uve,Bj=So(owe),Hj=So(swe),cwe=Object.assign(awe,{Input:zj,Button:jj,Label:lwe,Options:Bj,Option:Hj});function uwe(){let e=k.useRef(!1);return fn(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Wj(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||((t=e.as)!=null?t:Uj)!==k.Fragment||k.Children.count(e.children)===1}let L0=k.createContext(null);L0.displayName="TransitionContext";var dwe=(e=>(e.Visible="visible",e.Hidden="hidden",e))(dwe||{});function fwe(){let e=k.useContext(L0);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function hwe(){let e=k.useContext($0);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let $0=k.createContext(null);$0.displayName="NestingContext";function j0(e){return"children"in e?j0(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function Vj(e,t){let n=fl(e),r=k.useRef([]),o=uwe(),i=qd(),s=Ze((h,m=Ba.Hidden)=>{let b=r.current.findIndex(({el:y})=>y===h);b!==-1&&(Di(m,{[Ba.Unmount](){r.current.splice(b,1)},[Ba.Hidden](){r.current[b].state="hidden"}}),i.microTask(()=>{var y;!j0(r)&&o.current&&((y=n.current)==null||y.call(n))}))}),a=Ze(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,Ba.Unmount)}),l=k.useRef([]),c=k.useRef(Promise.resolve()),u=k.useRef({enter:[],leave:[]}),d=Ze((h,m,b)=>{l.current.splice(0),t&&(t.chains.current[m]=t.chains.current[m].filter(([y])=>y!==h)),t==null||t.chains.current[m].push([h,new Promise(y=>{l.current.push(y)})]),t==null||t.chains.current[m].push([h,new Promise(y=>{Promise.all(u.current[m].map(([v,w])=>w)).then(()=>y())})]),m==="enter"?c.current=c.current.then(()=>t==null?void 0:t.wait.current).then(()=>b(m)):b(m)}),p=Ze((h,m,b)=>{Promise.all(u.current[m].splice(0).map(([y,v])=>v)).then(()=>{var y;(y=l.current.shift())==null||y()}).then(()=>b(m))});return k.useMemo(()=>({children:r,register:a,unregister:s,onStart:d,onStop:p,wait:c,chains:u}),[a,s,r,d,p,u,c])}let Uj=k.Fragment,Gj=hy.RenderStrategy;function pwe(e,t){var n,r;let{transition:o=!0,beforeEnter:i,afterEnter:s,beforeLeave:a,afterLeave:l,enter:c,enterFrom:u,enterTo:d,entered:p,leave:h,leaveFrom:m,leaveTo:b,...y}=e,[v,w]=k.useState(null),_=k.useRef(null),R=Wj(e),C=Fi(...R?[_,t,w]:t===null?[]:[t]),E=(n=y.unmount)==null||n?Ba.Unmount:Ba.Hidden,{show:P,appear:A,initial:I}=fwe(),[F,L]=k.useState(P?"visible":"hidden"),j=hwe(),{register:X,unregister:U}=j;fn(()=>X(_),[X,_]),fn(()=>{if(E===Ba.Hidden&&_.current){if(P&&F!=="visible"){L("visible");return}return Di(F,{hidden:()=>U(_),visible:()=>X(_)})}},[F,_,X,U,P,E]);let $=mR();fn(()=>{if(R&&$&&F==="visible"&&_.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[_,F,$,R]);let B=I&&!A,W=A&&P&&I,q=k.useRef(!1),Q=Vj(()=>{q.current||(L("hidden"),U(_))},j),D=Ze(Y=>{q.current=!0;let J=Y?"enter":"leave";Q.onStart(_,J,ie=>{ie==="enter"?i==null||i():ie==="leave"&&(a==null||a())})}),G=Ze(Y=>{let J=Y?"enter":"leave";q.current=!1,Q.onStop(_,J,ie=>{ie==="enter"?s==null||s():ie==="leave"&&(l==null||l())}),J==="leave"&&!j0(Q)&&(L("hidden"),U(_))});k.useEffect(()=>{R&&o||(D(P),G(P))},[P,R,o]);let V=!(!o||!R||!$||B),[,M]=Mj(V,v,P,{start:D,end:G}),ee=Ta({ref:C,className:((r=l_(y.className,W&&c,W&&u,M.enter&&c,M.enter&&M.closed&&u,M.enter&&!M.closed&&d,M.leave&&h,M.leave&&!M.closed&&m,M.leave&&M.closed&&b,!M.transition&&P&&p))==null?void 0:r.trim())||void 0,...Oj(M)}),K=0;F==="visible"&&(K|=Mi.Open),F==="hidden"&&(K|=Mi.Closed),M.enter&&(K|=Mi.Opening),M.leave&&(K|=Mi.Closing);let re=Go();return k.createElement($0.Provider,{value:Q},k.createElement(Nj,{value:K},re({ourProps:ee,theirProps:y,defaultTag:Uj,features:Gj,visible:F==="visible",name:"Transition.Child"})))}function gwe(e,t){let{show:n,appear:r=!1,unmount:o=!0,...i}=e,s=k.useRef(null),a=Wj(e),l=Fi(...a?[s,t]:t===null?[]:[t]);mR();let c=pR();if(n===void 0&&c!==null&&(n=(c&Mi.Open)===Mi.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[u,d]=k.useState(n?"visible":"hidden"),p=Vj(()=>{n||d("hidden")}),[h,m]=k.useState(!0),b=k.useRef([n]);fn(()=>{h!==!1&&b.current[b.current.length-1]!==n&&(b.current.push(n),m(!1))},[b,n]);let y=k.useMemo(()=>({show:n,appear:r,initial:h}),[n,r,h]);fn(()=>{n?d("visible"):!j0(p)&&s.current!==null&&d("hidden")},[n,p]);let v={unmount:o},w=Ze(()=>{var C;h&&m(!1),(C=e.beforeEnter)==null||C.call(e)}),_=Ze(()=>{var C;h&&m(!1),(C=e.beforeLeave)==null||C.call(e)}),R=Go();return k.createElement($0.Provider,{value:p},k.createElement(L0.Provider,{value:y},R({ourProps:{...v,as:k.Fragment,children:k.createElement(qj,{ref:l,...v,...i,beforeEnter:w,beforeLeave:_})},theirProps:{},defaultTag:k.Fragment,features:Gj,visible:u==="visible",name:"Transition"})))}function mwe(e,t){let n=k.useContext(L0)!==null,r=pR()!==null;return k.createElement(k.Fragment,null,!n&&r?k.createElement(h_,{ref:t,...e}):k.createElement(qj,{ref:t,...e}))}let h_=So(gwe),qj=So(pwe),bwe=So(mwe),ywe=Object.assign(h_,{Child:bwe,Root:h_});var yR="Checkbox",[vwe,YAe]=lr(yR),[xwe,wwe]=vwe(yR),Yj=T.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:c,form:u,...d}=e,[p,h]=T.useState(null),m=dt(t,R=>h(R)),b=T.useRef(!1),y=p?u||!!p.closest("form"):!0,[v=!1,w]=$r({prop:o,defaultProp:i,onChange:c}),_=T.useRef(v);return T.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]),x.jsxs(xwe,{scope:n,state:v,disabled:a,children:[x.jsx(je.button,{type:"button",role:"checkbox","aria-checked":Va(v)?"mixed":v,"aria-required":s,"data-state":Qj(v),"data-disabled":a?"":void 0,disabled:a,value:l,...d,ref:m,onKeyDown:Te(e.onKeyDown,R=>{R.key==="Enter"&&R.preventDefault()}),onClick:Te(e.onClick,R=>{w(C=>Va(C)?!0:!C),y&&(b.current=R.isPropagationStopped(),b.current||R.stopPropagation())})}),y&&x.jsx(Swe,{control:p,bubbles:!b.current,name:r,value:l,checked:v,required:s,disabled:a,form:u,style:{transform:"translateX(-100%)"},defaultChecked:Va(i)?!1:i})]})});Yj.displayName=yR;var Kj="CheckboxIndicator",Xj=T.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,i=wwe(Kj,n);return x.jsx(er,{present:r||Va(i.state)||i.state===!0,children:x.jsx(je.span,{"data-state":Qj(i.state),"data-disabled":i.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});Xj.displayName=Kj;var Swe=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:o,...i}=e,s=T.useRef(null),a=w0(n),l=f0(t);T.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=Va(n),h.call(u,Va(n)?!1:n),u.dispatchEvent(m)}},[a,n,r]);const c=T.useRef(Va(n)?!1:n);return x.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o??c.current,...i,tabIndex:-1,ref:s,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Va(e){return e==="indeterminate"}function Qj(e){return Va(e)?"indeterminate":e?"checked":"unchecked"}var Zj=Yj,_we=Xj;const z0=T.forwardRef(({className:e,...t},n)=>x.jsx(Zj,{ref:n,className:me("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:x.jsx(_we,{className:me("flex items-center justify-center text-current"),children:x.jsx(Fd,{className:"h-4 w-4"})})}));z0.displayName=Zj.displayName;function Cwe(e){const t=/(>=|<=|>|<|=)/,n=e.match(t);if(n){const r=n[0],[o,i]=e.split(r);return{operation:r,value:i.trim()}}else return null}function Ewe(e,t,n){const r=`SELECT ${n}, COUNT(*) FROM ${t} {{ filters | where }} GROUP BY ${n} ORDER BY ${n} ASC LIMIT 50`,o=`SELECT min(${n}) as min, max(${n}) as max FROM ${t} {{ filters | where }}`;return Dd(e)?o:r}function Rwe(e){const t=ye(i=>{var s,a;return(a=(s=i==null?void 0:i.dashboard)==null?void 0:s.filters)==null?void 0:a.find(l=>l.id===e)}),{query:n,setQuery:r,...o}=vR(t||{});return o}function vR(e){const[t,n]=k.useState([]),[r,o]=k.useState(""),i=ye(E=>E.filterValues),s=ye(E=>E.selectedSheetId),{addOrUpdateFilterValue:a,removeFilterValues:l}=Yn(),{data:c,isLoading:u,isFetching:d,isError:p}=tj(e),h=k.useMemo(()=>{var P;return e.column?(P=c==null?void 0:c.records)==null?void 0:P.map(A=>{let I=e.column.split(".").slice(-1)[0].replace(/"/g,"");return A[I]===void 0&&(I=I.toLowerCase()),{id:A[I],value:A[I]}}):[]},[c,e.column]);k.useEffect(()=>{if(i){const E=i.find(P=>P.filterId===e.id);if(!E){n([]);return}if(E.operation==="in"){const P=h==null?void 0:h.filter(A=>E.values.includes(A.value));P&&n(P)}}},[c,s,i,e.id,h]),k.useEffect(()=>{if(i&&!i.find(P=>P.filterId===e.id)){n([]);return}},[i,e.id]);function m(E){const P=Cwe(E[0].toString());if(!(P!=null&&P.value)||!(P!=null&&P.operation))return;const A={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:Iu(e),name:e.column,operation:P.operation,values:[Number(P.value)]};a(A)}function b(E){if(Array.isArray(E)||(E=[E]),E.length===1&&h.find(A=>A.value===E[0].value)===void 0){m(E);return}if(n(E),E.length===0){l(e.id);return}const P={filterId:e.id,connectionType:e.database==="NA"?"api":"database",name:e.column,valueType:Iu(e),operation:e.operation,values:E.map(A=>A.value)};a(P)}function y(){n([]),l(e.id)}function v(E){if(E){n(h);const P={filterId:e.id,connectionType:e.database==="NA"?"api":"database",name:e.column,valueType:Iu(e),operation:e.operation,values:h.map(A=>A.value)};a(P)}else y()}function w(){if(xp(e.dataType))return h;const E=r.toLowerCase().replace(/\s+/g,"");return r===""?h:h.filter(P=>P.value.toLowerCase().replace(/\s+/g,"").includes(E))}const _=w(),R=e.type==="single",C=t.length===(h==null?void 0:h.length);return{isLoading:u,isFetching:d,isError:p,records:h,selectedRecords:t,handleChange:b,handleClear:y,handleSelectAll:v,query:r,setQuery:o,filteredRecords:_,isSingleSelect:R,allSelected:C}}function Twe({filter:e}){var h,m,b,y,v,w;const t=ye(_=>_.themeStyle),{filteredRecords:n,isSingleSelect:r,allSelected:o,handleChange:i,handleSelectAll:s,query:a,setQuery:l,isLoading:c,isFetching:u,isError:d,selectedRecords:p}=vR(e);return c||u?x.jsx(Fu,{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?x.jsx("div",{className:"flex h-8 w-full items-center bg-muted px-2 text-sm",children:"Error"}):x.jsx("div",{className:"w-full",children:x.jsx(cwe,{value:p,multiple:!r,onChange:i,children:x.jsxs("div",{className:"relative",children:[x.jsxs("div",{style:{borderRadius:(y=(b=t==null?void 0:t.chart)==null?void 0:b.options)==null?void 0:y.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:[x.jsx(zj,{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)}}),x.jsx(jj,{className:"absolute inset-y-0 right-0 flex items-center bg-background pl-1 pr-2",children:x.jsx(Tp,{className:"size-4 text-gray-400","aria-hidden":"true"})})]}),x.jsx(ywe,{as:k.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",afterLeave:()=>l(""),children:x.jsxs(Bj,{style:{borderRadius:(w=(v=t==null?void 0:t.chart)==null?void 0:v.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 text-foreground/80 shadow-lg focus:outline-none sm:text-sm",children:[e.type==="multiple"||e.type===void 0&&x.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-b-muted px-4 py-2",children:[x.jsx("span",{children:"Select All"}),x.jsx(z0,{className:"border-muted-foreground/50",checked:o,onCheckedChange:s})]}),(n==null?void 0:n.length)===0&&a!==""?x.jsx("div",{className:"relative cursor-default select-none px-4 py-2 text-gray-700",children:"Nothing found."}):n==null?void 0:n.map(_=>{var R,C;return x.jsx(Hj,{style:{borderRadius:(C=(R=t==null?void 0:t.chart)==null?void 0:R.options)==null?void 0:C.borderRadius},className:({active:E})=>`relative m-1 cursor-default select-none py-2 pl-10 pr-4 ${E?"bg-muted":"text-foreground-900"}`,value:_,children:({selected:E,active:P})=>x.jsxs("div",{className:"",children:[x.jsx("span",{className:`block ${E?"font-medium":"font-normal"}`,children:typeof _.value=="boolean"?_.value?"True":"False":_.value}),E?x.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 text-foreground",children:x.jsx(HC,{className:"size-4","aria-hidden":"true"})}):null]})},_.value)})]})})]})})})}var xR="Radio",[kwe,Jj]=lr(xR),[Pwe,Owe]=kwe(xR),e8=T.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:i,disabled:s,value:a="on",onCheck:l,form:c,...u}=e,[d,p]=T.useState(null),h=dt(t,y=>p(y)),m=T.useRef(!1),b=d?c||!!d.closest("form"):!0;return x.jsxs(Pwe,{scope:n,checked:o,disabled:s,children:[x.jsx(je.button,{type:"button",role:"radio","aria-checked":o,"data-state":r8(o),"data-disabled":s?"":void 0,disabled:s,value:a,...u,ref:h,onClick:Te(e.onClick,y=>{o||l==null||l(),b&&(m.current=y.isPropagationStopped(),m.current||y.stopPropagation())})}),b&&x.jsx(Mwe,{control:d,bubbles:!m.current,name:r,value:a,checked:o,required:i,disabled:s,form:c,style:{transform:"translateX(-100%)"}})]})});e8.displayName=xR;var t8="RadioIndicator",n8=T.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,i=Owe(t8,n);return x.jsx(er,{present:r||i.checked,children:x.jsx(je.span,{"data-state":r8(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:t})})});n8.displayName=t8;var Mwe=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=T.useRef(null),s=w0(n),a=f0(t);return T.useEffect(()=>{const l=i.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]),x.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function r8(e){return e?"checked":"unchecked"}var Awe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],wR="RadioGroup",[Dwe,KAe]=lr(wR,[Nd,Jj]),o8=Nd(),i8=Jj(),[Iwe,Nwe]=Dwe(wR),s8=T.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:i,required:s=!1,disabled:a=!1,orientation:l,dir:c,loop:u=!0,onValueChange:d,...p}=e,h=o8(n),m=$c(c),[b,y]=$r({prop:i,defaultProp:o,onChange:d});return x.jsx(Iwe,{scope:n,name:r,required:s,disabled:a,value:b,onValueChange:y,children:x.jsx(fC,{asChild:!0,...h,orientation:l,dir:m,loop:u,children:x.jsx(je.div,{role:"radiogroup","aria-required":s,"aria-orientation":l,"data-disabled":a?"":void 0,dir:m,...p,ref:t})})})});s8.displayName=wR;var a8="RadioGroupItem",l8=T.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,i=Nwe(a8,n),s=i.disabled||r,a=o8(n),l=i8(n),c=T.useRef(null),u=dt(t,c),d=i.value===o.value,p=T.useRef(!1);return T.useEffect(()=>{const h=b=>{Awe.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)}},[]),x.jsx(hC,{asChild:!0,...a,focusable:!s,active:d,children:x.jsx(e8,{disabled:s,required:i.required,checked:d,...l,...o,name:i.name,ref:u,onCheck:()=>i.onValueChange(o.value),onKeyDown:Te(h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:Te(o.onFocus,()=>{var h;p.current&&((h=c.current)==null||h.click())})})})});l8.displayName=a8;var Fwe="RadioGroupIndicator",c8=T.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=i8(n);return x.jsx(n8,{...o,...r,ref:t})});c8.displayName=Fwe;var u8=s8,d8=l8,Lwe=c8;const np=T.forwardRef(({className:e,...t},n)=>x.jsx(u8,{className:me("grid gap-2",e),...t,ref:n}));np.displayName=u8.displayName;const Xl=T.forwardRef(({className:e,...t},n)=>x.jsx(d8,{ref:n,className:me("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:x.jsx(Lwe,{className:"flex items-center justify-center",children:x.jsx(VC,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Xl.displayName=d8.displayName;function $we({filter:e}){var i;const{filteredRecords:t,handleChange:n,selectedRecords:r}=vR(e);function o(s){n([{value:s,id:s}])}return x.jsx(np,{onValueChange:o,value:((i=r==null?void 0:r[0])==null?void 0:i.value)||"",className:"mt-2 flex gap-3 overflow-x-auto",children:t==null?void 0:t.map(s=>x.jsxs("div",{className:"flex gap-2",children:[x.jsx(Xl,{value:s.value,id:"r1"}),x.jsx(Tn,{className:"text-muted-foreground",htmlFor:"r1",children:s.value})]},s.value))})}function SR({filter:e}){return Dd(e.dataType)?x.jsx(m0e,{filter:e}):e.uiType==="radio"&&e.type==="single"?x.jsx($we,{filter:e}):x.jsx(Twe,{filter:e})}function jwe({frame:e}){const[t,n]=k.useState(!1),r=e==null?void 0:e.cards[0],{data:o}=qa(r),i=e==null?void 0:e.cards[1],{data:s,isLoading:a,isFetching:l}=qa(i);return(i==null?void 0:i.type)!=="text"?x.jsx(ey,{card:r,data:(o==null?void 0:o.records)||[]}):x.jsxs(bc,{className:me("group relative overflow-y-auto",t?"m-4":"mx-0"),children:[t?x.jsx("div",{className:"overflow-y-auto break-words p-1",children:x.jsx(sy,{card:i,data:(s==null?void 0:s.records)||[],isLoading:!1})}):x.jsx(ey,{card:r,data:(o==null?void 0:o.records)||[]}),x.jsx("div",{className:me("fixed z-10",{"invisible bottom-4 right-4 group-hover:visible":t,"right-6 top-6":!t}),children:x.jsx(P0,{disabled:a||l,className:me("h-7 p-1"),pressed:t,onPressedChange:n,"aria-label":"Toggle bold",children:t?x.jsx(mF,{className:"size-4 text-muted-foreground/70"}):x.jsx(bF,{className:"size-4 text-muted-foreground/70"})})})]})}function zwe({card:e,frame:t}){var U,$,B;const{customCards:n,placeholders:r}=Uo(),o=ye(W=>W.themeStyle),i=ye(W=>W.selectedSheetId),s=ye(W=>W.isDashboardEditing),a=ye(W=>W.selectedLensId),l=ye(W=>W.dashboard.filters),c=l==null?void 0:l.find(W=>W.id===t.filterId&&!W.hide),{setCardTitle:u,setCardDescription:d,setSelectedFrameId:p,updateFilter:h}=Yn(),{updateFrame:m}=Yn(),b=((U=e.customCardPreferences)==null?void 0:U.showCardHeader)??!0,{isError:y,isLoading:v,isFetching:w,cfg:_,visualKey:R,data:C,handleDatapointClick:E}=A4(e);function P(){var W,q,Q;if(n&&n.length>0){const D=n.find(G=>G.cardId===e.id);if(D&&D.replaceDefault){const G=D.content;if(G)return x.jsx(G,{card:e})}}if(e.type==="kpi"){if(((W=t==null?void 0:t.cards)==null?void 0:W.length)===1)return x.jsx(ey,{card:e,data:(C==null?void 0:C.records)||[]});if(((q=t==null?void 0:t.cards)==null?void 0:q.length)>1)return x.jsx(jwe,{frame:t})}return e.type==="text"&&((Q=t==null?void 0:t.cards)==null?void 0:Q.length)===1?x.jsx(bc,{className:"mx-3 my-6 overflow-y-auto break-words px-3",children:x.jsx(sy,{isLoading:v||w,card:e,data:(C==null?void 0:C.records)||[]})}):X}function A(){return["{{ filters | where }}","{{ filters | and }}"].some(q=>{var Q;return(Q=e.sql)==null?void 0:Q.includes(q)})?x.jsx(Bde,{}):null}function I(){if(y)return x.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:[x.jsx(SF,{className:"size-8 text-destructive"}),x.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?x.jsx("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:r.NoRecords}):x.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:[x.jsx(kF,{className:"size-8 text-muted-foreground"}),x.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 x.jsxs(bc,{className:"relative flex h-full min-h-0 w-full flex-1 grow basis-0",children:[x.jsx(J$,{card:e,data:(C==null?void 0:C.records)||[]}),x.jsx(Wp,{orientation:"horizontal"})]});if(e.type==="text")return x.jsx(bc,{className:"overflow-y-auto break-words pr-2",children:x.jsx(sy,{isLoading:v||w,card:e,data:(C==null?void 0:C.records)||[]})});if(e.type==="custom")return x.jsx(kpe,{frame:t,card:e});if(n&&n.length>0){const W=n.find(q=>q.cardId===e.id);if(W&&W.content){const q=W.content;return x.jsx(q,{card:e})}}if(_)return x.jsx(JE,{cfg:_,onDatapointClick:E},`${R}-${a}`)}function F(){if(n&&n.length>0){const W=n.find(q=>q.cardId===e.id);if(W&&W.footer){const q=W.footer;if(q)return x.jsx(q,{card:e})}}return null}function L(){var W,q,Q;return x.jsx(mC,{value:t.activeCardId,className:"flex items-center justify-end gap-3",onValueChange:D=>{const G={...t,activeCardId:D};m(i,G)},children:x.jsx($y,{style:{borderRadius:(q=(W=o==null?void 0:o.chart)==null?void 0:W.options)==null?void 0:q.borderRadius},className:"flex-end flex-wrap items-center",children:(Q=t.cards.filter(D=>{var G;return!((G=D.tabTitle)!=null&&G.endsWith("__Header"))&&(D.displayTab===!0||D.displayTab===void 0)}))==null?void 0:Q.map(D=>{var G,V;return x.jsx(jy,{style:{borderRadius:(V=(G=o==null?void 0:o.chart)==null?void 0:G.options)==null?void 0:V.borderRadius},value:D.id,children:D.tabTitle||D.title},D.id)})})})}function j(){let W=t.cards.find(q=>q.type==="kpi"&&q.tabTitle===`${e.tabTitle}__Header`);return W||(W=t.cards.find(q=>q.type==="kpi"&&q.tabTitle==="All__Header")),W?x.jsx("div",{className:"flex items-end gap-2",children:x.jsx(Kue,{renderFilterInfo:A,card:W})}):x.jsxs(x.Fragment,{children:[x.jsxs("div",{role:"card-title-container",className:"flex items-center gap-2",children:[x.jsx(is,{text:e.title,onSave:q=>u(i,e.id,q),children:x.jsx(Id,{className:me("text-base",{}),children:e.title})}),(s||e.info)&&x.jsx(p3,{card:e}),e.refreshInterval&&x.jsxs(S3,{children:[x.jsx(_3,{className:"pr-1",children:x.jsx("div",{className:me("h-2 w-2 rounded-full bg-green-500 transition-opacity",{"opacity-10":v||w})})}),x.jsx(BE,{side:"right",align:"center",children:x.jsx("p",{className:"text-xs",children:`Realtime (${e==null?void 0:e.refreshInterval})`})})]}),A()]}),x.jsx("div",{role:"card-description-container",children:x.jsx(is,{text:(e==null?void 0:e.description)||"",onSave:q=>d(i,e.id,q),children:x.jsxs(uC,{className:me("",{}),children:[" ",e.description]})})})]})}if(!e.id)return null;const X=x.jsxs(x.Fragment,{children:[b?x.jsx(Dy,{children:x.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[x.jsx("div",{className:"grow",role:"header-container",children:j()}),x.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.cards.length>1&&L(),x.jsx("div",{children:c&&x.jsxs("div",{style:{borderRadius:(B=($=o==null?void 0:o.chart)==null?void 0:$.options)==null?void 0:B.borderRadius},role:"frame-filter-container",className:"flex h-10 shrink-0 items-center bg-muted p-1",children:[!Dd(c.dataType)&&x.jsx(is,{className:"my-1",containerClassName:"shrink-0",text:c.title||c.column,onSave:W=>h({...c,title:W}),children:x.jsx(Tn,{className:"px-3",children:c.title})}),x.jsx(SR,{filter:c})]})})]})]})}):x.jsx("div",{className:"h-8"}),x.jsx(Iy,{className:"relative flex min-h-0 grow flex-col",children:I()}),x.jsx(qN,{children:F()})]});return x.jsx("div",{className:me("flex h-full flex-col",{"animate-pulse":v||w}),children:P()})}function Bwe({frame:e,footer:t,className:n,...r}){var b,y;const o=k.useRef(null),i=ye(v=>v.themeStyle),s=ye(v=>v.selectedFrameId),a=ye(v=>v.isDashboardEditing),{setSelectedFrameId:l}=Yn(),{setSelectedConnectionId:c,setSelectedDatabaseName:u,setSelectedSchemaName:d,setSelectedTableName:p}=Rp(),h=e.cards.find(v=>v.id===e.activeCardId);hte(e,o);function m(v){v.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 x.jsx(Jy,{FallbackComponent:qC,children:x.jsxs("div",{tabIndex:-1,ref:o,role:"card-frame",onClick:m,style:{borderRadius:(y=(b=i==null?void 0:i.chart)==null?void 0:b.options)==null?void 0:y.borderRadius},className:me("relative flex h-full flex-col rounded-sm border bg-background shadow-sm",{"border-dashed border-foreground/50":s===e.id&&a},i==null?void 0:i.dashboardCard,n,"semaphor-card-frame"),...r,children:[x.jsx(MF,{frame:e}),x.jsx(zwe,{card:h,frame:e},h.id)]})})}const _R=T.forwardRef(({className:e,...t},n)=>x.jsx("textarea",{className:me("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}));_R.displayName="Textarea";function Hwe({label:e,onCheckedChange:t,checked:n}){return x.jsxs("div",{className:"flex items-center space-x-2",children:[x.jsx(z0,{onCheckedChange:t,id:"terms",checked:n}),x.jsx("label",{htmlFor:"terms",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:e})]})}function f8({text:e,className:t}){const[n,r]=k.useState(!1);return x.jsx(sr,{className:me("h-7 w-fit px-1 font-mono text-xs text-muted-foreground/70",t),variant:"ghost",size:"icon",onClick:()=>{navigator.clipboard.writeText(e),r(!0),setTimeout(()=>{r(!1)},1e3)},children:n?x.jsx(HC,{className:"size-3.5"}):x.jsx(UC,{className:"size-3.5"})})}function Wwe({filter:e}){const[t,n]=k.useState(e.sql),[r,o]=k.useState(!1),i=ye(h=>h.selectedSheetId),{updateFilter:s,updateFilterId:a}=Yn();function l(){const h={...e,sql:t};s(h),o(!1)}function c(h){console.log("operation",h);const m={...e,operation:h};s(m)}function u(h){const m={...e,type:h};s(m)}function d(h){const m={...e,uiType:h};s(m)}function p(h){if(!i)return;const m={...e,sheetId:h?i:void 0};s(m)}return x.jsxs(T0,{open:r,onOpenChange:o,children:[x.jsx(k0,{children:x.jsx(EF,{className:"invisible h-3 w-3 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"})}),x.jsxs(Hp,{onMouseDown:h=>h.stopPropagation(),onDoubleClick:h=>h.stopPropagation(),className:"z-50 m-2 w-full min-w-[350px] space-y-4",children:[x.jsxs("div",{className:"space-y-2",children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("p",{className:"font-semibold text-foreground",children:e.column}),x.jsx("div",{className:"flex items-center gap-2",children:x.jsxs(Fp,{children:[x.jsx(Lp,{children:x.jsx(pF,{className:"size-5 cursor-pointer text-muted-foreground hover:text-foreground/80"})}),x.jsxs(Vd,{align:"start",className:"flex w-auto items-center gap-2 px-3 py-2",children:[x.jsx("p",{className:"font-mono text-xs text-muted-foreground",children:e.id}),x.jsx(f8,{text:e.id})]})]})})]}),x.jsx("p",{className:"text-sm text-muted-foreground",children:"Customize filter operation and SQL"})]}),x.jsx(y0,{}),x.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[x.jsxs("div",{className:"space-y-2",children:[x.jsx(Tn,{children:"Type"}),x.jsxs(np,{onValueChange:u,value:e.type||"multiple",className:"flex gap-3",defaultValue:"x",children:[x.jsxs("div",{className:"flex items-center space-x-2",children:[x.jsx(Xl,{value:"multiple",id:"r1"}),x.jsx("label",{className:"text-sm",htmlFor:"r1",children:"Multiple"})]}),x.jsxs("div",{className:"flex items-center space-x-2",children:[x.jsx(Xl,{value:"single",id:"r2"}),x.jsx("label",{className:"text-sm",htmlFor:"r2",children:"Single"})]})]})]}),e.type==="single"&&x.jsxs("div",{className:"space-y-2",children:[x.jsx(Tn,{children:"Filter Element"}),x.jsxs(np,{onValueChange:d,value:e.uiType||"dropdown",className:"flex gap-3",defaultValue:"x",children:[x.jsxs("div",{className:"flex items-center space-x-2",children:[x.jsx(Xl,{value:"dropdown",id:"r2"}),x.jsx("label",{className:"text-sm",htmlFor:"r2",children:"Dropdown"})]}),x.jsxs("div",{className:"flex items-center space-x-2",children:[x.jsx(Xl,{value:"radio",id:"r1"}),x.jsx("label",{className:"text-sm",htmlFor:"r1",children:"Radio"})]})]})]})]}),x.jsxs("div",{className:"grid grid-cols-6 gap-4 text-sm",children:[x.jsxs("div",{className:"col-span-2 space-y-1",children:[x.jsx(Tn,{children:"Table Column"}),x.jsx(Tn,{className:"block rounded-md bg-muted p-2 font-mono text-xs",children:e.column})]}),x.jsxs("div",{className:"col-span-2 space-y-1",children:[x.jsx(Tn,{children:"Data Type"}),x.jsx(Tn,{className:"block rounded-md bg-muted p-2 font-mono text-xs",children:e.dataType})]}),x.jsxs("div",{className:"col-span-2 space-y-1",children:[x.jsx(Tn,{className:"text-sm",children:"Filter Operation"}),x.jsx(Vwe,{updateFilterOperation:c,value:e.operation})]})]}),x.jsxs("div",{className:"flex grow flex-col space-y-1",role:"container",children:[x.jsx(Tn,{className:"text-sm",children:"Values SQL"}),x.jsx(_R,{onKeyDown:h=>{h.stopPropagation()},value:t,onChange:h=>n(h.target.value),className:`min-w-full grow resize font-mono text-xs ${ch}`})]}),x.jsx("div",{children:x.jsx(Hwe,{label:"Local to sheet",onCheckedChange:p,checked:!!e.sheetId})}),x.jsx("div",{className:"flex justify-end gap-2",children:x.jsxs(sr,{onClick:l,size:"sm",variant:"outline",children:[x.jsx(Fd,{className:"mr-2 size-4"}),"Accept"]})})]})]})}function Vwe({value:e,updateFilterOperation:t}){return x.jsxs($s,{defaultValue:"in",value:e,onValueChange:n=>t(n),children:[x.jsx(Vi,{className:"h-8 w-[180px] focus:ring-0 focus:ring-offset-0",children:x.jsx(js,{placeholder:"Operation"})}),x.jsxs(Ui,{children:[x.jsx(Bn,{value:"=",children:"Equals"}),x.jsx(Bn,{value:"in",children:"Contains"}),x.jsx(Bn,{value:"like",children:"Like"})]})]})}function h8({filter:e}){const t=ye(a=>a.isDashboardEditing),n=ye(a=>a.filterValues),r=n==null?void 0:n.some(a=>a.filterId===e.id),{removeFilterValues:o,removeFilter:i,updateFilter:s}=Yn();return x.jsx(is,{className:"my-1",text:e.title||e.column,onSave:a=>s({...e,title:a}),children:x.jsxs("div",{className:"group mb-1 flex grow items-center justify-between",children:[x.jsxs("div",{className:"flex grow items-center gap-2",children:[x.jsx(Tn,{className:"inline-block text-sm",children:e.title}),r&&x.jsx("button",{onClick:()=>o(e.id),className:"text-foreground/30 hover:text-foreground/50",children:x.jsx(GC,{className:"size-3.5"})}),t&&x.jsx("button",{className:"invisible group-hover:visible",onClick:()=>{s({...e,hide:!e.hide})},children:e.hide?x.jsx(dF,{className:"size-3.5 text-foreground/50 hover:text-foreground/70"}):x.jsx(uF,{className:"size-3.5 text-foreground/50 hover:text-foreground/70"})}),t&&x.jsx(Wwe,{filter:e})]}),x.jsx("div",{className:"flex items-center gap-2",children:t&&x.jsx(Bc,{onClick:()=>{o(e.id),i(e.id)},className:"size-3.5 cursor-pointer text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})})]})})}var Uwe=e=>{switch(e){case"success":return Ywe;case"info":return Xwe;case"warning":return Kwe;case"error":return Qwe;default:return null}},Gwe=Array(12).fill(0),qwe=({visible:e,className:t})=>k.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},k.createElement("div",{className:"sonner-spinner"},Gwe.map((n,r)=>k.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Ywe=k.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},k.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"})),Kwe=k.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},k.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"})),Xwe=k.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},k.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"})),Qwe=k.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},k.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"})),Zwe=k.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"},k.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),k.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Jwe=()=>{let[e,t]=k.useState(document.hidden);return k.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},p_=1,e1e=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,o=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:p_++,i=this.toasts.find(a=>a.id===o),s=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),i?this.toasts=this.toasts.map(a=>a.id===o?(this.publish({...a,...e,id:o,title:n}),{...a,...e,id:o,dismissible:s,title:n}):a):this.addToast({title:n,...r,dismissible:s,id:o}),o},this.dismiss=e=>(this.dismissedToasts.add(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(),o=n!==void 0,i,s=r.then(async l=>{if(i=["resolve",l],k.isValidElement(l))o=!1,this.create({id:n,type:"default",message:l});else if(n1e(l)&&!l.ok){o=!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){o=!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(i=["reject",l],t.error!==void 0){o=!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;o&&(this.dismiss(n),n=void 0),(l=t.finally)==null||l.call(t)}),a=()=>new Promise((l,c)=>s.then(()=>i[0]==="reject"?c(i[1]):l(i[1])).catch(c));return typeof n!="string"&&typeof n!="number"?{unwrap:a}:Object.assign(n,{unwrap:a})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||p_++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},mo=new e1e,t1e=(e,t)=>{let n=(t==null?void 0:t.id)||p_++;return mo.addToast({title:e,...t,id:n}),n},n1e=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",r1e=t1e,o1e=()=>mo.toasts,i1e=()=>mo.getActiveToasts(),p8=Object.assign(r1e,{success:mo.success,info:mo.info,warning:mo.warning,error:mo.error,custom:mo.custom,message:mo.message,promise:mo.promise,dismiss:mo.dismiss,loading:mo.loading},{getHistory:o1e,getToasts:i1e});function s1e(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))}s1e(`: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%)}
391
+ `);function Hm(e){return e.label!==void 0}var a1e=3,l1e="32px",c1e="16px",RD=4e3,u1e=356,d1e=14,f1e=20,h1e=200;function wi(...e){return e.filter(Boolean).join(" ")}function p1e(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var g1e=e=>{var t,n,r,o,i,s,a,l,c,u,d;let{invert:p,toast:h,unstyled:m,interacting:b,setHeights:y,visibleToasts:v,heights:w,index:_,toasts:R,expanded:C,removeToast:E,defaultRichColors:P,closeButton:A,style:I,cancelButtonStyle:F,actionButtonStyle:L,className:j="",descriptionClassName:X="",duration:U,position:$,gap:B,loadingIcon:W,expandByDefault:q,classNames:Q,icons:D,closeButtonAriaLabel:G="Close toast",pauseWhenPageIsHidden:V}=e,[M,ee]=k.useState(null),[K,re]=k.useState(null),[Y,J]=k.useState(!1),[ie,de]=k.useState(!1),[he,se]=k.useState(!1),[ge,ue]=k.useState(!1),[Ce,ke]=k.useState(!1),[Ne,Oe]=k.useState(0),[Le,Je]=k.useState(0),it=k.useRef(h.duration||U||RD),ln=k.useRef(null),vt=k.useRef(null),$n=_===0,Ct=_+1<=v,fe=h.type,_e=h.dismissible!==!1,He=h.className||"",Ve=h.descriptionClassName||"",rt=k.useMemo(()=>w.findIndex($e=>$e.toastId===h.id)||0,[w,h.id]),An=k.useMemo(()=>{var $e;return($e=h.closeButton)!=null?$e:A},[h.closeButton,A]),Ue=k.useMemo(()=>h.duration||U||RD,[h.duration,U]),lt=k.useRef(0),Ge=k.useRef(0),tn=k.useRef(0),gt=k.useRef(null),[In,$t]=$.split("-"),Nn=k.useMemo(()=>w.reduce(($e,Pt,Xt)=>Xt>=rt?$e:$e+Pt.height,0),[w,rt]),st=Jwe(),qo=h.invert||p,cr=fe==="loading";Ge.current=k.useMemo(()=>rt*B+Nn,[rt,Nn]),k.useEffect(()=>{it.current=Ue},[Ue]),k.useEffect(()=>{J(!0)},[]),k.useEffect(()=>{let $e=vt.current;if($e){let Pt=$e.getBoundingClientRect().height;return Je(Pt),y(Xt=>[{toastId:h.id,height:Pt,position:h.position},...Xt]),()=>y(Xt=>Xt.filter(tr=>tr.toastId!==h.id))}},[y,h.id]),k.useLayoutEffect(()=>{if(!Y)return;let $e=vt.current,Pt=$e.style.height;$e.style.height="auto";let Xt=$e.getBoundingClientRect().height;$e.style.height=Pt,Je(Xt),y(tr=>tr.find(nr=>nr.toastId===h.id)?tr.map(nr=>nr.toastId===h.id?{...nr,height:Xt}:nr):[{toastId:h.id,height:Xt,position:h.position},...tr])},[Y,h.title,h.description,y,h.id]);let br=k.useCallback(()=>{de(!0),Oe(Ge.current),y($e=>$e.filter(Pt=>Pt.toastId!==h.id)),setTimeout(()=>{E(h)},h1e)},[h,E,y,Ge]);k.useEffect(()=>{if(h.promise&&fe==="loading"||h.duration===1/0||h.type==="loading")return;let $e;return C||b||V&&st?(()=>{if(tn.current<lt.current){let Pt=new Date().getTime()-lt.current;it.current=it.current-Pt}tn.current=new Date().getTime()})():it.current!==1/0&&(lt.current=new Date().getTime(),$e=setTimeout(()=>{var Pt;(Pt=h.onAutoClose)==null||Pt.call(h,h),br()},it.current)),()=>clearTimeout($e)},[C,b,h,fe,V,st,br]),k.useEffect(()=>{h.delete&&br()},[br,h.delete]);function mi(){var $e,Pt,Xt;return D!=null&&D.loading?k.createElement("div",{className:wi(Q==null?void 0:Q.loader,($e=h==null?void 0:h.classNames)==null?void 0:$e.loader,"sonner-loader"),"data-visible":fe==="loading"},D.loading):W?k.createElement("div",{className:wi(Q==null?void 0:Q.loader,(Pt=h==null?void 0:h.classNames)==null?void 0:Pt.loader,"sonner-loader"),"data-visible":fe==="loading"},W):k.createElement(qwe,{className:wi(Q==null?void 0:Q.loader,(Xt=h==null?void 0:h.classNames)==null?void 0:Xt.loader),visible:fe==="loading"})}return k.createElement("li",{tabIndex:0,ref:vt,className:wi(j,He,Q==null?void 0:Q.toast,(t=h==null?void 0:h.classNames)==null?void 0:t.toast,Q==null?void 0:Q.default,Q==null?void 0:Q[fe],(n=h==null?void 0:h.classNames)==null?void 0:n[fe]),"data-sonner-toast":"","data-rich-colors":(r=h.richColors)!=null?r:P,"data-styled":!(h.jsx||h.unstyled||m),"data-mounted":Y,"data-promise":!!h.promise,"data-swiped":Ce,"data-removed":ie,"data-visible":Ct,"data-y-position":In,"data-x-position":$t,"data-index":_,"data-front":$n,"data-swiping":he,"data-dismissible":_e,"data-type":fe,"data-invert":qo,"data-swipe-out":ge,"data-swipe-direction":K,"data-expanded":!!(C||q&&Y),style:{"--index":_,"--toasts-before":_,"--z-index":R.length-_,"--offset":`${ie?Ne:Ge.current}px`,"--initial-height":q?"auto":`${Le}px`,...I,...h.style},onDragEnd:()=>{se(!1),ee(null),gt.current=null},onPointerDown:$e=>{cr||!_e||(ln.current=new Date,Oe(Ge.current),$e.target.setPointerCapture($e.pointerId),$e.target.tagName!=="BUTTON"&&(se(!0),gt.current={x:$e.clientX,y:$e.clientY}))},onPointerUp:()=>{var $e,Pt,Xt,tr;if(ge||!_e)return;gt.current=null;let nr=Number((($e=vt.current)==null?void 0:$e.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),zr=Number(((Pt=vt.current)==null?void 0:Pt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),yr=new Date().getTime()-((Xt=ln.current)==null?void 0:Xt.getTime()),ur=M==="x"?nr:zr,_n=Math.abs(ur)/yr;if(Math.abs(ur)>=f1e||_n>.11){Oe(Ge.current),(tr=h.onDismiss)==null||tr.call(h,h),re(M==="x"?nr>0?"right":"left":zr>0?"down":"up"),br(),ue(!0),ke(!1);return}se(!1),ee(null)},onPointerMove:$e=>{var Pt,Xt,tr,nr;if(!gt.current||!_e||((Pt=window.getSelection())==null?void 0:Pt.toString().length)>0)return;let zr=$e.clientY-gt.current.y,yr=$e.clientX-gt.current.x,ur=(Xt=e.swipeDirections)!=null?Xt:p1e($);!M&&(Math.abs(yr)>1||Math.abs(zr)>1)&&ee(Math.abs(yr)>Math.abs(zr)?"x":"y");let _n={x:0,y:0};M==="y"?(ur.includes("top")||ur.includes("bottom"))&&(ur.includes("top")&&zr<0||ur.includes("bottom")&&zr>0)&&(_n.y=zr):M==="x"&&(ur.includes("left")||ur.includes("right"))&&(ur.includes("left")&&yr<0||ur.includes("right")&&yr>0)&&(_n.x=yr),(Math.abs(_n.x)>0||Math.abs(_n.y)>0)&&ke(!0),(tr=vt.current)==null||tr.style.setProperty("--swipe-amount-x",`${_n.x}px`),(nr=vt.current)==null||nr.style.setProperty("--swipe-amount-y",`${_n.y}px`)}},An&&!h.jsx?k.createElement("button",{"aria-label":G,"data-disabled":cr,"data-close-button":!0,onClick:cr||!_e?()=>{}:()=>{var $e;br(),($e=h.onDismiss)==null||$e.call(h,h)},className:wi(Q==null?void 0:Q.closeButton,(o=h==null?void 0:h.classNames)==null?void 0:o.closeButton)},(i=D==null?void 0:D.close)!=null?i:Zwe):null,h.jsx||k.isValidElement(h.title)?h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title:k.createElement(k.Fragment,null,fe||h.icon||h.promise?k.createElement("div",{"data-icon":"",className:wi(Q==null?void 0:Q.icon,(s=h==null?void 0:h.classNames)==null?void 0:s.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||mi():null,h.type!=="loading"?h.icon||(D==null?void 0:D[fe])||Uwe(fe):null):null,k.createElement("div",{"data-content":"",className:wi(Q==null?void 0:Q.content,(a=h==null?void 0:h.classNames)==null?void 0:a.content)},k.createElement("div",{"data-title":"",className:wi(Q==null?void 0:Q.title,(l=h==null?void 0:h.classNames)==null?void 0:l.title)},typeof h.title=="function"?h.title():h.title),h.description?k.createElement("div",{"data-description":"",className:wi(X,Ve,Q==null?void 0:Q.description,(c=h==null?void 0:h.classNames)==null?void 0:c.description)},typeof h.description=="function"?h.description():h.description):null),k.isValidElement(h.cancel)?h.cancel:h.cancel&&Hm(h.cancel)?k.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||F,onClick:$e=>{var Pt,Xt;Hm(h.cancel)&&_e&&((Xt=(Pt=h.cancel).onClick)==null||Xt.call(Pt,$e),br())},className:wi(Q==null?void 0:Q.cancelButton,(u=h==null?void 0:h.classNames)==null?void 0:u.cancelButton)},h.cancel.label):null,k.isValidElement(h.action)?h.action:h.action&&Hm(h.action)?k.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||L,onClick:$e=>{var Pt,Xt;Hm(h.action)&&((Xt=(Pt=h.action).onClick)==null||Xt.call(Pt,$e),!$e.defaultPrevented&&br())},className:wi(Q==null?void 0:Q.actionButton,(d=h==null?void 0:h.classNames)==null?void 0:d.actionButton)},h.action.label):null))};function TD(){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 m1e(e,t){let n={};return[e,t].forEach((r,o)=>{let i=o===1,s=i?"--mobile-offset":"--offset",a=i?c1e:l1e;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 b1e=k.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:o=["altKey","KeyT"],expand:i,closeButton:s,className:a,offset:l,mobileOffset:c,theme:u="light",richColors:d,duration:p,style:h,visibleToasts:m=a1e,toastOptions:b,dir:y=TD(),gap:v=d1e,loadingIcon:w,icons:_,containerAriaLabel:R="Notifications",pauseWhenPageIsHidden:C}=e,[E,P]=k.useState([]),A=k.useMemo(()=>Array.from(new Set([r].concat(E.filter(V=>V.position).map(V=>V.position)))),[E,r]),[I,F]=k.useState([]),[L,j]=k.useState(!1),[X,U]=k.useState(!1),[$,B]=k.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),W=k.useRef(null),q=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),Q=k.useRef(null),D=k.useRef(!1),G=k.useCallback(V=>{P(M=>{var ee;return(ee=M.find(K=>K.id===V.id))!=null&&ee.delete||mo.dismiss(V.id),M.filter(({id:K})=>K!==V.id)})},[]);return k.useEffect(()=>mo.subscribe(V=>{if(V.dismiss){P(M=>M.map(ee=>ee.id===V.id?{...ee,delete:!0}:ee));return}setTimeout(()=>{Ir.flushSync(()=>{P(M=>{let ee=M.findIndex(K=>K.id===V.id);return ee!==-1?[...M.slice(0,ee),{...M[ee],...V},...M.slice(ee+1)]:[V,...M]})})})}),[]),k.useEffect(()=>{if(u!=="system"){B(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?B("dark"):B("light")),typeof window>"u")return;let V=window.matchMedia("(prefers-color-scheme: dark)");try{V.addEventListener("change",({matches:M})=>{B(M?"dark":"light")})}catch{V.addListener(({matches:ee})=>{try{B(ee?"dark":"light")}catch(K){console.error(K)}})}},[u]),k.useEffect(()=>{E.length<=1&&j(!1)},[E]),k.useEffect(()=>{let V=M=>{var ee,K;o.every(re=>M[re]||M.code===re)&&(j(!0),(ee=W.current)==null||ee.focus()),M.code==="Escape"&&(document.activeElement===W.current||(K=W.current)!=null&&K.contains(document.activeElement))&&j(!1)};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[o]),k.useEffect(()=>{if(W.current)return()=>{Q.current&&(Q.current.focus({preventScroll:!0}),Q.current=null,D.current=!1)}},[W.current]),k.createElement("section",{ref:t,"aria-label":`${R} ${q}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},A.map((V,M)=>{var ee;let[K,re]=V.split("-");return E.length?k.createElement("ol",{key:V,dir:y==="auto"?TD():y,tabIndex:-1,ref:W,className:a,"data-sonner-toaster":!0,"data-theme":$,"data-y-position":K,"data-lifted":L&&E.length>1&&!i,"data-x-position":re,style:{"--front-toast-height":`${((ee=I[0])==null?void 0:ee.height)||0}px`,"--width":`${u1e}px`,"--gap":`${v}px`,...h,...m1e(l,c)},onBlur:Y=>{D.current&&!Y.currentTarget.contains(Y.relatedTarget)&&(D.current=!1,Q.current&&(Q.current.focus({preventScroll:!0}),Q.current=null))},onFocus:Y=>{Y.target instanceof HTMLElement&&Y.target.dataset.dismissible==="false"||D.current||(D.current=!0,Q.current=Y.relatedTarget)},onMouseEnter:()=>j(!0),onMouseMove:()=>j(!0),onMouseLeave:()=>{X||j(!1)},onDragEnd:()=>j(!1),onPointerDown:Y=>{Y.target instanceof HTMLElement&&Y.target.dataset.dismissible==="false"||U(!0)},onPointerUp:()=>U(!1)},E.filter(Y=>!Y.position&&M===0||Y.position===V).map((Y,J)=>{var ie,de;return k.createElement(g1e,{key:Y.id,icons:_,index:J,toast:Y,defaultRichColors:d,duration:(ie=b==null?void 0:b.duration)!=null?ie:p,className:b==null?void 0:b.className,descriptionClassName:b==null?void 0:b.descriptionClassName,invert:n,visibleToasts:m,closeButton:(de=b==null?void 0:b.closeButton)!=null?de:s,interacting:X,position:V,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:G,toasts:E.filter(he=>he.position==Y.position),heights:I.filter(he=>he.position==Y.position),setHeights:F,expandByDefault:i,gap:v,loadingIcon:w,expanded:L,pauseWhenPageIsHidden:C,swipeDirections:e.swipeDirections})})):null}))});function y1e(){const{getSelectedFrame:e,addFrame:t,setSelectedFrameId:n}=Yn(),r=ye(l=>l.dashboard.sheets),i=ye(l=>l.selectedSheetId)??(r==null?void 0:r[0].id),s=ye(l=>l.isDashboardEditing),a=ye(l=>l.isVisualEditing);k.useEffect(()=>{if(!s||a)return;async function l(d){const p=d.ctrlKey||d.metaKey;p&&d.key==="c"?(await c(),p8.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(!i)return null;try{const d=await navigator.clipboard.readText();try{const p=JSON.parse(d);if(p&&p.id){p.id=Ga();const h=p.activeCardId;p.cards.forEach(m=>{const b=m.id;m.id=Ga(),b===h&&(p.activeCardId=m.id,m.title=`${m.title} (Copy)`)}),t(i,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,i,s,a])}const v1e=YO.WidthProvider(YO.Responsive);function x1e({sheet:e}){var w,_,R;const t=ye(C=>C.isDashboardEditing),n=ye(C=>C.currentBreakpoint),r=ye(C=>C.themeStyle),[o,i]=k.useState([]),s=ye(C=>C.selectedSheetId);ye(C=>C.selectedLensId);const a=e.layouts,l=ye(C=>C.dashboard.filters),c=e.frames,{setSheetLayouts:u,setCurrentBreakpoint:d}=ye(C=>C.actions);k.useEffect(()=>{var C,E;document.documentElement.style.setProperty("--placeholder-border-radius",`${(E=(C=r==null?void 0:r.chart)==null?void 0:C.options)==null?void 0:E.borderRadius}px`)},[(_=(w=r==null?void 0:r.chart)==null?void 0:w.options)==null?void 0:_.borderRadius]),y1e();function p(C){d(C)}function h(C,E){s===e.id&&u(s,E)}if(!s)return null;const m=(C,E)=>x.jsx(g8,{className:"after:content-none",ref:E,handleAxis:C}),b=C=>C&&(C==null?void 0:C.h)===1&&(C==null?void 0:C.w)===1?{...C,h:8,minH:7,w:7}:null;function y(){const C=l==null?void 0:l.filter(E=>(E.sheetId===s||!E.sheetId)&&!E.hide);return C==null?void 0:C.map(E=>{var I,F,L;const P=(I=a==null?void 0:a[n])==null?void 0:I.find(j=>j.i===E.id);if(E.location==="frame")return null;const A=b(P);return x.jsxs("div",{style:{borderRadius:(L=(F=r==null?void 0:r.chart)==null?void 0:F.options)==null?void 0:L.borderRadius},className:me("z-50 flex flex-col rounded-md border bg-background px-3 py-2"),...A?{"data-grid":A}:{},children:[x.jsx(h8,{filter:E}),x.jsx(SR,{filter:E})]},E.id)})}function v(){return c==null?void 0:c.map(C=>x.jsx("div",{role:"dashboard-frame-container",className:me("group isolate overflow-hidden",r==null?void 0:r.dashboardCardContainer),children:x.jsx(Jy,{FallbackComponent:({error:E,resetErrorBoundary:P})=>x.jsx(mte,{error:E,resetErrorBoundary:P,frame:C}),children:x.jsx(Bwe,{frame:C})})},C.id))}return x.jsx(x.Fragment,{children:x.jsxs(v1e,{margin:[10,10],isDraggable:t,resizeHandles:t?["sw","nw","ne","se","e","w"]:[],className:me((R=r==null?void 0:r.gridLayout)==null?void 0:R.className),layouts:a,cols:{lg:48,md:36,sm:24,xs:12,xxs:6},rowHeight:1,onBreakpointChange:p,onLayoutChange:h,resizeHandle:m,children:[y(),v()]})})}const g8=k.forwardRef(({className:e,handleAxis:t,...n},r)=>{var s,a;const o=ye(l=>l.themeStyle),i=(a=(s=o==null?void 0:o.chart)==null?void 0:s.options)==null?void 0:a.borderRadius;return x.jsx("div",{ref:r,className:me(`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"&&i<11,"border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-l-0":t==="ne"&&i<11,"border-foreground/40 group-hover:border-2 group-hover:border-r-0 group-hover:border-t-0":t==="sw"&&i<11,"border-foreground/40 group-hover:border-2 group-hover:border-l-0 group-hover:border-t-0":t==="se"&&i<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})});g8.displayName="ResizeHandle";var m8="vercel.ai.error",w1e=Symbol.for(m8),b8,S1e=class y8 extends Error{constructor({name:t,message:n,cause:r}){super(n),this[b8]=!0,this.name=t,this.cause=r}static isInstance(t){return y8.hasMarker(t,m8)}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}};b8=w1e;var Od=S1e;function v8(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var x8="AI_InvalidArgumentError",w8=`vercel.ai.error.${x8}`,_1e=Symbol.for(w8),S8,C1e=class extends Od{constructor({message:e,cause:t,argument:n}){super({name:x8,message:e,cause:t}),this[S8]=!0,this.argument=n}static isInstance(e){return Od.hasMarker(e,w8)}};S8=_1e;var _8="AI_JSONParseError",C8=`vercel.ai.error.${_8}`,E1e=Symbol.for(C8),E8,kD=class extends Od{constructor({text:e,cause:t}){super({name:_8,message:`JSON parsing failed: Text: ${e}.
392
+ Error message: ${v8(t)}`,cause:t}),this[E8]=!0,this.text=e}static isInstance(e){return Od.hasMarker(e,C8)}};E8=E1e;var R8="AI_TypeValidationError",T8=`vercel.ai.error.${R8}`,R1e=Symbol.for(T8),k8,T1e=class g_ extends Od{constructor({value:t,cause:n}){super({name:R8,message:`Type validation failed: Value: ${JSON.stringify(t)}.
393
+ Error message: ${v8(n)}`,cause:n}),this[k8]=!0,this.value=t}static isInstance(t){return Od.hasMarker(t,T8)}static wrap({value:t,cause:n}){return g_.isInstance(n)&&n.value===t?n:new g_({value:t,cause:n})}};k8=R1e;var PD=T1e;let k1e=(e,t=21)=>(n=t)=>{let r="",o=n|0;for(;o--;)r+=e[Math.random()*e.length|0];return r};var Kd={exports:{}};const P1e=typeof Buffer<"u",OD=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,MD=/"(?: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 P8(e,t,n){n==null&&t!==null&&typeof t=="object"&&(n=t,t=void 0),P1e&&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 o=n&&n.protoAction||"error",i=n&&n.constructorAction||"error";if(o==="ignore"&&i==="ignore")return r;if(o!=="ignore"&&i!=="ignore"){if(OD.test(e)===!1&&MD.test(e)===!1)return r}else if(o!=="ignore"&&i==="ignore"){if(OD.test(e)===!1)return r}else if(MD.test(e)===!1)return r;return O8(r,{protoAction:o,constructorAction:i,safe:n&&n.safe})}function O8(e,{protoAction:t="error",constructorAction:n="error",safe:r}={}){let o=[e];for(;o.length;){const i=o;o=[];for(const s of i){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"&&o.push(l)}}}return e}function CR(e,t,n){const r=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return P8(e,t,n)}finally{Error.stackTraceLimit=r}}function O1e(e,t){const n=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return P8(e,t,{safe:!0})}catch{return null}finally{Error.stackTraceLimit=n}}Kd.exports=CR;Kd.exports.default=CR;Kd.exports.parse=CR;Kd.exports.safeParse=O1e;Kd.exports.scan=O8;var M1e=Kd.exports;const A1e=ol(M1e);var D1e=({prefix:e,size:t=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const o=k1e(n,t);if(e==null)return o;if(n.includes(r))throw new C1e({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return i=>`${e}${r}${o(i)}`},ER=D1e(),m_=Symbol.for("vercel.ai.validator");function I1e(e){return{[m_]:!0,validate:e}}function N1e(e){return typeof e=="object"&&e!==null&&m_ in e&&e[m_]===!0&&"validate"in e}function F1e(e){return N1e(e)?e:L1e(e)}function L1e(e){return I1e(t=>{const n=e.safeParse(t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}})}function $1e({value:e,schema:t}){const n=F1e(t);try{if(n.validate==null)return{success:!0,value:e};const r=n.validate(e);return r.success?r:{success:!1,error:PD.wrap({value:e,cause:r.error})}}catch(r){return{success:!1,error:PD.wrap({value:e,cause:r})}}}function AD({text:e,schema:t}){try{const n=A1e.parse(e);if(t==null)return{success:!0,value:n,rawValue:n};const r=$1e({value:n,schema:t});return r.success?{...r,rawValue:n}:r}catch(n){return{success:!1,error:kD.isInstance(n)?n:new kD({text:e,cause:n})}}}new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");var rp={code:"0",name:"text",parse:e=>{if(typeof e!="string")throw new Error('"text" parts expect a string value.');return{type:"text",value:e}}},op={code:"3",name:"error",parse:e=>{if(typeof e!="string")throw new Error('"error" parts expect a string value.');return{type:"error",value:e}}},ip={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}}},sp={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}}}},ap={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}}},j1e=[rp,op,ip,sp,ap];rp.code+"",op.code+"",ip.code+"",sp.code+"",ap.code+"";rp.name+"",rp.code,op.name+"",op.code,ip.name+"",ip.code,sp.name+"",sp.code,ap.name+"",ap.code;j1e.map(e=>e.code);function z1e({promptTokens:e,completionTokens:t}){return{promptTokens:e,completionTokens:t,totalTokens:e+t}}function B1e(e){const t=["ROOT"];let n=-1,r=null;function o(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 i(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":o(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":{o(c,l,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{i(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,o(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":{o(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"&&i(c,l);break}case"}":{t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&i(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"?i(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 H1e(e){if(e===void 0)return{value:void 0,state:"undefined-input"};let t=AD({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=AD({text:B1e(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var W1e={code:"0",name:"text",parse:e=>{if(typeof e!="string")throw new Error('"text" parts expect a string value.');return{type:"text",value:e}}},V1e={code:"2",name:"data",parse:e=>{if(!Array.isArray(e))throw new Error('"data" parts expect an array value.');return{type:"data",value:e}}},U1e={code:"3",name:"error",parse:e=>{if(typeof e!="string")throw new Error('"error" parts expect a string value.');return{type:"error",value:e}}},G1e={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}}},q1e={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}}},Y1e={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}}},K1e={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}}},X1e={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}}},Q1e={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}}},Z1e={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}}},J1e={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}}}},eSe={code:"g",name:"reasoning",parse:e=>{if(typeof e!="string")throw new Error('"reasoning" parts expect a string value.');return{type:"reasoning",value:e}}},tSe={code:"h",name:"source",parse:e=>{if(e==null||typeof e!="object")throw new Error('"source" parts expect a Source object.');return{type:"source",value:e}}},nSe={code:"i",name:"redacted_reasoning",parse:e=>{if(e==null||typeof e!="object"||!("data"in e)||typeof e.data!="string")throw new Error('"redacted_reasoning" parts expect an object with a "data" property.');return{type:"redacted_reasoning",value:{data:e.data}}}},rSe={code:"j",name:"reasoning_signature",parse:e=>{if(e==null||typeof e!="object"||!("signature"in e)||typeof e.signature!="string")throw new Error('"reasoning_signature" parts expect an object with a "signature" property.');return{type:"reasoning_signature",value:{signature:e.signature}}}},RR=[W1e,V1e,U1e,G1e,q1e,Y1e,K1e,X1e,Q1e,Z1e,J1e,eSe,tSe,nSe,rSe],oSe=Object.fromEntries(RR.map(e=>[e.code,e]));Object.fromEntries(RR.map(e=>[e.name,e.code]));var iSe=RR.map(e=>e.code),sSe=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(!iSe.includes(n))throw new Error(`Failed to parse stream string. Invalid code ${n}.`);const r=n,o=e.slice(t+1),i=JSON.parse(o);return oSe[r].parse(i)},aSe=10;function lSe(e,t){const n=new Uint8Array(t);let r=0;for(const o of e)n.set(o,r),r+=o.length;return e.length=0,n}async function cSe({stream:e,onTextPart:t,onReasoningPart:n,onReasoningSignaturePart:r,onRedactedReasoningPart:o,onSourcePart:i,onDataPart:s,onErrorPart:a,onToolCallStreamingStartPart:l,onToolCallDeltaPart:c,onToolCallPart:u,onToolResultPart:d,onMessageAnnotationsPart:p,onFinishMessagePart:h,onFinishStepPart:m,onStartStepPart:b}){const y=e.getReader(),v=new TextDecoder,w=[];let _=0;for(;;){const{value:R}=await y.read();if(R&&(w.push(R),_+=R.length,R[R.length-1]!==aSe))continue;if(w.length===0)break;const C=lSe(w,_);_=0;const E=v.decode(C,{stream:!0}).split(`
394
+ `).filter(P=>P!=="").map(sSe);for(const{type:P,value:A}of E)switch(P){case"text":await(t==null?void 0:t(A));break;case"reasoning":await(n==null?void 0:n(A));break;case"reasoning_signature":await(r==null?void 0:r(A));break;case"redacted_reasoning":await(o==null?void 0:o(A));break;case"source":await(i==null?void 0:i(A));break;case"data":await(s==null?void 0:s(A));break;case"error":await(a==null?void 0:a(A));break;case"message_annotations":await(p==null?void 0:p(A));break;case"tool_call_streaming_start":await(l==null?void 0:l(A));break;case"tool_call_delta":await(c==null?void 0:c(A));break;case"tool_call":await(u==null?void 0:u(A));break;case"tool_result":await(d==null?void 0:d(A));break;case"finish_message":await(h==null?void 0:h(A));break;case"finish_step":await(m==null?void 0:m(A));break;case"start_step":await(b==null?void 0:b(A));break;default:{const I=P;throw new Error(`Unknown stream part type: ${I}`)}}}}async function uSe({stream:e,update:t,onToolCall:n,onFinish:r,generateId:o=ER,getCurrentDate:i=()=>new Date,lastMessage:s}){var a,l;const c=(s==null?void 0:s.role)==="assistant";let u=c?1+((l=(a=s.toolInvocations)==null?void 0:a.reduce((E,P)=>{var A;return Math.max(E,(A=P.step)!=null?A:0)},0))!=null?l:0):0;const d=c?structuredClone(s):{id:o(),createdAt:i(),role:"assistant",content:"",parts:[]};let p,h,m;function b(E,P){const A=d.parts.find(I=>I.type==="tool-invocation"&&I.toolInvocation.toolCallId===E);A!=null?A.toolInvocation=P:d.parts.push({type:"tool-invocation",toolInvocation:P})}const y=[];let v=c?s==null?void 0:s.annotations:void 0;const w={};let _={completionTokens:NaN,promptTokens:NaN,totalTokens:NaN},R="unknown";function C(){const E=[...y];v!=null&&v.length&&(d.annotations=v);const P={...structuredClone(d),revisionId:o()};t({message:P,data:E,replaceLastMessage:c})}await cSe({stream:e,onTextPart(E){p==null?(p={type:"text",text:E},d.parts.push(p)):p.text+=E,d.content+=E,C()},onReasoningPart(E){var P;m==null?(m={type:"text",text:E},h!=null&&h.details.push(m)):m.text+=E,h==null?(h={type:"reasoning",reasoning:E,details:[m]},d.parts.push(h)):h.reasoning+=E,d.reasoning=((P=d.reasoning)!=null?P:"")+E,C()},onReasoningSignaturePart(E){m!=null&&(m.signature=E.signature)},onRedactedReasoningPart(E){h==null&&(h={type:"reasoning",reasoning:"",details:[]},d.parts.push(h)),h.details.push({type:"redacted",data:E.data}),m=void 0,C()},onSourcePart(E){d.parts.push({type:"source",source:E}),C()},onToolCallStreamingStartPart(E){d.toolInvocations==null&&(d.toolInvocations=[]),w[E.toolCallId]={text:"",step:u,toolName:E.toolName,index:d.toolInvocations.length};const P={state:"partial-call",step:u,toolCallId:E.toolCallId,toolName:E.toolName,args:void 0};d.toolInvocations.push(P),b(E.toolCallId,P),C()},onToolCallDeltaPart(E){const P=w[E.toolCallId];P.text+=E.argsTextDelta;const{value:A}=H1e(P.text),I={state:"partial-call",step:P.step,toolCallId:E.toolCallId,toolName:P.toolName,args:A};d.toolInvocations[P.index]=I,b(E.toolCallId,I),C()},async onToolCallPart(E){const P={state:"call",step:u,...E};if(w[E.toolCallId]!=null?d.toolInvocations[w[E.toolCallId].index]=P:(d.toolInvocations==null&&(d.toolInvocations=[]),d.toolInvocations.push(P)),b(E.toolCallId,P),C(),n){const A=await n({toolCall:E});if(A!=null){const I={state:"result",step:u,...E,result:A};d.toolInvocations[d.toolInvocations.length-1]=I,b(E.toolCallId,I),C()}}},onToolResultPart(E){const P=d.toolInvocations;if(P==null)throw new Error("tool_result must be preceded by a tool_call");const A=P.findIndex(F=>F.toolCallId===E.toolCallId);if(A===-1)throw new Error("tool_result must be preceded by a tool_call with the same toolCallId");const I={...P[A],state:"result",...E};P[A]=I,b(E.toolCallId,I),C()},onDataPart(E){y.push(...E),C()},onMessageAnnotationsPart(E){v==null?v=[...E]:v.push(...E),C()},onFinishStepPart(E){u+=1,p=E.isContinued?p:void 0,h=void 0,m=void 0},onStartStepPart(E){c||(d.id=E.messageId)},onFinishMessagePart(E){R=E.finishReason,E.usage!=null&&(_=z1e(E.usage))},onErrorPart(E){throw new Error(E)}}),r==null||r({message:d,finishReason:R,usage:_})}async function dSe({stream:e,onTextPart:t}){const n=e.pipeThrough(new TextDecoderStream).getReader();for(;;){const{done:r,value:o}=await n.read();if(r)break;await t(o)}}async function fSe({stream:e,update:t,onFinish:n,getCurrentDate:r=()=>new Date,generateId:o=ER}){const i={type:"text",text:""},s={id:o(),createdAt:r(),role:"assistant",content:"",parts:[i]};await dSe({stream:e,onTextPart:a=>{s.content+=a,i.text+=a,t({message:{...s},data:[],replaceLastMessage:!1})}}),n==null||n(s,{usage:{completionTokens:NaN,promptTokens:NaN,totalTokens:NaN},finishReason:"unknown"})}var hSe=()=>fetch;async function pSe({api:e,body:t,streamProtocol:n="data",credentials:r,headers:o,abortController:i,restoreMessagesOnFailure:s,onResponse:a,onUpdate:l,onFinish:c,onToolCall:u,generateId:d,fetch:p=hSe(),lastMessage:h}){var m,b;const y=await p(e,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",...o},signal:(m=i==null?void 0:i())==null?void 0:m.signal,credentials:r}).catch(v=>{throw s(),v});if(a)try{await a(y)}catch(v){throw v}if(!y.ok)throw s(),new Error((b=await y.text())!=null?b:"Failed to fetch the chat response.");if(!y.body)throw new Error("The response body is empty.");switch(n){case"text":{await fSe({stream:y.body,update:l,onFinish:c,generateId:d});return}case"data":{await uSe({stream:y.body,update:l,lastMessage:h,onToolCall:u,onFinish({message:v,finishReason:w,usage:_}){c&&v!=null&&c(v,{usage:_,finishReason:w})},generateId:d});return}default:{const v=n;throw new Error(`Unknown stream protocol: ${v}`)}}}function b_(e){return e==null?void 0:e.reduce((t,n)=>{var r;return Math.max(t,(r=n.step)!=null?r:0)},0)}function M8(e){var t;return(t=e.parts)!=null?t:[...e.toolInvocations?e.toolInvocations.map(n=>({type:"tool-invocation",toolInvocation:n})):[],...e.reasoning?[{type:"reasoning",reasoning:e.reasoning,details:[{type:"text",text:e.reasoning}]}]:[],...e.content?[{type:"text",text:e.content}]:[]]}function Bw(e){return e.map(t=>({...t,parts:M8(t)}))}function y_(e,t){if(e===t)return!0;if(e==null||t==null)return!1;if(typeof e!="object"&&typeof t!="object")return e===t;if(e.constructor!==t.constructor)return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(Array.isArray(e)){if(e.length!==t.length)return!1;for(let o=0;o<e.length;o++)if(!y_(e[o],t[o]))return!1;return!0}const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n)if(!r.includes(o)||!y_(e[o],t[o]))return!1;return!0}async function DD(e){if(!e)return[];if(e instanceof FileList)return Promise.all(Array.from(e).map(async t=>{const{name:n,type:r}=t,o=await new Promise((i,s)=>{const a=new FileReader;a.onload=l=>{var c;i((c=l.target)==null?void 0:c.result)},a.onerror=l=>s(l),a.readAsDataURL(t)});return{name:n,contentType:r,url:o}}));if(Array.isArray(e))return e;throw new Error("Invalid attachments type")}function gSe({originalMaxToolInvocationStep:e,originalMessageCount:t,maxSteps:n,messages:r}){var o;const i=r[r.length-1];return n>1&&i!=null&&(r.length>t||b_(i.toolInvocations)!==e)&&A8(i)&&!mSe(i)&&((o=b_(i.toolInvocations))!=null?o:0)<n}function mSe(e){let t=!1;return e.parts.forEach(n=>{n.type==="text"&&(t=!0),n.type==="tool-invocation"&&(t=!1)}),t}function A8(e){return e.role==="assistant"&&e.parts.filter(t=>t.type==="tool-invocation").every(t=>"result"in t.toolInvocation)}function bSe({messages:e,toolCallId:t,toolResult:n}){var r;const o=e[e.length-1],i=o.parts.find(a=>a.type==="tool-invocation"&&a.toolInvocation.toolCallId===t);if(i==null)return;const s={...i.toolInvocation,state:"result",result:n};i.toolInvocation=s,o.toolInvocations=(r=o.toolInvocations)==null?void 0:r.map(a=>a.toolCallId===t?s:a)}var D8=Y_();const I8=0,N8=1,F8=2,ID=3;var ND=Object.prototype.hasOwnProperty;function v_(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--&&v_(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(ND.call(e,n)&&++r&&!ND.call(t,n)||!(n in t)||!v_(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const Vs=new WeakMap,Ha=()=>{},Qr=Ha(),x_=Object,Yt=e=>e===Qr,es=e=>typeof e=="function",rl=(e,t)=>({...e,...t}),L8=e=>es(e.then),Hw={},Wm={},TR="undefined",Qp=typeof window!=TR,w_=typeof document!=TR,ySe=Qp&&"Deno"in window,vSe=()=>Qp&&typeof window.requestAnimationFrame!=TR,$8=(e,t)=>{const n=Vs.get(e);return[()=>!Yt(t)&&e.get(t)||Hw,r=>{if(!Yt(t)){const o=e.get(t);t in Wm||(Wm[t]=o),n[5](t,rl(o,r),o||Hw)}},n[6],()=>!Yt(t)&&t in Wm?Wm[t]:!Yt(t)&&e.get(t)||Hw]};let S_=!0;const xSe=()=>S_,[__,C_]=Qp&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Ha,Ha],wSe=()=>{const e=w_&&document.visibilityState;return Yt(e)||e!=="hidden"},SSe=e=>(w_&&document.addEventListener("visibilitychange",e),__("focus",e),()=>{w_&&document.removeEventListener("visibilitychange",e),C_("focus",e)}),_Se=e=>{const t=()=>{S_=!0,e()},n=()=>{S_=!1};return __("online",t),__("offline",n),()=>{C_("online",t),C_("offline",n)}},CSe={isOnline:xSe,isVisible:wSe},ESe={initFocus:SSe,initReconnect:_Se},FD=!k.useId,lp=!Qp||ySe,RSe=e=>vSe()?window.requestAnimationFrame(e):setTimeout(e,1),Ww=lp?k.useEffect:k.useLayoutEffect,Vw=typeof navigator<"u"&&navigator.connection,LD=!lp&&Vw&&(["slow-2g","2g"].includes(Vw.effectiveType)||Vw.saveData),Vm=new WeakMap,Uw=(e,t)=>x_.prototype.toString.call(e)===`[object ${t}]`;let TSe=0;const E_=e=>{const t=typeof e,n=Uw(e,"Date"),r=Uw(e,"RegExp"),o=Uw(e,"Object");let i,s;if(x_(e)===e&&!n&&!r){if(i=Vm.get(e),i)return i;if(i=++TSe+"~",Vm.set(e,i),Array.isArray(e)){for(i="@",s=0;s<e.length;s++)i+=E_(e[s])+",";Vm.set(e,i)}if(o){i="#";const a=x_.keys(e).sort();for(;!Yt(s=a.pop());)Yt(e[s])||(i+=s+":"+E_(e[s])+",");Vm.set(e,i)}}else i=n?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return i},kR=e=>{if(es(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?E_(e):"",[e,t]};let kSe=0;const R_=()=>++kSe;async function j8(...e){const[t,n,r,o]=e,i=rl({populateCache:!0,throwOnError:!0},typeof o=="boolean"?{revalidate:o}:o||{});let s=i.populateCache;const a=i.rollbackOnError;let l=i.optimisticData;const c=p=>typeof a=="function"?a(p):a!==!1,u=i.throwOnError;if(es(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]=kR(p);if(!h)return;const[m,b]=$8(t,h),[y,v,w,_]=Vs.get(t),R=()=>{const X=y[h];return(es(i.revalidate)?i.revalidate(m().data,p):i.revalidate!==!1)&&(delete w[h],delete _[h],X&&X[0])?X[0](F8).then(()=>m().data):m().data};if(e.length<3)return R();let C=r,E;const P=R_();v[h]=[P,0];const A=!Yt(l),I=m(),F=I.data,L=I._c,j=Yt(L)?F:L;if(A&&(l=es(l)?l(j,F):l,b({data:l,_c:j})),es(C))try{C=C(j)}catch(X){E=X}if(C&&L8(C))if(C=await C.catch(X=>{E=X}),P!==v[h][0]){if(E)throw E;return C}else E&&A&&c(E)&&(s=!0,b({data:j,_c:Qr}));if(s&&!E)if(es(s)){const X=s(C,j);b({data:X,error:Qr,_c:Qr})}else b({data:C,error:Qr,_c:Qr});if(v[h][1]=R_(),Promise.resolve(R()).then(()=>{b({_c:Qr})}),E){if(u)throw E;return}return C}}const $D=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},PSe=(e,t)=>{if(!Vs.has(e)){const n=rl(ESe,t),r={},o=j8.bind(Qr,e);let i=Ha;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(!Vs.has(e)&&(Vs.set(e,[r,{},{},{},o,l,a]),!lp)){const u=n.initFocus(setTimeout.bind(Qr,$D.bind(Qr,r,I8))),d=n.initReconnect(setTimeout.bind(Qr,$D.bind(Qr,r,N8)));i=()=>{u&&u(),d&&d(),Vs.delete(e)}}};return c(),[e,o,c,i]}return[e,Vs.get(e)[4]]},OSe=(e,t,n,r,o)=>{const i=n.errorRetryCount,s=o.retryCount,a=~~((Math.random()+.5)*(1<<(s<8?s:8)))*n.errorRetryInterval;!Yt(i)&&s>i||setTimeout(r,a,o)},MSe=v_,[z8,ASe]=PSe(new Map),DSe=rl({onLoadingSlow:Ha,onSuccess:Ha,onError:Ha,onErrorRetry:OSe,onDiscarded:Ha,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:LD?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:LD?5e3:3e3,compare:MSe,isPaused:()=>!1,cache:z8,mutate:ASe,fallback:{}},CSe),ISe=(e,t)=>{const n=rl(e,t);if(t){const{use:r,fallback:o}=e,{use:i,fallback:s}=t;r&&i&&(n.use=r.concat(i)),o&&s&&(n.fallback=rl(o,s))}return n},NSe=k.createContext({}),FSe="$inf$",B8=Qp&&window.__SWR_DEVTOOLS_USE__,LSe=B8?window.__SWR_DEVTOOLS_USE__:[],$Se=()=>{B8&&(window.__SWR_DEVTOOLS_REACT__=k)},jSe=e=>es(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],zSe=()=>rl(DSe,k.useContext(NSe)),BSe=e=>(t,n,r)=>e(t,n&&((...i)=>{const[s]=kR(t),[,,,a]=Vs.get(z8);if(s.startsWith(FSe))return n(...i);const l=a[s];return Yt(l)?n(...i):(delete a[s],l)}),r),HSe=LSe.concat(BSe),WSe=e=>function(...n){const r=zSe(),[o,i,s]=jSe(n),a=ISe(r,s);let l=e;const{use:c}=a,u=(c||[]).concat(HSe);for(let d=u.length;d--;)l=u[d](l);return l(o,i||a.fetcher||null,a)},VSe=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const o=r.indexOf(n);o>=0&&(r[o]=r[r.length-1],r.pop())}};$Se();const Gw=k.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}}),qw={dedupe:!0},USe=(e,t,n)=>{const{cache:r,compare:o,suspense:i,fallbackData:s,revalidateOnMount:a,revalidateIfStale:l,refreshInterval:c,refreshWhenHidden:u,refreshWhenOffline:d,keepPreviousData:p}=n,[h,m,b,y]=Vs.get(r),[v,w]=kR(e),_=k.useRef(!1),R=k.useRef(!1),C=k.useRef(v),E=k.useRef(t),P=k.useRef(n),A=()=>P.current,I=()=>A().isVisible()&&A().isOnline(),[F,L,j,X]=$8(r,v),U=k.useRef({}).current,$=Yt(s)?Yt(n.fallback)?Qr:n.fallback[v]:s,B=(ge,ue)=>{for(const Ce in U){const ke=Ce;if(ke==="data"){if(!o(ge[ke],ue[ke])&&(!Yt(ge[ke])||!o(K,ue[ke])))return!1}else if(ue[ke]!==ge[ke])return!1}return!0},W=k.useMemo(()=>{const ge=!v||!t?!1:Yt(a)?A().isPaused()||i?!1:l!==!1:a,ue=Je=>{const it=rl(Je);return delete it._k,ge?{isValidating:!0,isLoading:!0,...it}:it},Ce=F(),ke=X(),Ne=ue(Ce),Oe=Ce===ke?Ne:ue(ke);let Le=Ne;return[()=>{const Je=ue(F());return B(Je,Le)?(Le.data=Je.data,Le.isLoading=Je.isLoading,Le.isValidating=Je.isValidating,Le.error=Je.error,Le):(Le=Je,Je)},()=>Oe]},[r,v]),q=D8.useSyncExternalStore(k.useCallback(ge=>j(v,(ue,Ce)=>{B(Ce,ue)||ge()}),[r,v]),W[0],W[1]),Q=!_.current,D=h[v]&&h[v].length>0,G=q.data,V=Yt(G)?$&&L8($)?Gw($):$:G,M=q.error,ee=k.useRef(V),K=p?Yt(G)?Yt(ee.current)?V:ee.current:G:V,re=D&&!Yt(M)?!1:Q&&!Yt(a)?a:A().isPaused()?!1:i?Yt(V)?!1:l:Yt(V)||l,Y=!!(v&&t&&Q&&re),J=Yt(q.isValidating)?Y:q.isValidating,ie=Yt(q.isLoading)?Y:q.isLoading,de=k.useCallback(async ge=>{const ue=E.current;if(!v||!ue||R.current||A().isPaused())return!1;let Ce,ke,Ne=!0;const Oe=ge||{},Le=!b[v]||!Oe.dedupe,Je=()=>FD?!R.current&&v===C.current&&_.current:v===C.current,it={isValidating:!1,isLoading:!1},ln=()=>{L(it)},vt=()=>{const Ct=b[v];Ct&&Ct[1]===ke&&delete b[v]},$n={isValidating:!0};Yt(F().data)&&($n.isLoading=!0);try{if(Le&&(L($n),n.loadingTimeout&&Yt(F().data)&&setTimeout(()=>{Ne&&Je()&&A().onLoadingSlow(v,n)},n.loadingTimeout),b[v]=[ue(w),R_()]),[Ce,ke]=b[v],Ce=await Ce,Le&&setTimeout(vt,n.dedupingInterval),!b[v]||b[v][1]!==ke)return Le&&Je()&&A().onDiscarded(v),!1;it.error=Qr;const Ct=m[v];if(!Yt(Ct)&&(ke<=Ct[0]||ke<=Ct[1]||Ct[1]===0))return ln(),Le&&Je()&&A().onDiscarded(v),!1;const fe=F().data;it.data=o(fe,Ce)?fe:Ce,Le&&Je()&&A().onSuccess(Ce,v,n)}catch(Ct){vt();const fe=A(),{shouldRetryOnError:_e}=fe;fe.isPaused()||(it.error=Ct,Le&&Je()&&(fe.onError(Ct,v,fe),(_e===!0||es(_e)&&_e(Ct))&&(!A().revalidateOnFocus||!A().revalidateOnReconnect||I())&&fe.onErrorRetry(Ct,v,fe,He=>{const Ve=h[v];Ve&&Ve[0]&&Ve[0](ID,He)},{retryCount:(Oe.retryCount||0)+1,dedupe:!0})))}return Ne=!1,ln(),!0},[v,r]),he=k.useCallback((...ge)=>j8(r,C.current,...ge),[]);if(Ww(()=>{E.current=t,P.current=n,Yt(G)||(ee.current=G)}),Ww(()=>{if(!v)return;const ge=de.bind(Qr,qw);let ue=0;const ke=VSe(v,h,(Ne,Oe={})=>{if(Ne==I8){const Le=Date.now();A().revalidateOnFocus&&Le>ue&&I()&&(ue=Le+A().focusThrottleInterval,ge())}else if(Ne==N8)A().revalidateOnReconnect&&I()&&ge();else{if(Ne==F8)return de();if(Ne==ID)return de(Oe)}});return R.current=!1,C.current=v,_.current=!0,L({_k:w}),re&&(Yt(V)||lp?ge():RSe(ge)),()=>{R.current=!0,ke()}},[v]),Ww(()=>{let ge;function ue(){const ke=es(c)?c(F().data):c;ke&&ge!==-1&&(ge=setTimeout(Ce,ke))}function Ce(){!F().error&&(u||A().isVisible())&&(d||A().isOnline())?de(qw).then(ue):ue()}return ue(),()=>{ge&&(clearTimeout(ge),ge=-1)}},[c,u,d,v]),k.useDebugValue(K),i&&Yt(V)&&v){if(!FD&&lp)throw new Error("Fallback data is required when using Suspense in SSR.");E.current=t,P.current=n,R.current=!1;const ge=y[v];if(!Yt(ge)){const ue=he(ge);Gw(ue)}if(Yt(M)){const ue=de(qw);Yt(K)||(ue.status="fulfilled",ue.value=!0),Gw(ue)}else throw M}return{mutate:he,get data(){return U.data=!0,K},get error(){return U.error=!0,M},get isValidating(){return U.isValidating=!0,J},get isLoading(){return U.isLoading=!0,ie}}},Um=WSe(USe);function GSe(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(...i){clearTimeout(n);const s=Date.now(),a=s-r,l=t-a;l<=0?(r=s,e.apply(this,i)):n=setTimeout(()=>{r=Date.now(),e.apply(this,i)},l)}}var qSe=GSe;const YSe=ol(qSe);function jD(e,t){return t!=null?YSe(e,t):e}function KSe(e){const[t,n]=k.useState(e);return k.useEffect(()=>{y_(e,t)||n(e)},[e,t]),t}function H8({api:e="/api/chat",id:t,initialMessages:n,initialInput:r="",sendExtraMessageFields:o,onToolCall:i,experimental_prepareRequestBody:s,maxSteps:a=1,streamProtocol:l="data",onResponse:c,onFinish:u,onError:d,credentials:p,headers:h,body:m,generateId:b=ER,fetch:y,keepLastMessageOnError:v=!0,experimental_throttle:w}={}){const[_]=k.useState(b),R=t??_,C=typeof e=="string"?[e,R]:R,E=KSe(n??[]),P=k.useMemo(()=>Bw(E),[E]),{data:A,mutate:I}=Um([C,"messages"],null,{fallbackData:P}),F=k.useRef(A||[]);k.useEffect(()=>{F.current=A||[]},[A]);const{data:L,mutate:j}=Um([C,"streamData"],null),X=k.useRef(L);k.useEffect(()=>{X.current=L},[L]);const{data:U="ready",mutate:$}=Um([C,"status"],null),{data:B=void 0,mutate:W}=Um([C,"error"],null),q=k.useRef(null),Q=k.useRef({credentials:p,headers:h,body:m});k.useEffect(()=>{Q.current={credentials:p,headers:h,body:m}},[p,h,m]);const D=k.useCallback(async he=>{var se,ge;$("submitted"),W(void 0);const ue=Bw(he.messages),Ce=ue.length,ke=b_((se=ue[ue.length-1])==null?void 0:se.toolInvocations);try{const Oe=new AbortController;q.current=Oe;const Le=jD(I,w),Je=jD(j,w),it=F.current;Le(ue,!1);const ln=o?ue:ue.map(({role:$n,content:Ct,experimental_attachments:fe,data:_e,annotations:He,toolInvocations:Ve,parts:rt})=>({role:$n,content:Ct,...fe!==void 0&&{experimental_attachments:fe},..._e!==void 0&&{data:_e},...He!==void 0&&{annotations:He},...Ve!==void 0&&{toolInvocations:Ve},...rt!==void 0&&{parts:rt}})),vt=X.current;await pSe({api:e,body:(ge=s==null?void 0:s({id:R,messages:ue,requestData:he.data,requestBody:he.body}))!=null?ge:{id:R,messages:ln,data:he.data,...Q.current.body,...he.body},streamProtocol:l,credentials:Q.current.credentials,headers:{...Q.current.headers,...he.headers},abortController:()=>q.current,restoreMessagesOnFailure(){v||Le(it,!1)},onResponse:c,onUpdate({message:$n,data:Ct,replaceLastMessage:fe}){$("streaming"),Le([...fe?ue.slice(0,ue.length-1):ue,$n],!1),Ct!=null&&Ct.length&&Je([...vt??[],...Ct],!1)},onToolCall:i,onFinish:u,generateId:b,fetch:y,lastMessage:ue[ue.length-1]}),q.current=null,$("ready")}catch(Oe){if(Oe.name==="AbortError")return q.current=null,$("ready"),null;d&&Oe instanceof Error&&d(Oe),W(Oe),$("error")}const Ne=F.current;gSe({originalMaxToolInvocationStep:ke,originalMessageCount:Ce,maxSteps:a,messages:Ne})&&await D({messages:Ne})},[I,$,e,Q,c,u,d,W,j,X,l,o,s,i,a,F,q,b,y,v,w,R]),G=k.useCallback(async(he,{data:se,headers:ge,body:ue,experimental_attachments:Ce}={})=>{var ke,Ne;const Oe=await DD(Ce),Le=F.current.concat({...he,id:(ke=he.id)!=null?ke:b(),createdAt:(Ne=he.createdAt)!=null?Ne:new Date,experimental_attachments:Oe.length>0?Oe:void 0,parts:M8(he)});return D({messages:Le,headers:ge,body:ue,data:se})},[D,b]),V=k.useCallback(async({data:he,headers:se,body:ge}={})=>{const ue=F.current;if(ue.length===0)return null;const Ce=ue[ue.length-1];return D({messages:Ce.role==="assistant"?ue.slice(0,-1):ue,headers:se,body:ge,data:he})},[D]),M=k.useCallback(()=>{q.current&&(q.current.abort(),q.current=null)},[]),ee=k.useCallback(he=>{typeof he=="function"&&(he=he(F.current));const se=Bw(he);I(se,!1),F.current=se},[I]),K=k.useCallback(he=>{typeof he=="function"&&(he=he(X.current)),j(he,!1),X.current=he},[j]),[re,Y]=k.useState(r),J=k.useCallback(async(he,se={},ge)=>{var ue;if((ue=he==null?void 0:he.preventDefault)==null||ue.call(he),!re&&!se.allowEmptySubmit)return;ge&&(Q.current={...Q.current,...ge});const Ce=await DD(se.experimental_attachments),Ne={messages:F.current.concat({id:b(),createdAt:new Date,role:"user",content:re,experimental_attachments:Ce.length>0?Ce:void 0,parts:[{type:"text",text:re}]}),headers:se.headers,body:se.body,data:se.data};D(Ne),Y("")},[re,b,D]),ie=he=>{Y(he.target.value)},de=k.useCallback(({toolCallId:he,result:se})=>{const ge=F.current;bSe({messages:ge,toolCallId:he,toolResult:se}),I(ge,!1);const ue=ge[ge.length-1];A8(ue)&&D({messages:ge})},[I,D]);return{messages:A??[],id:R,setMessages:ee,data:L,setData:K,error:B,append:G,reload:V,stop:M,input:re,setInput:Y,handleInputChange:ie,handleSubmit:J,isLoading:U==="submitted"||U==="streaming",status:U,addToolResult:de}}var PR="Collapsible",[XSe,W8]=lr(PR),[QSe,OR]=XSe(PR),V8=T.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:s,...a}=e,[l=!1,c]=$r({prop:r,defaultProp:o,onChange:s});return x.jsx(QSe,{scope:n,disabled:i,contentId:Jn(),open:l,onOpenToggle:T.useCallback(()=>c(u=>!u),[c]),children:x.jsx(je.div,{"data-state":IR(l),"data-disabled":i?"":void 0,...a,ref:t})})});V8.displayName=PR;var U8="CollapsibleTrigger",MR=T.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=OR(U8,n);return x.jsx(je.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":IR(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:Te(e.onClick,o.onOpenToggle)})});MR.displayName=U8;var AR="CollapsibleContent",DR=T.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=OR(AR,e.__scopeCollapsible);return x.jsx(er,{present:n||o.open,children:({present:i})=>x.jsx(ZSe,{...r,ref:t,present:i})})});DR.displayName=AR;var ZSe=T.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,s=OR(AR,n),[a,l]=T.useState(r),c=T.useRef(null),u=dt(t,c),d=T.useRef(0),p=d.current,h=T.useRef(0),m=h.current,b=s.open||a,y=T.useRef(b),v=T.useRef(void 0);return T.useEffect(()=>{const w=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(w)},[]),Cr(()=>{const w=c.current;if(w){v.current=v.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,y.current||(w.style.transitionDuration=v.current.transitionDuration,w.style.animationName=v.current.animationName),l(r)}},[s.open,r]),x.jsx(je.div,{"data-state":IR(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!b,...i,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&&o})});function IR(e){return e?"open":"closed"}var G8=V8,JSe=MR,e_e=DR;const t_e=G8,n_e=MR,r_e=DR;function o_e(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const i_e=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,s_e=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,a_e={};function zD(e,t){return(a_e.jsx?s_e:i_e).test(e)}const l_e=/[ \t\n\f\r]/g;function c_e(e){return typeof e=="object"?e.type==="text"?BD(e.value):!1:BD(e)}function BD(e){return e.replace(l_e,"")===""}class Zp{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Zp.prototype.normal={};Zp.prototype.property={};Zp.prototype.space=void 0;function q8(e,t){const n={},r={};for(const o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new Zp(n,r,t)}function T_(e){return e.toLowerCase()}class _o{constructor(t,n){this.attribute=n,this.property=t}}_o.prototype.attribute="";_o.prototype.booleanish=!1;_o.prototype.boolean=!1;_o.prototype.commaOrSpaceSeparated=!1;_o.prototype.commaSeparated=!1;_o.prototype.defined=!1;_o.prototype.mustUseProperty=!1;_o.prototype.number=!1;_o.prototype.overloadedBoolean=!1;_o.prototype.property="";_o.prototype.spaceSeparated=!1;_o.prototype.space=void 0;let u_e=0;const mt=Vc(),Xn=Vc(),Y8=Vc(),Pe=Vc(),xn=Vc(),Wu=Vc(),Do=Vc();function Vc(){return 2**++u_e}const k_=Object.freeze(Object.defineProperty({__proto__:null,boolean:mt,booleanish:Xn,commaOrSpaceSeparated:Do,commaSeparated:Wu,number:Pe,overloadedBoolean:Y8,spaceSeparated:xn},Symbol.toStringTag,{value:"Module"})),Yw=Object.keys(k_);class NR extends _o{constructor(t,n,r,o){let i=-1;if(super(t,n),HD(this,"space",o),typeof r=="number")for(;++i<Yw.length;){const s=Yw[i];HD(this,Yw[i],(r&k_[s])===k_[s])}}}NR.prototype.defined=!0;function HD(e,t,n){n&&(e[t]=n)}function Xd(e){const t={},n={};for(const[r,o]of Object.entries(e.properties)){const i=new NR(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[T_(r)]=r,n[T_(i.attribute)]=r}return new Zp(t,n,e.space)}const K8=Xd({properties:{ariaActiveDescendant:null,ariaAtomic:Xn,ariaAutoComplete:null,ariaBusy:Xn,ariaChecked:Xn,ariaColCount:Pe,ariaColIndex:Pe,ariaColSpan:Pe,ariaControls:xn,ariaCurrent:null,ariaDescribedBy:xn,ariaDetails:null,ariaDisabled:Xn,ariaDropEffect:xn,ariaErrorMessage:null,ariaExpanded:Xn,ariaFlowTo:xn,ariaGrabbed:Xn,ariaHasPopup:null,ariaHidden:Xn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:xn,ariaLevel:Pe,ariaLive:null,ariaModal:Xn,ariaMultiLine:Xn,ariaMultiSelectable:Xn,ariaOrientation:null,ariaOwns:xn,ariaPlaceholder:null,ariaPosInSet:Pe,ariaPressed:Xn,ariaReadOnly:Xn,ariaRelevant:null,ariaRequired:Xn,ariaRoleDescription:xn,ariaRowCount:Pe,ariaRowIndex:Pe,ariaRowSpan:Pe,ariaSelected:Xn,ariaSetSize:Pe,ariaSort:null,ariaValueMax:Pe,ariaValueMin:Pe,ariaValueNow:Pe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function X8(e,t){return t in e?e[t]:t}function Q8(e,t){return X8(e,t.toLowerCase())}const d_e=Xd({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Wu,acceptCharset:xn,accessKey:xn,action:null,allow:null,allowFullScreen:mt,allowPaymentRequest:mt,allowUserMedia:mt,alt:null,as:null,async:mt,autoCapitalize:null,autoComplete:xn,autoFocus:mt,autoPlay:mt,blocking:xn,capture:null,charSet:null,checked:mt,cite:null,className:xn,cols:Pe,colSpan:null,content:null,contentEditable:Xn,controls:mt,controlsList:xn,coords:Pe|Wu,crossOrigin:null,data:null,dateTime:null,decoding:null,default:mt,defer:mt,dir:null,dirName:null,disabled:mt,download:Y8,draggable:Xn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:mt,formTarget:null,headers:xn,height:Pe,hidden:mt,high:Pe,href:null,hrefLang:null,htmlFor:xn,httpEquiv:xn,id:null,imageSizes:null,imageSrcSet:null,inert:mt,inputMode:null,integrity:null,is:null,isMap:mt,itemId:null,itemProp:xn,itemRef:xn,itemScope:mt,itemType:xn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:mt,low:Pe,manifest:null,max:null,maxLength:Pe,media:null,method:null,min:null,minLength:Pe,multiple:mt,muted:mt,name:null,nonce:null,noModule:mt,noValidate:mt,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:mt,optimum:Pe,pattern:null,ping:xn,placeholder:null,playsInline:mt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:mt,referrerPolicy:null,rel:xn,required:mt,reversed:mt,rows:Pe,rowSpan:Pe,sandbox:xn,scope:null,scoped:mt,seamless:mt,selected:mt,shadowRootClonable:mt,shadowRootDelegatesFocus:mt,shadowRootMode:null,shape:null,size:Pe,sizes:null,slot:null,span:Pe,spellCheck:Xn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Pe,step:null,style:null,tabIndex:Pe,target:null,title:null,translate:null,type:null,typeMustMatch:mt,useMap:null,value:Xn,width:Pe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:xn,axis:null,background:null,bgColor:null,border:Pe,borderColor:null,bottomMargin:Pe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:mt,declare:mt,event:null,face:null,frame:null,frameBorder:null,hSpace:Pe,leftMargin:Pe,link:null,longDesc:null,lowSrc:null,marginHeight:Pe,marginWidth:Pe,noResize:mt,noHref:mt,noShade:mt,noWrap:mt,object:null,profile:null,prompt:null,rev:null,rightMargin:Pe,rules:null,scheme:null,scrolling:Xn,standby:null,summary:null,text:null,topMargin:Pe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Pe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:mt,disableRemotePlayback:mt,prefix:null,property:null,results:Pe,security:null,unselectable:null},space:"html",transform:Q8}),f_e=Xd({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"},properties:{about:Do,accentHeight:Pe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Pe,amplitude:Pe,arabicForm:null,ascent:Pe,attributeName:null,attributeType:null,azimuth:Pe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Pe,by:null,calcMode:null,capHeight:Pe,className:xn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Pe,diffuseConstant:Pe,direction:null,display:null,dur:null,divisor:Pe,dominantBaseline:null,download:mt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Pe,enableBackground:null,end:null,event:null,exponent:Pe,externalResourcesRequired:null,fill:null,fillOpacity:Pe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Wu,g2:Wu,glyphName:Wu,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Pe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Pe,horizOriginX:Pe,horizOriginY:Pe,id:null,ideographic:Pe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Pe,k:Pe,k1:Pe,k2:Pe,k3:Pe,k4:Pe,kernelMatrix:Do,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Pe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Pe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Pe,overlineThickness:Pe,paintOrder:null,panose1:null,path:null,pathLength:Pe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:xn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Pe,pointsAtY:Pe,pointsAtZ:Pe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Do,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Do,rev:Do,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Do,requiredFeatures:Do,requiredFonts:Do,requiredFormats:Do,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Pe,specularExponent:Pe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Pe,strikethroughThickness:Pe,string:null,stroke:null,strokeDashArray:Do,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Pe,strokeOpacity:Pe,strokeWidth:null,style:null,surfaceScale:Pe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Do,tabIndex:Pe,tableValues:null,target:null,targetX:Pe,targetY:Pe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Do,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Pe,underlineThickness:Pe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Pe,values:null,vAlphabetic:Pe,vMathematical:Pe,vectorEffect:null,vHanging:Pe,vIdeographic:Pe,version:null,vertAdvY:Pe,vertOriginX:Pe,vertOriginY:Pe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Pe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:X8}),Z8=Xd({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),J8=Xd({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Q8}),e9=Xd({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),h_e={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"},p_e=/[A-Z]/g,WD=/-[a-z]/g,g_e=/^data[-\w.:]+$/i;function m_e(e,t){const n=T_(t);let r=t,o=_o;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&g_e.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(WD,y_e);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!WD.test(i)){let s=i.replace(p_e,b_e);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}o=NR}return new o(r,t)}function b_e(e){return"-"+e.toLowerCase()}function y_e(e){return e.charAt(1).toUpperCase()}const v_e=q8([K8,d_e,Z8,J8,e9],"html"),FR=q8([K8,f_e,Z8,J8,e9],"svg");function x_e(e){return e.join(" ").trim()}var LR={},VD=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,w_e=/\n/g,S_e=/^\s*/,__e=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,C_e=/^:\s*/,E_e=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,R_e=/^[;\s]*/,T_e=/^\s+|\s+$/g,k_e=`
395
+ `,UD="/",GD="*",Bl="",P_e="comment",O_e="declaration",M_e=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 o(m){var b=m.match(w_e);b&&(n+=b.length);var y=m.lastIndexOf(k_e);r=~y?m.length-y:r+m.length}function i(){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 y=b[0];return o(y),e=e.slice(y.length),b}}function c(){l(S_e)}function u(m){var b;for(m=m||[];b=d();)b!==!1&&m.push(b);return m}function d(){var m=i();if(!(UD!=e.charAt(0)||GD!=e.charAt(1))){for(var b=2;Bl!=e.charAt(b)&&(GD!=e.charAt(b)||UD!=e.charAt(b+1));)++b;if(b+=2,Bl===e.charAt(b-1))return a("End of comment missing");var y=e.slice(2,b-2);return r+=2,o(y),e=e.slice(b),r+=2,m({type:P_e,comment:y})}}function p(){var m=i(),b=l(__e);if(b){if(d(),!l(C_e))return a("property missing ':'");var y=l(E_e),v=m({type:O_e,property:qD(b[0].replace(VD,Bl)),value:y?qD(y[0].replace(VD,Bl)):Bl});return l(R_e),v}}function h(){var m=[];u(m);for(var b;b=p();)b!==!1&&(m.push(b),u(m));return m}return c(),h()};function qD(e){return e?e.replace(T_e,Bl):Bl}var A_e=Xi&&Xi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(LR,"__esModule",{value:!0});LR.default=I_e;var D_e=A_e(M_e);function I_e(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,D_e.default)(e),o=typeof t=="function";return r.forEach(function(i){if(i.type==="declaration"){var s=i.property,a=i.value;o?t(s,a,i):a&&(n=n||{},n[s]=a)}}),n}var B0={};Object.defineProperty(B0,"__esModule",{value:!0});B0.camelCase=void 0;var N_e=/^--[a-zA-Z0-9_-]+$/,F_e=/-([a-z])/g,L_e=/^[^-]+$/,$_e=/^-(webkit|moz|ms|o|khtml)-/,j_e=/^-(ms)-/,z_e=function(e){return!e||L_e.test(e)||N_e.test(e)},B_e=function(e,t){return t.toUpperCase()},YD=function(e,t){return"".concat(t,"-")},H_e=function(e,t){return t===void 0&&(t={}),z_e(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(j_e,YD):e=e.replace($_e,YD),e.replace(F_e,B_e))};B0.camelCase=H_e;var W_e=Xi&&Xi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},V_e=W_e(LR),U_e=B0;function P_(e,t){var n={};return!e||typeof e!="string"||(0,V_e.default)(e,function(r,o){r&&o&&(n[(0,U_e.camelCase)(r,t)]=o)}),n}P_.default=P_;var G_e=P_;const q_e=ol(G_e),t9=n9("end"),$R=n9("start");function n9(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 Y_e(e){const t=$R(e),n=t9(e);if(t&&n)return{start:t,end:n}}function kh(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?KD(e.position):"start"in e||"end"in e?KD(e):"line"in e||"column"in e?O_(e):""}function O_(e){return XD(e&&e.line)+":"+XD(e&&e.column)}function KD(e){return O_(e&&e.start)+"-"+O_(e&&e.end)}function XD(e){return e&&typeof e=="number"?e:1}class jr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let o="",i={},s=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?o=t:!i.cause&&t&&(s=!0,o=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const a=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=o,this.line=a?a.line:void 0,this.name=kh(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=s&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual,this.expected,this.note,this.url}}jr.prototype.file="";jr.prototype.name="";jr.prototype.reason="";jr.prototype.message="";jr.prototype.stack="";jr.prototype.column=void 0;jr.prototype.line=void 0;jr.prototype.ancestors=void 0;jr.prototype.cause=void 0;jr.prototype.fatal=void 0;jr.prototype.place=void 0;jr.prototype.ruleId=void 0;jr.prototype.source=void 0;const jR={}.hasOwnProperty,K_e=new Map,X_e=/[A-Z]/g,Q_e=new Set(["table","tbody","thead","tfoot","tr"]),Z_e=new Set(["td","th"]),r9="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function J_e(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=aCe(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=sCe(n,t.jsx,t.jsxs)}const o={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"?FR:v_e,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=o9(o,e,void 0);return i&&typeof i!="string"?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function o9(e,t,n){if(t.type==="element")return eCe(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return tCe(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return rCe(e,t,n);if(t.type==="mdxjsEsm")return nCe(e,t);if(t.type==="root")return oCe(e,t,n);if(t.type==="text")return iCe(e,t)}function eCe(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=FR,e.schema=o),e.ancestors.push(t);const i=s9(e,t.tagName,!1),s=lCe(e,t);let a=BR(e,t);return Q_e.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!c_e(l):!0})),i9(e,s,i,t),zR(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function tCe(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)}cp(e,t.position)}function nCe(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);cp(e,t.position)}function rCe(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=FR,e.schema=o),e.ancestors.push(t);const i=t.name===null?e.Fragment:s9(e,t.name,!0),s=cCe(e,t),a=BR(e,t);return i9(e,s,i,t),zR(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function oCe(e,t,n){const r={};return zR(r,BR(e,t)),e.create(t,e.Fragment,r,n)}function iCe(e,t){return t.value}function i9(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function zR(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function sCe(e,t,n){return r;function r(o,i,s,a){const c=Array.isArray(s.children)?n:t;return a?c(i,s,a):c(i,s)}}function aCe(e,t){return n;function n(r,o,i,s){const a=Array.isArray(i.children),l=$R(r);return t(o,i,s,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function lCe(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&jR.call(t.properties,o)){const i=uCe(e,o,t.properties[o]);if(i){const[s,a]=i;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&Z_e.has(t.tagName)?r=a:n[s]=a}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function cCe(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const s=i.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else cp(e,t.position);else{const o=r.name;let i;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,i=e.evaluater.evaluateExpression(a.expression)}else cp(e,t.position);else i=r.value===null?!0:r.value;n[o]=i}return n}function BR(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:K_e;for(;++r<t.children.length;){const i=t.children[r];let s;if(e.passKeys){const l=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(l){const c=o.get(l)||0;s=l+"-"+c,o.set(l,c+1)}}const a=o9(e,i,s);a!==void 0&&n.push(a)}return n}function uCe(e,t,n){const r=m_e(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?o_e(n):x_e(n)),r.property==="style"){let o=typeof n=="object"?n:dCe(e,String(n));return e.stylePropertyNameCase==="css"&&(o=fCe(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?h_e[r.property]||r.property:r.attribute,n]}}function dCe(e,t){try{return q_e(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,o=new jr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=r9+"#cannot-parse-style-attribute",o}}function s9(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let i=-1,s;for(;++i<o.length;){const a=zD(o[i])?{type:"Identifier",name:o[i]}:{type:"Literal",value:o[i]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(i&&a.type==="Literal"),optional:!1}:a}r=s}else r=zD(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const o=r.value;return jR.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);cp(e)}function cp(e,t){const n=new jr("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=r9+"#cannot-handle-mdx-estrees-without-createevaluater",n}function fCe(e){const t={};let n;for(n in e)jR.call(e,n)&&(t[hCe(n)]=e[n]);return t}function hCe(e){let t=e.replace(X_e,pCe);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function pCe(e){return"-"+e.toLowerCase()}const Kw={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"]},gCe={};function mCe(e,t){const n=gCe,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return a9(e,r,o)}function a9(e,t,n){if(bCe(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 QD(e.children,t,n)}return Array.isArray(e)?QD(e,t,n):""}function QD(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=a9(e[o],t,n);return r.join("")}function bCe(e){return!!(e&&typeof e=="object")}const ZD=document.createElement("i");function HR(e){const t="&"+e+";";ZD.innerHTML=t;const n=ZD.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function hs(e,t,n,r){const o=e.length;let i=0,s;if(t<0?t=-t>o?0:o+t:t=t>o?o: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);i<r.length;)s=r.slice(i,i+1e4),s.unshift(t,0),e.splice(...s),i+=1e4,t+=1e4}function si(e,t){return e.length>0?(hs(e,e.length,0,t),e):t}const JD={}.hasOwnProperty;function yCe(e){const t={};let n=-1;for(;++n<e.length;)vCe(t,e[n]);return t}function vCe(e,t){let n;for(n in t){const o=(JD.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let s;if(i)for(s in i){JD.call(o,s)||(o[s]=[]);const a=i[s];xCe(o[s],Array.isArray(a)?a:a?[a]:[])}}}function xCe(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);hs(e,0,0,r)}function l9(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 Vu(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ts=hl(/[A-Za-z]/),$o=hl(/[\dA-Za-z]/),wCe=hl(/[#-'*+\--9=?A-Z^-~]/);function M_(e){return e!==null&&(e<32||e===127)}const A_=hl(/\d/),SCe=hl(/[\dA-Fa-f]/),_Ce=hl(/[!-/:-@[-`{-~]/);function at(e){return e!==null&&e<-2}function wo(e){return e!==null&&(e<0||e===32)}function Jt(e){return e===-2||e===-1||e===32}const CCe=hl(new RegExp("\\p{P}|\\p{S}","u")),ECe=hl(/\s/);function hl(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Qd(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const i=e.charCodeAt(n);let s="";if(i===37&&$o(e.charCodeAt(n+1))&&$o(e.charCodeAt(n+2)))o=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(s=String.fromCharCode(i));else if(i>55295&&i<57344){const a=e.charCodeAt(n+1);i<56320&&a>56319&&a<57344?(s=String.fromCharCode(i,a),o=1):s="�"}else s=String.fromCharCode(i);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+o+1,s=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function Sn(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return s;function s(l){return Jt(l)?(e.enter(n),a(l)):t(l)}function a(l){return Jt(l)&&i++<o?(e.consume(l),a):(e.exit(n),t(l))}}const RCe={tokenize:TCe};function TCe(e){const t=e.attempt(this.parser.constructs.contentInitial,r,o);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Sn(e,t,"linePrefix")}function o(a){return e.enter("paragraph"),i(a)}function i(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 at(a)?(e.consume(a),e.exit("chunkText"),i):(e.consume(a),s)}}const kCe={tokenize:PCe},eI={tokenize:OCe};function PCe(e){const t=this,n=[];let r=0,o,i,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,o&&w();const R=t.events.length;let C=R,E;for(;C--;)if(t.events[C][0]==="exit"&&t.events[C][1].type==="chunkFlow"){E=t.events[C][1].end;break}v(r);let P=R;for(;P<t.events.length;)t.events[P][1].end={...E},P++;return hs(t.events,C+1,0,t.events.slice(R)),t.events.length=P,c(_)}return a(_)}function c(_){if(r===n.length){if(!o)return p(_);if(o.currentConstruct&&o.currentConstruct.concrete)return m(_);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(eI,u,d)(_)}function u(_){return o&&w(),v(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(eI,h,m)(_)}function h(_){return r++,n.push([t.currentConstruct,t.containerState]),p(_)}function m(_){if(_===null){o&&w(),v(0),e.consume(_);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:i}),b(_)}function b(_){if(_===null){y(e.exit("chunkFlow"),!0),v(0),e.consume(_);return}return at(_)?(e.consume(_),y(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(_),b)}function y(_,R){const C=t.sliceStream(_);if(R&&C.push(null),_.previous=i,i&&(i.next=_),i=_,o.defineSkip(_.start),o.write(C),t.parser.lazy[_.start.line]){let E=o.events.length;for(;E--;)if(o.events[E][1].start.offset<s&&(!o.events[E][1].end||o.events[E][1].end.offset>s))return;const P=t.events.length;let A=P,I,F;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){if(I){F=t.events[A][1].end;break}I=!0}for(v(r),E=P;E<t.events.length;)t.events[E][1].end={...F},E++;hs(t.events,A+1,0,t.events.slice(P)),t.events.length=E}}function v(_){let R=n.length;for(;R-- >_;){const C=n[R];t.containerState=C[1],C[0].exit.call(t,e)}n.length=_}function w(){o.write([null]),i=void 0,o=void 0,t.containerState._closeFlow=void 0}}function OCe(e,t,n){return Sn(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function tI(e){if(e===null||wo(e)||ECe(e))return 1;if(CCe(e))return 2}function WR(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const i=e[o].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const D_={name:"attention",resolveAll:MCe,tokenize:ACe};function MCe(e,t){let n=-1,r,o,i,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};nI(d,-l),nI(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},i={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},o={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=si(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=si(c,[["enter",o,t],["enter",s,t],["exit",s,t],["enter",i,t]]),c=si(c,WR(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=si(c,[["exit",i,t],["enter",a,t],["exit",a,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=si(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,hs(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 ACe(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=tI(r);let i;return s;function s(l){return i=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===i)return e.consume(l),a;const c=e.exit("attentionSequence"),u=tI(l),d=!u||u===2&&o||n.includes(l),p=!o||o===2&&u||n.includes(r);return c._open=!!(i===42?d:d&&(o||!p)),c._close=!!(i===42?p:p&&(u||!d)),t(l)}}function nI(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const DCe={name:"autolink",tokenize:ICe};function ICe(e,t,n){let r=0;return o;function o(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(h){return ts(h)?(e.consume(h),s):h===64?n(h):c(h)}function s(h){return h===43||h===45||h===46||$o(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||$o(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||M_(h)?n(h):(e.consume(h),l)}function c(h){return h===64?(e.consume(h),u):wCe(h)?(e.consume(h),c):n(h)}function u(h){return $o(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||$o(h))&&r++<63){const m=h===45?p:d;return e.consume(h),m}return n(h)}}const H0={partial:!0,tokenize:NCe};function NCe(e,t,n){return r;function r(i){return Jt(i)?Sn(e,o,"linePrefix")(i):o(i)}function o(i){return i===null||at(i)?t(i):n(i)}}const c9={continuation:{tokenize:LCe},exit:$Ce,name:"blockQuote",tokenize:FCe};function FCe(e,t,n){const r=this;return o;function o(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"),i}return n(s)}function i(s){return Jt(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function LCe(e,t,n){const r=this;return o;function o(s){return Jt(s)?Sn(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):i(s)}function i(s){return e.attempt(c9,t,n)(s)}}function $Ce(e){e.exit("blockQuote")}const u9={name:"characterEscape",tokenize:jCe};function jCe(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),o}function o(i){return _Ce(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const d9={name:"characterReference",tokenize:zCe};function zCe(e,t,n){const r=this;let o=0,i,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"),i=31,s=$o,u(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,s=SCe,u):(e.enter("characterReferenceValue"),i=7,s=A_,u(d))}function u(d){if(d===59&&o){const p=e.exit("characterReferenceValue");return s===$o&&!HR(r.sliceSerialize(p))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(d)&&o++<i?(e.consume(d),u):n(d)}}const rI={partial:!0,tokenize:HCe},oI={concrete:!0,name:"codeFenced",tokenize:BCe};function BCe(e,t,n){const r=this,o={partial:!0,tokenize:C};let i=0,s=0,a;return l;function l(E){return c(E)}function c(E){const P=r.events[r.events.length-1];return i=P&&P[1].type==="linePrefix"?P[2].sliceSerialize(P[1],!0).length:0,a=E,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(E)}function u(E){return E===a?(s++,e.consume(E),u):s<3?n(E):(e.exit("codeFencedFenceSequence"),Jt(E)?Sn(e,d,"whitespace")(E):d(E))}function d(E){return E===null||at(E)?(e.exit("codeFencedFence"),r.interrupt?t(E):e.check(rI,b,R)(E)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(E))}function p(E){return E===null||at(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(E)):Jt(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Sn(e,h,"whitespace")(E)):E===96&&E===a?n(E):(e.consume(E),p)}function h(E){return E===null||at(E)?d(E):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(E))}function m(E){return E===null||at(E)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(E)):E===96&&E===a?n(E):(e.consume(E),m)}function b(E){return e.attempt(o,R,y)(E)}function y(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),v}function v(E){return i>0&&Jt(E)?Sn(e,w,"linePrefix",i+1)(E):w(E)}function w(E){return E===null||at(E)?e.check(rI,b,R)(E):(e.enter("codeFlowValue"),_(E))}function _(E){return E===null||at(E)?(e.exit("codeFlowValue"),w(E)):(e.consume(E),_)}function R(E){return e.exit("codeFenced"),t(E)}function C(E,P,A){let I=0;return F;function F($){return E.enter("lineEnding"),E.consume($),E.exit("lineEnding"),L}function L($){return E.enter("codeFencedFence"),Jt($)?Sn(E,j,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):j($)}function j($){return $===a?(E.enter("codeFencedFenceSequence"),X($)):A($)}function X($){return $===a?(I++,E.consume($),X):I>=s?(E.exit("codeFencedFenceSequence"),Jt($)?Sn(E,U,"whitespace")($):U($)):A($)}function U($){return $===null||at($)?(E.exit("codeFencedFence"),P($)):A($)}}}function HCe(e,t,n){const r=this;return o;function o(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i)}function i(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const Xw={name:"codeIndented",tokenize:VCe},WCe={partial:!0,tokenize:UCe};function VCe(e,t,n){const r=this;return o;function o(c){return e.enter("codeIndented"),Sn(e,i,"linePrefix",5)(c)}function i(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):at(c)?e.attempt(WCe,s,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||at(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function UCe(e,t,n){const r=this;return o;function o(s){return r.parser.lazy[r.now().line]?n(s):at(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):Sn(e,i,"linePrefix",5)(s)}function i(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):at(s)?o(s):n(s)}}const GCe={name:"codeText",previous:YCe,resolve:qCe,tokenize:KCe};function qCe(e){let t=e.length-4,n=3,r,o;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;)o===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(o=r):(r===t||e[r][1].type==="lineEnding")&&(e[o][1].type="codeTextData",r!==o+2&&(e[o][1].end=e[r-1][1].end,e.splice(o+2,r-o-2),t-=r-o-2,r=o+2),o=void 0);return e}function YCe(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function KCe(e,t,n){let r=0,o,i;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?(i=e.enter("codeTextSequence"),o=0,u(d)):at(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||at(d)?(e.exit("codeTextData"),l(d)):(e.consume(d),c)}function u(d){return d===96?(e.consume(d),o++,u):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(i.type="codeTextData",c(d))}}class XCe{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 o=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return r&&jf(this.left,r),i.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),jf(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),jf(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);jf(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);jf(this.left,n.reverse())}}}function jf(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 f9(e){const t={};let n=-1,r,o,i,s,a,l,c;const u=new XCe(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,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,QCe(u,n)),n=t[n],c=!0);else if(r[1]._container){for(i=n,o=void 0;i--;)if(s=u.get(i),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(o&&(u.get(o)[1].type="lineEndingBlank"),s[1].type="lineEnding",o=i);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;o&&(r[1].end={...u.get(o)[1].start},a=u.slice(o,n),a.unshift(r),u.splice(o,n-o+1,a))}}return hs(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function QCe(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const i=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const a=s.events,l=[],c={};let u,d,p=-1,h=n,m=0,b=0;const y=[b];for(;h;){for(;e.get(++o)[1]!==h;);i.push(o),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,y.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):y.pop(),p=y.length;p--;){const v=a.slice(y[p],y[p+1]),w=i.pop();l.push([w,w+v.length-1]),e.splice(w,2,v)}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 ZCe={resolve:eEe,tokenize:tEe},JCe={partial:!0,tokenize:nEe};function eEe(e){return f9(e),e}function tEe(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),o(a)}function o(a){return a===null?i(a):at(a)?e.check(JCe,s,i)(a):(e.consume(a),o)}function i(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,o}}function nEe(e,t,n){const r=this;return o;function o(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Sn(e,i,"linePrefix")}function i(s){if(s===null||at(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 h9(e,t,n,r,o,i,s,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return d;function d(v){return v===60?(e.enter(r),e.enter(o),e.enter(i),e.consume(v),e.exit(i),p):v===null||v===32||v===41||M_(v)?n(v):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),b(v))}function p(v){return v===62?(e.enter(i),e.consume(v),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(v))}function h(v){return v===62?(e.exit("chunkString"),e.exit(a),p(v)):v===null||v===60||at(v)?n(v):(e.consume(v),v===92?m:h)}function m(v){return v===60||v===62||v===92?(e.consume(v),h):h(v)}function b(v){return!u&&(v===null||v===41||wo(v))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(v)):u<c&&v===40?(e.consume(v),u++,b):v===41?(e.consume(v),u--,b):v===null||v===32||v===40||M_(v)?n(v):(e.consume(v),v===92?y:b)}function y(v){return v===40||v===41||v===92?(e.consume(v),b):b(v)}}function p9(e,t,n,r,o,i){const s=this;let a=0,l;return c;function c(h){return e.enter(r),e.enter(o),e.consume(h),e.exit(o),e.enter(i),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(i),e.enter(o),e.consume(h),e.exit(o),e.exit(r),t):at(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||at(h)||a++>999?(e.exit("chunkString"),u(h)):(e.consume(h),l||(l=!Jt(h)),h===92?p:d)}function p(h){return h===91||h===92||h===93?(e.consume(h),a++,d):d(h)}}function g9(e,t,n,r,o,i){let s;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(o),e.consume(p),e.exit(o),s=p===40?41:p,l):n(p)}function l(p){return p===s?(e.enter(o),e.consume(p),e.exit(o),e.exit(r),t):(e.enter(i),c(p))}function c(p){return p===s?(e.exit(i),l(s)):p===null?n(p):at(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),Sn(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(p))}function u(p){return p===s||p===null||at(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 Ph(e,t){let n;return r;function r(o){return at(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):Jt(o)?Sn(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const rEe={name:"definition",tokenize:iEe},oEe={partial:!0,tokenize:sEe};function iEe(e,t,n){const r=this;let o;return i;function i(h){return e.enter("definition"),s(h)}function s(h){return p9.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return o=Vu(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 wo(h)?Ph(e,c)(h):c(h)}function c(h){return h9(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function u(h){return e.attempt(oEe,d,d)(h)}function d(h){return Jt(h)?Sn(e,p,"whitespace")(h):p(h)}function p(h){return h===null||at(h)?(e.exit("definition"),r.parser.defined.push(o),t(h)):n(h)}}function sEe(e,t,n){return r;function r(a){return wo(a)?Ph(e,o)(a):n(a)}function o(a){return g9(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return Jt(a)?Sn(e,s,"whitespace")(a):s(a)}function s(a){return a===null||at(a)?t(a):n(a)}}const aEe={name:"hardBreakEscape",tokenize:lEe};function lEe(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),o}function o(i){return at(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const cEe={name:"headingAtx",resolve:uEe,tokenize:dEe};function uEe(e,t){let n=e.length-2,r=3,o,i;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&&(o={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},hs(e,r,n-r+1,[["enter",o,t],["enter",i,t],["exit",i,t],["exit",o,t]])),e}function dEe(e,t,n){let r=0;return o;function o(u){return e.enter("atxHeading"),i(u)}function i(u){return e.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&r++<6?(e.consume(u),s):u===null||wo(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||at(u)?(e.exit("atxHeading"),t(u)):Jt(u)?Sn(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||wo(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const fEe=["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"],iI=["pre","script","style","textarea"],hEe={concrete:!0,name:"htmlFlow",resolveTo:mEe,tokenize:bEe},pEe={partial:!0,tokenize:vEe},gEe={partial:!0,tokenize:yEe};function mEe(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 bEe(e,t,n){const r=this;let o,i,s,a,l;return c;function c(M){return u(M)}function u(M){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(M),d}function d(M){return M===33?(e.consume(M),p):M===47?(e.consume(M),i=!0,b):M===63?(e.consume(M),o=3,r.interrupt?t:D):ts(M)?(e.consume(M),s=String.fromCharCode(M),y):n(M)}function p(M){return M===45?(e.consume(M),o=2,h):M===91?(e.consume(M),o=5,a=0,m):ts(M)?(e.consume(M),o=4,r.interrupt?t:D):n(M)}function h(M){return M===45?(e.consume(M),r.interrupt?t:D):n(M)}function m(M){const ee="CDATA[";return M===ee.charCodeAt(a++)?(e.consume(M),a===ee.length?r.interrupt?t:j:m):n(M)}function b(M){return ts(M)?(e.consume(M),s=String.fromCharCode(M),y):n(M)}function y(M){if(M===null||M===47||M===62||wo(M)){const ee=M===47,K=s.toLowerCase();return!ee&&!i&&iI.includes(K)?(o=1,r.interrupt?t(M):j(M)):fEe.includes(s.toLowerCase())?(o=6,ee?(e.consume(M),v):r.interrupt?t(M):j(M)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(M):i?w(M):_(M))}return M===45||$o(M)?(e.consume(M),s+=String.fromCharCode(M),y):n(M)}function v(M){return M===62?(e.consume(M),r.interrupt?t:j):n(M)}function w(M){return Jt(M)?(e.consume(M),w):F(M)}function _(M){return M===47?(e.consume(M),F):M===58||M===95||ts(M)?(e.consume(M),R):Jt(M)?(e.consume(M),_):F(M)}function R(M){return M===45||M===46||M===58||M===95||$o(M)?(e.consume(M),R):C(M)}function C(M){return M===61?(e.consume(M),E):Jt(M)?(e.consume(M),C):_(M)}function E(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),l=M,P):Jt(M)?(e.consume(M),E):A(M)}function P(M){return M===l?(e.consume(M),l=null,I):M===null||at(M)?n(M):(e.consume(M),P)}function A(M){return M===null||M===34||M===39||M===47||M===60||M===61||M===62||M===96||wo(M)?C(M):(e.consume(M),A)}function I(M){return M===47||M===62||Jt(M)?_(M):n(M)}function F(M){return M===62?(e.consume(M),L):n(M)}function L(M){return M===null||at(M)?j(M):Jt(M)?(e.consume(M),L):n(M)}function j(M){return M===45&&o===2?(e.consume(M),B):M===60&&o===1?(e.consume(M),W):M===62&&o===4?(e.consume(M),G):M===63&&o===3?(e.consume(M),D):M===93&&o===5?(e.consume(M),Q):at(M)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(pEe,V,X)(M)):M===null||at(M)?(e.exit("htmlFlowData"),X(M)):(e.consume(M),j)}function X(M){return e.check(gEe,U,V)(M)}function U(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),$}function $(M){return M===null||at(M)?X(M):(e.enter("htmlFlowData"),j(M))}function B(M){return M===45?(e.consume(M),D):j(M)}function W(M){return M===47?(e.consume(M),s="",q):j(M)}function q(M){if(M===62){const ee=s.toLowerCase();return iI.includes(ee)?(e.consume(M),G):j(M)}return ts(M)&&s.length<8?(e.consume(M),s+=String.fromCharCode(M),q):j(M)}function Q(M){return M===93?(e.consume(M),D):j(M)}function D(M){return M===62?(e.consume(M),G):M===45&&o===2?(e.consume(M),D):j(M)}function G(M){return M===null||at(M)?(e.exit("htmlFlowData"),V(M)):(e.consume(M),G)}function V(M){return e.exit("htmlFlow"),t(M)}}function yEe(e,t,n){const r=this;return o;function o(s){return at(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):n(s)}function i(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function vEe(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(H0,t,n)}}const xEe={name:"htmlText",tokenize:wEe};function wEe(e,t,n){const r=this;let o,i,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),_):ts(D)?(e.consume(D),A):n(D)}function c(D){return D===45?(e.consume(D),u):D===91?(e.consume(D),i=0,m):ts(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):at(D)?(s=d,W(D)):(e.consume(D),d)}function p(D){return D===45?(e.consume(D),h):d(D)}function h(D){return D===62?B(D):D===45?p(D):d(D)}function m(D){const G="CDATA[";return D===G.charCodeAt(i++)?(e.consume(D),i===G.length?b:m):n(D)}function b(D){return D===null?n(D):D===93?(e.consume(D),y):at(D)?(s=b,W(D)):(e.consume(D),b)}function y(D){return D===93?(e.consume(D),v):b(D)}function v(D){return D===62?B(D):D===93?(e.consume(D),v):b(D)}function w(D){return D===null||D===62?B(D):at(D)?(s=w,W(D)):(e.consume(D),w)}function _(D){return D===null?n(D):D===63?(e.consume(D),R):at(D)?(s=_,W(D)):(e.consume(D),_)}function R(D){return D===62?B(D):_(D)}function C(D){return ts(D)?(e.consume(D),E):n(D)}function E(D){return D===45||$o(D)?(e.consume(D),E):P(D)}function P(D){return at(D)?(s=P,W(D)):Jt(D)?(e.consume(D),P):B(D)}function A(D){return D===45||$o(D)?(e.consume(D),A):D===47||D===62||wo(D)?I(D):n(D)}function I(D){return D===47?(e.consume(D),B):D===58||D===95||ts(D)?(e.consume(D),F):at(D)?(s=I,W(D)):Jt(D)?(e.consume(D),I):B(D)}function F(D){return D===45||D===46||D===58||D===95||$o(D)?(e.consume(D),F):L(D)}function L(D){return D===61?(e.consume(D),j):at(D)?(s=L,W(D)):Jt(D)?(e.consume(D),L):I(D)}function j(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),o=D,X):at(D)?(s=j,W(D)):Jt(D)?(e.consume(D),j):(e.consume(D),U)}function X(D){return D===o?(e.consume(D),o=void 0,$):D===null?n(D):at(D)?(s=X,W(D)):(e.consume(D),X)}function U(D){return D===null||D===34||D===39||D===60||D===61||D===96?n(D):D===47||D===62||wo(D)?I(D):(e.consume(D),U)}function $(D){return D===47||D===62||wo(D)?I(D):n(D)}function B(D){return D===62?(e.consume(D),e.exit("htmlTextData"),e.exit("htmlText"),t):n(D)}function W(D){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),q}function q(D){return Jt(D)?Sn(e,Q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):Q(D)}function Q(D){return e.enter("htmlTextData"),s(D)}}const VR={name:"labelEnd",resolveAll:EEe,resolveTo:REe,tokenize:TEe},SEe={tokenize:kEe},_Ee={tokenize:PEe},CEe={tokenize:OEe};function EEe(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 o=r.type==="labelImage"?4:2;r.type="data",t+=o}}return e.length!==n.length&&hs(e,0,e.length,n),e}function REe(e,t){let n=e.length,r=0,o,i,s,a;for(;n--;)if(o=e[n][1],i){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[n][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(i=n,o.type!=="labelLink")){r=2;break}}else o.type==="labelEnd"&&(s=n);const l={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[i][1].start},end:{...e[s][1].end}},u={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",l,t],["enter",c,t]],a=si(a,e.slice(i+1,i+r+3)),a=si(a,[["enter",u,t]]),a=si(a,WR(t.parser.constructs.insideSpan.null,e.slice(i+r+4,s-3),t)),a=si(a,[["exit",u,t],e[s-2],e[s-1],["exit",c,t]]),a=si(a,e.slice(s+1)),a=si(a,[["exit",l,t]]),hs(e,i,e.length,a),e}function TEe(e,t,n){const r=this;let o=r.events.length,i,s;for(;o--;)if((r.events[o][1].type==="labelImage"||r.events[o][1].type==="labelLink")&&!r.events[o][1]._balanced){i=r.events[o][1];break}return a;function a(p){return i?i._inactive?d(p):(s=r.parser.defined.includes(Vu(r.sliceSerialize({start:i.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(SEe,u,s?u:d)(p):p===91?e.attempt(_Ee,u,s?c:d)(p):s?u(p):d(p)}function c(p){return e.attempt(CEe,u,d)(p)}function u(p){return t(p)}function d(p){return i._balanced=!0,n(p)}}function kEe(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),o}function o(d){return wo(d)?Ph(e,i)(d):i(d)}function i(d){return d===41?u(d):h9(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function s(d){return wo(d)?Ph(e,l)(d):u(d)}function a(d){return n(d)}function l(d){return d===34||d===39||d===40?g9(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return wo(d)?Ph(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 PEe(e,t,n){const r=this;return o;function o(a){return p9.call(r,e,i,s,"reference","referenceMarker","referenceString")(a)}function i(a){return r.parser.defined.includes(Vu(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function OEe(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),o}function o(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const MEe={name:"labelStartImage",resolveAll:VR.resolveAll,tokenize:AEe};function AEe(e,t,n){const r=this;return o;function o(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),i}function i(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 DEe={name:"labelStartLink",resolveAll:VR.resolveAll,tokenize:IEe};function IEe(e,t,n){const r=this;return o;function o(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),i}function i(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const Qw={name:"lineEnding",tokenize:NEe};function NEe(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Sn(e,t,"linePrefix")}}const mb={name:"thematicBreak",tokenize:FEe};function FEe(e,t,n){let r=0,o;return i;function i(c){return e.enter("thematicBreak"),s(c)}function s(c){return o=c,a(c)}function a(c){return c===o?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||at(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===o?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),Jt(c)?Sn(e,a,"whitespace")(c):a(c))}}const uo={continuation:{tokenize:zEe},exit:HEe,name:"list",tokenize:jEe},LEe={partial:!0,tokenize:WEe},$Ee={partial:!0,tokenize:BEe};function jEe(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[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:A_(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(mb,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 A_(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(H0,r.interrupt?n:u,e.attempt(LEe,p,d))}function u(h){return r.containerState.initialBlankLine=!0,i++,p(h)}function d(h){return Jt(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):n(h)}function p(h){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function zEe(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(H0,o,i);function o(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Sn(e,t,"listItemIndent",r.containerState.size+1)(a)}function i(a){return r.containerState.furtherBlankLines||!Jt(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($Ee,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Sn(e,e.attempt(uo,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function BEe(e,t,n){const r=this;return Sn(e,o,"listItemIndent",r.containerState.size+1);function o(i){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(i):n(i)}}function HEe(e){e.exit(this.containerState.type)}function WEe(e,t,n){const r=this;return Sn(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(i){const s=r.events[r.events.length-1];return!Jt(i)&&s&&s[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const sI={name:"setextUnderline",resolveTo:VEe,tokenize:UEe};function VEe(e,t){let n=e.length,r,o,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",i?(e.splice(o,0,["enter",s,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function UEe(e,t,n){const r=this;let o;return i;function i(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"),o=c,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===o?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),Jt(c)?Sn(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||at(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const GEe={tokenize:qEe};function qEe(e){const t=this,n=e.attempt(H0,r,e.attempt(this.parser.constructs.flowInitial,o,Sn(e,e.attempt(this.parser.constructs.flow,o,e.attempt(ZCe,o)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const YEe={resolveAll:b9()},KEe=m9("string"),XEe=m9("text");function m9(e){return{resolveAll:b9(e==="text"?QEe:void 0),tokenize:t};function t(n){const r=this,o=this.parser.constructs[e],i=n.attempt(o,s,a);return s;function s(u){return c(u)?i(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"),i(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const d=o[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 b9(e){return t;function t(n,r){let o=-1,i;for(;++o<=n.length;)i===void 0?n[o]&&n[o][1].type==="data"&&(i=o,o++):(!n[o]||n[o][1].type!=="data")&&(o!==i+2&&(n[i][1].end=n[o-1][1].end,n.splice(i+2,o-i-2),o=i+2),i=void 0);return e?e(n,r):n}}function QEe(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],o=t.sliceStream(r);let i=o.length,s=-1,a=0,l;for(;i--;){const c=o[i];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){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?s:r.start._bufferIndex+s,_index:r.start._index+i,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 ZEe={42:uo,43:uo,45:uo,48:uo,49:uo,50:uo,51:uo,52:uo,53:uo,54:uo,55:uo,56:uo,57:uo,62:c9},JEe={91:rEe},eRe={[-2]:Xw,[-1]:Xw,32:Xw},tRe={35:cEe,42:mb,45:[sI,mb],60:hEe,61:sI,95:mb,96:oI,126:oI},nRe={38:d9,92:u9},rRe={[-5]:Qw,[-4]:Qw,[-3]:Qw,33:MEe,38:d9,42:D_,60:[DCe,xEe],91:DEe,92:[aEe,u9],93:VR,95:D_,96:GCe},oRe={null:[D_,YEe]},iRe={null:[42,95]},sRe={null:[]},aRe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:iRe,contentInitial:JEe,disable:sRe,document:ZEe,flow:tRe,flowInitial:eRe,insideSpan:oRe,string:nRe,text:rRe},Symbol.toStringTag,{value:"Module"}));function lRe(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 o={},i=[];let s=[],a=[];const l={attempt:P(C),check:P(E),consume:w,enter:_,exit:R,interrupt:P(E,{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&&i.push(t),c;function d(L){return s=si(s,L),y(),s[s.length-1]!==null?[]:(A(t,0),c.events=WR(i,c.events,c),c.events)}function p(L,j){return uRe(h(L),j)}function h(L){return cRe(s,L)}function m(){const{_bufferIndex:L,_index:j,line:X,column:U,offset:$}=r;return{_bufferIndex:L,_index:j,line:X,column:U,offset:$}}function b(L){o[L.line]=L.column,F()}function y(){let L;for(;r._index<s.length;){const j=s[r._index];if(typeof j=="string")for(L=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===L&&r._bufferIndex<j.length;)v(j.charCodeAt(r._bufferIndex));else v(j)}}function v(L){u=u(L)}function w(L){at(L)?(r.line++,r.column=1,r.offset+=L===-3?2:1,F()):L!==-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=L}function _(L,j){const X=j||{};return X.type=L,X.start=m(),c.events.push(["enter",X,c]),a.push(X),X}function R(L){const j=a.pop();return j.end=m(),c.events.push(["exit",j,c]),j}function C(L,j){A(L,j.from)}function E(L,j){j.restore()}function P(L,j){return X;function X(U,$,B){let W,q,Q,D;return Array.isArray(U)?V(U):"tokenize"in U?V([U]):G(U);function G(re){return Y;function Y(J){const ie=J!==null&&re[J],de=J!==null&&re.null,he=[...Array.isArray(ie)?ie:ie?[ie]:[],...Array.isArray(de)?de:de?[de]:[]];return V(he)(J)}}function V(re){return W=re,q=0,re.length===0?B:M(re[q])}function M(re){return Y;function Y(J){return D=I(),Q=re,re.partial||(c.currentConstruct=re),re.name&&c.parser.constructs.disable.null.includes(re.name)?K():re.tokenize.call(j?Object.assign(Object.create(c),j):c,l,ee,K)(J)}}function ee(re){return L(Q,D),$}function K(re){return D.restore(),++q<W.length?M(W[q]):B}}}function A(L,j){L.resolveAll&&!i.includes(L)&&i.push(L),L.resolve&&hs(c.events,j,c.events.length-j,L.resolve(c.events.slice(j),c)),L.resolveTo&&(c.events=L.resolveTo(c.events,c))}function I(){const L=m(),j=c.previous,X=c.currentConstruct,U=c.events.length,$=Array.from(a);return{from:U,restore:B};function B(){r=L,c.previous=j,c.currentConstruct=X,c.events.length=U,a=$,F()}}function F(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function cRe(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex;let s;if(n===o)s=[e[n].slice(r,i)];else{if(s=e.slice(n,o),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}i>0&&s.push(e[o].slice(0,i))}return s}function uRe(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const i=e[n];let s;if(typeof i=="string")s=i;else switch(i){case-5:{s="\r";break}case-4:{s=`
396
+ `;break}case-3:{s=`\r
397
+ `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&o)continue;s=" ";break}default:s=String.fromCharCode(i)}o=i===-2,r.push(s)}return r.join("")}function dRe(e){const r={constructs:yCe([aRe,...(e||{}).extensions||[]]),content:o(RCe),defined:[],document:o(kCe),flow:o(GEe),lazy:{},string:o(KEe),text:o(XEe)};return r;function o(i){return s;function s(a){return lRe(r,i,a)}}}function fRe(e){for(;!f9(e););return e}const aI=/[\0\t\n\r]/g;function hRe(){let e=1,t="",n=!0,r;return o;function o(i,s,a){const l=[];let c,u,d,p,h;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(s||void 0).decode(i)),d=0,t="",n&&(i.charCodeAt(0)===65279&&d++,n=void 0);d<i.length;){if(aI.lastIndex=d,c=aI.exec(i),p=c&&c.index!==void 0?c.index:i.length,h=i.charCodeAt(p),!c){t=i.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(i.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 pRe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function gRe(e){return e.replace(pRe,mRe)}function mRe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),i=o===120||o===88;return l9(n.slice(i?2:1),i?16:10)}return HR(n)||e}const y9={}.hasOwnProperty;function bRe(e,t,n){return typeof t!="string"&&(n=t,t=void 0),yRe(n)(fRe(dRe(n).document().write(hRe()(e,t,!0))))}function yRe(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Le),autolinkProtocol:I,autolinkEmail:I,atxHeading:i(Ce),blockQuote:i(de),characterEscape:I,characterReference:I,codeFenced:i(he),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(he,s),codeText:i(se,s),codeTextData:I,data:I,codeFlowValue:I,definition:i(ge),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(ue),hardBreakEscape:i(ke),hardBreakTrailing:i(ke),htmlFlow:i(Ne,s),htmlFlowData:I,htmlText:i(Ne,s),htmlTextData:I,image:i(Oe),label:s,link:i(Le),listItem:i(it),listItemValue:p,listOrdered:i(Je,d),listUnordered:i(Je),paragraph:i(ln),reference:M,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(Ce),strong:i(vt),thematicBreak:i(Ct)},exit:{atxHeading:l(),atxHeadingSequence:C,autolink:l(),autolinkEmail:ie,autolinkProtocol:J,blockQuote:l(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:K,characterReferenceMarkerNumeric:K,characterReferenceValue:re,characterReference:Y,codeFenced:l(y),codeFencedFence:b,codeFencedFenceInfo:h,codeFencedFenceMeta:m,codeFlowValue:F,codeIndented:l(v),codeText:l($),codeTextData:F,data:F,definition:l(),definitionDestinationString:R,definitionLabelString:w,definitionTitleString:_,emphasis:l(),hardBreakEscape:l(j),hardBreakTrailing:l(j),htmlFlow:l(X),htmlFlowData:F,htmlText:l(U),htmlTextData:F,image:l(W),label:Q,labelText:q,lineEnding:L,link:l(B),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ee,resourceDestinationString:D,resourceTitleString:G,resource:V,setextHeading:l(A),setextHeadingLineSequence:P,setextHeadingText:E,strong:l(),thematicBreak:l()}};v9(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},Ve=[];let rt=-1;for(;++rt<fe.length;)if(fe[rt][1].type==="listOrdered"||fe[rt][1].type==="listUnordered")if(fe[rt][0]==="enter")Ve.push(rt);else{const An=Ve.pop();rt=o(fe,An,rt)}for(rt=-1;++rt<fe.length;){const An=t[fe[rt][0]];y9.call(An,fe[rt][1].type)&&An[fe[rt][1].type].call(Object.assign({sliceSerialize:fe[rt][2].sliceSerialize},He),fe[rt][1])}if(He.tokenStack.length>0){const An=He.tokenStack[He.tokenStack.length-1];(An[1]||lI).call(He,void 0,An[0])}for(_e.position={start:Ca(fe.length>0?fe[0][1].start:{line:1,column:1,offset:0}),end:Ca(fe.length>0?fe[fe.length-2][1].end:{line:1,column:1,offset:0})},rt=-1;++rt<t.transforms.length;)_e=t.transforms[rt](_e)||_e;return _e}function o(fe,_e,He){let Ve=_e-1,rt=-1,An=!1,Ue,lt,Ge,tn;for(;++Ve<=He;){const gt=fe[Ve];switch(gt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{gt[0]==="enter"?rt++:rt--,tn=void 0;break}case"lineEndingBlank":{gt[0]==="enter"&&(Ue&&!tn&&!rt&&!Ge&&(Ge=Ve),tn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:tn=void 0}if(!rt&&gt[0]==="enter"&&gt[1].type==="listItemPrefix"||rt===-1&&gt[0]==="exit"&&(gt[1].type==="listUnordered"||gt[1].type==="listOrdered")){if(Ue){let In=Ve;for(lt=void 0;In--;){const $t=fe[In];if($t[1].type==="lineEnding"||$t[1].type==="lineEndingBlank"){if($t[0]==="exit")continue;lt&&(fe[lt][1].type="lineEndingBlank",An=!0),$t[1].type="lineEnding",lt=In}else if(!($t[1].type==="linePrefix"||$t[1].type==="blockQuotePrefix"||$t[1].type==="blockQuotePrefixWhitespace"||$t[1].type==="blockQuoteMarker"||$t[1].type==="listItemIndent"))break}Ge&&(!lt||Ge<lt)&&(Ue._spread=!0),Ue.end=Object.assign({},lt?fe[lt][1].start:gt[1].end),fe.splice(lt||Ve,0,["exit",Ue,gt[2]]),Ve++,He++}if(gt[1].type==="listItemPrefix"){const In={type:"listItem",_spread:!1,start:Object.assign({},gt[1].start),end:void 0};Ue=In,fe.splice(Ve,0,["enter",In,gt[2]]),Ve++,He++,Ge=void 0,tn=!0}}}return fe[_e][1]._spread=An,He}function i(fe,_e){return He;function He(Ve){a.call(this,fe(Ve),Ve),_e&&_e.call(this,Ve)}}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:Ca(_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(),Ve=this.tokenStack.pop();if(Ve)Ve[0].type!==fe.type&&(_e?_e.call(this,fe,Ve[0]):(Ve[1]||lI).call(this,fe,Ve[0]));else throw new Error("Cannot close `"+fe.type+"` ("+kh({start:fe.start,end:fe.end})+"): it’s not open");He.position.end=Ca(fe.end)}function u(){return mCe(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 y(){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 v(){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=Vu(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 E(){this.data.setextHeadingSlurpLineEnding=!0}function P(fe){const _e=this.stack[this.stack.length-1];_e.depth=this.sliceSerialize(fe).codePointAt(0)===61?1:2}function A(){this.data.setextHeadingSlurpLineEnding=void 0}function I(fe){const He=this.stack[this.stack.length-1].children;let Ve=He[He.length-1];(!Ve||Ve.type!=="text")&&(Ve=$n(),Ve.position={start:Ca(fe.start),end:void 0},He.push(Ve)),this.stack.push(Ve)}function F(fe){const _e=this.stack.pop();_e.value+=this.sliceSerialize(fe),_e.position.end=Ca(fe.end)}function L(fe){const _e=this.stack[this.stack.length-1];if(this.data.atHardBreak){const He=_e.children[_e.children.length-1];He.position.end=Ca(fe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(_e.type)&&(I.call(this,fe),F.call(this,fe))}function j(){this.data.atHardBreak=!0}function X(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.value=fe}function U(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.value=fe}function $(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.value=fe}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(){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 q(fe){const _e=this.sliceSerialize(fe),He=this.stack[this.stack.length-2];He.label=gRe(_e),He.identifier=Vu(_e).toLowerCase()}function Q(){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 Ve=fe.children;He.children=Ve}else He.alt=_e}function D(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.url=fe}function G(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.title=fe}function V(){this.data.inReference=void 0}function M(){this.data.referenceType="collapsed"}function ee(fe){const _e=this.resume(),He=this.stack[this.stack.length-1];He.label=_e,He.identifier=Vu(this.sliceSerialize(fe)).toLowerCase(),this.data.referenceType="full"}function K(fe){this.data.characterReferenceType=fe.type}function re(fe){const _e=this.sliceSerialize(fe),He=this.data.characterReferenceType;let Ve;He?(Ve=l9(_e,He==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ve=HR(_e);const rt=this.stack[this.stack.length-1];rt.value+=Ve}function Y(fe){const _e=this.stack.pop();_e.position.end=Ca(fe.end)}function J(fe){F.call(this,fe);const _e=this.stack[this.stack.length-1];_e.url=this.sliceSerialize(fe)}function ie(fe){F.call(this,fe);const _e=this.stack[this.stack.length-1];_e.url="mailto:"+this.sliceSerialize(fe)}function de(){return{type:"blockquote",children:[]}}function he(){return{type:"code",lang:null,meta:null,value:""}}function se(){return{type:"inlineCode",value:""}}function ge(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ue(){return{type:"emphasis",children:[]}}function Ce(){return{type:"heading",depth:0,children:[]}}function ke(){return{type:"break"}}function Ne(){return{type:"html",value:""}}function Oe(){return{type:"image",title:null,url:"",alt:null}}function Le(){return{type:"link",title:null,url:"",children:[]}}function Je(fe){return{type:"list",ordered:fe.type==="listOrdered",start:null,spread:fe._spread,children:[]}}function it(fe){return{type:"listItem",spread:fe._spread,checked:null,children:[]}}function ln(){return{type:"paragraph",children:[]}}function vt(){return{type:"strong",children:[]}}function $n(){return{type:"text",value:""}}function Ct(){return{type:"thematicBreak"}}}function Ca(e){return{line:e.line,column:e.column,offset:e.offset}}function v9(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?v9(e,r):vRe(e,r)}}function vRe(e,t){let n;for(n in t)if(y9.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 lI(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+kh({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+kh({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+kh({start:t.start,end:t.end})+") is still open")}function xRe(e){const t=this;t.parser=n;function n(r){return bRe(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function wRe(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 SRe(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
398
+ `}]}function _Re(e,t){const n=t.value?t.value+`
399
+ `:"",r={};t.lang&&(r.className=["language-"+t.lang]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function CRe(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ERe(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function RRe(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=Qd(r.toLowerCase()),i=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=i+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(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 TRe(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 kRe(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function x9(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 o=e.all(t),i=o[0];i&&i.type==="text"?i.value="["+i.value:o.unshift({type:"text",value:"["});const s=o[o.length-1];return s&&s.type==="text"?s.value+=r:o.push({type:"text",value:r}),o}function PRe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return x9(e,t);const o={src:Qd(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(o.title=r.title);const i={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,i),e.applyData(t,i)}function ORe(e,t){const n={src:Qd(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 MRe(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 ARe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return x9(e,t);const o={href:Qd(r.url||"")};r.title!==null&&r.title!==void 0&&(o.title=r.title);const i={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function DRe(e,t){const n={href:Qd(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 IRe(e,t,n){const r=e.all(t),o=n?NRe(n):w9(t),i={},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:[]}),i.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const u=r[a];(o||a!==0||u.type!=="element"||u.tagName!=="p")&&s.push({type:"text",value:`
400
+ `}),u.type==="element"&&u.tagName==="p"&&!o?s.push(...u.children):s.push(u)}const l=r[r.length-1];l&&(o||l.type!=="element"||l.tagName!=="p")&&s.push({type:"text",value:`
401
+ `});const c={type:"element",tagName:"li",properties:i,children:s};return e.patch(t,c),e.applyData(t,c)}function NRe(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=w9(n[r])}return t}function w9(e){const t=e.spread;return t??e.children.length>1}function FRe(e,t){const n={},r=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++o<r.length;){const s=r[o];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 i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)}function LRe(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $Re(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function jRe(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function zRe(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),o.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=$R(t.children[1]),l=t9(t.children[t.children.length-1]);a&&l&&(s.position={start:a,end:l}),o.push(s)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,i),e.applyData(t,i)}function BRe(e,t,n){const r=n?n.children:void 0,i=(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:i,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 HRe(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const cI=9,uI=32;function WRe(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const i=[];for(;r;)i.push(dI(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(dI(t.slice(o),o>0,!1)),i.join("")}function dI(e,t,n){let r=0,o=e.length;if(t){let i=e.codePointAt(r);for(;i===cI||i===uI;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(o-1);for(;i===cI||i===uI;)o--,i=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function VRe(e,t){const n={type:"text",value:WRe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function URe(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const GRe={blockquote:wRe,break:SRe,code:_Re,delete:CRe,emphasis:ERe,footnoteReference:RRe,heading:TRe,html:kRe,imageReference:PRe,image:ORe,inlineCode:MRe,linkReference:ARe,link:DRe,listItem:IRe,list:FRe,paragraph:LRe,root:$Re,strong:jRe,table:zRe,tableCell:HRe,tableRow:BRe,text:VRe,thematicBreak:URe,toml:Gm,yaml:Gm,definition:Gm,footnoteDefinition:Gm};function Gm(){}const S9=-1,W0=0,Oh=1,py=2,UR=3,GR=4,qR=5,YR=6,_9=7,C9=8,fI=typeof self=="object"?self:globalThis,qRe=(e,t)=>{const n=(o,i)=>(e.set(i,o),o),r=o=>{if(e.has(o))return e.get(o);const[i,s]=t[o];switch(i){case W0:case S9:return n(s,o);case Oh:{const a=n([],o);for(const l of s)a.push(r(l));return a}case py:{const a=n({},o);for(const[l,c]of s)a[r(l)]=r(c);return a}case UR:return n(new Date(s),o);case GR:{const{source:a,flags:l}=s;return n(new RegExp(a,l),o)}case qR:{const a=n(new Map,o);for(const[l,c]of s)a.set(r(l),r(c));return a}case YR:{const a=n(new Set,o);for(const l of s)a.add(r(l));return a}case _9:{const{name:a,message:l}=s;return n(new fI[a](l),o)}case C9:return n(BigInt(s),o);case"BigInt":return n(Object(BigInt(s)),o);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:a}=new Uint8Array(s);return n(new DataView(a),s)}}return n(new fI[i](s),o)};return r},hI=e=>qRe(new Map,e)(0),xu="",{toString:YRe}={},{keys:KRe}=Object,zf=e=>{const t=typeof e;if(t!=="object"||!e)return[W0,t];const n=YRe.call(e).slice(8,-1);switch(n){case"Array":return[Oh,xu];case"Object":return[py,xu];case"Date":return[UR,xu];case"RegExp":return[GR,xu];case"Map":return[qR,xu];case"Set":return[YR,xu];case"DataView":return[Oh,n]}return n.includes("Array")?[Oh,n]:n.includes("Error")?[_9,n]:[py,n]},qm=([e,t])=>e===W0&&(t==="function"||t==="symbol"),XRe=(e,t,n,r)=>{const o=(s,a)=>{const l=r.push(s)-1;return n.set(a,l),l},i=s=>{if(n.has(s))return n.get(s);let[a,l]=zf(s);switch(a){case W0:{let u=s;switch(l){case"bigint":a=C9,u=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return o([S9],s)}return o([a,u],s)}case Oh:{if(l){let p=s;return l==="DataView"?p=new Uint8Array(s.buffer):l==="ArrayBuffer"&&(p=new Uint8Array(s)),o([l,[...p]],s)}const u=[],d=o([a,u],s);for(const p of s)u.push(i(p));return d}case py:{if(l)switch(l){case"BigInt":return o([l,s.toString()],s);case"Boolean":case"Number":case"String":return o([l,s.valueOf()],s)}if(t&&"toJSON"in s)return i(s.toJSON());const u=[],d=o([a,u],s);for(const p of KRe(s))(e||!qm(zf(s[p])))&&u.push([i(p),i(s[p])]);return d}case UR:return o([a,s.toISOString()],s);case GR:{const{source:u,flags:d}=s;return o([a,{source:u,flags:d}],s)}case qR:{const u=[],d=o([a,u],s);for(const[p,h]of s)(e||!(qm(zf(p))||qm(zf(h))))&&u.push([i(p),i(h)]);return d}case YR:{const u=[],d=o([a,u],s);for(const p of s)(e||!qm(zf(p)))&&u.push(i(p));return d}}const{message:c}=s;return o([a,{name:l,message:c}],s)};return i},pI=(e,{json:t,lossy:n}={})=>{const r=[];return XRe(!(t||n),!!t,new Map,r)(e),r},gy=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?hI(pI(e,t)):structuredClone(e):(e,t)=>hI(pI(e,t));function QRe(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 ZRe(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function JRe(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||QRe,r=e.options.footnoteBackLabel||ZRe,o=e.options.footnoteLabel||"Footnotes",i=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=Qd(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 y=u[u.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const w=y.children[y.children.length-1];w&&w.type==="text"?w.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...m)}else u.push(...m);const v={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(u,!0)};e.patch(c,v),a.push(v)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...gy(s),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
402
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
403
+ `}]}}const E9=function(e){if(e==null)return rTe;if(typeof e=="function")return V0(e);if(typeof e=="object")return Array.isArray(e)?eTe(e):tTe(e);if(typeof e=="string")return nTe(e);throw new Error("Expected function, string, or object as test")};function eTe(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=E9(e[n]);return V0(r);function r(...o){let i=-1;for(;++i<t.length;)if(t[i].apply(this,o))return!0;return!1}}function tTe(e){const t=e;return V0(n);function n(r){const o=r;let i;for(i in e)if(o[i]!==t[i])return!1;return!0}}function nTe(e){return V0(t);function t(n){return n&&n.type===e}}function V0(e){return t;function t(n,r,o){return!!(oTe(n)&&e.call(this,n,typeof r=="number"?r:void 0,o||void 0))}}function rTe(){return!0}function oTe(e){return e!==null&&typeof e=="object"&&"type"in e}const R9=[],iTe=!0,gI=!1,sTe="skip";function aTe(e,t,n,r){let o;typeof t=="function"&&typeof n!="function"?(r=n,n=t):o=t;const i=E9(o),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=R9,m,b,y;if((!t||i(l,c,u[u.length-1]||void 0))&&(h=lTe(n(l,u)),h[0]===gI))return h;if("children"in l&&l.children){const v=l;if(v.children&&h[0]!==sTe)for(b=(r?v.children.length:-1)+s,y=u.concat(v);b>-1&&b<v.children.length;){const w=v.children[b];if(m=a(w,b,y)(),m[0]===gI)return m;b=typeof m[1]=="number"?m[1]:b+s}}return h}}}function lTe(e){return Array.isArray(e)?e:typeof e=="number"?[iTe,e]:e==null?R9:[e]}function T9(e,t,n,r){let o,i,s;typeof t=="function"?(i=void 0,s=t,o=n):(i=t,s=n,o=r),aTe(e,i,a,o);function a(l,c){const u=c[c.length-1],d=u?u.children.indexOf(l):void 0;return s(l,d,u)}}const I_={}.hasOwnProperty,cTe={};function uTe(e,t){const n=t||cTe,r=new Map,o=new Map,i=new Map,s={...GRe,...n.handlers},a={all:c,applyData:fTe,definitionById:r,footnoteById:o,footnoteCounts:i,footnoteOrder:[],handlers:s,one:l,options:n,patch:dTe,wrap:pTe};return T9(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const d=u.type==="definition"?r:o,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(I_.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,...y}=u,v=gy(y);return v.children=a.all(u),v}return gy(u)}return(a.options.unknownHandler||hTe)(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=mI(m.value)),!Array.isArray(m)&&m.type==="element")){const b=m.children[0];b&&b.type==="text"&&(b.value=mI(b.value))}Array.isArray(m)?d.push(...m):d.push(m)}}}return d}}function dTe(e,t){e.position&&(t.position=Y_e(e))}function fTe(e,t){let n=t;if(e&&e.data){const r=e.data.hName,o=e.data.hChildren,i=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"&&i&&Object.assign(n.properties,gy(i)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function hTe(e,t){const n=t.data||{},r="value"in t&&!(I_.call(n,"hProperties")||I_.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 pTe(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
404
+ `});++r<e.length;)r&&n.push({type:"text",value:`
405
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
406
+ `}),n}function mI(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function bI(e,t){const n=uTe(e,t),r=n.one(e,void 0),o=JRe(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&i.children.push({type:"text",value:`
407
+ `},o),i}function gTe(e,t){return e&&"run"in e?async function(n,r){const o=bI(n,{file:r,...t});await e.run(o,r)}:function(n,r){return bI(n,{file:r,...e||t})}}function yI(e){if(e)throw e}var bb=Object.prototype.hasOwnProperty,k9=Object.prototype.toString,vI=Object.defineProperty,xI=Object.getOwnPropertyDescriptor,wI=function(t){return typeof Array.isArray=="function"?Array.isArray(t):k9.call(t)==="[object Array]"},SI=function(t){if(!t||k9.call(t)!=="[object Object]")return!1;var n=bb.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&bb.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var o;for(o in t);return typeof o>"u"||bb.call(t,o)},_I=function(t,n){vI&&n.name==="__proto__"?vI(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},CI=function(t,n){if(n==="__proto__")if(bb.call(t,n)){if(xI)return xI(t,n).value}else return;return t[n]},mTe=function e(){var t,n,r,o,i,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=CI(a,n),o=CI(t,n),a!==o&&(u&&o&&(SI(o)||(i=wI(o)))?(i?(i=!1,s=r&&wI(r)?r:[]):s=r&&SI(r)?r:{},_I(a,{name:n,newValue:e(u,s,o)})):typeof o<"u"&&_I(a,{name:n,newValue:o}));return a};const Zw=ol(mTe);function N_(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 bTe(){const e=[],t={run:n,use:r};return t;function n(...o){let i=-1;const s=o.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...o);function a(l,...c){const u=e[++i];let d=-1;if(l){s(l);return}for(;++d<o.length;)(c[d]===null||c[d]===void 0)&&(c[d]=o[d]);o=c,u?yTe(u,a)(...c):s(null,...c)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function yTe(e,t){let n;return r;function r(...s){const a=e.length>s.length;let l;a&&s.push(o);try{l=e.apply(this,s)}catch(c){const u=c;if(a&&n)throw u;return o(u)}a||(l&&l.then&&typeof l.then=="function"?l.then(i,o):l instanceof Error?o(l):i(l))}function o(s,...a){n||(n=!0,t(s,...a))}function i(s){o(null,s)}}const Wi={basename:vTe,dirname:xTe,extname:wTe,join:STe,sep:"/"};function vTe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Jp(e);let n=0,r=-1,o=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else r<0&&(i=!0,r=o+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else s<0&&(i=!0,s=o+1),a>-1&&(e.codePointAt(o)===t.codePointAt(a--)?a<0&&(r=o):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function xTe(e){if(Jp(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 wTe(e){Jp(e);let t=e.length,n=-1,r=0,o=-1,i=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?o<0?o=t:i!==1&&(i=1):o>-1&&(i=-1)}return o<0||n<0||i===0||i===1&&o===n-1&&o===r+1?"":e.slice(o,n)}function STe(...e){let t=-1,n;for(;++t<e.length;)Jp(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":_Te(n)}function _Te(e){Jp(e);const t=e.codePointAt(0)===47;let n=CTe(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function CTe(e,t){let n="",r=0,o=-1,i=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(!(o===s-1||i===1))if(o!==s-1&&i===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("/")),o=s,i=0;continue}}else if(n.length>0){n="",r=0,o=s,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(o+1,s):n=e.slice(o+1,s),r=s-o-1;o=s,i=0}else a===46&&i>-1?i++:i=-1}return n}function Jp(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const ETe={cwd:RTe};function RTe(){return"/"}function F_(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function TTe(e){if(typeof e=="string")e=new URL(e);else if(!F_(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 kTe(e)}function kTe(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 o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const Jw=["history","path","basename","stem","extname","dirname"];class P9{constructor(t){let n;t?F_(t)?n={path:t}:typeof t=="string"||PTe(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":ETe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Jw.length;){const i=Jw[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let o;for(o in n)Jw.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?Wi.basename(this.path):void 0}set basename(t){t1(t,"basename"),e1(t,"basename"),this.path=Wi.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Wi.dirname(this.path):void 0}set dirname(t){EI(this.basename,"dirname"),this.path=Wi.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Wi.extname(this.path):void 0}set extname(t){if(e1(t,"extname"),EI(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=Wi.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){F_(t)&&(t=TTe(t)),t1(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Wi.basename(this.path,this.extname):void 0}set stem(t){t1(t,"stem"),e1(t,"stem"),this.path=Wi.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const o=this.message(t,n,r);throw o.fatal=!0,o}info(t,n,r){const o=this.message(t,n,r);return o.fatal=void 0,o}message(t,n,r){const o=new jr(t,n,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function e1(e,t){if(e&&e.includes(Wi.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Wi.sep+"`")}function t1(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function EI(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function PTe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const OTe=function(e){const r=this.constructor.prototype,o=r[e],i=function(){return o.apply(i,arguments)};return Object.setPrototypeOf(i,r),i},MTe={}.hasOwnProperty;class KR extends OTe{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=bTe()}copy(){const t=new KR;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Zw(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(o1("data",this.frozen),this.namespace[t]=n,this):MTe.call(this.namespace,t)&&this.namespace[t]||void 0:t?(o1("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 o=n.call(t,...r);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Ym(t),r=this.parser||this.Parser;return n1("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),n1("process",this.parser||this.Parser),r1("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(i,s){const a=Ym(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);ITe(m)?p.value=m:p.result=m,c(u,p)});function c(u,d){u||!d?s(u):i?i(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),n1("processSync",this.parser||this.Parser),r1("processSync",this.compiler||this.Compiler),this.process(t,o),TI("processSync","process",n),r;function o(i,s){n=!0,yI(i),r=s}}run(t,n,r){RI(t),this.freeze();const o=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(s,a){const l=Ym(n);o.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,o;return this.run(t,n,i),TI("runSync","run",r),o;function i(s,a){yI(s),o=a,r=!0}}stringify(t,n){this.freeze();const r=Ym(n),o=this.compiler||this.Compiler;return r1("stringify",o),RI(t),o(t,r)}use(t,...n){const r=this.attachers,o=this.namespace;if(o1("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 i(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&&(o.settings=Zw(!0,o.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const d=c[u];i(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];N_(b)&&N_(h)&&(h=Zw(!0,b,h)),r[p]=[c,h,...m]}}}}const ATe=new KR().freeze();function n1(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function r1(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function o1(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 RI(e){if(!N_(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function TI(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Ym(e){return DTe(e)?e:new P9(e)}function DTe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function ITe(e){return typeof e=="string"||NTe(e)}function NTe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const FTe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",kI=[],PI={allowDangerousHtml:!0},LTe=/^(https?|ircs?|mailto|xmpp)$/i,$Te=[{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 jTe(e){const t=zTe(e),n=BTe(e);return HTe(t.runSync(t.parse(n),n),e)}function zTe(e){const t=e.rehypePlugins||kI,n=e.remarkPlugins||kI,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...PI}:PI;return ATe().use(xRe).use(n).use(gTe,r).use(t)}function BTe(e){const t=e.children||"",n=new P9;return typeof t=="string"&&(n.value=t),n}function HTe(e,t){const n=t.allowedElements,r=t.allowElement,o=t.components,i=t.disallowedElements,s=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||WTe;for(const u of $Te)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+FTe+u.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),T9(e,c),J_e(e,{Fragment:x.Fragment,components:o,ignoreInvalidStyle:!0,jsx:x.jsx,jsxs:x.jsxs,passKeys:!0,passNode:!0});function c(u,d,p){if(u.type==="raw"&&p&&typeof d=="number")return s?p.children.splice(d,1):p.children[d]={type:"text",value:u.value},d;if(u.type==="element"){let h;for(h in Kw)if(Object.hasOwn(Kw,h)&&Object.hasOwn(u.properties,h)){const m=u.properties[h],b=Kw[h];(b===null||b.includes(u.tagName))&&(u.properties[h]=l(String(m||""),h,u))}}if(u.type==="element"){let h=n?!n.includes(u.tagName):i?i.includes(u.tagName):!1;if(!h&&r&&typeof d=="number"&&(h=!r(u,d,p)),h&&p&&typeof d=="number")return a&&u.children?p.children.splice(d,1,...u.children):p.children.splice(d,1),d}}}function WTe(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||n!==-1&&t>n||r!==-1&&t>r||LTe.test(e.slice(0,t))?e:""}var VTe=Object.create,U0=Object.defineProperty,UTe=Object.defineProperties,GTe=Object.getOwnPropertyDescriptor,qTe=Object.getOwnPropertyDescriptors,O9=Object.getOwnPropertyNames,my=Object.getOwnPropertySymbols,YTe=Object.getPrototypeOf,XR=Object.prototype.hasOwnProperty,M9=Object.prototype.propertyIsEnumerable,OI=(e,t,n)=>t in e?U0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,as=(e,t)=>{for(var n in t||(t={}))XR.call(t,n)&&OI(e,n,t[n]);if(my)for(var n of my(t))M9.call(t,n)&&OI(e,n,t[n]);return e},G0=(e,t)=>UTe(e,qTe(t)),A9=(e,t)=>{var n={};for(var r in e)XR.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&my)for(var r of my(e))t.indexOf(r)<0&&M9.call(e,r)&&(n[r]=e[r]);return n},KTe=(e,t)=>function(){return t||(0,e[O9(e)[0]])((t={exports:{}}).exports,t),t.exports},XTe=(e,t)=>{for(var n in t)U0(e,n,{get:t[n],enumerable:!0})},QTe=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of O9(t))!XR.call(e,o)&&o!==n&&U0(e,o,{get:()=>t[o],enumerable:!(r=GTe(t,o))||r.enumerable});return e},ZTe=(e,t,n)=>(n=e!=null?VTe(YTe(e)):{},QTe(!e||!e.__esModule?U0(n,"default",{value:e,enumerable:!0}):n,e)),JTe=KTe({"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(e,t){var n=function(){var r=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,o=0,i={},s={util:{encode:function m(b){return b instanceof a?new a(b.type,m(b.content),b.alias):Array.isArray(b)?b.map(m):b.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(m){return Object.prototype.toString.call(m).slice(8,-1)},objId:function(m){return m.__id||Object.defineProperty(m,"__id",{value:++o}),m.__id},clone:function m(b,y){y=y||{};var v,w;switch(s.util.type(b)){case"Object":if(w=s.util.objId(b),y[w])return y[w];v={},y[w]=v;for(var _ in b)b.hasOwnProperty(_)&&(v[_]=m(b[_],y));return v;case"Array":return w=s.util.objId(b),y[w]?y[w]:(v=[],y[w]=v,b.forEach(function(R,C){v[C]=m(R,y)}),v);default:return b}},getLanguage:function(m){for(;m;){var b=r.exec(m.className);if(b)return b[1].toLowerCase();m=m.parentElement}return"none"},setLanguage:function(m,b){m.className=m.className.replace(RegExp(r,"gi"),""),m.classList.add("language-"+b)},isActive:function(m,b,y){for(var v="no-"+b;m;){var w=m.classList;if(w.contains(b))return!0;if(w.contains(v))return!1;m=m.parentElement}return!!y}},languages:{plain:i,plaintext:i,text:i,txt:i,extend:function(m,b){var y=s.util.clone(s.languages[m]);for(var v in b)y[v]=b[v];return y},insertBefore:function(m,b,y,v){v=v||s.languages;var w=v[m],_={};for(var R in w)if(w.hasOwnProperty(R)){if(R==b)for(var C in y)y.hasOwnProperty(C)&&(_[C]=y[C]);y.hasOwnProperty(R)||(_[R]=w[R])}var E=v[m];return v[m]=_,s.languages.DFS(s.languages,function(P,A){A===E&&P!=m&&(this[P]=_)}),_},DFS:function m(b,y,v,w){w=w||{};var _=s.util.objId;for(var R in b)if(b.hasOwnProperty(R)){y.call(b,R,b[R],v||R);var C=b[R],E=s.util.type(C);E==="Object"&&!w[_(C)]?(w[_(C)]=!0,m(C,y,null,w)):E==="Array"&&!w[_(C)]&&(w[_(C)]=!0,m(C,y,R,w))}}},plugins:{},highlight:function(m,b,y){var v={code:m,grammar:b,language:y};if(s.hooks.run("before-tokenize",v),!v.grammar)throw new Error('The language "'+v.language+'" has no grammar.');return v.tokens=s.tokenize(v.code,v.grammar),s.hooks.run("after-tokenize",v),a.stringify(s.util.encode(v.tokens),v.language)},tokenize:function(m,b){var y=b.rest;if(y){for(var v in y)b[v]=y[v];delete b.rest}var w=new u;return d(w,w.head,m),c(m,w,b,w.head,0),h(w)},hooks:{all:{},add:function(m,b){var y=s.hooks.all;y[m]=y[m]||[],y[m].push(b)},run:function(m,b){var y=s.hooks.all[m];if(!(!y||!y.length))for(var v=0,w;w=y[v++];)w(b)}},Token:a};function a(m,b,y,v){this.type=m,this.content=b,this.alias=y,this.length=(v||"").length|0}a.stringify=function m(b,y){if(typeof b=="string")return b;if(Array.isArray(b)){var v="";return b.forEach(function(E){v+=m(E,y)}),v}var w={type:b.type,content:m(b.content,y),tag:"span",classes:["token",b.type],attributes:{},language:y},_=b.alias;_&&(Array.isArray(_)?Array.prototype.push.apply(w.classes,_):w.classes.push(_)),s.hooks.run("wrap",w);var R="";for(var C in w.attributes)R+=" "+C+'="'+(w.attributes[C]||"").replace(/"/g,"&quot;")+'"';return"<"+w.tag+' class="'+w.classes.join(" ")+'"'+R+">"+w.content+"</"+w.tag+">"};function l(m,b,y,v){m.lastIndex=b;var w=m.exec(y);if(w&&v&&w[1]){var _=w[1].length;w.index+=_,w[0]=w[0].slice(_)}return w}function c(m,b,y,v,w,_){for(var R in y)if(!(!y.hasOwnProperty(R)||!y[R])){var C=y[R];C=Array.isArray(C)?C:[C];for(var E=0;E<C.length;++E){if(_&&_.cause==R+","+E)return;var P=C[E],A=P.inside,I=!!P.lookbehind,F=!!P.greedy,L=P.alias;if(F&&!P.pattern.global){var j=P.pattern.toString().match(/[imsuy]*$/)[0];P.pattern=RegExp(P.pattern.source,j+"g")}for(var X=P.pattern||P,U=v.next,$=w;U!==b.tail&&!(_&&$>=_.reach);$+=U.value.length,U=U.next){var B=U.value;if(b.length>m.length)return;if(!(B instanceof a)){var W=1,q;if(F){if(q=l(X,$,m,I),!q||q.index>=m.length)break;var V=q.index,Q=q.index+q[0].length,D=$;for(D+=U.value.length;V>=D;)U=U.next,D+=U.value.length;if(D-=U.value.length,$=D,U.value instanceof a)continue;for(var G=U;G!==b.tail&&(D<Q||typeof G.value=="string");G=G.next)W++,D+=G.value.length;W--,B=m.slice($,D),q.index-=$}else if(q=l(X,0,B,I),!q)continue;var V=q.index,M=q[0],ee=B.slice(0,V),K=B.slice(V+M.length),re=$+B.length;_&&re>_.reach&&(_.reach=re);var Y=U.prev;ee&&(Y=d(b,Y,ee),$+=ee.length),p(b,Y,W);var J=new a(R,A?s.tokenize(M,A):M,L,M);if(U=d(b,Y,J),K&&d(b,U,K),W>1){var ie={cause:R+","+E,reach:re};c(m,b,y,U.prev,$,ie),_&&ie.reach>_.reach&&(_.reach=ie.reach)}}}}}}function u(){var m={value:null,prev:null,next:null},b={value:null,prev:m,next:null};m.next=b,this.head=m,this.tail=b,this.length=0}function d(m,b,y){var v=b.next,w={value:y,prev:b,next:v};return b.next=w,v.prev=w,m.length++,w}function p(m,b,y){for(var v=b.next,w=0;w<y&&v!==m.tail;w++)v=v.next;b.next=v,v.prev=b,m.length-=w}function h(m){for(var b=[],y=m.head.next;y!==m.tail;)b.push(y.value),y=y.next;return b}return s}();t.exports=n,n.default=n}}),xe=ZTe(JTe());xe.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},xe.languages.markup.tag.inside["attr-value"].inside.entity=xe.languages.markup.entity,xe.languages.markup.doctype.inside["internal-subset"].inside=xe.languages.markup,xe.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&amp;/,"&"))}),Object.defineProperty(xe.languages.markup.tag,"addInlined",{value:function(e,r){var n={},n=(n["language-"+r]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:xe.languages[r]},n.cdata=/^<!\[CDATA\[|\]\]>$/i,{"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}}),r=(n["language-"+r]={pattern:/[\s\S]+/,inside:xe.languages[r]},{});r[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:n},xe.languages.insertBefore("markup","cdata",r)}}),Object.defineProperty(xe.languages.markup.tag,"addAttribute",{value:function(e,t){xe.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:xe.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),xe.languages.html=xe.languages.markup,xe.languages.mathml=xe.languages.markup,xe.languages.svg=xe.languages.markup,xe.languages.xml=xe.languages.extend("markup",{}),xe.languages.ssml=xe.languages.xml,xe.languages.atom=xe.languages.xml,xe.languages.rss=xe.languages.xml,function(e){var t={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},n=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,r="(?:[^\\\\-]|"+n.source+")",r=RegExp(r+"-"+r),o={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};e.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:r,inside:{escape:n,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":t,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:n}},"special-escape":t,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":o}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:n,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":o}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}}(xe),xe.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},xe.languages.javascript=xe.languages.extend("clike",{"class-name":[xe.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),xe.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,xe.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:xe.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:xe.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:xe.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:xe.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:xe.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),xe.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:xe.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),xe.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),xe.languages.markup&&(xe.languages.markup.tag.addInlined("script","javascript"),xe.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),xe.languages.js=xe.languages.javascript,xe.languages.actionscript=xe.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),xe.languages.actionscript["class-name"].alias="function",delete xe.languages.actionscript.parameter,delete xe.languages.actionscript["literal-property"],xe.languages.markup&&xe.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:xe.languages.markup}}),function(e){var t=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:t,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:t,interpolation:n}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:e.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:n}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript["template-string"],e.languages.coffee=e.languages.coffeescript}(xe),function(e){var t=e.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(t,"addSupport",{value:function(n,r){(n=typeof n=="string"?[n]:n).forEach(function(o){var i=function(d){d.inside||(d.inside={}),d.inside.rest=r},s="doc-comment";if(a=e.languages[o]){var a,l=a[s];if((l=l||(a=e.languages.insertBefore(o,"comment",{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"}}))[s])instanceof RegExp&&(l=a[s]={pattern:l}),Array.isArray(l))for(var c=0,u=l.length;c<u;c++)l[c]instanceof RegExp&&(l[c]={pattern:l[c]}),i(l[c]);else i(l)}})}}),t.addSupport(["java","javascript","php"],t)}(xe),function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,t=(e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css,e.languages.markup);t&&(t.tag.addInlined("style","css"),t.tag.addAttribute("style","css"))}(xe),function(e){var t=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,t=(e.languages.css.selector={pattern:e.languages.css.selector.pattern,lookbehind:!0,inside:t={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp(`\\[(?:[^[\\]"']|`+t.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[t,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},e.languages.css.atrule.inside["selector-function-argument"].inside=t,e.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}}),{pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0}),n={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};e.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:t,number:n,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:t,number:n})}(xe),function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ ]+"+t.source+")?|"+t.source+"(?:[ ]+"+n.source+")?)",o=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),i=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function s(a,l){l=(l||"").replace(/m/g,"")+"m";var c=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return a});return RegExp(c,l)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return r})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<key>>/g,function(){return"(?:"+o+"|"+i+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:s(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:s(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:s(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:s(i),lookbehind:!0,greedy:!0},number:{pattern:s(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(xe),function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(c){return c=c.replace(/<inner>/g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+c+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,o=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),i=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source,s=(e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+o+i+"(?:"+o+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+o+i+")(?:"+o+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+o+")"+i+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+o+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(c){["url","bold","italic","strike","code-snippet"].forEach(function(u){c!==u&&(e.languages.markdown[c].inside.content.inside[u]=e.languages.markdown[u])})}),e.hooks.add("after-tokenize",function(c){c.language!=="markdown"&&c.language!=="md"||function u(d){if(d&&typeof d!="string")for(var p=0,h=d.length;p<h;p++){var m,b=d[p];b.type!=="code"?u(b.content):(m=b.content[1],b=b.content[3],m&&b&&m.type==="code-language"&&b.type==="code-block"&&typeof m.content=="string"&&(m=m.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),m="language-"+(m=(/[a-z][\w-]*/i.exec(m)||[""])[0].toLowerCase()),b.alias?typeof b.alias=="string"?b.alias=[b.alias,m]:b.alias.push(m):b.alias=[m]))}}(c.tokens)}),e.hooks.add("wrap",function(c){if(c.type==="code-block"){for(var u="",d=0,p=c.classes.length;d<p;d++){var h=c.classes[d],h=/language-(.+)/.exec(h);if(h){u=h[1];break}}var m,b=e.languages[u];b?c.content=e.highlight(function(y){return y=y.replace(s,""),y=y.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(v,w){var _;return(w=w.toLowerCase())[0]==="#"?(_=w[1]==="x"?parseInt(w.slice(2),16):Number(w.slice(1)),l(_)):a[w]||v})}(c.content),b,u):u&&u!=="none"&&e.plugins.autoloader&&(m="md-"+new Date().valueOf()+"-"+Math.floor(1e16*Math.random()),c.attributes.id=m,e.plugins.autoloader.loadLanguages(u,function(){var y=document.getElementById(m);y&&(y.innerHTML=e.highlight(y.textContent,e.languages[u],u))}))}}),RegExp(e.languages.markup.tag.pattern.source,"gi")),a={amp:"&",lt:"<",gt:">",quot:'"'},l=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(xe),xe.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:xe.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},xe.hooks.add("after-tokenize",function(e){if(e.language==="graphql")for(var t=e.tokens.filter(function(m){return typeof m!="string"&&m.type!=="comment"&&m.type!=="scalar"}),n=0;n<t.length;){var r=t[n++];if(r.type==="keyword"&&r.content==="mutation"){var o=[];if(d(["definition-mutation","punctuation"])&&u(1).content==="("){n+=2;var i=p(/^\($/,/^\)$/);if(i===-1)continue;for(;n<i;n++){var s=u(0);s.type==="variable"&&(h(s,"variable-input"),o.push(s.content))}n=i+1}if(d(["punctuation","property-query"])&&u(0).content==="{"&&(n++,h(u(0),"property-mutation"),0<o.length)){var a=p(/^\{$/,/^\}$/);if(a!==-1)for(var l=n;l<a;l++){var c=t[l];c.type==="variable"&&0<=o.indexOf(c.content)&&h(c,"variable-input")}}}}function u(m){return t[n+m]}function d(m,b){b=b||0;for(var y=0;y<m.length;y++){var v=u(y+b);if(!v||v.type!==m[y])return}return 1}function p(m,b){for(var y=1,v=n;v<t.length;v++){var w=t[v],_=w.content;if(w.type==="punctuation"&&typeof _=="string"){if(m.test(_))y++;else if(b.test(_)&&--y===0)return v}}return-1}function h(m,b){var y=m.alias;y?Array.isArray(y)||(m.alias=y=[y]):m.alias=y=[],y.push(b)}}),xe.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(e){var t=e.languages.javascript["template-string"],n=t.pattern.source,r=t.inside.interpolation,o=r.inside["interpolation-punctuation"],i=r.pattern.source;function s(d,p){if(e.languages[d])return{pattern:RegExp("((?:"+p+")\\s*)"+n),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:d}}}}function a(d,p,h){return d={code:d,grammar:p,language:h},e.hooks.run("before-tokenize",d),d.tokens=e.tokenize(d.code,d.grammar),e.hooks.run("after-tokenize",d),d.tokens}function l(d,p,h){var y=e.tokenize(d,{interpolation:{pattern:RegExp(i),lookbehind:!0}}),m=0,b={},y=a(y.map(function(w){if(typeof w=="string")return w;for(var _,R,w=w.content;d.indexOf((R=m++,_="___"+h.toUpperCase()+"_"+R+"___"))!==-1;);return b[_]=w,_}).join(""),p,h),v=Object.keys(b);return m=0,function w(_){for(var R=0;R<_.length;R++){if(m>=v.length)return;var C,E,P,A,I,F,L,j=_[R];typeof j=="string"||typeof j.content=="string"?(C=v[m],(L=(F=typeof j=="string"?j:j.content).indexOf(C))!==-1&&(++m,E=F.substring(0,L),I=b[C],P=void 0,(A={})["interpolation-punctuation"]=o,(A=e.tokenize(I,A)).length===3&&((P=[1,1]).push.apply(P,a(A[1],e.languages.javascript,"javascript")),A.splice.apply(A,P)),P=new e.Token("interpolation",A,r.alias,I),A=F.substring(L+C.length),I=[],E&&I.push(E),I.push(P),A&&(w(F=[A]),I.push.apply(I,F)),typeof j=="string"?(_.splice.apply(_,[R,1].concat(I)),R+=I.length-1):j.content=I)):(L=j.content,Array.isArray(L)?w(L):w([L]))}}(y),new e.Token(h,y,"language-"+h,d)}e.languages.javascript["template-string"]=[s("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),s("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),s("svg",/\bsvg/.source),s("markdown",/\b(?:markdown|md)/.source),s("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),s("sql",/\bsql/.source),t].filter(Boolean);var c={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function u(d){return typeof d=="string"?d:Array.isArray(d)?d.map(u).join(""):u(d.content)}e.hooks.add("after-tokenize",function(d){d.language in c&&function p(h){for(var m=0,b=h.length;m<b;m++){var y,v,w,_=h[m];typeof _!="string"&&(y=_.content,Array.isArray(y)?_.type==="template-string"?(_=y[1],y.length===3&&typeof _!="string"&&_.type==="embedded-code"&&(v=u(_),_=_.alias,_=Array.isArray(_)?_[0]:_,w=e.languages[_])&&(y[1]=l(v,w,_))):p(y):typeof y!="string"&&p([y]))}}(d.tokens)})}(xe),function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(xe),function(e){var t=e.languages.javascript,n=/\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source,r="(@(?:arg|argument|param|property)\\s+(?:"+n+"\\s+)?)";e.languages.jsdoc=e.languages.extend("javadoclike",{parameter:{pattern:RegExp(r+/(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source),lookbehind:!0,inside:{punctuation:/\./}}}),e.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(r+/\[(?:(?!\s)[$\w\xA0-\uFFFF.])+(?:=[^[\]]+)?\](?=\s|$)/.source),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:t,alias:"language-javascript"},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp(/(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\s+(?:<TYPE>\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(/<TYPE>/g,function(){return n})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+n),lookbehind:!0,inside:{string:t.string,number:t.number,boolean:t.boolean,keyword:e.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:t,alias:"language-javascript"}}}}),e.languages.javadoclike.addSupport("javascript",e.languages.jsdoc)}(xe),function(e){e.languages.flow=e.languages.extend("javascript",{}),e.languages.insertBefore("flow","keyword",{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:"class-name"}]}),e.languages.flow["function-variable"].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete e.languages.flow.parameter,e.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(e.languages.flow.keyword)||(e.languages.flow.keyword=[e.languages.flow.keyword]),e.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,lookbehind:!0})}(xe),xe.languages.n4js=xe.languages.extend("javascript",{keyword:/\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),xe.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),xe.languages.n4jsd=xe.languages.n4js,function(e){function t(s,a){return RegExp(s.replace(/<ID>/g,function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source}),a)}e.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+e.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),e.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+e.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),e.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),e.languages.insertBefore("javascript","keyword",{imports:{pattern:t(/(\bimport\b\s*)(?:<ID>(?:\s*,\s*(?:\*\s*as\s+<ID>|\{[^{}]*\}))?|\*\s*as\s+<ID>|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:e.languages.javascript},exports:{pattern:t(/(\bexport\b\s*)(?:\*(?:\s*as\s+<ID>)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:e.languages.javascript}}),e.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),e.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),e.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:t(/(\.\s*)#?<ID>/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var n=["function","function-variable","method","method-variable","property-access"],r=0;r<n.length;r++){var i=n[r],o=e.languages.javascript[i],i=(o=e.util.type(o)==="RegExp"?e.languages.javascript[i]={pattern:o}:o).inside||{};(o.inside=i)["maybe-class-name"]=/^[A-Z][\s\S]*/}}(xe),function(e){var t=e.util.clone(e.languages.javascript),n=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,r=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,o=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function i(l,c){return l=l.replace(/<S>/g,function(){return n}).replace(/<BRACES>/g,function(){return r}).replace(/<SPREAD>/g,function(){return o}),RegExp(l,c)}o=i(o).source,e.languages.jsx=e.languages.extend("markup",t),e.languages.jsx.tag.pattern=i(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore("inside","attr-name",{spread:{pattern:i(/<SPREAD>/.source),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore("inside","special-attr",{script:{pattern:i(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:e.languages.jsx}}},e.languages.jsx.tag);function s(l){for(var c=[],u=0;u<l.length;u++){var d=l[u],p=!1;typeof d!="string"&&(d.type==="tag"&&d.content[0]&&d.content[0].type==="tag"?d.content[0].content[0].content==="</"?0<c.length&&c[c.length-1].tagName===a(d.content[0].content[1])&&c.pop():d.content[d.content.length-1].content!=="/>"&&c.push({tagName:a(d.content[0].content[1]),openedBraces:0}):0<c.length&&d.type==="punctuation"&&d.content==="{"?c[c.length-1].openedBraces++:0<c.length&&0<c[c.length-1].openedBraces&&d.type==="punctuation"&&d.content==="}"?c[c.length-1].openedBraces--:p=!0),(p||typeof d=="string")&&0<c.length&&c[c.length-1].openedBraces===0&&(p=a(d),u<l.length-1&&(typeof l[u+1]=="string"||l[u+1].type==="plain-text")&&(p+=a(l[u+1]),l.splice(u+1,1)),0<u&&(typeof l[u-1]=="string"||l[u-1].type==="plain-text")&&(p=a(l[u-1])+p,l.splice(u-1,1),u--),l[u]=new e.Token("plain-text",p,null,p)),d.content&&typeof d.content!="string"&&s(d.content)}}var a=function(l){return l?typeof l=="string"?l:typeof l.content=="string"?l.content:l.content.map(a).join(""):""};e.hooks.add("after-tokenize",function(l){l.language!=="jsx"&&l.language!=="tsx"||s(l.tokens)})}(xe),function(e){var t=e.util.clone(e.languages.typescript),t=(e.languages.tsx=e.languages.extend("jsx",t),delete e.languages.tsx.parameter,delete e.languages.tsx["literal-property"],e.languages.tsx.tag);t.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+t.pattern.source+")",t.pattern.flags),t.lookbehind=!0}(xe),xe.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},xe.languages.swift["string-literal"].forEach(function(e){e.inside.interpolation.inside=xe.languages.swift}),function(e){e.languages.kotlin=e.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete e.languages.kotlin["class-name"];var t={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:e.languages.kotlin}};e.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:t},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:t},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete e.languages.kotlin.string,e.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),e.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),e.languages.kt=e.languages.kotlin,e.languages.kts=e.languages.kotlin}(xe),xe.languages.c=xe.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),xe.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),xe.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},xe.languages.c.string],char:xe.languages.c.char,comment:xe.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:xe.languages.c}}}}),xe.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete xe.languages.c.boolean,xe.languages.objectivec=xe.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete xe.languages.objectivec["class-name"],xe.languages.objc=xe.languages.objectivec,xe.languages.reason=xe.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),xe.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete xe.languages.reason.function,function(e){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return/[^\s\S]/.source}),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string}(xe),xe.languages.go=xe.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),xe.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete xe.languages.go["class-name"],function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return n})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(xe),xe.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},xe.languages.python["string-interpolation"].inside.interpolation.inside.rest=xe.languages.python,xe.languages.py=xe.languages.python,xe.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},xe.languages.webmanifest=xe.languages.json;var L_={};XTe(L_,{dracula:()=>tke,duotoneDark:()=>rke,duotoneLight:()=>ike,github:()=>ake,gruvboxMaterialDark:()=>Fke,gruvboxMaterialLight:()=>$ke,jettwaveDark:()=>kke,jettwaveLight:()=>Oke,nightOwl:()=>cke,nightOwlLight:()=>dke,oceanicNext:()=>hke,okaidia:()=>gke,oneDark:()=>Ake,oneLight:()=>Ike,palenight:()=>bke,shadesOfPurple:()=>vke,synthwave84:()=>wke,ultramin:()=>_ke,vsDark:()=>D9,vsLight:()=>Rke});var eke={plain:{color:"#F8F8F2",backgroundColor:"#282A36"},styles:[{types:["prolog","constant","builtin"],style:{color:"rgb(189, 147, 249)"}},{types:["inserted","function"],style:{color:"rgb(80, 250, 123)"}},{types:["deleted"],style:{color:"rgb(255, 85, 85)"}},{types:["changed"],style:{color:"rgb(255, 184, 108)"}},{types:["punctuation","symbol"],style:{color:"rgb(248, 248, 242)"}},{types:["string","char","tag","selector"],style:{color:"rgb(255, 121, 198)"}},{types:["keyword","variable"],style:{color:"rgb(189, 147, 249)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(98, 114, 164)"}},{types:["attr-name"],style:{color:"rgb(241, 250, 140)"}}]},tke=eke,nke={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]},rke=nke,oke={plain:{backgroundColor:"#faf8f5",color:"#728fcb"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#b6ad9a"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#063289"}},{types:["property","function"],style:{color:"#b29762"}},{types:["tag-id","selector","atrule-id"],style:{color:"#2d2006"}},{types:["attr-name"],style:{color:"#896724"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule"],style:{color:"#728fcb"}},{types:["placeholder","variable"],style:{color:"#93abdc"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#896724"}}]},ike=oke,ske={plain:{color:"#393A34",backgroundColor:"#f6f8fa"},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:"#999988",fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}},{types:["string","attr-value"],style:{color:"#e3116c"}},{types:["punctuation","operator"],style:{color:"#393A34"}},{types:["entity","url","symbol","number","boolean","variable","constant","property","regex","inserted"],style:{color:"#36acaa"}},{types:["atrule","keyword","attr-name","selector"],style:{color:"#00a4db"}},{types:["function","deleted","tag"],style:{color:"#d73a49"}},{types:["function-variable"],style:{color:"#6f42c1"}},{types:["tag","selector","keyword"],style:{color:"#00009f"}}]},ake=ske,lke={plain:{color:"#d6deeb",backgroundColor:"#011627"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(99, 119, 119)",fontStyle:"italic"}},{types:["string","url"],style:{color:"rgb(173, 219, 103)"}},{types:["variable"],style:{color:"rgb(214, 222, 235)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation"],style:{color:"rgb(199, 146, 234)"}},{types:["selector","doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(255, 203, 139)"}},{types:["tag","operator","keyword"],style:{color:"rgb(127, 219, 202)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["property"],style:{color:"rgb(128, 203, 196)"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}}]},cke=lke,uke={plain:{color:"#403f53",backgroundColor:"#FBFBFB"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(72, 118, 214)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(152, 159, 177)",fontStyle:"italic"}},{types:["string","builtin","char","constant","url"],style:{color:"rgb(72, 118, 214)"}},{types:["variable"],style:{color:"rgb(201, 103, 101)"}},{types:["number"],style:{color:"rgb(170, 9, 130)"}},{types:["punctuation"],style:{color:"rgb(153, 76, 195)"}},{types:["function","selector","doctype"],style:{color:"rgb(153, 76, 195)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(17, 17, 17)"}},{types:["tag"],style:{color:"rgb(153, 76, 195)"}},{types:["operator","property","keyword","namespace"],style:{color:"rgb(12, 150, 155)"}},{types:["boolean"],style:{color:"rgb(188, 84, 84)"}}]},dke=uke,Mo={char:"#D8DEE9",comment:"#999999",keyword:"#c5a5c5",primitive:"#5a9bcf",string:"#8dc891",variable:"#d7deea",boolean:"#ff8b50",tag:"#fc929e",function:"#79b6f2",className:"#FAC863"},fke={plain:{backgroundColor:"#282c34",color:"#ffffff"},styles:[{types:["attr-name"],style:{color:Mo.keyword}},{types:["attr-value"],style:{color:Mo.string}},{types:["comment","block-comment","prolog","doctype","cdata","shebang"],style:{color:Mo.comment}},{types:["property","number","function-name","constant","symbol","deleted"],style:{color:Mo.primitive}},{types:["boolean"],style:{color:Mo.boolean}},{types:["tag"],style:{color:Mo.tag}},{types:["string"],style:{color:Mo.string}},{types:["punctuation"],style:{color:Mo.string}},{types:["selector","char","builtin","inserted"],style:{color:Mo.char}},{types:["function"],style:{color:Mo.function}},{types:["operator","entity","url","variable"],style:{color:Mo.variable}},{types:["keyword"],style:{color:Mo.keyword}},{types:["atrule","class-name"],style:{color:Mo.className}},{types:["important"],style:{fontWeight:"400"}},{types:["bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}}]},hke=fke,pke={plain:{color:"#f8f8f2",backgroundColor:"#272822"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"#f92672",fontStyle:"italic"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"#8292a2",fontStyle:"italic"}},{types:["string","url"],style:{color:"#a6e22e"}},{types:["variable"],style:{color:"#f8f8f2"}},{types:["number"],style:{color:"#ae81ff"}},{types:["builtin","char","constant","function","class-name"],style:{color:"#e6db74"}},{types:["punctuation"],style:{color:"#f8f8f2"}},{types:["selector","doctype"],style:{color:"#a6e22e",fontStyle:"italic"}},{types:["tag","operator","keyword"],style:{color:"#66d9ef"}},{types:["boolean"],style:{color:"#ae81ff"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)",opacity:.7}},{types:["tag","property"],style:{color:"#f92672"}},{types:["attr-name"],style:{color:"#a6e22e !important"}},{types:["doctype"],style:{color:"#8292a2"}},{types:["rule"],style:{color:"#e6db74"}}]},gke=pke,mke={plain:{color:"#bfc7d5",backgroundColor:"#292d3e"},styles:[{types:["comment"],style:{color:"rgb(105, 112, 152)",fontStyle:"italic"}},{types:["string","inserted"],style:{color:"rgb(195, 232, 141)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation","selector"],style:{color:"rgb(199, 146, 234)"}},{types:["variable"],style:{color:"rgb(191, 199, 213)"}},{types:["class-name","attr-name"],style:{color:"rgb(255, 203, 107)"}},{types:["tag","deleted"],style:{color:"rgb(255, 85, 114)"}},{types:["operator"],style:{color:"rgb(137, 221, 255)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["keyword"],style:{fontStyle:"italic"}},{types:["doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}},{types:["url"],style:{color:"rgb(221, 221, 221)"}}]},bke=mke,yke={plain:{color:"#9EFEFF",backgroundColor:"#2D2A55"},styles:[{types:["changed"],style:{color:"rgb(255, 238, 128)"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)"}},{types:["comment"],style:{color:"rgb(179, 98, 255)",fontStyle:"italic"}},{types:["punctuation"],style:{color:"rgb(255, 255, 255)"}},{types:["constant"],style:{color:"rgb(255, 98, 140)"}},{types:["string","url"],style:{color:"rgb(165, 255, 144)"}},{types:["variable"],style:{color:"rgb(255, 238, 128)"}},{types:["number","boolean"],style:{color:"rgb(255, 98, 140)"}},{types:["attr-name"],style:{color:"rgb(255, 180, 84)"}},{types:["keyword","operator","property","namespace","tag","selector","doctype"],style:{color:"rgb(255, 157, 0)"}},{types:["builtin","char","constant","function","class-name"],style:{color:"rgb(250, 208, 0)"}}]},vke=yke,xke={plain:{backgroundColor:"linear-gradient(to bottom, #2a2139 75%, #34294f)",backgroundImage:"#34294f",color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"},styles:[{types:["comment","block-comment","prolog","doctype","cdata"],style:{color:"#495495",fontStyle:"italic"}},{types:["punctuation"],style:{color:"#ccc"}},{types:["tag","attr-name","namespace","number","unit","hexcode","deleted"],style:{color:"#e2777a"}},{types:["property","selector"],style:{color:"#72f1b8",textShadow:"0 0 2px #100c0f, 0 0 10px #257c5575, 0 0 35px #21272475"}},{types:["function-name"],style:{color:"#6196cc"}},{types:["boolean","selector-id","function"],style:{color:"#fdfdfd",textShadow:"0 0 2px #001716, 0 0 3px #03edf975, 0 0 5px #03edf975, 0 0 8px #03edf975"}},{types:["class-name","maybe-class-name","builtin"],style:{color:"#fff5f6",textShadow:"0 0 2px #000, 0 0 10px #fc1f2c75, 0 0 5px #fc1f2c75, 0 0 25px #fc1f2c75"}},{types:["constant","symbol"],style:{color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"}},{types:["important","atrule","keyword","selector-class"],style:{color:"#f4eee4",textShadow:"0 0 2px #393a33, 0 0 8px #f39f0575, 0 0 2px #f39f0575"}},{types:["string","char","attr-value","regex","variable"],style:{color:"#f87c32"}},{types:["parameter"],style:{fontStyle:"italic"}},{types:["entity","url"],style:{color:"#67cdcc"}},{types:["operator"],style:{color:"ffffffee"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["entity"],style:{cursor:"help"}},{types:["inserted"],style:{color:"green"}}]},wke=xke,Ske={plain:{color:"#282a2e",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(197, 200, 198)"}},{types:["string","number","builtin","variable"],style:{color:"rgb(150, 152, 150)"}},{types:["class-name","function","tag","attr-name"],style:{color:"rgb(40, 42, 46)"}}]},_ke=Ske,Cke={plain:{color:"#9CDCFE",backgroundColor:"#1E1E1E"},styles:[{types:["prolog"],style:{color:"rgb(0, 0, 128)"}},{types:["comment"],style:{color:"rgb(106, 153, 85)"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"rgb(86, 156, 214)"}},{types:["number","inserted"],style:{color:"rgb(181, 206, 168)"}},{types:["constant"],style:{color:"rgb(100, 102, 149)"}},{types:["attr-name","variable"],style:{color:"rgb(156, 220, 254)"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"rgb(206, 145, 120)"}},{types:["selector"],style:{color:"rgb(215, 186, 125)"}},{types:["tag"],style:{color:"rgb(78, 201, 176)"}},{types:["tag"],languages:["markup"],style:{color:"rgb(86, 156, 214)"}},{types:["punctuation","operator"],style:{color:"rgb(212, 212, 212)"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"rgb(220, 220, 170)"}},{types:["class-name"],style:{color:"rgb(78, 201, 176)"}},{types:["char"],style:{color:"rgb(209, 105, 105)"}}]},D9=Cke,Eke={plain:{color:"#000000",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(0, 128, 0)"}},{types:["builtin"],style:{color:"rgb(0, 112, 193)"}},{types:["number","variable","inserted"],style:{color:"rgb(9, 134, 88)"}},{types:["operator"],style:{color:"rgb(0, 0, 0)"}},{types:["constant","char"],style:{color:"rgb(129, 31, 63)"}},{types:["tag"],style:{color:"rgb(128, 0, 0)"}},{types:["attr-name"],style:{color:"rgb(255, 0, 0)"}},{types:["deleted","string"],style:{color:"rgb(163, 21, 21)"}},{types:["changed","punctuation"],style:{color:"rgb(4, 81, 165)"}},{types:["function","keyword"],style:{color:"rgb(0, 0, 255)"}},{types:["class-name"],style:{color:"rgb(38, 127, 153)"}}]},Rke=Eke,Tke={plain:{color:"#f8fafc",backgroundColor:"#011627"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#569CD6"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#f8fafc"}},{types:["attr-name","variable"],style:{color:"#9CDCFE"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#cbd5e1"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#D4D4D4"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#7dd3fc"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},kke=Tke,Pke={plain:{color:"#0f172a",backgroundColor:"#f1f5f9"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#0c4a6e"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#0f172a"}},{types:["attr-name","variable"],style:{color:"#0c4a6e"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#64748b"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#475569"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#0e7490"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},Oke=Pke,Mke={plain:{backgroundColor:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(220, 10%, 40%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(220, 14%, 71%)"}},{types:["attr-name","class-name","maybe-class-name","boolean","constant","number","atrule"],style:{color:"hsl(29, 54%, 61%)"}},{types:["keyword"],style:{color:"hsl(286, 60%, 67%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(355, 65%, 65%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value"],style:{color:"hsl(95, 38%, 62%)"}},{types:["variable","operator","function"],style:{color:"hsl(207, 82%, 66%)"}},{types:["url"],style:{color:"hsl(187, 47%, 55%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(220, 14%, 71%)"}}]},Ake=Mke,Dke={plain:{backgroundColor:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(230, 4%, 64%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(230, 8%, 24%)"}},{types:["attr-name","class-name","boolean","constant","number","atrule"],style:{color:"hsl(35, 99%, 36%)"}},{types:["keyword"],style:{color:"hsl(301, 63%, 40%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(5, 74%, 59%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value","punctuation"],style:{color:"hsl(119, 34%, 47%)"}},{types:["variable","operator","function"],style:{color:"hsl(221, 87%, 60%)"}},{types:["url"],style:{color:"hsl(198, 99%, 37%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(230, 8%, 24%)"}}]},Ike=Dke,Nke={plain:{color:"#ebdbb2",backgroundColor:"#292828"},styles:[{types:["imports","class-name","maybe-class-name","constant","doctype","builtin","function"],style:{color:"#d8a657"}},{types:["property-access"],style:{color:"#7daea3"}},{types:["tag"],style:{color:"#e78a4e"}},{types:["attr-name","char","url","regex"],style:{color:"#a9b665"}},{types:["attr-value","string"],style:{color:"#89b482"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#ea6962"}},{types:["entity","number","symbol"],style:{color:"#d3869b"}}]},Fke=Nke,Lke={plain:{color:"#654735",backgroundColor:"#f9f5d7"},styles:[{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#af2528"}},{types:["imports","class-name","maybe-class-name","constant","doctype","builtin"],style:{color:"#b4730e"}},{types:["string","attr-value"],style:{color:"#477a5b"}},{types:["property-access"],style:{color:"#266b79"}},{types:["function","attr-name","char","url"],style:{color:"#72761e"}},{types:["tag"],style:{color:"#b94c07"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["entity","number","symbol"],style:{color:"#924f79"}}]},$ke=Lke,jke=e=>k.useCallback(t=>{var n=t,{className:r,style:o,line:i}=n,s=A9(n,["className","style","line"]);const a=G0(as({},s),{className:ad("token-line",r)});return typeof e=="object"&&"plain"in e&&(a.style=e.plain),typeof o=="object"&&(a.style=as(as({},a.style||{}),o)),a},[e]),zke=e=>{const t=k.useCallback(({types:n,empty:r})=>{if(e!=null){{if(n.length===1&&n[0]==="plain")return r!=null?{display:"inline-block"}:void 0;if(n.length===1&&r!=null)return e[n[0]]}return Object.assign(r!=null?{display:"inline-block"}:{},...n.map(o=>e[o]))}},[e]);return k.useCallback(n=>{var r=n,{token:o,className:i,style:s}=r,a=A9(r,["token","className","style"]);const l=G0(as({},a),{className:ad("token",...o.types,i),children:o.content,style:t(o)});return s!=null&&(l.style=as(as({},l.style||{}),s)),l},[t])},Bke=/\r\n|\r|\n/,MI=e=>{e.length===0?e.push({types:["plain"],content:`
408
+ `,empty:!0}):e.length===1&&e[0].content===""&&(e[0].content=`
409
+ `,e[0].empty=!0)},AI=(e,t)=>{const n=e.length;return n>0&&e[n-1]===t?e:e.concat(t)},Hke=e=>{const t=[[]],n=[e],r=[0],o=[e.length];let i=0,s=0,a=[];const l=[a];for(;s>-1;){for(;(i=r[s]++)<o[s];){let c,u=t[s];const p=n[s][i];if(typeof p=="string"?(u=s>0?u:["plain"],c=p):(u=AI(u,p.type),p.alias&&(u=AI(u,p.alias)),c=p.content),typeof c!="string"){s++,t.push(u),n.push(c),r.push(0),o.push(c.length);continue}const h=c.split(Bke),m=h.length;a.push({types:u,content:h[0]});for(let b=1;b<m;b++)MI(a),l.push(a=[]),a.push({types:u,content:h[b]})}s--,t.pop(),n.pop(),r.pop(),o.pop()}return MI(a),l},DI=Hke,Wke=({prism:e,code:t,grammar:n,language:r})=>k.useMemo(()=>{if(n==null)return DI([t]);const o={code:t,grammar:n,language:r,tokens:[]};return e.hooks.run("before-tokenize",o),o.tokens=e.tokenize(t,n),e.hooks.run("after-tokenize",o),DI(o.tokens)},[t,n,r,e]),Vke=(e,t)=>{const{plain:n}=e,r=e.styles.reduce((o,i)=>{const{languages:s,style:a}=i;return s&&!s.includes(t)||i.types.forEach(l=>{const c=as(as({},o[l]),a);o[l]=c}),o},{});return r.root=n,r.plain=G0(as({},n),{backgroundColor:void 0}),r},Uke=Vke,Gke=({children:e,language:t,code:n,theme:r,prism:o})=>{const i=t.toLowerCase(),s=Uke(r,i),a=jke(s),l=zke(s),c=o.languages[i],u=Wke({prism:o,language:i,code:n,grammar:c});return e({tokens:u,className:`prism-code language-${i}`,style:s!=null?s.root:{},getLineProps:a,getTokenProps:l})},qke=e=>k.createElement(Gke,G0(as({},e),{prism:e.prism||xe,theme:e.theme||D9,code:e.code,language:e.language}));/*! Bundled license information:
410
+
411
+ prismjs/prism.js:
412
+ (**
413
+ * Prism: Lightweight, robust, elegant syntax highlighting
414
+ *
415
+ * @license MIT <https://opensource.org/licenses/MIT>
416
+ * @author Lea Verou <https://lea.verou.me>
417
+ * @namespace
418
+ * @public
419
+ *)
420
+ */function Yke({message:e,onAddToDashboard:t}){var i;const n=(i=e==null?void 0:e.parts)==null?void 0:i.filter(s=>s.type==="tool-invocation"&&s.toolInvocation.toolName==="getData"&&s.toolInvocation.state==="result");if(!n)return null;const o=n.map(s=>s.toolInvocation).map(s=>{const a=s.result;if(a.status==="error")return null;const l=a.data.records;return{chartCfg:EE({cardType:s.args.chartType,data:l}),chartTitle:s.args.chartTitle,chartType:s.args.chartType,sql:s.args.sql,data:l,connectionId:s.args.connectionId}}).filter(s=>s!==null);return!o||o.length===0?null:x.jsx("div",{className:"",children:o.map((s,a)=>x.jsxs("div",{className:"group relative isolate flex h-[350px] w-[99%] grow flex-col",children:[x.jsxs(sr,{className:"invisible absolute right-0 top-0 z-10 h-8 p-2 group-hover:visible",onClick:()=>{t==null||t({sql:s.sql,data:s.data,cardCfg:s.chartCfg,cardTitle:s.chartTitle,connectionId:s.connectionId,cardType:s.chartType})},size:"sm",variant:"outline",children:[x.jsx(Zy,{className:"mr-1 size-4"}),"Add"]}),x.jsx(JE,{cfg:s.chartCfg})]},a))})}function Kke({message:e,showTools:t}){var r;if(!t)return null;const n=(r=e==null?void 0:e.parts)==null?void 0:r.filter(o=>o.type==="tool-invocation");return x.jsx("div",{className:"space-y-3",children:n==null?void 0:n.map((o,i)=>{const s=o.toolInvocation;return x.jsxs(t_e,{children:[x.jsxs(n_e,{className:"rounded-md bg-green-200 p-1 px-2 font-mono text-xs text-black",children:[x.jsx("span",{className:"font-bold",children:"Tool:"})," ",s.toolName]}),x.jsx(r_e,{className:"mt-2 font-mono text-xs",children:x.jsxs("div",{className:"space-y-2 px-2",children:[x.jsxs("div",{className:"space-y-1",children:[x.jsx("span",{children:"Args:"}),x.jsx(by,{language:"json",code:JSON.stringify(s.args,null,2)})]}),x.jsxs("div",{className:"space-y-1",children:[x.jsx("span",{children:"Result:"}),x.jsx(by,{language:"json",code:JSON.stringify(s.result,null,2)})]})]})})]},i)})})}function Xke({message:e}){return e.role!=="user"?null:x.jsxs("div",{className:"rounded-md bg-muted/50 p-3 text-sm",children:[x.jsx(PF,{className:"float-left mr-2 size-4"}),x.jsx("div",{children:e.content})]})}function Qke({message:e}){if(e.role!=="system")return null;const t=e.content.split("|"),n=t[0],r=t[1]||"{}",o=JSON.parse(r);return x.jsxs("div",{className:"space-y-1",children:[x.jsxs("div",{children:[x.jsx("span",{className:"font-bold",children:"System Message:"})," ",n]}),x.jsxs("div",{className:"space-y-1",children:[x.jsx("span",{className:"font-mono text-xs",children:"Scope:"}),x.jsx(by,{language:"json",code:JSON.stringify(o,null,2)})]})]})}function Zke({message:e,handleRun:t}){if(e.role!=="assistant")return null;const n={p:({node:r,...o})=>x.jsx("p",{className:"text-sm",...o}),code:({node:r,...o})=>{var s,a;const i=(a=(s=r==null?void 0:r.children)==null?void 0:s[0])==null?void 0:a.value;return i&&/^#([0-9a-fA-F]{6})$/.test(i)?x.jsx("code",{className:"rounded-md bg-muted px-2 py-1 text-xs",style:{backgroundColor:i},...o}):x.jsx("code",{className:"rounded-md bg-muted px-2 py-1 text-xs",...o})},pre:r=>x.jsx(Jke,{...r,handleRun:t}),li:({node:r,...o})=>x.jsx("li",{className:"my-2 list-outside pl-4 text-sm",...o})};return x.jsx(jTe,{components:n,children:e.content.replace(/DuckDB/gi,"Semaphor")})}function I9({status:e,isLoading:t}){return t?x.jsx("div",{className:"flex items-center text-xs text-muted-foreground",children:e}):null}function N9({messages:e,showTools:t=!1,showSystemMessage:n=!1,handleRun:r,onAddToDashboard:o}){return e==null?void 0:e.map(i=>x.jsxs("div",{className:me("relative my-4 space-y-4 text-sm text-foreground/80"),children:[x.jsx(Xke,{message:i}),n&&x.jsx(Qke,{message:i}),x.jsx(Kke,{message:i,showTools:t}),x.jsx(Yke,{onAddToDashboard:o,message:i}),x.jsx(Zke,{message:i,handleRun:r})]},i.id))}function Jke({children:e,handleRun:t}){const n=ye(a=>a.isVisualEditing),[r,o]=k.useState(!1);k.useRef(null);const i=()=>{navigator.clipboard.writeText(s).then(()=>{o(!0),setTimeout(()=>o(!1),2e3)})},s=$_(e);return x.jsxs("pre",{className:"relative my-2 space-y-2 rounded-md bg-muted/50",children:[x.jsxs("div",{className:"float-right m-1.5",children:[x.jsx(sr,{className:"h-8 p-2 text-xs text-muted-foreground hover:text-foreground",onClick:i,size:"sm",variant:"ghost",children:r?x.jsx(Fd,{className:"size-3"}):x.jsx(UC,{className:"size-3"})}),n&&x.jsx(sr,{className:"h-8 p-2 text-muted-foreground hover:text-foreground",onClick:()=>t==null?void 0:t(s),size:"sm",variant:"ghost",children:x.jsx(wF,{className:"size-3"})})]}),x.jsx(by,{code:s})]})}function $_(e){return typeof e=="string"?e:Array.isArray(e)?e.map($_).join(""):k.isValidElement(e)?$_(e.props.children):""}const by=({code:e,language:t="sql"})=>{const n=ye(r=>r.theme);return x.jsx(qke,{code:e,language:t,theme:n==="dark"?L_.vsDark:L_.oneLight,children:({className:r,style:o,tokens:i,getLineProps:s,getTokenProps:a})=>x.jsx("pre",{className:`${r} border-1 whitespace-pre-wrap rounded-md border border-muted p-2 text-xs`,style:{...o},children:i.map((l,c)=>x.jsx("div",{...s({line:l}),children:l.map((u,d)=>x.jsx("span",{...a({token:u})},d))},c))})})};function F9(e,t){return t||(e==="ready"?"":e==="error"?"Error":e==="streaming"?"":"Thinking...")}function ePe(e,t){return e.some(n=>n.tableName&&n.tableName===t.tableName||n.datamodelName&&n.datamodelName===t.datamodelName)}function tPe(e){return e.filter((n,r,o)=>r===o.findIndex(i=>i.tableName===n.tableName&&i.datamodelName===n.datamodelName))}function nPe(e,t){return e.filter(n=>!(n.connectionId===t.connectionId&&n.tableName===t.tableName&&n.datamodelName===t.datamodelName))}const L9=k.forwardRef(({input:e,handleInputChange:t,handleSubmit:n,isLoading:r,stop:o},i)=>x.jsxs("form",{onSubmit:n,className:"flex w-full items-center rounded-md border",children:[x.jsx(mc,{autoFocus:!0,ref:i,placeholder:"Type your question...",className:me("max-h-10 min-h-7 resize-none border-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"),disabled:r,value:e,onChange:t}),x.jsxs("div",{className:"mr-2 flex items-center gap-2",children:[r===!0&&x.jsx(sr,{size:"sm",className:"h-7 rounded-full p-[9px]",onClick:()=>o(),children:x.jsx(yF,{className:"size-2.5 bg-background"})}),r===!1&&e&&x.jsx("button",{disabled:!e,className:"mr-3",children:x.jsx(CF,{className:"size-4 text-muted-foreground hover:text-foreground"})})]})]}));function rPe({handleChatBox:e}){const t=k.useRef(null),[n,r]=k.useState(""),[o,i]=k.useState(!1),s=ye(I=>I.dashboard.aiScopeTables),{setSelectedConnectionId:a}=Rp(),l=ye(I=>I.selectedSheetId),{addFrame:c,setSelectedFrameId:u,setIsDashboardEditing:d}=Yn(),{authToken:p}=Uo(),h=cC(),{messages:m,setMessages:b,reload:y,input:v,status:w,handleInputChange:_,handleSubmit:R,stop:C}=H8({api:"https://semaphor.cloud/api/v1/chat",headers:{Authorization:`Bearer ${p==null?void 0:p.accessToken}`},maxSteps:10,async onToolCall({toolCall:I}){if(I.toolName==="getTables")return r("Initializing..."),{tables:s||[]};if(I.toolName==="getSchemas"&&r("Analyzing..."),I.toolName==="getData"){r("Fetching...");const F=I.args;if(!(F!=null&&F.sql)||!(F!=null&&F.connectionId))return"Please provide sql, connectionId and table";try{return{status:"success",data:await h.fetchQuery({queryKey:["chat",F.connectionId,F.sql],queryFn:()=>Ay("https://semaphor.cloud/api/v1/query",(p==null?void 0:p.accessToken)||(p==null?void 0:p.accessToken)||"",{connection_id:F.connectionId,sql:F.sql,cache_config:oC({})})})}}catch(L){return console.log("error",L.message),r("Error fetching data"),{status:"error",message:L.message}}}},onFinish(I,F){r(I.content),F.finishReason==="stop"&&r("")}}),E=()=>{var I;(I=t.current)==null||I.scrollIntoView({behavior:"smooth"})};k.useEffect(()=>{E()},[m]);function P({sql:I,data:F,cardCfg:L,cardTitle:j,connectionId:X,cardType:U}){if(!l)return;const $={id:Ga(),title:j||"Title",description:"Description",preferences:{onClickFilter:[{columnIndex:0,expression:""}],chartOptions:{indexAxis:U==="horizontalBar"?"y":"x"}},type:L.type,cfg:L,sql:I,data:F,connectionId:X},B={id:Ga(),cards:[$],activeCardId:$.id};d(!0),c(l,B,"start"),u(B.id)}const A=!["ready","error"].includes(w);return x.jsxs("div",{role:"chat-box",className:"flex h-full grow flex-col justify-between break-words rounded-md",children:[x.jsxs("div",{className:"flex items-center justify-between gap-2 px-6 pb-3 pt-6",children:[x.jsxs("div",{className:"flex items-center gap-4",children:[x.jsx(Tn,{className:"flex items-center gap-2 text-xl",children:"Assistant"}),x.jsxs(Fp,{openDelay:0,children:[x.jsx(Lp,{children:x.jsx(OF,{className:"size-4 text-muted-foreground"})}),x.jsx(Vd,{className:"w-70 p-2",children:x.jsx("div",{className:"flex justify-between space-x-2 text-muted-foreground",children:x.jsxs("div",{children:[(s==null?void 0:s.length)===0&&x.jsx("p",{className:"text-sm",children:"No tables in scope"}),x.jsx("div",{className:"space-y-2",children:s==null?void 0:s.map((I,F)=>x.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[x.jsx(TF,{className:"size-3 text-muted-foreground/70"}),x.jsx("span",{children:TN({schemaName:I.schemaName||"",tableName:I.tableName||"",modelName:I.datamodelName||"",connectionType:I.connectionType||""})})]},F))})]})})})]})]}),x.jsxs("div",{className:"flex items-center gap-1",children:[x.jsx(sr,{className:"h-7 p-2",size:"sm",variant:"ghost",onClick:()=>{b([]),y()},children:x.jsx(RF,{className:"size-4 text-muted-foreground"})}),x.jsx(sr,{className:"h-7 p-2",size:"sm",variant:"ghost",onClick:()=>e(!1),children:x.jsx(Bc,{className:"size-4 text-muted-foreground"})})]})]}),x.jsxs(bc,{className:"flex flex-1 basis-0 flex-col flex-wrap justify-end px-6 py-3",children:[x.jsxs("div",{className:"pb-4",children:[x.jsx(N9,{messages:m,onAddToDashboard:P}),x.jsx(I9,{status:F9(w,n),isLoading:A}),x.jsx("div",{ref:t})]}),x.jsx(Wp,{orientation:"vertical"})]}),x.jsx("div",{className:"px-6 pb-6",children:x.jsx(L9,{stop:C,input:v,handleInputChange:_,handleSubmit:R,isLoading:A})})]})}const{createElement:Md,createContext:oPe,forwardRef:$9,useCallback:fo,useContext:j9,useEffect:vc,useImperativeHandle:z9,useLayoutEffect:iPe,useMemo:sPe,useRef:yo,useState:Uu}=T,II=T[`useId${Math.random()}`.slice(0,5)],aPe=iPe,q0=oPe(null);q0.displayName="PanelGroupContext";const xc=aPe,lPe=typeof II=="function"?II:()=>null;let cPe=0;function QR(e=null){const t=lPe(),n=yo(e||t||null);return n.current===null&&(n.current=""+cPe++),e??n.current}function B9({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:o,forwardedRef:i,id:s,maxSize:a,minSize:l,onCollapse:c,onExpand:u,onResize:d,order:p,style:h,tagName:m="div",...b}){const y=j9(q0);if(y===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:v,expandPanel:w,getPanelSize:_,getPanelStyle:R,groupId:C,isPanelCollapsed:E,reevaluatePanelConstraints:P,registerPanel:A,resizePanel:I,unregisterPanel:F}=y,L=QR(s),j=yo({callbacks:{onCollapse:c,onExpand:u,onResize:d},constraints:{collapsedSize:n,collapsible:r,defaultSize:o,maxSize:a,minSize:l},id:L,idIsFromProps:s!==void 0,order:p});yo({didLogMissingDefaultSizeWarning:!1}),xc(()=>{const{callbacks:U,constraints:$}=j.current,B={...$};j.current.id=L,j.current.idIsFromProps=s!==void 0,j.current.order=p,U.onCollapse=c,U.onExpand=u,U.onResize=d,$.collapsedSize=n,$.collapsible=r,$.defaultSize=o,$.maxSize=a,$.minSize=l,(B.collapsedSize!==$.collapsedSize||B.collapsible!==$.collapsible||B.maxSize!==$.maxSize||B.minSize!==$.minSize)&&P(j.current,B)}),xc(()=>{const U=j.current;return A(U),()=>{F(U)}},[p,L,A,F]),z9(i,()=>({collapse:()=>{v(j.current)},expand:U=>{w(j.current,U)},getId(){return L},getSize(){return _(j.current)},isCollapsed(){return E(j.current)},isExpanded(){return!E(j.current)},resize:U=>{I(j.current,U)}}),[v,w,_,E,L,I]);const X=R(j.current,o);return Md(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":L,"data-panel-size":parseFloat(""+X.flexGrow).toFixed(1)})}const H9=$9((e,t)=>Md(B9,{...e,forwardedRef:t}));B9.displayName="Panel";H9.displayName="forwardRef(Panel)";let j_=null,Ql=null;function uPe(e,t){if(t){const n=(t&q9)!==0,r=(t&Y9)!==0,o=(t&K9)!==0,i=(t&X9)!==0;if(n)return o?"se-resize":i?"ne-resize":"e-resize";if(r)return o?"sw-resize":i?"nw-resize":"w-resize";if(o)return"s-resize";if(i)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function dPe(){Ql!==null&&(document.head.removeChild(Ql),j_=null,Ql=null)}function i1(e,t){const n=uPe(e,t);j_!==n&&(j_=n,Ql===null&&(Ql=document.createElement("style"),document.head.appendChild(Ql)),Ql.innerHTML=`*{cursor: ${n}!important;}`)}function W9(e){return e.type==="keydown"}function V9(e){return e.type.startsWith("pointer")}function U9(e){return e.type.startsWith("mouse")}function Y0(e){if(V9(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(U9(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function fPe(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function hPe(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 pPe(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:LI(e),b:LI(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;kt(r,"Stacking order can only be calculated for elements with a common ancestor");const o={a:FI(NI(n.a)),b:FI(NI(n.b))};if(o.a===o.b){const i=r.childNodes,s={a:n.a.at(-1),b:n.b.at(-1)};let a=i.length;for(;a--;){const l=i[a];if(l===s.a)return 1;if(l===s.b)return-1}}return Math.sign(o.a-o.b)}const gPe=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function mPe(e){var t;const n=getComputedStyle((t=G9(e))!==null&&t!==void 0?t:e).display;return n==="flex"||n==="inline-flex"}function bPe(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||mPe(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"||gPe.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function NI(e){let t=e.length;for(;t--;){const n=e[t];if(kt(n,"Missing node"),bPe(n))return n}return null}function FI(e){return e&&Number(getComputedStyle(e).zIndex)||0}function LI(e){const t=[];for(;e;)t.push(e),e=G9(e);return t}function G9(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const q9=1,Y9=2,K9=4,X9=8,yPe=fPe()==="coarse";let Ii=[],Gu=!1,ka=new Map,K0=new Map;const up=new Set;function vPe(e,t,n,r,o){var i;const{ownerDocument:s}=t,a={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:o},l=(i=ka.get(s))!==null&&i!==void 0?i:0;return ka.set(s,l+1),up.add(a),yy(),function(){var u;K0.delete(e),up.delete(a);const d=(u=ka.get(s))!==null&&u!==void 0?u:1;if(ka.set(s,d-1),yy(),d===1&&ka.delete(s),Ii.includes(a)){const p=Ii.indexOf(a);p>=0&&Ii.splice(p,1),JR(),o("up",!0,null)}}}function $I(e){const{target:t}=e,{x:n,y:r}=Y0(e);Gu=!0,ZR({target:t,x:n,y:r}),yy(),Ii.length>0&&(vy("down",e),e.preventDefault(),e.stopPropagation())}function Bf(e){const{x:t,y:n}=Y0(e);if(Gu&&e.buttons===0&&(Gu=!1,vy("up",e)),!Gu){const{target:r}=e;ZR({target:r,x:t,y:n})}vy("move",e),JR(),Ii.length>0&&e.preventDefault()}function wu(e){const{target:t}=e,{x:n,y:r}=Y0(e);K0.clear(),Gu=!1,Ii.length>0&&e.preventDefault(),vy("up",e),ZR({target:t,x:n,y:r}),JR(),yy()}function ZR({target:e,x:t,y:n}){Ii.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),up.forEach(o=>{const{element:i,hitAreaMargins:s}=o,a=i.getBoundingClientRect(),{bottom:l,left:c,right:u,top:d}=a,p=yPe?s.coarse:s.fine;if(t>=c-p&&t<=u+p&&n>=d-p&&n<=l+p){if(r!==null&&document.contains(r)&&i!==r&&!i.contains(r)&&!r.contains(i)&&pPe(r,i)>0){let m=r,b=!1;for(;m&&!m.contains(i);){if(hPe(m.getBoundingClientRect(),a)){b=!0;break}m=m.parentElement}if(b)return}Ii.push(o)}})}function s1(e,t){K0.set(e,t)}function JR(){let e=!1,t=!1;Ii.forEach(r=>{const{direction:o}=r;o==="horizontal"?e=!0:t=!0});let n=0;K0.forEach(r=>{n|=r}),e&&t?i1("intersection",n):e?i1("horizontal",n):t?i1("vertical",n):dPe()}function yy(){ka.forEach((e,t)=>{const{body:n}=t;n.removeEventListener("contextmenu",wu),n.removeEventListener("pointerdown",$I),n.removeEventListener("pointerleave",Bf),n.removeEventListener("pointermove",Bf)}),window.removeEventListener("pointerup",wu),window.removeEventListener("pointercancel",wu),up.size>0&&(Gu?(Ii.length>0&&ka.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("contextmenu",wu),n.addEventListener("pointerleave",Bf),n.addEventListener("pointermove",Bf))}),window.addEventListener("pointerup",wu),window.addEventListener("pointercancel",wu)):ka.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("pointerdown",$I,{capture:!0}),n.addEventListener("pointermove",Bf))}))}function vy(e,t){up.forEach(n=>{const{setResizeHandlerState:r}=n,o=Ii.includes(n);r(e,o,t)})}function xPe(){const[e,t]=Uu(0);return fo(()=>t(n=>n+1),[])}function kt(e,t){if(!e)throw console.error(t),Error(t)}const eT=10;function Dc(e,t,n=eT){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function Us(e,t,n=eT){return Dc(e,t,n)===0}function No(e,t,n){return Dc(e,t,n)===0}function wPe(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){const o=e[r],i=t[r];if(!No(o,i,n))return!1}return!0}function Mu({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];kt(r!=null,`Panel constraints not found for index ${t}`);let{collapsedSize:o=0,collapsible:i,maxSize:s=100,minSize:a=0}=r;if(Dc(n,a)<0)if(i){const l=(o+a)/2;Dc(n,l)<0?n=o:n=a}else n=a;return n=Math.min(s,n),n=parseFloat(n.toFixed(eT)),n}function ih({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:o,trigger:i}){if(No(e,0))return t;const s=[...t],[a,l]=r;kt(a!=null,"Invalid first pivot index"),kt(l!=null,"Invalid second pivot index");let c=0;if(i==="keyboard"){{const d=e<0?l:a,p=n[d];kt(p,`Panel constraints not found for index ${d}`);const{collapsedSize:h=0,collapsible:m,minSize:b=0}=p;if(m){const y=t[d];if(kt(y!=null,`Previous layout not found for panel index ${d}`),No(y,h)){const v=b-y;Dc(v,Math.abs(e))>0&&(e=e<0?0-v:v)}}}{const d=e<0?a:l,p=n[d];kt(p,`No panel constraints found for index ${d}`);const{collapsedSize:h=0,collapsible:m,minSize:b=0}=p;if(m){const y=t[d];if(kt(y!=null,`Previous layout not found for panel index ${d}`),No(y,b)){const v=y-h;Dc(v,Math.abs(e))>0&&(e=e<0?0-v:v)}}}}{const d=e<0?1:-1;let p=e<0?l:a,h=0;for(;;){const b=t[p];kt(b!=null,`Previous layout not found for panel index ${p}`);const v=Mu({panelConstraints:n,panelIndex:p,size:100})-b;if(h+=v,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];kt(m!=null,`Previous layout not found for panel index ${p}`);const b=m-h,y=Mu({panelConstraints:n,panelIndex:p,size:b});if(!No(m,y)&&(c+=m-y,s[p]=y,c.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?p--:p++}}if(wPe(o,s))return o;{const d=e<0?l:a,p=t[d];kt(p!=null,`Previous layout not found for panel index ${d}`);const h=p+c,m=Mu({panelConstraints:n,panelIndex:d,size:h});if(s[d]=m,!No(m,h)){let b=h-m,v=e<0?l:a;for(;v>=0&&v<n.length;){const w=s[v];kt(w!=null,`Previous layout not found for panel index ${v}`);const _=w+b,R=Mu({panelConstraints:n,panelIndex:v,size:_});if(No(w,R)||(b-=R-w,s[v]=R),No(b,0))break;e>0?v--:v++}}}const u=s.reduce((d,p)=>p+d,0);return No(u,100)?s:o}function SPe({layout:e,panelsArray:t,pivotIndices:n}){let r=0,o=100,i=0,s=0;const a=n[0];kt(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,o=m):(i+=b,s+=m)});const l=Math.min(o,100-i),c=Math.max(r,100-s),u=e[a];return{valueMax:l,valueMin:c,valueNow:u}}function dp(e,t=document){return Array.from(t.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function Q9(e,t,n=document){const o=dp(e,n).findIndex(i=>i.getAttribute("data-panel-resize-handle-id")===t);return o??null}function Z9(e,t,n){const r=Q9(e,t,n);return r!=null?[r,r+1]:[-1,-1]}function J9(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 X0(e,t=document){const n=t.querySelector(`[data-panel-resize-handle-id="${e}"]`);return n||null}function _Pe(e,t,n,r=document){var o,i,s,a;const l=X0(t,r),c=dp(e,r),u=l?c.indexOf(l):-1,d=(o=(i=n[u])===null||i===void 0?void 0:i.id)!==null&&o!==void 0?o: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 CPe({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:o,panelGroupElement:i,setLayout:s}){yo({didWarnAboutMissingResizeHandle:!1}),xc(()=>{if(!i)return;const a=dp(n,i);for(let l=0;l<o.length-1;l++){const{valueMax:c,valueMin:u,valueNow:d}=SPe({layout:r,panelsArray:o,pivotIndices:[l,l+1]}),p=a[l];if(p!=null){const h=o[l];kt(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,o,i]),vc(()=>{if(!i)return;const a=t.current;kt(a,"Eager values not found");const{panelDataArray:l}=a,c=J9(n,i);kt(c!=null,`No group found for id "${n}"`);const u=dp(n,i);kt(u,`No resize handles found for group id "${n}"`);const d=u.map(p=>{const h=p.getAttribute("data-panel-resize-handle-id");kt(h,"Resize handle element has no handle id attribute");const[m,b]=_Pe(n,h,l,i);if(m==null||b==null)return()=>{};const y=v=>{if(!v.defaultPrevented)switch(v.key){case"Enter":{v.preventDefault();const w=l.findIndex(_=>_.id===m);if(w>=0){const _=l[w];kt(_,`No panel data found for index ${w}`);const R=r[w],{collapsedSize:C=0,collapsible:E,minSize:P=0}=_.constraints;if(R!=null&&E){const A=ih({delta:No(R,C)?P-C:C-R,initialLayout:r,panelConstraints:l.map(I=>I.constraints),pivotIndices:Z9(n,h,i),prevLayout:r,trigger:"keyboard"});r!==A&&s(A)}}break}}};return p.addEventListener("keydown",y),()=>{p.removeEventListener("keydown",y)}});return()=>{d.forEach(p=>p())}},[i,e,t,n,r,o,s])}function jI(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 e7(e,t){const n=e==="horizontal",{x:r,y:o}=Y0(t);return n?r:o}function EPe(e,t,n,r,o){const i=n==="horizontal",s=X0(t,o);kt(s,`No resize handle element found for id "${t}"`);const a=s.getAttribute("data-panel-group-id");kt(a,"Resize handle element has no group id attribute");let{initialCursorPosition:l}=r;const c=e7(n,e),u=J9(a,o);kt(u,`No group element found for id "${a}"`);const d=u.getBoundingClientRect(),p=i?d.width:d.height;return(c-l)/p*100}function RPe(e,t,n,r,o,i){if(W9(e)){const s=n==="horizontal";let a=0;e.shiftKey?a=100:o!=null?a=o: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:EPe(e,t,n,r,i)}function TPe({panelDataArray:e}){const t=Array(e.length),n=e.map(i=>i.constraints);let r=0,o=100;for(let i=0;i<e.length;i++){const s=n[i];kt(s,`Panel constraints not found for index ${i}`);const{defaultSize:a}=s;a!=null&&(r++,t[i]=a,o-=a)}for(let i=0;i<e.length;i++){const s=n[i];kt(s,`Panel constraints not found for index ${i}`);const{defaultSize:a}=s;if(a!=null)continue;const l=e.length-r,c=o/l;r++,t[i]=c,o-=c}return t}function Su(e,t,n){t.forEach((r,o)=>{const i=e[o];kt(i,`Panel data not found for index ${o}`);const{callbacks:s,constraints:a,id:l}=i,{collapsedSize:c=0,collapsible:u}=a,d=n[l];if(d==null||r!==d){n[l]=r;const{onCollapse:p,onExpand:h,onResize:m}=s;m&&m(r,d),u&&(p||h)&&(h&&(d==null||Us(d,c))&&!Us(r,c)&&h(),p&&(d==null||!Us(d,c))&&Us(r,c)&&p())}})}function Km(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 kPe({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:o,precision:i=3}){const s=n[o];let a;return s==null?a=e!=null?e.toPrecision(i):"1":r.length===1?a="1":a=s.toPrecision(i),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}function PPe(e,t=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}function zI(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 t7(e){return`react-resizable-panels:${e}`}function n7(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:o,order:i}=t;return o?r:i?`${i}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function r7(e,t){try{const n=t7(e),r=t.getItem(n);if(r){const o=JSON.parse(r);if(typeof o=="object"&&o!=null)return o}}catch{}return null}function OPe(e,t,n){var r,o;const i=(r=r7(e,n))!==null&&r!==void 0?r:{},s=n7(t);return(o=i[s])!==null&&o!==void 0?o:null}function MPe(e,t,n,r,o){var i;const s=t7(e),a=n7(t),l=(i=r7(e,o))!==null&&i!==void 0?i:{};l[a]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{o.setItem(s,JSON.stringify(l))}catch(c){console.error(c)}}function BI({layout:e,panelConstraints:t}){const n=[...e],r=n.reduce((i,s)=>i+s,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(i=>`${i}%`).join(", ")}`);if(!No(r,100)&&n.length>0)for(let i=0;i<t.length;i++){const s=n[i];kt(s!=null,`No layout data found for index ${i}`);const a=100/r*s;n[i]=a}let o=0;for(let i=0;i<t.length;i++){const s=n[i];kt(s!=null,`No layout data found for index ${i}`);const a=Mu({panelConstraints:t,panelIndex:i,size:s});s!=a&&(o+=s-a,n[i]=a)}if(!No(o,0))for(let i=0;i<t.length;i++){const s=n[i];kt(s!=null,`No layout data found for index ${i}`);const a=s+o,l=Mu({panelConstraints:t,panelIndex:i,size:a});if(s!==l&&(o-=l-s,n[i]=l,No(o,0)))break}return n}const APe=100,sh={getItem:e=>(zI(sh),sh.getItem(e)),setItem:(e,t)=>{zI(sh),sh.setItem(e,t)}},HI={};function o7({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:o,id:i=null,onLayout:s=null,keyboardResizeBy:a=null,storage:l=sh,style:c,tagName:u="div",...d}){const p=QR(i),h=yo(null),[m,b]=Uu(null),[y,v]=Uu([]),w=xPe(),_=yo({}),R=yo(new Map),C=yo(0),E=yo({autoSaveId:e,direction:r,dragState:m,id:p,keyboardResizeBy:a,onLayout:s,storage:l}),P=yo({layout:y,panelDataArray:[],panelDataArrayChanged:!1});yo({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),z9(o,()=>({getId:()=>E.current.id,getLayout:()=>{const{layout:M}=P.current;return M},setLayout:M=>{const{onLayout:ee}=E.current,{layout:K,panelDataArray:re}=P.current,Y=BI({layout:M,panelConstraints:re.map(J=>J.constraints)});jI(K,Y)||(v(Y),P.current.layout=Y,ee&&ee(Y),Su(re,Y,_.current))}}),[]),xc(()=>{E.current.autoSaveId=e,E.current.direction=r,E.current.dragState=m,E.current.id=p,E.current.onLayout=s,E.current.storage=l}),CPe({committedValuesRef:E,eagerValuesRef:P,groupId:p,layout:y,panelDataArray:P.current.panelDataArray,setLayout:v,panelGroupElement:h.current}),vc(()=>{const{panelDataArray:M}=P.current;if(e){if(y.length===0||y.length!==M.length)return;let ee=HI[e];ee==null&&(ee=PPe(MPe,APe),HI[e]=ee);const K=[...M],re=new Map(R.current);ee(e,K,re,y,l)}},[e,y,l]),vc(()=>{});const A=fo(M=>{const{onLayout:ee}=E.current,{layout:K,panelDataArray:re}=P.current;if(M.constraints.collapsible){const Y=re.map(he=>he.constraints),{collapsedSize:J=0,panelSize:ie,pivotIndices:de}=Ol(re,M,K);if(kt(ie!=null,`Panel size not found for panel "${M.id}"`),!Us(ie,J)){R.current.set(M.id,ie);const se=Cu(re,M)===re.length-1?ie-J:J-ie,ge=ih({delta:se,initialLayout:K,panelConstraints:Y,pivotIndices:de,prevLayout:K,trigger:"imperative-api"});Km(K,ge)||(v(ge),P.current.layout=ge,ee&&ee(ge),Su(re,ge,_.current))}}},[]),I=fo((M,ee)=>{const{onLayout:K}=E.current,{layout:re,panelDataArray:Y}=P.current;if(M.constraints.collapsible){const J=Y.map(ue=>ue.constraints),{collapsedSize:ie=0,panelSize:de=0,minSize:he=0,pivotIndices:se}=Ol(Y,M,re),ge=ee??he;if(Us(de,ie)){const ue=R.current.get(M.id),Ce=ue!=null&&ue>=ge?ue:ge,Ne=Cu(Y,M)===Y.length-1?de-Ce:Ce-de,Oe=ih({delta:Ne,initialLayout:re,panelConstraints:J,pivotIndices:se,prevLayout:re,trigger:"imperative-api"});Km(re,Oe)||(v(Oe),P.current.layout=Oe,K&&K(Oe),Su(Y,Oe,_.current))}}},[]),F=fo(M=>{const{layout:ee,panelDataArray:K}=P.current,{panelSize:re}=Ol(K,M,ee);return kt(re!=null,`Panel size not found for panel "${M.id}"`),re},[]),L=fo((M,ee)=>{const{panelDataArray:K}=P.current,re=Cu(K,M);return kPe({defaultSize:ee,dragState:m,layout:y,panelData:K,panelIndex:re})},[m,y]),j=fo(M=>{const{layout:ee,panelDataArray:K}=P.current,{collapsedSize:re=0,collapsible:Y,panelSize:J}=Ol(K,M,ee);return kt(J!=null,`Panel size not found for panel "${M.id}"`),Y===!0&&Us(J,re)},[]),X=fo(M=>{const{layout:ee,panelDataArray:K}=P.current,{collapsedSize:re=0,collapsible:Y,panelSize:J}=Ol(K,M,ee);return kt(J!=null,`Panel size not found for panel "${M.id}"`),!Y||Dc(J,re)>0},[]),U=fo(M=>{const{panelDataArray:ee}=P.current;ee.push(M),ee.sort((K,re)=>{const Y=K.order,J=re.order;return Y==null&&J==null?0:Y==null?-1:J==null?1:Y-J}),P.current.panelDataArrayChanged=!0,w()},[w]);xc(()=>{if(P.current.panelDataArrayChanged){P.current.panelDataArrayChanged=!1;const{autoSaveId:M,onLayout:ee,storage:K}=E.current,{layout:re,panelDataArray:Y}=P.current;let J=null;if(M){const de=OPe(M,Y,K);de&&(R.current=new Map(Object.entries(de.expandToSizes)),J=de.layout)}J==null&&(J=TPe({panelDataArray:Y}));const ie=BI({layout:J,panelConstraints:Y.map(de=>de.constraints)});jI(re,ie)||(v(ie),P.current.layout=ie,ee&&ee(ie),Su(Y,ie,_.current))}}),xc(()=>{const M=P.current;return()=>{M.layout=[]}},[]);const $=fo(M=>{let ee=!1;const K=h.current;return K&&window.getComputedStyle(K,null).getPropertyValue("direction")==="rtl"&&(ee=!0),function(Y){Y.preventDefault();const J=h.current;if(!J)return()=>null;const{direction:ie,dragState:de,id:he,keyboardResizeBy:se,onLayout:ge}=E.current,{layout:ue,panelDataArray:Ce}=P.current,{initialLayout:ke}=de??{},Ne=Z9(he,M,J);let Oe=RPe(Y,M,ie,de,se,J);const Le=ie==="horizontal";Le&&ee&&(Oe=-Oe);const Je=Ce.map(vt=>vt.constraints),it=ih({delta:Oe,initialLayout:ke??ue,panelConstraints:Je,pivotIndices:Ne,prevLayout:ue,trigger:W9(Y)?"keyboard":"mouse-or-touch"}),ln=!Km(ue,it);(V9(Y)||U9(Y))&&C.current!=Oe&&(C.current=Oe,!ln&&Oe!==0?Le?s1(M,Oe<0?q9:Y9):s1(M,Oe<0?K9:X9):s1(M,0)),ln&&(v(it),P.current.layout=it,ge&&ge(it),Su(Ce,it,_.current))}},[]),B=fo((M,ee)=>{const{onLayout:K}=E.current,{layout:re,panelDataArray:Y}=P.current,J=Y.map(ue=>ue.constraints),{panelSize:ie,pivotIndices:de}=Ol(Y,M,re);kt(ie!=null,`Panel size not found for panel "${M.id}"`);const se=Cu(Y,M)===Y.length-1?ie-ee:ee-ie,ge=ih({delta:se,initialLayout:re,panelConstraints:J,pivotIndices:de,prevLayout:re,trigger:"imperative-api"});Km(re,ge)||(v(ge),P.current.layout=ge,K&&K(ge),Su(Y,ge,_.current))},[]),W=fo((M,ee)=>{const{layout:K,panelDataArray:re}=P.current,{collapsedSize:Y=0,collapsible:J}=ee,{collapsedSize:ie=0,collapsible:de,maxSize:he=100,minSize:se=0}=M.constraints,{panelSize:ge}=Ol(re,M,K);ge!=null&&(J&&de&&Us(ge,Y)?Us(Y,ie)||B(M,ie):ge<se?B(M,se):ge>he&&B(M,he))},[B]),q=fo((M,ee)=>{const{direction:K}=E.current,{layout:re}=P.current;if(!h.current)return;const Y=X0(M,h.current);kt(Y,`Drag handle element not found for id "${M}"`);const J=e7(K,ee);b({dragHandleId:M,dragHandleRect:Y.getBoundingClientRect(),initialCursorPosition:J,initialLayout:re})},[]),Q=fo(()=>{b(null)},[]),D=fo(M=>{const{panelDataArray:ee}=P.current,K=Cu(ee,M);K>=0&&(ee.splice(K,1),delete _.current[M.id],P.current.panelDataArrayChanged=!0,w())},[w]),G=sPe(()=>({collapsePanel:A,direction:r,dragState:m,expandPanel:I,getPanelSize:F,getPanelStyle:L,groupId:p,isPanelCollapsed:j,isPanelExpanded:X,reevaluatePanelConstraints:W,registerPanel:U,registerResizeHandle:$,resizePanel:B,startDragging:q,stopDragging:Q,unregisterPanel:D,panelGroupElement:h.current}),[A,m,r,I,F,L,p,j,X,W,U,$,B,q,Q,D]),V={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return Md(q0.Provider,{value:G},Md(u,{...d,children:t,className:n,id:i,ref:h,style:{...V,...c},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":p}))}const i7=$9((e,t)=>Md(o7,{...e,forwardedRef:t}));o7.displayName="PanelGroup";i7.displayName="forwardRef(PanelGroup)";function Cu(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function Ol(e,t,n){const r=Cu(e,t),i=r===e.length-1?[r-1,r]:[r,r+1],s=n[r];return{...t.constraints,panelSize:s,pivotIndices:i}}function DPe({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){vc(()=>{if(e||n==null||r==null)return;const o=X0(t,r);if(o==null)return;const i=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=o.getAttribute("data-panel-group-id");kt(a,`No group element found for id "${a}"`);const l=dp(a,r),c=Q9(a,t,r);kt(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 o.addEventListener("keydown",i),()=>{o.removeEventListener("keydown",i)}},[r,e,t,n])}function tT({children:e=null,className:t="",disabled:n=!1,hitAreaMargins:r,id:o,onBlur:i,onDragging:s,onFocus:a,style:l={},tabIndex:c=0,tagName:u="div",...d}){var p,h;const m=yo(null),b=yo({onDragging:s});vc(()=>{b.current.onDragging=s});const y=j9(q0);if(y===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:v,groupId:w,registerResizeHandle:_,startDragging:R,stopDragging:C,panelGroupElement:E}=y,P=QR(o),[A,I]=Uu("inactive"),[F,L]=Uu(!1),[j,X]=Uu(null),U=yo({state:A});xc(()=>{U.current.state=A}),vc(()=>{if(n)X(null);else{const q=_(P);X(()=>q)}},[n,P,_]);const $=(p=r==null?void 0:r.coarse)!==null&&p!==void 0?p:15,B=(h=r==null?void 0:r.fine)!==null&&h!==void 0?h:5;return vc(()=>{if(n||j==null)return;const q=m.current;return kt(q,"Element ref not attached"),vPe(P,q,v,{coarse:$,fine:B},(D,G,V)=>{if(G)switch(D){case"down":{I("drag"),kt(V,'Expected event to be defined for "down" action'),R(P,V);const{onDragging:M}=b.current;M&&M(!0);break}case"move":{const{state:M}=U.current;M!=="drag"&&I("hover"),kt(V,'Expected event to be defined for "move" action'),j(V);break}case"up":{I("hover"),C();const{onDragging:M}=b.current;M&&M(!1);break}}else I("inactive")})},[$,v,n,B,_,P,j,R,C]),DPe({disabled:n,handleId:P,resizeHandler:j,panelGroupElement:E}),Md(u,{...d,children:e,className:t,id:o,onBlur:()=>{L(!1),i==null||i()},onFocus:()=>{L(!0),a==null||a()},ref:m,role:"separator",style:{...{touchAction:"none",userSelect:"none"},...l},tabIndex:c,"data-panel-group-direction":v,"data-panel-group-id":w,"data-resize-handle":"","data-resize-handle-active":A==="drag"?"pointer":F?"keyboard":void 0,"data-resize-handle-state":A,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":P})}tT.displayName="PanelResizeHandle";const s7=({className:e,...t})=>x.jsx(i7,{className:me("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}),z_=H9,IPe=({withHandle:e,className:t,...n})=>x.jsx(tT,{className:me("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&&x.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:x.jsx(hF,{className:"h-2.5 w-2.5"})})}),NPe=({withHandle:e,className:t,onTabClick:n,open:r,...o})=>x.jsx(tT,{className:me("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),...o,children:e&&!r&&x.jsx("div",{className:me("z-50 flex items-center justify-start",{"border-l":r}),children:x.jsx(sr,{variant:"secondary",className:me("h-7 p-0.5",{"rounded-bl-none rounded-br-md rounded-tl-none rounded-tr-md":r,"mt-0 rounded-bl-md rounded-br-none rounded-tl-md rounded-tr-none":!r}),onClick:()=>n(!r),children:r?x.jsx(WC,{className:"size-4"}):x.jsx(aF,{className:"size-4"})})})});var nT="Dialog",[a7,l7]=lr(nT),[FPe,Li]=a7(nT),c7=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,a=T.useRef(null),l=T.useRef(null),[c=!1,u]=$r({prop:r,defaultProp:o,onChange:i});return x.jsx(FPe,{scope:t,triggerRef:a,contentRef:l,contentId:Jn(),titleId:Jn(),descriptionId:Jn(),open:c,onOpenChange:u,onOpenToggle:T.useCallback(()=>u(d=>!d),[u]),modal:s,children:n})};c7.displayName=nT;var u7="DialogTrigger",d7=T.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Li(u7,n),i=dt(t,o.triggerRef);return x.jsx(je.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":iT(o.open),...r,ref:i,onClick:Te(e.onClick,o.onOpenToggle)})});d7.displayName=u7;var rT="DialogPortal",[LPe,f7]=a7(rT,{forceMount:void 0}),h7=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=Li(rT,t);return x.jsx(LPe,{scope:t,forceMount:n,children:T.Children.map(r,s=>x.jsx(er,{present:n||i.open,children:x.jsx(Np,{asChild:!0,container:o,children:s})}))})};h7.displayName=rT;var xy="DialogOverlay",p7=T.forwardRef((e,t)=>{const n=f7(xy,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Li(xy,e.__scopeDialog);return i.modal?x.jsx(er,{present:r||i.open,children:x.jsx($Pe,{...o,ref:t})}):null});p7.displayName=xy;var $Pe=T.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Li(xy,n);return x.jsx(jp,{as:Js,allowPinchZoom:!0,shards:[o.contentRef],children:x.jsx(je.div,{"data-state":iT(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Ic="DialogContent",g7=T.forwardRef((e,t)=>{const n=f7(Ic,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Li(Ic,e.__scopeDialog);return x.jsx(er,{present:r||i.open,children:i.modal?x.jsx(jPe,{...o,ref:t}):x.jsx(zPe,{...o,ref:t})})});g7.displayName=Ic;var jPe=T.forwardRef((e,t)=>{const n=Li(Ic,e.__scopeDialog),r=T.useRef(null),o=dt(t,n.contentRef,r);return T.useEffect(()=>{const i=r.current;if(i)return S0(i)},[]),x.jsx(m7,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Te(e.onCloseAutoFocus,i=>{var s;i.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:Te(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:Te(e.onFocusOutside,i=>i.preventDefault())})}),zPe=T.forwardRef((e,t)=>{const n=Li(Ic,e.__scopeDialog),r=T.useRef(!1),o=T.useRef(!1);return x.jsx(m7,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;((c=n.triggerRef.current)==null?void 0:c.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),m7=T.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,a=Li(Ic,n),l=T.useRef(null),c=dt(t,l);return x0(),x.jsxs(x.Fragment,{children:[x.jsx($p,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:x.jsx(Wc,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":iT(a.open),...s,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),x.jsxs(x.Fragment,{children:[x.jsx(HPe,{titleId:a.titleId}),x.jsx(VPe,{contentRef:l,descriptionId:a.descriptionId})]})]})}),oT="DialogTitle",b7=T.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Li(oT,n);return x.jsx(je.h2,{id:o.titleId,...r,ref:t})});b7.displayName=oT;var y7="DialogDescription",v7=T.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Li(y7,n);return x.jsx(je.p,{id:o.descriptionId,...r,ref:t})});v7.displayName=y7;var x7="DialogClose",w7=T.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Li(x7,n);return x.jsx(je.button,{type:"button",...r,ref:t,onClick:Te(e.onClick,()=>o.onOpenChange(!1))})});w7.displayName=x7;function iT(e){return e?"open":"closed"}var S7="DialogTitleWarning",[BPe,_7]=xQ(S7,{contentName:Ic,titleName:oT,docsSlug:"dialog"}),HPe=({titleId:e})=>{const t=_7(S7),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
421
+
422
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
423
+
424
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return T.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},WPe="DialogDescriptionWarning",VPe=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${_7(WPe).contentName}}.`;return T.useEffect(()=>{var i;const o=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},sT=c7,C7=d7,aT=h7,Q0=p7,Z0=g7,lT=b7,cT=v7,uT=w7,E7="AlertDialog",[UPe,XAe]=lr(E7,[l7]),sa=l7(),R7=e=>{const{__scopeAlertDialog:t,...n}=e,r=sa(t);return x.jsx(sT,{...r,...n,modal:!0})};R7.displayName=E7;var GPe="AlertDialogTrigger",qPe=T.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=sa(n);return x.jsx(C7,{...o,...r,ref:t})});qPe.displayName=GPe;var YPe="AlertDialogPortal",T7=e=>{const{__scopeAlertDialog:t,...n}=e,r=sa(t);return x.jsx(aT,{...r,...n})};T7.displayName=YPe;var KPe="AlertDialogOverlay",k7=T.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=sa(n);return x.jsx(Q0,{...o,...r,ref:t})});k7.displayName=KPe;var qu="AlertDialogContent",[XPe,QPe]=UPe(qu),P7=T.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...o}=e,i=sa(n),s=T.useRef(null),a=dt(t,s),l=T.useRef(null);return x.jsx(BPe,{contentName:qu,titleName:O7,docsSlug:"alert-dialog",children:x.jsx(XPe,{scope:n,cancelRef:l,children:x.jsxs(Z0,{role:"alertdialog",...i,...o,ref:a,onOpenAutoFocus:Te(o.onOpenAutoFocus,c=>{var u;c.preventDefault(),(u=l.current)==null||u.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[x.jsx(dC,{children:r}),x.jsx(JPe,{contentRef:s})]})})})});P7.displayName=qu;var O7="AlertDialogTitle",M7=T.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=sa(n);return x.jsx(lT,{...o,...r,ref:t})});M7.displayName=O7;var A7="AlertDialogDescription",D7=T.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=sa(n);return x.jsx(cT,{...o,...r,ref:t})});D7.displayName=A7;var ZPe="AlertDialogAction",I7=T.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=sa(n);return x.jsx(uT,{...o,...r,ref:t})});I7.displayName=ZPe;var N7="AlertDialogCancel",F7=T.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:o}=QPe(N7,n),i=sa(n),s=dt(t,o);return x.jsx(uT,{...i,...r,ref:s})});F7.displayName=N7;var JPe=({contentRef:e})=>{const t=`\`${qu}\` requires a description for the component to be accessible for screen reader users.
425
+
426
+ You can add a description to the \`${qu}\` by passing a \`${A7}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
427
+
428
+ 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 \`${qu}\`. 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.
429
+
430
+ For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return T.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},eOe=R7,tOe=T7,L7=k7,$7=P7,j7=I7,z7=F7,B7=M7,H7=D7;const nOe=eOe,rOe=tOe,W7=T.forwardRef(({className:e,...t},n)=>x.jsx(L7,{className:me("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}));W7.displayName=L7.displayName;const V7=T.forwardRef(({className:e,...t},n)=>x.jsx(rOe,{children:x.jsxs(Lc,{children:[x.jsx(W7,{}),x.jsx($7,{ref:n,className:me("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})]})}));V7.displayName=$7.displayName;const U7=({className:e,...t})=>x.jsx("div",{className:me("flex flex-col space-y-2 text-center sm:text-left",e),...t});U7.displayName="AlertDialogHeader";const G7=({className:e,...t})=>x.jsx("div",{className:me("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});G7.displayName="AlertDialogFooter";const q7=T.forwardRef(({className:e,...t},n)=>x.jsx(B7,{ref:n,className:me("text-lg font-semibold",e),...t}));q7.displayName=B7.displayName;const Y7=T.forwardRef(({className:e,...t},n)=>x.jsx(H7,{ref:n,className:me("text-sm text-muted-foreground",e),...t}));Y7.displayName=H7.displayName;const K7=T.forwardRef(({className:e,...t},n)=>x.jsx(j7,{ref:n,className:me(Xh(),e),...t}));K7.displayName=j7.displayName;const X7=T.forwardRef(({className:e,...t},n)=>x.jsx(z7,{ref:n,className:me(Xh({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));X7.displayName=z7.displayName;function oOe({open:e,setOpen:t}){const n=ye(i=>i.selectedSheetId),{deleteSheet:r}=Yn();function o(){n&&(r(n),t(!1))}return x.jsx(nOe,{open:e,onOpenChange:t,children:x.jsxs(V7,{children:[x.jsxs(U7,{children:[x.jsx(q7,{children:"Delete Sheet"}),x.jsx(Y7,{children:"Are you sure you want to delete this sheet along with all its cards? This action cannot be undone."})]}),x.jsxs(G7,{children:[x.jsx(X7,{children:"Cancel"}),x.jsx(K7,{onClick:o,children:"Delete"})]})]})})}function Q7(){var y,v;const[e,t]=k.useState(!1),n=ye(w=>{var _;return(_=w.dashboard)==null?void 0:_.sheets}),{showAssistant:r}=Uo(),o=k.useRef(null),[i,s]=k.useState(!1),a=ye(w=>w.isDashboardEditing),l=ye(w=>w.themeStyle),c=ye(w=>w.selectedSheetId),{setSelectedSheetId:u,setSheetTitle:d,addSheet:p}=Yn();if(!n)return null;function h(w){var _,R;w?((_=o.current)==null||_.resize(35),s(!0)):(s(!1),(R=o.current)==null||R.resize(0))}function m(){const w={id:Ga(),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 x.jsxs(mC,{role:"dashboard-tabs-container",className:me("relative flex h-full flex-col",l==null?void 0:l.dashboardTabsContainer),onValueChange:w=>{u(w)},value:c||n[0].id,children:[x.jsx("div",{children:(n.length>1||a)&&x.jsxs($y,{role:"tab-list",className:"flex h-11 items-center justify-start gap-2 rounded-none border-b border-b-muted bg-transparent px-2.5 py-3",children:[n==null?void 0:n.map(w=>{var _,R;return x.jsx(is,{text:w.title,onSave:C=>d(w.id,C),children:x.jsxs(jy,{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&&x.jsx(Bc,{className:"ml-1 size-3",onClick:()=>t(!0)})]})},w.id)}),a&&x.jsx("div",{style:{borderRadius:(v=(y=l==null?void 0:l.chart)==null?void 0:y.options)==null?void 0:v.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:x.jsx(Zy,{className:"size-3"})})]})}),x.jsxs(s7,{className:"grow",direction:"horizontal",children:[x.jsx(z_,{children:x.jsx("div",{style:{},className:"h-full overflow-y-auto",children:n==null?void 0:n.map(w=>x.jsx(bC,{style:{backgroundColor:b()},className:me("mt-0",{}),value:w.id,children:x.jsx(x1e,{sheet:w})},w.id))})}),r===!0&&x.jsxs(x.Fragment,{children:[x.jsx(NPe,{open:i,onTabClick:h,withHandle:!0}),x.jsx(z_,{onResize:w=>{w<1?s(!1):i||s(!0)},defaultSize:0,ref:o,children:x.jsx(rPe,{handleChatBox:h})})]})]}),x.jsx(oOe,{open:e,setOpen:t})]})}function Z7({children:e}){return x.jsx(FX,{defaultTheme:"system",storageKey:"vite-ui-theme",children:x.jsx(mde,{delayDuration:0,children:e})})}function J7(e){return x.jsx(Jy,{FallbackComponent:qC,children:x.jsx(VN,{dashboardProps:e,children:x.jsx(Z7,{children:x.jsx(YN,{...e,children:x.jsx(Q7,{})})})})})}var B_=["Enter"," "],iOe=["ArrowDown","PageUp","Home"],ez=["ArrowUp","PageDown","End"],sOe=[...iOe,...ez],aOe={ltr:[...B_,"ArrowRight"],rtl:[...B_,"ArrowLeft"]},lOe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},eg="Menu",[fp,cOe,uOe]=Fy(eg),[Uc,tz]=lr(eg,[uOe,vs,Nd]),J0=vs(),nz=Nd(),[dOe,Gc]=Uc(eg),[fOe,tg]=Uc(eg),rz=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,a=J0(t),[l,c]=T.useState(null),u=T.useRef(!1),d=ir(i),p=$c(o);return T.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})}},[]),x.jsx(Ap,{...a,children:x.jsx(dOe,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:c,children:x.jsx(fOe,{scope:t,onClose:T.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:p,modal:s,children:r})})})};rz.displayName=eg;var hOe="MenuAnchor",dT=T.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=J0(n);return x.jsx(Wd,{...o,...r,ref:t})});dT.displayName=hOe;var fT="MenuPortal",[pOe,oz]=Uc(fT,{forceMount:void 0}),iz=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=Gc(fT,t);return x.jsx(pOe,{scope:t,forceMount:n,children:x.jsx(er,{present:n||i.open,children:x.jsx(Np,{asChild:!0,container:o,children:r})})})};iz.displayName=fT;var di="MenuContent",[gOe,hT]=Uc(di),sz=T.forwardRef((e,t)=>{const n=oz(di,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Gc(di,e.__scopeMenu),s=tg(di,e.__scopeMenu);return x.jsx(fp.Provider,{scope:e.__scopeMenu,children:x.jsx(er,{present:r||i.open,children:x.jsx(fp.Slot,{scope:e.__scopeMenu,children:s.modal?x.jsx(mOe,{...o,ref:t}):x.jsx(bOe,{...o,ref:t})})})})}),mOe=T.forwardRef((e,t)=>{const n=Gc(di,e.__scopeMenu),r=T.useRef(null),o=dt(t,r);return T.useEffect(()=>{const i=r.current;if(i)return S0(i)},[]),x.jsx(pT,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Te(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),bOe=T.forwardRef((e,t)=>{const n=Gc(di,e.__scopeMenu);return x.jsx(pT,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),pT=T.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,onDismiss:h,disableOutsideScroll:m,...b}=e,y=Gc(di,n),v=tg(di,n),w=J0(n),_=nz(n),R=cOe(n),[C,E]=T.useState(null),P=T.useRef(null),A=dt(t,P,y.onContentChange),I=T.useRef(0),F=T.useRef(""),L=T.useRef(0),j=T.useRef(null),X=T.useRef("right"),U=T.useRef(0),$=m?jp:T.Fragment,B=m?{as:Js,allowPinchZoom:!0}:void 0,W=Q=>{var Y,J;const D=F.current+Q,G=R().filter(ie=>!ie.disabled),V=document.activeElement,M=(Y=G.find(ie=>ie.ref.current===V))==null?void 0:Y.textValue,ee=G.map(ie=>ie.textValue),K=POe(ee,D,M),re=(J=G.find(ie=>ie.textValue===K))==null?void 0:J.ref.current;(function ie(de){F.current=de,window.clearTimeout(I.current),de!==""&&(I.current=window.setTimeout(()=>ie(""),1e3))})(D),re&&setTimeout(()=>re.focus())};T.useEffect(()=>()=>window.clearTimeout(I.current),[]),x0();const q=T.useCallback(Q=>{var G,V;return X.current===((G=j.current)==null?void 0:G.side)&&MOe(Q,(V=j.current)==null?void 0:V.area)},[]);return x.jsx(gOe,{scope:n,searchRef:F,onItemEnter:T.useCallback(Q=>{q(Q)&&Q.preventDefault()},[q]),onItemLeave:T.useCallback(Q=>{var D;q(Q)||((D=P.current)==null||D.focus(),E(null))},[q]),onTriggerLeave:T.useCallback(Q=>{q(Q)&&Q.preventDefault()},[q]),pointerGraceTimerRef:L,onPointerGraceIntentChange:T.useCallback(Q=>{j.current=Q},[]),children:x.jsx($,{...B,children:x.jsx($p,{asChild:!0,trapped:o,onMountAutoFocus:Te(i,Q=>{var D;Q.preventDefault(),(D=P.current)==null||D.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:x.jsx(Wc,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,onDismiss:h,children:x.jsx(fC,{asChild:!0,..._,dir:v.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:E,onEntryFocus:Te(l,Q=>{v.isUsingKeyboardRef.current||Q.preventDefault()}),preventScrollOnEntryFocus:!0,children:x.jsx(Dp,{role:"menu","aria-orientation":"vertical","data-state":Sz(y.open),"data-radix-menu-content":"",dir:v.dir,...w,...b,ref:A,style:{outline:"none",...b.style},onKeyDown:Te(b.onKeyDown,Q=>{const G=Q.target.closest("[data-radix-menu-content]")===Q.currentTarget,V=Q.ctrlKey||Q.altKey||Q.metaKey,M=Q.key.length===1;G&&(Q.key==="Tab"&&Q.preventDefault(),!V&&M&&W(Q.key));const ee=P.current;if(Q.target!==ee||!sOe.includes(Q.key))return;Q.preventDefault();const re=R().filter(Y=>!Y.disabled).map(Y=>Y.ref.current);ez.includes(Q.key)&&re.reverse(),TOe(re)}),onBlur:Te(e.onBlur,Q=>{Q.currentTarget.contains(Q.target)||(window.clearTimeout(I.current),F.current="")}),onPointerMove:Te(e.onPointerMove,hp(Q=>{const D=Q.target,G=U.current!==Q.clientX;if(Q.currentTarget.contains(D)&&G){const V=Q.clientX>U.current?"right":"left";X.current=V,U.current=Q.clientX}}))})})})})})})});sz.displayName=di;var yOe="MenuGroup",gT=T.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return x.jsx(je.div,{role:"group",...r,ref:t})});gT.displayName=yOe;var vOe="MenuLabel",az=T.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return x.jsx(je.div,{...r,ref:t})});az.displayName=vOe;var wy="MenuItem",WI="menu.itemSelect",ev=T.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=T.useRef(null),s=tg(wy,e.__scopeMenu),a=hT(wy,e.__scopeMenu),l=dt(t,i),c=T.useRef(!1),u=()=>{const d=i.current;if(!n&&d){const p=new CustomEvent(WI,{bubbles:!0,cancelable:!0});d.addEventListener(WI,h=>r==null?void 0:r(h),{once:!0}),KN(d,p),p.defaultPrevented?c.current=!1:s.onClose()}};return x.jsx(lz,{...o,ref:l,disabled:n,onClick:Te(e.onClick,u),onPointerDown:d=>{var p;(p=e.onPointerDown)==null||p.call(e,d),c.current=!0},onPointerUp:Te(e.onPointerUp,d=>{var p;c.current||(p=d.currentTarget)==null||p.click()}),onKeyDown:Te(e.onKeyDown,d=>{const p=a.searchRef.current!=="";n||p&&d.key===" "||B_.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});ev.displayName=wy;var lz=T.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=hT(wy,n),a=nz(n),l=T.useRef(null),c=dt(t,l),[u,d]=T.useState(!1),[p,h]=T.useState("");return T.useEffect(()=>{const m=l.current;m&&h((m.textContent??"").trim())},[i.children]),x.jsx(fp.ItemSlot,{scope:n,disabled:r,textValue:o??p,children:x.jsx(hC,{asChild:!0,...a,focusable:!r,children:x.jsx(je.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:c,onPointerMove:Te(e.onPointerMove,hp(m=>{r?s.onItemLeave(m):(s.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Te(e.onPointerLeave,hp(m=>s.onItemLeave(m))),onFocus:Te(e.onFocus,()=>d(!0)),onBlur:Te(e.onBlur,()=>d(!1))})})})}),xOe="MenuCheckboxItem",cz=T.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return x.jsx(pz,{scope:e.__scopeMenu,checked:n,children:x.jsx(ev,{role:"menuitemcheckbox","aria-checked":Sy(n)?"mixed":n,...o,ref:t,"data-state":bT(n),onSelect:Te(o.onSelect,()=>r==null?void 0:r(Sy(n)?!0:!n),{checkForDefaultPrevented:!1})})})});cz.displayName=xOe;var uz="MenuRadioGroup",[wOe,SOe]=Uc(uz,{value:void 0,onValueChange:()=>{}}),dz=T.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=ir(r);return x.jsx(wOe,{scope:e.__scopeMenu,value:n,onValueChange:i,children:x.jsx(gT,{...o,ref:t})})});dz.displayName=uz;var fz="MenuRadioItem",hz=T.forwardRef((e,t)=>{const{value:n,...r}=e,o=SOe(fz,e.__scopeMenu),i=n===o.value;return x.jsx(pz,{scope:e.__scopeMenu,checked:i,children:x.jsx(ev,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":bT(i),onSelect:Te(r.onSelect,()=>{var s;return(s=o.onValueChange)==null?void 0:s.call(o,n)},{checkForDefaultPrevented:!1})})})});hz.displayName=fz;var mT="MenuItemIndicator",[pz,_Oe]=Uc(mT,{checked:!1}),gz=T.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=_Oe(mT,n);return x.jsx(er,{present:r||Sy(i.checked)||i.checked===!0,children:x.jsx(je.span,{...o,ref:t,"data-state":bT(i.checked)})})});gz.displayName=mT;var COe="MenuSeparator",mz=T.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return x.jsx(je.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});mz.displayName=COe;var EOe="MenuArrow",bz=T.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=J0(n);return x.jsx(Ip,{...o,...r,ref:t})});bz.displayName=EOe;var ROe="MenuSub",[QAe,yz]=Uc(ROe),ah="MenuSubTrigger",vz=T.forwardRef((e,t)=>{const n=Gc(ah,e.__scopeMenu),r=tg(ah,e.__scopeMenu),o=yz(ah,e.__scopeMenu),i=hT(ah,e.__scopeMenu),s=T.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,c={__scopeMenu:e.__scopeMenu},u=T.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return T.useEffect(()=>u,[u]),T.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),l(null)}},[a,l]),x.jsx(dT,{asChild:!0,...c,children:x.jsx(lz,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":Sz(n.open),...e,ref:Ny(t,o.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:Te(e.onPointerMove,hp(d=>{i.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:Te(e.onPointerLeave,hp(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,y=b==="right",v=y?-5:5,w=p[y?"left":"right"],_=p[y?"right":"left"];i.onPointerGraceIntentChange({area:[{x:d.clientX+v,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(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(d),d.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:Te(e.onKeyDown,d=>{var h;const p=i.searchRef.current!=="";e.disabled||p&&d.key===" "||aOe[r.dir].includes(d.key)&&(n.onOpenChange(!0),(h=n.content)==null||h.focus(),d.preventDefault())})})})});vz.displayName=ah;var xz="MenuSubContent",wz=T.forwardRef((e,t)=>{const n=oz(di,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Gc(di,e.__scopeMenu),s=tg(di,e.__scopeMenu),a=yz(xz,e.__scopeMenu),l=T.useRef(null),c=dt(t,l);return x.jsx(fp.Provider,{scope:e.__scopeMenu,children:x.jsx(er,{present:r||i.open,children:x.jsx(fp.Slot,{scope:e.__scopeMenu,children:x.jsx(pT,{id:a.contentId,"aria-labelledby":a.triggerId,...o,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:Te(e.onFocusOutside,u=>{u.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Te(e.onEscapeKeyDown,u=>{s.onClose(),u.preventDefault()}),onKeyDown:Te(e.onKeyDown,u=>{var h;const d=u.currentTarget.contains(u.target),p=lOe[s.dir].includes(u.key);d&&p&&(i.onOpenChange(!1),(h=a.trigger)==null||h.focus(),u.preventDefault())})})})})})});wz.displayName=xz;function Sz(e){return e?"open":"closed"}function Sy(e){return e==="indeterminate"}function bT(e){return Sy(e)?"indeterminate":e?"checked":"unchecked"}function TOe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function kOe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function POe(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=kOe(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function OOe(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i].x,l=t[i].y,c=t[s].x,u=t[s].y;l>r!=u>r&&n<(c-a)*(r-l)/(u-l)+a&&(o=!o)}return o}function MOe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return OOe(n,t)}function hp(e){return t=>t.pointerType==="mouse"?e(t):void 0}var AOe=rz,DOe=dT,IOe=iz,NOe=sz,FOe=gT,LOe=az,$Oe=ev,jOe=cz,zOe=dz,BOe=hz,HOe=gz,WOe=mz,VOe=bz,UOe=vz,GOe=wz,yT="DropdownMenu",[qOe,ZAe]=lr(yT,[tz]),to=tz(),[YOe,_z]=qOe(yT),Cz=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,l=to(t),c=T.useRef(null),[u=!1,d]=$r({prop:o,defaultProp:i,onChange:s});return x.jsx(YOe,{scope:t,triggerId:Jn(),triggerRef:c,contentId:Jn(),open:u,onOpenChange:d,onOpenToggle:T.useCallback(()=>d(p=>!p),[d]),modal:a,children:x.jsx(AOe,{...l,open:u,onOpenChange:d,dir:r,modal:a,children:n})})};Cz.displayName=yT;var Ez="DropdownMenuTrigger",Rz=T.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=_z(Ez,n),s=to(n);return x.jsx(DOe,{asChild:!0,...s,children:x.jsx(je.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:Ny(t,i.triggerRef),onPointerDown:Te(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:Te(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});Rz.displayName=Ez;var KOe="DropdownMenuPortal",Tz=e=>{const{__scopeDropdownMenu:t,...n}=e,r=to(t);return x.jsx(IOe,{...r,...n})};Tz.displayName=KOe;var kz="DropdownMenuContent",Pz=T.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=_z(kz,n),i=to(n),s=T.useRef(!1);return x.jsx(NOe,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...r,ref:t,onCloseAutoFocus:Te(e.onCloseAutoFocus,a=>{var l;s.current||(l=o.triggerRef.current)==null||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:Te(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!o.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)"}})});Pz.displayName=kz;var XOe="DropdownMenuGroup",QOe=T.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=to(n);return x.jsx(FOe,{...o,...r,ref:t})});QOe.displayName=XOe;var ZOe="DropdownMenuLabel",Oz=T.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=to(n);return x.jsx(LOe,{...o,...r,ref:t})});Oz.displayName=ZOe;var JOe="DropdownMenuItem",Mz=T.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=to(n);return x.jsx($Oe,{...o,...r,ref:t})});Mz.displayName=JOe;var e2e="DropdownMenuCheckboxItem",Az=T.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=to(n);return x.jsx(jOe,{...o,...r,ref:t})});Az.displayName=e2e;var t2e="DropdownMenuRadioGroup",Dz=T.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=to(n);return x.jsx(zOe,{...o,...r,ref:t})});Dz.displayName=t2e;var n2e="DropdownMenuRadioItem",Iz=T.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=to(n);return x.jsx(BOe,{...o,...r,ref:t})});Iz.displayName=n2e;var r2e="DropdownMenuItemIndicator",Nz=T.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=to(n);return x.jsx(HOe,{...o,...r,ref:t})});Nz.displayName=r2e;var o2e="DropdownMenuSeparator",Fz=T.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=to(n);return x.jsx(WOe,{...o,...r,ref:t})});Fz.displayName=o2e;var i2e="DropdownMenuArrow",s2e=T.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=to(n);return x.jsx(VOe,{...o,...r,ref:t})});s2e.displayName=i2e;var a2e="DropdownMenuSubTrigger",Lz=T.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=to(n);return x.jsx(UOe,{...o,...r,ref:t})});Lz.displayName=a2e;var l2e="DropdownMenuSubContent",$z=T.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=to(n);return x.jsx(GOe,{...o,...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)"}})});$z.displayName=l2e;var c2e=Cz,u2e=Rz,d2e=Tz,jz=Pz,zz=Oz,Bz=Mz,Hz=Az,f2e=Dz,Wz=Iz,Vz=Nz,Uz=Fz,Gz=Lz,qz=$z;const h2e=c2e,p2e=u2e,g2e=f2e,m2e=T.forwardRef(({className:e,inset:t,children:n,...r},o)=>x.jsxs(Gz,{ref:o,className:me("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,x.jsx(WC,{className:"ml-auto h-4 w-4"})]}));m2e.displayName=Gz.displayName;const b2e=T.forwardRef(({className:e,...t},n)=>x.jsx(Lc,{children:x.jsx(qz,{ref:n,className:me("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})}));b2e.displayName=qz.displayName;const Yz=T.forwardRef(({className:e,sideOffset:t=4,...n},r)=>x.jsx(d2e,{children:x.jsx(Lc,{children:x.jsx(jz,{ref:r,sideOffset:t,className:me("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})})}));Yz.displayName=jz.displayName;const Kz=T.forwardRef(({className:e,inset:t,...n},r)=>x.jsx(Bz,{ref:r,className:me("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}));Kz.displayName=Bz.displayName;const Xz=T.forwardRef(({className:e,children:t,checked:n,...r},o)=>x.jsxs(Hz,{ref:o,className:me("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:[x.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:x.jsx(Vz,{children:x.jsx(Fd,{className:"h-4 w-4"})})}),t]}));Xz.displayName=Hz.displayName;const Qz=T.forwardRef(({className:e,children:t,...n},r)=>x.jsxs(Wz,{ref:r,className:me("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:[x.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:x.jsx(Vz,{children:x.jsx(VC,{className:"h-2 w-2 fill-current"})})}),t]}));Qz.displayName=Wz.displayName;const Zz=T.forwardRef(({className:e,inset:t,...n},r)=>x.jsx(zz,{ref:r,className:me("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Zz.displayName=zz.displayName;const Jz=T.forwardRef(({className:e,...t},n)=>x.jsx(Uz,{ref:n,className:me("-mx-1 my-1 h-px bg-muted",e),...t}));Jz.displayName=Uz.displayName;const y2e=sT,v2e=C7,x2e=aT,eB=T.forwardRef(({className:e,...t},n)=>x.jsx(Q0,{ref:n,className:me("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}));eB.displayName=Q0.displayName;const tB=T.forwardRef(({className:e,children:t,...n},r)=>x.jsx(x2e,{children:x.jsxs(Lc,{children:[x.jsx(eB,{}),x.jsxs(Z0,{ref:r,className:me("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,x.jsxs(uT,{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:[x.jsx(Bc,{className:"h-4 w-4"}),x.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}));tB.displayName=Z0.displayName;const nB=({className:e,...t})=>x.jsx("div",{className:me("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});nB.displayName="DialogHeader";const rB=({className:e,...t})=>x.jsx("div",{className:me("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});rB.displayName="DialogFooter";const oB=T.forwardRef(({className:e,...t},n)=>x.jsx(lT,{ref:n,className:me("text-lg font-semibold leading-none tracking-tight",e),...t}));oB.displayName=lT.displayName;const iB=T.forwardRef(({className:e,...t},n)=>x.jsx(cT,{ref:n,className:me("text-sm text-muted-foreground",e),...t}));iB.displayName=cT.displayName;const sB=k.forwardRef(({className:e,...t},n)=>x.jsx("div",{role:"editor-panel",ref:n,className:me("flex h-full grow",e),...t}));sB.displayName="EditorPanel";const aB=k.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:me("flex w-[300px] flex-col space-y-2",e),...t}));aB.displayName="EditorAside";const lB=k.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:me("grow",e),...t}));lB.displayName="EditorMain";function w2e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function UI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VI(Object(n),!0).forEach(function(r){w2e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function S2e(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function _2e(e,t){if(e==null)return{};var n=S2e(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function C2e(e,t){return E2e(e)||R2e(e,t)||T2e(e,t)||k2e()}function E2e(e){if(Array.isArray(e))return e}function R2e(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,o=!1,i=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){o=!0,i=l}finally{try{!r&&s.return!=null&&s.return()}finally{if(o)throw i}}return n}}function T2e(e,t){if(e){if(typeof e=="string")return GI(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 GI(e,t)}}function GI(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 k2e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
431
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function P2e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function YI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qI(Object(n),!0).forEach(function(r){P2e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function O2e(){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(o,i){return i(o)},r)}}function lh(e){return function t(){for(var n=this,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return t.apply(n,[].concat(o,a))}}}function _y(e){return{}.toString.call(e).includes("Object")}function M2e(e){return!Object.keys(e).length}function pp(e){return typeof e=="function"}function A2e(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function D2e(e,t){return _y(t)||Ua("changeType"),Object.keys(t).some(function(n){return!A2e(e,n)})&&Ua("changeField"),t}function I2e(e){pp(e)||Ua("selectorType")}function N2e(e){pp(e)||_y(e)||Ua("handlerType"),_y(e)&&Object.values(e).some(function(t){return!pp(t)})&&Ua("handlersType")}function F2e(e){e||Ua("initialIsRequired"),_y(e)||Ua("initialType"),M2e(e)&&Ua("initialContent")}function L2e(e,t){throw new Error(e[t]||e.default)}var $2e={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"},Ua=lh(L2e)($2e),Xm={changes:D2e,selector:I2e,handler:N2e,initial:F2e};function j2e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Xm.initial(e),Xm.handler(t);var n={current:e},r=lh(H2e)(n,t),o=lh(B2e)(n),i=lh(Xm.changes)(e),s=lh(z2e)(n);function a(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(u){return u};return Xm.selector(c),c(n.current)}function l(c){O2e(r,o,i,s)(c)}return[a,l]}function z2e(e,t){return pp(t)?t(e.current):t}function B2e(e,t){return e.current=YI(YI({},e.current),t),t}function H2e(e,t,n){return pp(t)?t(e.current):Object.keys(n).forEach(function(r){var o;return(o=t[r])===null||o===void 0?void 0:o.call(t,e.current[r])}),n}var W2e={create:j2e},V2e={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/vs"}};function U2e(e){return function t(){for(var n=this,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return t.apply(n,[].concat(o,a))}}}function G2e(e){return{}.toString.call(e).includes("Object")}function q2e(e){return e||KI("configIsRequired"),G2e(e)||KI("configType"),e.urls?(Y2e(),{paths:{vs:e.urls.monacoBase}}):e}function Y2e(){console.warn(cB.deprecation)}function K2e(e,t){throw new Error(e[t]||e.default)}var cB={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!
432
+ You are using deprecated way of configuration.
433
+
434
+ Instead of using
435
+ monaco.config({ urls: { monacoBase: '...' } })
436
+ use
437
+ monaco.config({ paths: { vs: '...' } })
438
+
439
+ For more please check the link https://github.com/suren-atoyan/monaco-loader#config
440
+ `},KI=U2e(K2e)(cB),X2e={config:q2e},Q2e=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o){return n.reduceRight(function(i,s){return s(i)},o)}};function uB(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],uB(e[n],t[n]))}),UI(UI({},e),t)}var Z2e={type:"cancelation",msg:"operation is manually canceled"};function a1(e){var t=!1,n=new Promise(function(r,o){e.then(function(i){return t?o(Z2e):r(i)}),e.catch(o)});return n.cancel=function(){return t=!0},n}var J2e=W2e.create({config:V2e,isInitialized:!1,resolve:null,reject:null,monaco:null}),dB=C2e(J2e,2),ng=dB[0],tv=dB[1];function eMe(e){var t=X2e.config(e),n=t.monaco,r=_2e(t,["monaco"]);tv(function(o){return{config:uB(o.config,r),monaco:n}})}function tMe(){var e=ng(function(t){var n=t.monaco,r=t.isInitialized,o=t.resolve;return{monaco:n,isInitialized:r,resolve:o}});if(!e.isInitialized){if(tv({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),a1(l1);if(window.monaco&&window.monaco.editor)return fB(window.monaco),e.resolve(window.monaco),a1(l1);Q2e(nMe,oMe)(iMe)}return a1(l1)}function nMe(e){return document.body.appendChild(e)}function rMe(e){var t=document.createElement("script");return e&&(t.src=e),t}function oMe(e){var t=ng(function(r){var o=r.config,i=r.reject;return{config:o,reject:i}}),n=rMe("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function iMe(){var e=ng(function(n){var r=n.config,o=n.resolve,i=n.reject;return{config:r,resolve:o,reject:i}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){fB(n),e.resolve(n)},function(n){e.reject(n)})}function fB(e){ng().monaco||tv({monaco:e})}function sMe(){return ng(function(e){var t=e.monaco;return t})}var l1=new Promise(function(e,t){return tv({resolve:e,reject:t})}),Cy={config:eMe,init:tMe,__getMonacoInstance:sMe},aMe={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},c1=aMe,lMe={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},cMe=lMe;function uMe({children:e}){return k.createElement("div",{style:cMe.container},e)}var dMe=uMe,fMe=dMe;function hMe({width:e,height:t,isEditorReady:n,loading:r,_ref:o,className:i,wrapperProps:s}){return k.createElement("section",{style:{...c1.wrapper,width:e,height:t},...s},!n&&k.createElement(fMe,null,r),k.createElement("div",{ref:o,style:{...c1.fullWidth,...!n&&c1.hide},className:i}))}var pMe=hMe,hB=k.memo(pMe);function gMe(e){k.useEffect(e,[])}var vT=gMe;function mMe(e,t,n=!0){let r=k.useRef(!0);k.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var Lo=mMe;function Mh(){}function Au(e,t,n,r){return bMe(e,r)||yMe(e,t,n,r)}function bMe(e,t){return e.editor.getModel(pB(e,t))}function yMe(e,t,n,r){return e.editor.createModel(t,n,r?pB(e,r):void 0)}function pB(e,t){return e.Uri.parse(t)}function vMe({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:o,originalModelPath:i,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:y=Mh,onMount:v=Mh}){let[w,_]=k.useState(!1),[R,C]=k.useState(!0),E=k.useRef(null),P=k.useRef(null),A=k.useRef(null),I=k.useRef(v),F=k.useRef(y),L=k.useRef(!1);vT(()=>{let $=Cy.init();return $.then(B=>(P.current=B)&&C(!1)).catch(B=>(B==null?void 0:B.type)!=="cancelation"&&console.error("Monaco initialization: error:",B)),()=>E.current?U():$.cancel()}),Lo(()=>{if(E.current&&P.current){let $=E.current.getOriginalEditor(),B=Au(P.current,e||"",r||n||"text",i||"");B!==$.getModel()&&$.setModel(B)}},[i],w),Lo(()=>{if(E.current&&P.current){let $=E.current.getModifiedEditor(),B=Au(P.current,t||"",o||n||"text",s||"");B!==$.getModel()&&$.setModel(B)}},[s],w),Lo(()=>{let $=E.current.getModifiedEditor();$.getOption(P.current.editor.EditorOption.readOnly)?$.setValue(t||""):t!==$.getValue()&&($.executeEdits("",[{range:$.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),$.pushUndoStop())},[t],w),Lo(()=>{var $,B;(B=($=E.current)==null?void 0:$.getModel())==null||B.original.setValue(e||"")},[e],w),Lo(()=>{let{original:$,modified:B}=E.current.getModel();P.current.editor.setModelLanguage($,r||n||"text"),P.current.editor.setModelLanguage(B,o||n||"text")},[n,r,o],w),Lo(()=>{var $;($=P.current)==null||$.editor.setTheme(c)},[c],w),Lo(()=>{var $;($=E.current)==null||$.updateOptions(d)},[d],w);let j=k.useCallback(()=>{var W;if(!P.current)return;F.current(P.current);let $=Au(P.current,e||"",r||n||"text",i||""),B=Au(P.current,t||"",o||n||"text",s||"");(W=E.current)==null||W.setModel({original:$,modified:B})},[n,t,o,e,r,i,s]),X=k.useCallback(()=>{var $;!L.current&&A.current&&(E.current=P.current.editor.createDiffEditor(A.current,{automaticLayout:!0,...d}),j(),($=P.current)==null||$.editor.setTheme(c),_(!0),L.current=!0)},[d,c,j]);k.useEffect(()=>{w&&I.current(E.current,P.current)},[w]),k.useEffect(()=>{!R&&!w&&X()},[R,w,X]);function U(){var B,W,q,Q;let $=(B=E.current)==null?void 0:B.getModel();a||((W=$==null?void 0:$.original)==null||W.dispose()),l||((q=$==null?void 0:$.modified)==null||q.dispose()),(Q=E.current)==null||Q.dispose()}return k.createElement(hB,{width:h,height:p,isEditorReady:w,loading:u,_ref:A,className:m,wrapperProps:b})}var xMe=vMe;k.memo(xMe);function wMe(){let[e,t]=k.useState(Cy.__getMonacoInstance());return vT(()=>{let n;return e||(n=Cy.init(),n.then(r=>{t(r)})),()=>n==null?void 0:n.cancel()}),e}var SMe=wMe;function _Me(e){let t=k.useRef();return k.useEffect(()=>{t.current=e},[e]),t.current}var CMe=_Me,Qm=new Map;function EMe({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:o,path:i,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:y={},beforeMount:v=Mh,onMount:w=Mh,onChange:_,onValidate:R=Mh}){let[C,E]=k.useState(!1),[P,A]=k.useState(!0),I=k.useRef(null),F=k.useRef(null),L=k.useRef(null),j=k.useRef(w),X=k.useRef(v),U=k.useRef(),$=k.useRef(r),B=CMe(i),W=k.useRef(!1),q=k.useRef(!1);vT(()=>{let G=Cy.init();return G.then(V=>(I.current=V)&&A(!1)).catch(V=>(V==null?void 0:V.type)!=="cancelation"&&console.error("Monaco initialization: error:",V)),()=>F.current?D():G.cancel()}),Lo(()=>{var V,M,ee,K;let G=Au(I.current,e||r||"",t||o||"",i||n||"");G!==((V=F.current)==null?void 0:V.getModel())&&(d&&Qm.set(B,(M=F.current)==null?void 0:M.saveViewState()),(ee=F.current)==null||ee.setModel(G),d&&((K=F.current)==null||K.restoreViewState(Qm.get(i))))},[i],C),Lo(()=>{var G;(G=F.current)==null||G.updateOptions(c)},[c],C),Lo(()=>{!F.current||r===void 0||(F.current.getOption(I.current.editor.EditorOption.readOnly)?F.current.setValue(r):r!==F.current.getValue()&&(q.current=!0,F.current.executeEdits("",[{range:F.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),F.current.pushUndoStop(),q.current=!1))},[r],C),Lo(()=>{var V,M;let G=(V=F.current)==null?void 0:V.getModel();G&&o&&((M=I.current)==null||M.editor.setModelLanguage(G,o))},[o],C),Lo(()=>{var G;a!==void 0&&((G=F.current)==null||G.revealLine(a))},[a],C),Lo(()=>{var G;(G=I.current)==null||G.editor.setTheme(s)},[s],C);let Q=k.useCallback(()=>{var G;if(!(!L.current||!I.current)&&!W.current){X.current(I.current);let V=i||n,M=Au(I.current,r||e||"",t||o||"",V||"");F.current=(G=I.current)==null?void 0:G.editor.create(L.current,{model:M,automaticLayout:!0,...c},u),d&&F.current.restoreViewState(Qm.get(V)),I.current.editor.setTheme(s),a!==void 0&&F.current.revealLine(a),E(!0),W.current=!0}},[e,t,n,r,o,i,c,u,d,s,a]);k.useEffect(()=>{C&&j.current(F.current,I.current)},[C]),k.useEffect(()=>{!P&&!C&&Q()},[P,C,Q]),$.current=r,k.useEffect(()=>{var G,V;C&&_&&((G=U.current)==null||G.dispose(),U.current=(V=F.current)==null?void 0:V.onDidChangeModelContent(M=>{q.current||_(F.current.getValue(),M)}))},[C,_]),k.useEffect(()=>{if(C){let G=I.current.editor.onDidChangeMarkers(V=>{var ee;let M=(ee=F.current.getModel())==null?void 0:ee.uri;if(M&&V.find(K=>K.path===M.path)){let K=I.current.editor.getModelMarkers({resource:M});R==null||R(K)}});return()=>{G==null||G.dispose()}}return()=>{}},[C,R]);function D(){var G,V;(G=U.current)==null||G.dispose(),p?d&&Qm.set(i,F.current.saveViewState()):(V=F.current.getModel())==null||V.dispose(),F.current.dispose()}return k.createElement(hB,{width:h,height:m,isEditorReady:C,loading:l,_ref:L,className:b,wrapperProps:y})}var RMe=EMe,gB=k.memo(RMe),TMe=gB,xT="Switch",[kMe,JAe]=lr(xT),[PMe,OMe]=kMe(xT),mB=T.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:c,form:u,...d}=e,[p,h]=T.useState(null),m=dt(t,_=>h(_)),b=T.useRef(!1),y=p?u||!!p.closest("form"):!0,[v=!1,w]=$r({prop:o,defaultProp:i,onChange:c});return x.jsxs(PMe,{scope:n,checked:v,disabled:a,children:[x.jsx(je.button,{type:"button",role:"switch","aria-checked":v,"aria-required":s,"data-state":vB(v),"data-disabled":a?"":void 0,disabled:a,value:l,...d,ref:m,onClick:Te(e.onClick,_=>{w(R=>!R),y&&(b.current=_.isPropagationStopped(),b.current||_.stopPropagation())})}),y&&x.jsx(MMe,{control:p,bubbles:!b.current,name:r,value:l,checked:v,required:s,disabled:a,form:u,style:{transform:"translateX(-100%)"}})]})});mB.displayName=xT;var bB="SwitchThumb",yB=T.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=OMe(bB,n);return x.jsx(je.span,{"data-state":vB(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});yB.displayName=bB;var MMe=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=T.useRef(null),s=w0(n),a=f0(t);return T.useEffect(()=>{const l=i.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]),x.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function vB(e){return e?"checked":"unchecked"}var nv=mB,xB=yB;const wB=T.forwardRef(({className:e,...t},n)=>x.jsx(nv,{className:me("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:x.jsx(xB,{className:me("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")})}));wB.displayName=nv.displayName;const AMe=T.forwardRef(({className:e,...t},n)=>x.jsx(nv,{className:me("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:x.jsx(xB,{className:me("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")})}));AMe.displayName=nv.displayName;var aa="Accordion",DMe=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[wT,IMe,NMe]=Fy(aa),[rv,eDe]=lr(aa,[NMe,W8]),ST=W8(),SB=k.forwardRef((e,t)=>{const{type:n,...r}=e,o=r,i=r;return x.jsx(wT.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?x.jsx(jMe,{...i,ref:t}):x.jsx($Me,{...o,ref:t})})});SB.displayName=aa;var[_B,FMe]=rv(aa),[CB,LMe]=rv(aa,{collapsible:!1}),$Me=k.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},collapsible:i=!1,...s}=e,[a,l]=$r({prop:n,defaultProp:r,onChange:o});return x.jsx(_B,{scope:e.__scopeAccordion,value:a?[a]:[],onItemOpen:l,onItemClose:k.useCallback(()=>i&&l(""),[i,l]),children:x.jsx(CB,{scope:e.__scopeAccordion,collapsible:i,children:x.jsx(EB,{...s,ref:t})})})}),jMe=k.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[s=[],a]=$r({prop:n,defaultProp:r,onChange:o}),l=k.useCallback(u=>a((d=[])=>[...d,u]),[a]),c=k.useCallback(u=>a((d=[])=>d.filter(p=>p!==u)),[a]);return x.jsx(_B,{scope:e.__scopeAccordion,value:s,onItemOpen:l,onItemClose:c,children:x.jsx(CB,{scope:e.__scopeAccordion,collapsible:!0,children:x.jsx(EB,{...i,ref:t})})})}),[zMe,ov]=rv(aa),EB=k.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:o,orientation:i="vertical",...s}=e,a=k.useRef(null),l=dt(a,t),c=IMe(n),d=$c(o)==="ltr",p=Te(e.onKeyDown,h=>{var A;if(!DMe.includes(h.key))return;const m=h.target,b=c().filter(I=>{var F;return!((F=I.ref.current)!=null&&F.disabled)}),y=b.findIndex(I=>I.ref.current===m),v=b.length;if(y===-1)return;h.preventDefault();let w=y;const _=0,R=v-1,C=()=>{w=y+1,w>R&&(w=_)},E=()=>{w=y-1,w<_&&(w=R)};switch(h.key){case"Home":w=_;break;case"End":w=R;break;case"ArrowRight":i==="horizontal"&&(d?C():E());break;case"ArrowDown":i==="vertical"&&C();break;case"ArrowLeft":i==="horizontal"&&(d?E():C());break;case"ArrowUp":i==="vertical"&&E();break}const P=w%v;(A=b[P].ref.current)==null||A.focus()});return x.jsx(zMe,{scope:n,disabled:r,direction:o,orientation:i,children:x.jsx(wT.Slot,{scope:n,children:x.jsx(je.div,{...s,"data-orientation":i,ref:l,onKeyDown:r?void 0:p})})})}),Ey="AccordionItem",[BMe,_T]=rv(Ey),RB=k.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...o}=e,i=ov(Ey,n),s=FMe(Ey,n),a=ST(n),l=Jn(),c=r&&s.value.includes(r)||!1,u=i.disabled||e.disabled;return x.jsx(BMe,{scope:n,open:c,disabled:u,triggerId:l,children:x.jsx(G8,{"data-orientation":i.orientation,"data-state":AB(c),...a,...o,ref:t,disabled:u,open:c,onOpenChange:d=>{d?s.onItemOpen(r):s.onItemClose(r)}})})});RB.displayName=Ey;var TB="AccordionHeader",kB=k.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=ov(aa,n),i=_T(TB,n);return x.jsx(je.h3,{"data-orientation":o.orientation,"data-state":AB(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:t})});kB.displayName=TB;var H_="AccordionTrigger",PB=k.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=ov(aa,n),i=_T(H_,n),s=LMe(H_,n),a=ST(n);return x.jsx(wT.ItemSlot,{scope:n,children:x.jsx(JSe,{"aria-disabled":i.open&&!s.collapsible||void 0,"data-orientation":o.orientation,id:i.triggerId,...a,...r,ref:t})})});PB.displayName=H_;var OB="AccordionContent",MB=k.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=ov(aa,n),i=_T(OB,n),s=ST(n);return x.jsx(e_e,{role:"region","aria-labelledby":i.triggerId,"data-orientation":o.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}})});MB.displayName=OB;function AB(e){return e?"open":"closed"}var HMe=SB,WMe=RB,VMe=kB,DB=PB,IB=MB;const UMe=HMe,NB=T.forwardRef(({className:e,...t},n)=>x.jsx(WMe,{ref:n,className:me("border-b",e),...t}));NB.displayName="AccordionItem";const FB=T.forwardRef(({className:e,children:t,...n},r)=>x.jsx(VMe,{className:"flex",children:x.jsxs(DB,{ref:r,className:me("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,x.jsx(Tp,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));FB.displayName=DB.displayName;const LB=T.forwardRef(({className:e,children:t,...n},r)=>x.jsx(IB,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:x.jsx("div",{className:me("pb-4 pt-0",e),children:t})}));LB.displayName=IB.displayName;var XI=1,GMe=.9,qMe=.8,YMe=.17,u1=.1,d1=.999,KMe=.9999,XMe=.99,QMe=/[\\\/_+.#"@\[\(\{&]/,ZMe=/[\\\/_+.#"@\[\(\{&]/g,JMe=/[\s-]/,$B=/[\s-]/g;function W_(e,t,n,r,o,i,s){if(i===t.length)return o===e.length?XI:XMe;var a=`${o},${i}`;if(s[a]!==void 0)return s[a];for(var l=r.charAt(i),c=n.indexOf(l,o),u=0,d,p,h,m;c>=0;)d=W_(e,t,n,r,c+1,i+1,s),d>u&&(c===o?d*=XI:QMe.test(e.charAt(c-1))?(d*=qMe,h=e.slice(o,c-1).match(ZMe),h&&o>0&&(d*=Math.pow(d1,h.length))):JMe.test(e.charAt(c-1))?(d*=GMe,m=e.slice(o,c-1).match($B),m&&o>0&&(d*=Math.pow(d1,m.length))):(d*=YMe,o>0&&(d*=Math.pow(d1,c-o))),e.charAt(c)!==t.charAt(i)&&(d*=KMe)),(d<u1&&n.charAt(c-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(c-1)!==r.charAt(i))&&(p=W_(e,t,n,r,c+1,i+2,s),p*u1>d&&(d=p*u1)),d>u&&(u=d),c=n.indexOf(l,c+1);return s[a]=u,u}function QI(e){return e.toLowerCase().replace($B," ")}function eAe(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,W_(e,t,QI(e),QI(t),0,0,{})}var Hf='[cmdk-group=""]',f1='[cmdk-group-items=""]',tAe='[cmdk-group-heading=""]',CT='[cmdk-item=""]',ZI=`${CT}:not([aria-disabled="true"])`,V_="cmdk-item-select",Hl="data-value",nAe=(e,t,n)=>eAe(e,t,n),jB=T.createContext(void 0),rg=()=>T.useContext(jB),zB=T.createContext(void 0),ET=()=>T.useContext(zB),BB=T.createContext(void 0),HB=T.forwardRef((e,t)=>{let n=Eu(()=>{var V,M;return{search:"",value:(M=(V=e.value)!=null?V:e.defaultValue)!=null?M:"",filtered:{count:0,items:new Map,groups:new Set}}}),r=Eu(()=>new Set),o=Eu(()=>new Map),i=Eu(()=>new Map),s=Eu(()=>new Set),a=WB(e),{label:l,children:c,value:u,onValueChange:d,filter:p,shouldFilter:h,loop:m,disablePointerSelection:b=!1,vimBindings:y=!0,...v}=e,w=Jn(),_=Jn(),R=Jn(),C=T.useRef(null),E=hAe();Nc(()=>{if(u!==void 0){let V=u.trim();n.current.value=V,P.emit()}},[u]),Nc(()=>{E(6,X)},[]);let P=T.useMemo(()=>({subscribe:V=>(s.current.add(V),()=>s.current.delete(V)),snapshot:()=>n.current,setState:(V,M,ee)=>{var K,re,Y;if(!Object.is(n.current[V],M)){if(n.current[V]=M,V==="search")j(),F(),E(1,L);else if(V==="value"&&(ee||E(5,X),((K=a.current)==null?void 0:K.value)!==void 0)){let J=M??"";(Y=(re=a.current).onValueChange)==null||Y.call(re,J);return}P.emit()}},emit:()=>{s.current.forEach(V=>V())}}),[]),A=T.useMemo(()=>({value:(V,M,ee)=>{var K;M!==((K=i.current.get(V))==null?void 0:K.value)&&(i.current.set(V,{value:M,keywords:ee}),n.current.filtered.items.set(V,I(M,ee)),E(2,()=>{F(),P.emit()}))},item:(V,M)=>(r.current.add(V),M&&(o.current.has(M)?o.current.get(M).add(V):o.current.set(M,new Set([V]))),E(3,()=>{j(),F(),n.current.value||L(),P.emit()}),()=>{i.current.delete(V),r.current.delete(V),n.current.filtered.items.delete(V);let ee=U();E(4,()=>{j(),(ee==null?void 0:ee.getAttribute("id"))===V&&L(),P.emit()})}),group:V=>(o.current.has(V)||o.current.set(V,new Set),()=>{i.current.delete(V),o.current.delete(V)}),filter:()=>a.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:w,inputId:R,labelId:_,listInnerRef:C}),[]);function I(V,M){var ee,K;let re=(K=(ee=a.current)==null?void 0:ee.filter)!=null?K:nAe;return V?re(V,n.current.search,M):0}function F(){if(!n.current.search||a.current.shouldFilter===!1)return;let V=n.current.filtered.items,M=[];n.current.filtered.groups.forEach(K=>{let re=o.current.get(K),Y=0;re.forEach(J=>{let ie=V.get(J);Y=Math.max(ie,Y)}),M.push([K,Y])});let ee=C.current;$().sort((K,re)=>{var Y,J;let ie=K.getAttribute("id"),de=re.getAttribute("id");return((Y=V.get(de))!=null?Y:0)-((J=V.get(ie))!=null?J:0)}).forEach(K=>{let re=K.closest(f1);re?re.appendChild(K.parentElement===re?K:K.closest(`${f1} > *`)):ee.appendChild(K.parentElement===ee?K:K.closest(`${f1} > *`))}),M.sort((K,re)=>re[1]-K[1]).forEach(K=>{var re;let Y=(re=C.current)==null?void 0:re.querySelector(`${Hf}[${Hl}="${encodeURIComponent(K[0])}"]`);Y==null||Y.parentElement.appendChild(Y)})}function L(){let V=$().find(ee=>ee.getAttribute("aria-disabled")!=="true"),M=V==null?void 0:V.getAttribute(Hl);P.setState("value",M||void 0)}function j(){var V,M,ee,K;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let re=0;for(let Y of r.current){let J=(M=(V=i.current.get(Y))==null?void 0:V.value)!=null?M:"",ie=(K=(ee=i.current.get(Y))==null?void 0:ee.keywords)!=null?K:[],de=I(J,ie);n.current.filtered.items.set(Y,de),de>0&&re++}for(let[Y,J]of o.current)for(let ie of J)if(n.current.filtered.items.get(ie)>0){n.current.filtered.groups.add(Y);break}n.current.filtered.count=re}function X(){var V,M,ee;let K=U();K&&(((V=K.parentElement)==null?void 0:V.firstChild)===K&&((ee=(M=K.closest(Hf))==null?void 0:M.querySelector(tAe))==null||ee.scrollIntoView({block:"nearest"})),K.scrollIntoView({block:"nearest"}))}function U(){var V;return(V=C.current)==null?void 0:V.querySelector(`${CT}[aria-selected="true"]`)}function $(){var V;return Array.from(((V=C.current)==null?void 0:V.querySelectorAll(ZI))||[])}function B(V){let M=$()[V];M&&P.setState("value",M.getAttribute(Hl))}function W(V){var M;let ee=U(),K=$(),re=K.findIndex(J=>J===ee),Y=K[re+V];(M=a.current)!=null&&M.loop&&(Y=re+V<0?K[K.length-1]:re+V===K.length?K[0]:K[re+V]),Y&&P.setState("value",Y.getAttribute(Hl))}function q(V){let M=U(),ee=M==null?void 0:M.closest(Hf),K;for(;ee&&!K;)ee=V>0?dAe(ee,Hf):fAe(ee,Hf),K=ee==null?void 0:ee.querySelector(ZI);K?P.setState("value",K.getAttribute(Hl)):W(V)}let Q=()=>B($().length-1),D=V=>{V.preventDefault(),V.metaKey?Q():V.altKey?q(1):W(1)},G=V=>{V.preventDefault(),V.metaKey?B(0):V.altKey?q(-1):W(-1)};return T.createElement(je.div,{ref:t,tabIndex:-1,...v,"cmdk-root":"",onKeyDown:V=>{var M;if((M=v.onKeyDown)==null||M.call(v,V),!V.defaultPrevented)switch(V.key){case"n":case"j":{y&&V.ctrlKey&&D(V);break}case"ArrowDown":{D(V);break}case"p":case"k":{y&&V.ctrlKey&&G(V);break}case"ArrowUp":{G(V);break}case"Home":{V.preventDefault(),B(0);break}case"End":{V.preventDefault(),Q();break}case"Enter":if(!V.nativeEvent.isComposing&&V.keyCode!==229){V.preventDefault();let ee=U();if(ee){let K=new Event(V_);ee.dispatchEvent(K)}}}}},T.createElement("label",{"cmdk-label":"",htmlFor:A.inputId,id:A.labelId,style:gAe},l),iv(e,V=>T.createElement(zB.Provider,{value:P},T.createElement(jB.Provider,{value:A},V))))}),rAe=T.forwardRef((e,t)=>{var n,r;let o=Jn(),i=T.useRef(null),s=T.useContext(BB),a=rg(),l=WB(e),c=(r=(n=l.current)==null?void 0:n.forceMount)!=null?r:s==null?void 0:s.forceMount;Nc(()=>{if(!c)return a.item(o,s==null?void 0:s.id)},[c]);let u=VB(o,i,[e.value,e.children,i],e.keywords),d=ET(),p=Fc(E=>E.value&&E.value===u.current),h=Fc(E=>c||a.filter()===!1?!0:E.search?E.filtered.items.get(o)>0:!0);T.useEffect(()=>{let E=i.current;if(!(!E||e.disabled))return E.addEventListener(V_,m),()=>E.removeEventListener(V_,m)},[h,e.onSelect,e.disabled]);function m(){var E,P;b(),(P=(E=l.current).onSelect)==null||P.call(E,u.current)}function b(){d.setState("value",u.current,!0)}if(!h)return null;let{disabled:y,value:v,onSelect:w,forceMount:_,keywords:R,...C}=e;return T.createElement(je.div,{ref:gp([i,t]),...C,id:o,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!p,"data-disabled":!!y,"data-selected":!!p,onPointerMove:y||a.getDisablePointerSelection()?void 0:b,onClick:y?void 0:m},e.children)}),oAe=T.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:o,...i}=e,s=Jn(),a=T.useRef(null),l=T.useRef(null),c=Jn(),u=rg(),d=Fc(h=>o||u.filter()===!1?!0:h.search?h.filtered.groups.has(s):!0);Nc(()=>u.group(s),[]),VB(s,a,[e.value,e.heading,l]);let p=T.useMemo(()=>({id:s,forceMount:o}),[o]);return T.createElement(je.div,{ref:gp([a,t]),...i,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&T.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:c},n),iv(e,h=>T.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?c:void 0},T.createElement(BB.Provider,{value:p},h))))}),iAe=T.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=T.useRef(null),i=Fc(s=>!s.search);return!n&&!i?null:T.createElement(je.div,{ref:gp([o,t]),...r,"cmdk-separator":"",role:"separator"})}),sAe=T.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,o=e.value!=null,i=ET(),s=Fc(u=>u.search),a=Fc(u=>u.value),l=rg(),c=T.useMemo(()=>{var u;let d=(u=l.listInnerRef.current)==null?void 0:u.querySelector(`${CT}[${Hl}="${encodeURIComponent(a)}"]`);return d==null?void 0:d.getAttribute("id")},[]);return T.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),T.createElement(je.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:o?e.value:s,onChange:u=>{o||i.setState("search",u.target.value),n==null||n(u.target.value)}})}),aAe=T.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...o}=e,i=T.useRef(null),s=T.useRef(null),a=rg();return T.useEffect(()=>{if(s.current&&i.current){let l=s.current,c=i.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)}}},[]),T.createElement(je.div,{ref:gp([i,t]),...o,"cmdk-list":"",role:"listbox","aria-label":r,id:a.listId},iv(e,l=>T.createElement("div",{ref:gp([s,a.listInnerRef]),"cmdk-list-sizer":""},l)))}),lAe=T.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:i,container:s,...a}=e;return T.createElement(sT,{open:n,onOpenChange:r},T.createElement(aT,{container:s},T.createElement(Q0,{"cmdk-overlay":"",className:o}),T.createElement(Z0,{"aria-label":e.label,"cmdk-dialog":"",className:i},T.createElement(HB,{ref:t,...a}))))}),cAe=T.forwardRef((e,t)=>Fc(n=>n.filtered.count===0)?T.createElement(je.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),uAe=T.forwardRef((e,t)=>{let{progress:n,children:r,label:o="Loading...",...i}=e;return T.createElement(je.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},iv(e,s=>T.createElement("div",{"aria-hidden":!0},s)))}),Co=Object.assign(HB,{List:aAe,Item:rAe,Input:sAe,Group:oAe,Separator:iAe,Dialog:lAe,Empty:cAe,Loading:uAe});function dAe(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function fAe(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function WB(e){let t=T.useRef(e);return Nc(()=>{t.current=e}),t}var Nc=typeof window>"u"?T.useEffect:T.useLayoutEffect;function Eu(e){let t=T.useRef();return t.current===void 0&&(t.current=e()),t}function gp(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function Fc(e){let t=ET(),n=()=>e(t.snapshot());return D8.useSyncExternalStore(t.subscribe,n,n)}function VB(e,t,n,r=[]){let o=T.useRef(),i=rg();return Nc(()=>{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():o.current}})(),l=r.map(c=>c.trim());i.value(e,a,l),(s=t.current)==null||s.setAttribute(Hl,a),o.current=a}),o}var hAe=()=>{let[e,t]=T.useState(),n=Eu(()=>new Map);return Nc(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,o)=>{n.current.set(r,o),t({})}};function pAe(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function iv({asChild:e,children:t},n){return e&&T.isValidElement(t)?T.cloneElement(pAe(t),{ref:t.ref},n(t.props.children)):n(t)}var gAe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const UB=T.forwardRef(({className:e,...t},n)=>x.jsx(Co,{ref:n,className:me("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));UB.displayName=Co.displayName;const GB=T.forwardRef(({className:e,...t},n)=>x.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[x.jsx(_F,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),x.jsx(Co.Input,{ref:n,className:me("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})]}));GB.displayName=Co.Input.displayName;const qB=T.forwardRef(({className:e,...t},n)=>x.jsx(Co.List,{ref:n,className:me("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));qB.displayName=Co.List.displayName;const YB=T.forwardRef((e,t)=>x.jsx(Co.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));YB.displayName=Co.Empty.displayName;const KB=T.forwardRef(({className:e,...t},n)=>x.jsx(Co.Group,{ref:n,className:me("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}));KB.displayName=Co.Group.displayName;const mAe=T.forwardRef(({className:e,...t},n)=>x.jsx(Co.Separator,{ref:n,className:me("-mx-1 h-px bg-border",e),...t}));mAe.displayName=Co.Separator.displayName;const XB=T.forwardRef(({className:e,...t},n)=>x.jsx(Co.Item,{ref:n,className:me("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}));XB.displayName=Co.Item.displayName;var bAe=Object.defineProperty,yAe=(e,t,n)=>t in e?bAe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Zm=(e,t,n)=>yAe(e,typeof t!="symbol"?t+"":t,n);const vAe={stringify:e=>e?"true":"false",parse:e=>/^[ty1-9]/i.test(e)},xAe={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}},wAe={stringify:e=>JSON.stringify(e),parse:e=>JSON.parse(e)},SAe={stringify:e=>`${e}`,parse:e=>parseFloat(e)},_Ae={stringify:e=>e,parse:e=>e},h1={string:_Ae,number:SAe,boolean:vAe,function:xAe,json:wAe};function CAe(e){return e.replace(/([a-z0-9])([A-Z])/g,(t,n,r)=>`${n}-${r.toLowerCase()}`)}const Jm=Symbol.for("r2wc.render"),eb=Symbol.for("r2wc.connected"),Ml=Symbol.for("r2wc.context"),Ds=Symbol.for("r2wc.props");function EAe(e,t,n){var r,o,i;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=CAe(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(),Zm(this,i,!0),Zm(this,o),Zm(this,r,{}),Zm(this,"container"),t.shadow?this.container=this.attachShadow({mode:t.shadow}):this.container=this,this[Ds].container=this.container;for(const m of s){const b=u[m],y=this.getAttribute(b),v=l[m],w=v?h1[v]:null;w!=null&&w.parse&&y&&(this[Ds][m]=w.parse(y,b,this))}for(const m of a)this[Ds][m]=b=>{const y=m.replace(/^on/,"").toLowerCase();this.dispatchEvent(new CustomEvent(y,{detail:b,...c[m]}))}}static get observedAttributes(){return Object.keys(d)}connectedCallback(){this[eb]=!0,this[Jm]()}disconnectedCallback(){this[eb]=!1,this[Ml]&&n.unmount(this[Ml]),delete this[Ml]}attributeChangedCallback(m,b,y){const v=d[m],w=l[v],_=w?h1[w]:null;v in l&&_!=null&&_.parse&&y&&(this[Ds][v]=_.parse(y,m,this),this[Jm]())}[(i=eb,o=Ml,r=Ds,Jm)](){this[eb]&&(this[Ml]?n.update(this[Ml],this[Ds]):this[Ml]=n.mount(this.container,e,this[Ds]))}}for(const h of s){const m=u[h],b=l[h];Object.defineProperty(p.prototype,h,{enumerable:!0,configurable:!0,get(){return this[Ds][h]},set(y){this[Ds][h]=y;const v=b?h1[b]:null;if(v!=null&&v.stringify){const w=v.stringify(y,m,this);this.getAttribute(m)!==w&&this.setAttribute(m,w)}else this[Jm]()}})}return p}function RAe(e,t,n){const r=C1(e),o=k.createElement(t,n);return r.render(o),{root:r,ReactComponent:t}}function TAe({root:e,ReactComponent:t},n){const r=k.createElement(t,n);e.render(r)}function kAe({root:e}){e.unmount()}function PAe(e,t={}){return EAe(e,t,{mount:RAe,update:TAe,unmount:kAe})}const OAe={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",selectedSheetId:"string"},MAe=PAe(J7,{props:OAe});exports.$e=b1e;exports.Accordion=UMe;exports.AccordionContent=LB;exports.AccordionItem=NB;exports.AccordionTrigger=FB;exports.Button=sr;exports.Calendar=sF;exports.Card=GN;exports.CardContent=Iy;exports.CardDescription=uC;exports.CardHeader=Dy;exports.CardTitle=Id;exports.CaretSortIcon=Mee;exports.ChartJsVisual=JE;exports.ChatInput=L9;exports.ChatStatus=I9;exports.Check=Fd;exports.CheckIcon=HC;exports.Checkbox=z0;exports.ChevronDown=Tp;exports.ChevronLeft=aF;exports.ChevronRight=WC;exports.ChevronUp=lF;exports.Circle=VC;exports.ColorFormat=X$;exports.Command=UB;exports.CommandEmpty=YB;exports.CommandGroup=KB;exports.CommandInput=GB;exports.CommandItem=XB;exports.CommandList=qB;exports.Copy=UC;exports.CopyButton=f8;exports.Cross2Icon=tF;exports.DATAMODEL_NAMESPCACE=J_;exports.Dashboard=J7;exports.DashboardPanel=YN;exports.DashboardTabs=Q7;exports.DashboardWC=MAe;exports.Dialog=y2e;exports.DialogContent=tB;exports.DialogDescription=iB;exports.DialogFooter=rB;exports.DialogHeader=nB;exports.DialogTitle=oB;exports.DialogTrigger=v2e;exports.Download=cF;exports.DropdownMenu=h2e;exports.DropdownMenuCheckboxItem=Xz;exports.DropdownMenuContent=Yz;exports.DropdownMenuItem=Kz;exports.DropdownMenuLabel=Zz;exports.DropdownMenuRadioGroup=g2e;exports.DropdownMenuRadioItem=Qz;exports.DropdownMenuSeparator=Jz;exports.DropdownMenuTrigger=p2e;exports.Editable=is;exports.EditorAside=aB;exports.EditorMain=lB;exports.EditorPanel=sB;exports.ErrorBoundary=Jy;exports.Eye=dF;exports.EyeOff=uF;exports.Fallback=qC;exports.FallbackEditorCard=bte;exports.Filter=fF;exports.FilterComponent=SR;exports.FilterHeader=h8;exports.FilterX=GC;exports.Ft=TMe;exports.GripVertical=hF;exports.HoverCard=Fp;exports.HoverCardContent=Vd;exports.HoverCardTrigger=Lp;exports.Icon=iF;exports.IdCard=pF;exports.Info=gF;exports.Input=mc;exports.KPICard=ey;exports.LOCALE_CURRENCY_PAIRS=E1;exports.Label=Tn;exports.Le=SMe;exports.Lightbulb=bF;exports.LightbulbOff=mF;exports.MultiInputEmptyRenderer=n6;exports.Octagon=yF;exports.PYTHON_DEFAULT_CODE=Z_;exports.Pencil=vF;exports.Percent=xF;exports.Play=wF;exports.Plus=Zy;exports.Popover=T0;exports.PopoverContent=Hp;exports.PopoverTrigger=k0;exports.PrintMessages=N9;exports.RadioGroup=np;exports.RadioGroupItem=Xl;exports.ResizableHandle=IPe;exports.ResizablePanel=z_;exports.ResizablePanelGroup=s7;exports.ScrollArea=bc;exports.ScrollBar=Wp;exports.Search=_F;exports.SearchX=SF;exports.Select=$s;exports.SelectContent=Ui;exports.SelectGroup=_u;exports.SelectItem=Bn;exports.SelectLabel=jl;exports.SelectSeparator=Sh;exports.SelectTrigger=Vi;exports.SelectValue=js;exports.SemaphorContextProvider=VN;exports.SemaphorQueryClient=HN;exports.SendHorizontal=CF;exports.Separator=y0;exports.Settings=EF;exports.SliderIcon=jee;exports.SquarePen=RF;exports.Switch=wB;exports.Table2=TF;exports.TableBody=VE;exports.TableCell=GE;exports.TableHead=UE;exports.TableHeader=WE;exports.TableRow=xh;exports.TableVisual=J$;exports.Tabs=mC;exports.TabsContent=bC;exports.TabsList=$y;exports.TabsTrigger=jy;exports.TextCard=sy;exports.Textarea=_R;exports.Toggle=P0;exports.Tooltip=S3;exports.TooltipContent=BE;exports.TooltipTrigger=_3;exports.TooltipTrigger$1=zE;exports.TreePalm=kF;exports.TriangleDownIcon=nF;exports.TriangleUpIcon=rF;exports.UXProvider=Z7;exports.UserRound=PF;exports.UserSearch=OF;exports.X=Bc;exports._=sc;exports.cn=me;exports.createChartConfig=EE;exports.createLucideIcon=Gt;exports.createSqlGenConfig=xX;exports.de=gB;exports.dedup=tPe;exports.flexRender=YS;exports.fmt=tC;exports.getCanvasBackgroundColor=Ih;exports.getColumnDataType=wX;exports.getContrastColor=ud;exports.getCoreRowModel=z3;exports.getDefaultFilterSql=Ewe;exports.getFilterValueType=Iu;exports.getFormattedTableNameForQuery=TN;exports.getKeys=hr;exports.getNumberAxis=KC;exports.getPaginationRowModel=B3;exports.getPlugins=IX;exports.getQualifiedTableName=rC;exports.getRequest=kX;exports.getSortedRowModel=H3;exports.getSql=vX;exports.getStatus=F9;exports.getTenantAndEndUserId=PX;exports.getTokenParams=PN;exports.hslStringToHex=AF;exports.invalidateToken=AX;exports.isBooleanDataType=nC;exports.isColumnInSqlGen=SX;exports.isDateDataType=Dd;exports.isInAiScopeArray=ePe;exports.isNumberDataType=xp;exports.isObjectEmpty=TX;exports.isTextDataType=Oy;exports.jsxRuntimeExports=x;exports.loadManifest=e6;exports.pivotData=Pb;exports.postRequest=Ay;exports.removeFromScopeArray=nPe;exports.removeRing=ch;exports.resolveDataType=My;exports.titleCase=MX;exports.ue=p8;exports.useCard=Mce;exports.useChat=H8;exports.useCustomVisual=t6;exports.useDashboardActions=Yn;exports.useDashboardCardQuery=qa;exports.useDashboardStore=ye;exports.useDateFilterHook=g0e;exports.useEditorActions=Rp;exports.useEditorStore=bo;exports.useQuery=Sp;exports.useQueryClient=cC;exports.useReactTable=W3;exports.useSemaphorContext=Uo;exports.useTextFilterHook=Rwe;exports.useTheme=MN;exports.useTopoJson=M4;exports.v4=Ga;